Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h backgrounds.c desktops.c hints.c
Log Message:
Attempt to fix issues with _XROOTPMAP_ID across restart.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.478
retrieving revision 1.479
diff -u -3 -r1.478 -r1.479
--- E.h 10 Aug 2005 19:33:33 -0000 1.478
+++ E.h 13 Aug 2005 08:50:27 -0000 1.479
@@ -783,6 +783,10 @@
} grabs;
struct
{
+ Pixmap old_root_pmap;
+ } hints;
+ struct
+ {
const char *lang;
char utf8_int; /* Use UTF-8 internally */
char utf8_loc; /* Locale is UTF-8 */
@@ -1483,6 +1487,7 @@
void HintsProcessPropertyChange(EWin * ewin, Atom atom_change);
void HintsProcessClientMessage(XClientMessageEvent * event);
+Pixmap HintsGetRootPixmap(Window win);
void HintsSetRootHints(Window win);
void HintsSetRootInfo(Window win, Pixmap pmap,
unsigned int color);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/backgrounds.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- backgrounds.c 4 Aug 2005 22:05:28 -0000 1.40
+++ backgrounds.c 13 Aug 2005 08:50:28 -0000 1.41
@@ -527,6 +527,26 @@
}
}
+static Pixmap
+BackgroundCreatePixmap(Window win, unsigned int w, unsigned int h,
+ unsigned int depth)
+{
+ Pixmap pmap;
+
+ /*
+ * Stupid hack to avoid that a new root pixmap has the same ID as the now
+ * invalid one from a previous session.
+ */
+ pmap = ECreatePixmap(win, w, h, depth);
+ if (win == VRoot.win && pmap == Mode.hints.old_root_pmap)
+ {
+ EFreePixmap(pmap);
+ pmap = ECreatePixmap(win, w, h, depth);
+ Mode.hints.old_root_pmap = None;
+ }
+ return pmap;
+}
+
Pixmap
BackgroundApply(Background * bg, Drawable draw,
unsigned int rw, unsigned int rh, int is_win)
@@ -638,7 +658,7 @@
((w == rw && h == rh) || (bg->bg_tile && !TransparencyEnabled())))
{
/* Window, no fg, no offset, and scale to 100%, or tiled, no trans */
- pmap = ECreatePixmap(VRoot.win, w, h, VRoot.depth);
+ pmap = BackgroundCreatePixmap(draw, w, h, VRoot.depth);
imlib_context_set_drawable(pmap);
imlib_render_image_on_drawable_at_size(0, 0, w, h);
@@ -660,7 +680,7 @@
/* The rest that require some more work */
if (is_win)
- pmap = ECreatePixmap(VRoot.win, rw, rh, VRoot.depth);
+ pmap = BackgroundCreatePixmap(draw, w, h, VRoot.depth);
else
pmap = draw;
imlib_context_set_drawable(pmap);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -3 -r1.162 -r1.163
--- desktops.c 7 Aug 2005 10:41:43 -0000 1.162
+++ desktops.c 13 Aug 2005 08:50:28 -0000 1.163
@@ -414,6 +414,7 @@
win = (desk == 0) ? VRoot.win : None;
Esnprintf(buf, sizeof(buf), "Desk-%d", desk);
EobjInit(&d->o, EOBJ_TYPE_DESK, win, 0, 0, VRoot.w, VRoot.h, 0, buf);
+ EventCallbackRegister(EoGetWin(d), 0, DesktopHandleEvents, d);
EoSetShadow(d, 0);
if (desk > 0)
{
@@ -423,14 +424,12 @@
d->event_mask = EDESK_EVENT_MASK;
DeskEventsConfigure(d, 1);
#endif
+ /* Set the _XROOT... atoms so apps will find them even before the bg is
set */
+ HintsSetRootInfo(EoGetWin(d), None, 0);
}
- EventCallbackRegister(EoGetWin(d), 0, DesktopHandleEvents, d);
HintsSetRootHints(EoGetWin(d));
- /* Set the _XROOT... atoms so apps will find them even before the bg is set
*/
- HintsSetRootInfo(EoGetWin(d), None, 0);
-
if (configure)
DeskConfigure(d);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/hints.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -3 -r1.48 -r1.49
--- hints.c 4 Aug 2005 16:01:55 -0000 1.48
+++ hints.c 13 Aug 2005 08:50:28 -0000 1.49
@@ -55,6 +55,8 @@
HintsSetWindowName(VRoot.win, "Enlightenment");
HintsSetWindowClass(VRoot.win, "Virtual-Root", "Enlightenment");
}
+
+ Mode.hints.old_root_pmap = HintsGetRootPixmap(VRoot.win);
}
void
@@ -287,6 +289,21 @@
XFree(name);
}
+Pixmap
+HintsGetRootPixmap(Window win)
+{
+ Atom a = 0;
+ Ecore_X_Pixmap pm;
+ int num;
+
+ a = XInternAtom(disp, "_XROOTPMAP_ID", False);
+
+ pm = None;
+ num = ecore_x_window_prop_xid_get(win, a, XA_PIXMAP, &pm, 1);
+
+ return pm;
+}
+
void
HintsSetRootInfo(Window win, Pixmap pmap, unsigned int color)
{
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs