… | |
… | |
1304 | Window root = target->display->root; |
1304 | Window root = target->display->root; |
1305 | int screen = target->display->screen; |
1305 | int screen = target->display->screen; |
1306 | Display *dpy = target->dpy; |
1306 | Display *dpy = target->dpy; |
1307 | int root_width = DisplayWidth (dpy, screen); |
1307 | int root_width = DisplayWidth (dpy, screen); |
1308 | int root_height = DisplayHeight (dpy, screen); |
1308 | int root_height = DisplayHeight (dpy, screen); |
1309 | unsigned int root_pmap_width, root_pmap_height; |
|
|
1310 | int window_width = target->szHint.width; |
1309 | int window_width = target->szHint.width; |
1311 | int window_height = target->szHint.height; |
1310 | int window_height = target->szHint.height; |
1312 | int sx, sy; |
1311 | int sx, sy; |
1313 | XGCValues gcv; |
1312 | XGCValues gcv; |
1314 | GC gc; |
1313 | GC gc; |
… | |
… | |
1318 | /* check if we are outside of the visible part of the virtual screen : */ |
1317 | /* check if we are outside of the visible part of the virtual screen : */ |
1319 | if (sx + window_width <= 0 || sy + window_height <= 0 |
1318 | if (sx + window_width <= 0 || sy + window_height <= 0 |
1320 | || sx >= root_width || sy >= root_height) |
1319 | || sx >= root_width || sy >= root_height) |
1321 | return 0; |
1320 | return 0; |
1322 | |
1321 | |
1323 | if (root_pixmap != None) |
|
|
1324 | { |
|
|
1325 | /* we want to validate the pixmap and get its size at the same time : */ |
|
|
1326 | int junk; |
|
|
1327 | unsigned int ujunk; |
|
|
1328 | /* root pixmap may be bad - allow a error */ |
|
|
1329 | target->allowedxerror = -1; |
|
|
1330 | |
|
|
1331 | if (!XGetGeometry (dpy, root_pixmap, &root, &junk, &junk, &root_pmap_width, &root_pmap_height, &ujunk, &ujunk)) |
|
|
1332 | root_pixmap = None; |
|
|
1333 | |
|
|
1334 | target->allowedxerror = 0; |
|
|
1335 | } |
|
|
1336 | |
|
|
1337 | if (root_pixmap == None) |
1322 | if (root_pixmap == None) |
1338 | return 0; |
1323 | return 0; |
1339 | |
1324 | |
1340 | Pixmap tiled_root_pmap = XCreatePixmap (dpy, root, window_width, window_height, root_depth); |
1325 | Pixmap tiled_root_pmap = XCreatePixmap (dpy, root, window_width, window_height, root_depth); |
1341 | |
1326 | |
… | |
… | |
1386 | } |
1371 | } |
1387 | |
1372 | |
1388 | return result; |
1373 | return result; |
1389 | } |
1374 | } |
1390 | |
1375 | |
1391 | bool |
1376 | void |
1392 | bgPixmap_t::set_root_pixmap () |
1377 | bgPixmap_t::set_root_pixmap () |
1393 | { |
1378 | { |
1394 | Pixmap new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID); |
1379 | Pixmap new_root_pixmap = target->get_pixmap_property (XA_XROOTPMAP_ID); |
1395 | if (new_root_pixmap == None) |
1380 | if (new_root_pixmap == None) |
1396 | new_root_pixmap = target->get_pixmap_property (XA_ESETROOT_PMAP_ID); |
1381 | new_root_pixmap = target->get_pixmap_property (XA_ESETROOT_PMAP_ID); |
1397 | |
1382 | |
1398 | if (new_root_pixmap != root_pixmap) |
|
|
1399 | { |
|
|
1400 | root_pixmap = new_root_pixmap; |
1383 | root_pixmap = new_root_pixmap; |
1401 | return true; |
1384 | |
|
|
1385 | // validate root pixmap |
|
|
1386 | if (root_pixmap != None) |
1402 | } |
1387 | { |
|
|
1388 | unsigned int width, height; |
|
|
1389 | Window wdummy; |
|
|
1390 | int idummy; |
|
|
1391 | unsigned int udummy; |
1403 | |
1392 | |
1404 | return false; |
1393 | target->allowedxerror = -1; |
|
|
1394 | |
|
|
1395 | if (!XGetGeometry (target->dpy, root_pixmap, &wdummy, &idummy, &idummy, &width, &height, &udummy, &udummy)) |
|
|
1396 | root_pixmap = None; |
|
|
1397 | |
|
|
1398 | target->allowedxerror = 0; |
|
|
1399 | } |
1405 | } |
1400 | } |
1406 | # endif /* ENABLE_TRANSPARENCY */ |
1401 | # endif /* ENABLE_TRANSPARENCY */ |
1407 | |
1402 | |
1408 | # ifndef HAVE_AFTERIMAGE |
1403 | # ifndef HAVE_AFTERIMAGE |
1409 | static void ShadeXImage(Visual *visual, XImage *srcImage, int shade, int rm, int gm, int bm); |
1404 | static void ShadeXImage(Visual *visual, XImage *srcImage, int shade, int rm, int gm, int bm); |
… | |
… | |
1538 | void |
1533 | void |
1539 | bgPixmap_t::apply () |
1534 | bgPixmap_t::apply () |
1540 | { |
1535 | { |
1541 | if (target) |
1536 | if (target) |
1542 | { |
1537 | { |
1543 | flags &= ~isVtOrigin; |
|
|
1544 | |
|
|
1545 | if (pixmap != None) |
1538 | if (pixmap != None) |
1546 | { |
1539 | { |
1547 | /* set target's background to pixmap */ |
1540 | /* set target's background to pixmap */ |
1548 | # ifdef ENABLE_TRANSPARENCY |
1541 | # ifdef ENABLE_TRANSPARENCY |
1549 | if (flags & isTransparent) |
1542 | if (flags & isTransparent) |
… | |
… | |
1555 | XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative); |
1548 | XSetWindowBackgroundPixmap (target->dpy, target->scrollBar.win, ParentRelative); |
1556 | } |
1549 | } |
1557 | else |
1550 | else |
1558 | # endif |
1551 | # endif |
1559 | { |
1552 | { |
1560 | flags |= isVtOrigin; |
|
|
1561 | /* force old pixmap dereference in case it was transparent before :*/ |
1553 | /* force old pixmap dereference in case it was transparent before :*/ |
1562 | XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]); |
1554 | XSetWindowBackground (target->dpy, target->parent[0], target->pix_colors[Color_border]); |
1563 | XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap); |
1555 | XSetWindowBackgroundPixmap (target->dpy, target->vt, pixmap); |
1564 | /* do we also need to set scrollbar's background here ? */ |
1556 | /* do we also need to set scrollbar's background here ? */ |
1565 | |
1557 | |