Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: backgrounds.c backgrounds.h desktops.c pager.c setup.c Log Message: Fix some incorrect window attribute propagation. Cleanups. =================================================================== RCS file: /cvs/e/e16/e/src/backgrounds.c,v retrieving revision 1.76 retrieving revision 1.77 diff -u -3 -r1.76 -r1.77 --- backgrounds.c 28 May 2006 11:09:46 -0000 1.76 +++ backgrounds.c 28 May 2006 11:51:41 -0000 1.77 @@ -492,8 +492,7 @@ } static Pixmap -BackgroundCreatePixmap(Drawable draw, unsigned int w, unsigned int h, - unsigned int depth) +BackgroundCreatePixmap(Win win, unsigned int w, unsigned int h) { Pixmap pmap; @@ -501,11 +500,11 @@ * Stupid hack to avoid that a new root pixmap has the same ID as the now * invalid one from a previous session. */ - pmap = EXCreatePixmap(draw, w, h, depth); - if (draw == VRoot.xwin && pmap == Mode.root.ext_pmap) + pmap = ECreatePixmap(win, w, h, 0); + if (win == RRoot.win && pmap == Mode.root.ext_pmap) { EFreePixmap(pmap); - pmap = EXCreatePixmap(draw, w, h, depth); + pmap = ECreatePixmap(win, w, h, 0); Mode.root.ext_pmap = None; Mode.root.ext_pmap_valid = 0; } @@ -513,7 +512,7 @@ } void -BackgroundRealize(Background * bg, Drawable draw, unsigned int rw, +BackgroundRealize(Background * bg, Win win, Drawable draw, unsigned int rw, unsigned int rh, int is_win, Pixmap * ppmap, unsigned long *ppixel) { @@ -573,6 +572,9 @@ } #endif + if (!draw) + draw = WinGetXwin(win); + hasbg = bg->bg.im != NULL; hasfg = bg->top.im != NULL; @@ -612,8 +614,8 @@ ((w == rw && h == rh) || (bg->bg_tile && !TransparencyEnabled()))) { /* Window, no fg, no offset, and scale to 100%, or tiled, no trans */ - pmap = BackgroundCreatePixmap(draw, w, h, VRoot.depth); - EImageRenderOnDrawable(bg->bg.im, NULL, pmap, 0, 0, w, h, 0); + pmap = BackgroundCreatePixmap(win, w, h); + EImageRenderOnDrawable(bg->bg.im, win, pmap, 0, 0, w, h, 0); #if 0 /* FIXME - Remove? */ if (x == 0 && y == 0) /* Hmmm. Always true. */ @@ -635,7 +637,7 @@ /* The rest that require some more work */ if (is_win) - pmap = BackgroundCreatePixmap(draw, rw, rh, VRoot.depth); + pmap = BackgroundCreatePixmap(win, rw, rh); else pmap = draw; @@ -679,7 +681,7 @@ EImageBlend(im, bg->top.im, 1, 0, 0, ww, hh, x, y, w, h, 0, 0); } - EImageRenderOnDrawable(im, NULL, pmap, 0, 0, rw, rh, 0); + EImageRenderOnDrawable(im, win, pmap, 0, 0, rw, rh, 0); if (im != bg->bg.im) EImageFree(im); @@ -694,10 +696,10 @@ } void -BackgroundApplyPmap(Background * bg, Drawable draw, +BackgroundApplyPmap(Background * bg, Win win, Drawable draw, unsigned int w, unsigned int h) { - BackgroundRealize(bg, draw, w, h, 0, NULL, NULL); + BackgroundRealize(bg, win, draw, w, h, 0, NULL, NULL); } static void @@ -710,7 +712,7 @@ if (!EGetGeometry(win, NULL, NULL, NULL, &w, &h, NULL, NULL)) return; - BackgroundRealize(bg, Xwin(win), w, h, 1, &pmap, &pixel); + BackgroundRealize(bg, win, None, w, h, 1, &pmap, &pixel); if (pmap != None) { ESetWindowBackgroundPixmap(win, pmap); @@ -736,7 +738,7 @@ if (bg->pmap) pmap = bg->pmap; else - BackgroundRealize(bg, Xwin(win), w, h, 1, &pmap, &pixel); + BackgroundRealize(bg, win, None, w, h, 1, &pmap, &pixel); bg->pmap = pmap; if (pmap != None) @@ -949,7 +951,7 @@ /* Create new cached bg mini image */ pmap = ECreatePixmap(VRoot.win, 64, 48, 0); - BackgroundApplyPmap(bg, pmap, 64, 48); + BackgroundApplyPmap(bg, VRoot.win, pmap, 64, 48); im = EImageGrabDrawable(pmap, None, 0, 0, 64, 48, 0); EImageSave(im, s); EFreePixmap(pmap); @@ -1524,7 +1526,7 @@ if (val == 1) { ESetWindowBackgroundPixmap(win, pmap); - BackgroundApplyPmap(tmp_bg, pmap, w, h); + BackgroundApplyPmap(tmp_bg, win, pmap, w, h); } else { @@ -1539,7 +1541,7 @@ tmp_bg->top.yjust, tmp_bg->top.xperc, tmp_bg->top.yperc); - BackgroundApplyPmap(bg, pmap, w, h); + BackgroundApplyPmap(bg, win, pmap, w, h); BackgroundDestroy(bg); } EClearWindow(win); =================================================================== RCS file: /cvs/e/e16/e/src/backgrounds.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- backgrounds.h 29 Apr 2006 19:39:20 -0000 1.11 +++ backgrounds.h 28 May 2006 11:51:41 -0000 1.12 @@ -30,11 +30,11 @@ char *BackgroundGetUniqueString(const Background * bg); void BackgroundPixmapSet(Background * bg, Pixmap pmap); void BackgroundDestroyByName(const char *name); -void BackgroundRealize(Background * bg, Drawable draw, +void BackgroundRealize(Background * bg, Win win, Drawable draw, unsigned int rw, unsigned int rh, int is_win, Pixmap * ppmap, unsigned long *ppixel); -void BackgroundApplyPmap(Background * bg, Drawable draw, +void BackgroundApplyPmap(Background * bg, Win win, Drawable draw, unsigned int rw, unsigned int rh); void BackgroundSet(Background * bg, Win win, unsigned int rw, unsigned int rh); =================================================================== RCS file: /cvs/e/e16/e/src/desktops.c,v retrieving revision 1.244 retrieving revision 1.245 diff -u -3 -r1.244 -r1.245 --- desktops.c 21 May 2006 12:09:14 -0000 1.244 +++ desktops.c 28 May 2006 11:51:41 -0000 1.245 @@ -624,8 +624,8 @@ pixel = 0; if (pmap == None) - BackgroundRealize(bg, EoGetXwin(dsk), EoGetW(dsk), EoGetH(dsk), - 1, &pmap, &pixel); + BackgroundRealize(bg, EoGetWin(dsk), None, + EoGetW(dsk), EoGetH(dsk), 1, &pmap, &pixel); if (pmap != None) BackgroundPixmapSet(bg, pmap); @@ -2305,7 +2305,7 @@ bg = DeskBackgroundGet(DeskGet(i)); if (bg) - BackgroundApplyPmap(bg, pmap, 64, 48); + BackgroundApplyPmap(bg, wins[i], pmap, 64, 48); else { ic = ImageclassFind("SETTINGS_DESKTOP_AREA", 0); =================================================================== RCS file: /cvs/e/e16/e/src/pager.c,v retrieving revision 1.216 retrieving revision 1.217 diff -u -3 -r1.216 -r1.217 --- pager.c 14 May 2006 10:59:30 -0000 1.216 +++ pager.c 28 May 2006 11:51:41 -0000 1.217 @@ -305,7 +305,7 @@ { ewin->mini_pmm.type = 1; ewin->mini_pmm.mask = None; - ScaleRect(EoGetWin(ewin), draw, VRoot.win, None, &ewin->mini_pmm.pmap, + ScaleRect(EoGetWin(ewin), draw, p->win, None, &ewin->mini_pmm.pmap, 0, 0, EoGetW(ewin), EoGetH(ewin), 0, 0, w, h, Conf_pagers.hiq); } @@ -532,7 +532,7 @@ else { #endif - BackgroundApplyPmap(bg, pmap, p->dw, p->dh); + BackgroundApplyPmap(bg, p->win, pmap, p->dw, p->dh); #if USE_PAGER_BACKGROUND_CACHE im = EImageGrabDrawable(pmap, None, 0, 0, p->dw, p->dh, 0); EImageSave(im, s); =================================================================== RCS file: /cvs/e/e16/e/src/setup.c,v retrieving revision 1.176 retrieving revision 1.177 diff -u -3 -r1.176 -r1.177 --- setup.c 21 May 2006 12:09:14 -0000 1.176 +++ setup.c 28 May 2006 11:51:42 -0000 1.177 @@ -202,36 +202,22 @@ /* Root defaults */ RRoot.scr = DefaultScreen(disp); RRoot.xwin = DefaultRootWindow(disp); + RRoot.w = DisplayWidth(disp, RRoot.scr); + RRoot.h = DisplayHeight(disp, RRoot.scr); RRoot.vis = DefaultVisual(disp, RRoot.scr); RRoot.depth = DefaultDepth(disp, RRoot.scr); RRoot.cmap = DefaultColormap(disp, RRoot.scr); - RRoot.w = DisplayWidth(disp, RRoot.scr); - RRoot.h = DisplayHeight(disp, RRoot.scr); + RRoot.win = ERegisterWindow(RRoot.xwin, NULL); VRoot.xwin = RRoot.xwin; VRoot.vis = RRoot.vis; VRoot.depth = RRoot.depth; VRoot.cmap = RRoot.cmap; - RRoot.win = ERegisterWindow(RRoot.xwin, NULL); - if (Mode.wm.window) { - XSetWindowAttributes attr; - - /* Running E in its own virtual root window */ - attr.backing_store = NotUseful; - attr.override_redirect = False; - attr.colormap = VRoot.cmap; - attr.border_pixel = 0; - attr.background_pixel = 0; - attr.save_under = True; - VRoot.xwin = XCreateWindow(disp, RRoot.xwin, 0, 0, VRoot.w, VRoot.h, 0, - CopyFromParent, InputOutput, CopyFromParent, - CWOverrideRedirect | CWSaveUnder | - CWBackingStore | CWColormap | CWBackPixel | - CWBorderPixel, &attr); - VRoot.win = ERegisterWindow(VRoot.xwin, NULL); + VRoot.win = ECreateWindow(RRoot.win, 0, 0, VRoot.w, VRoot.h, 0); + VRoot.xwin = WinGetXwin(VRoot.win); /* Enable eesh and edox to pix up the virtual root */ Esnprintf(buf, sizeof(buf), "%#lx", VRoot.xwin); ------------------------------------------------------- All the advantages of Linux Managed Hosting--Without the Cost and Risk! Fully trained technicians. The highest number of Red Hat certifications in the hosting industry. Fanatical Support. Click to learn more http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs