Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h ewins.c x.c
Log Message:
Initial ARGB client support (Rajsekar Manokaran).
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.414
retrieving revision 1.415
diff -u -3 -r1.414 -r1.415
--- E.h 25 Apr 2005 22:07:34 -0000 1.414
+++ E.h 29 Apr 2005 17:37:29 -0000 1.415
@@ -2263,6 +2263,9 @@
Window ECreateWindow(Window parent, int x, int y, int w, int h,
int saveunder);
+Window ECreateVisualWindow(Window parent, int x, int y, int w,
+ int h, int saveunder,
+ XWindowAttributes * child_attr);
Window ECreateEventWindow(Window parent, int x, int y, int w,
int h);
Window ECreateFocusWindow(Window parent, int x, int y, int w,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -3 -r1.49 -r1.50
--- ewins.c 28 Apr 2005 22:11:21 -0000 1.49
+++ ewins.c 29 Apr 2005 17:37:29 -0000 1.50
@@ -66,7 +66,10 @@
EWin *ewin;
XSetWindowAttributes att;
Window frame;
+ int require_argb;
+ XWindowAttributes win_attr;
+ require_argb = 0;
ewin = Ecalloc(1, sizeof(EWin));
ewin->type = type;
@@ -107,7 +110,18 @@
ewin->ewmh.opacity = 0; /* If 0, ignore */
- frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
+ {
+ Status s = XGetWindowAttributes(disp, win, &win_attr);
+
+ if (s != BadDrawable && s != BadWindow && win_attr.depth == 32)
+ {
+ frame = ECreateVisualWindow(VRoot.win, -10, -10, 1, 1, 1, &win_attr);
+ require_argb = 1;
+ }
+ else
+ frame = ECreateWindow(VRoot.win, -10, -10, 1, 1, 1);
+ }
+
ewin->o.stacked = -1; /* Not placed on desk yet */
EobjInit(&ewin->o, EOBJ_TYPE_EWIN, frame, -10, -10, -1, -1, NULL);
EoSetDesk(ewin, DesksGetCurrent());
@@ -115,7 +129,11 @@
EoSetShadow(ewin, 1);
EobjListFocusAdd(&ewin->o, 0);
- ewin->win_container = ECreateWindow(EoGetWin(ewin), 0, 0, 1, 1, 0);
+ if (require_argb)
+ ewin->win_container =
+ ECreateVisualWindow(EoGetWin(ewin), 0, 0, 1, 1, 0, &win_attr);
+ else
+ ewin->win_container = ECreateWindow(EoGetWin(ewin), 0, 0, 1, 1, 0);
att.event_mask = EWIN_CONTAINER_EVENT_MASK;
att.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask;
EChangeWindowAttributes(ewin->win_container,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/x.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -3 -r1.84 -r1.85
--- x.c 23 Apr 2005 08:28:04 -0000 1.84
+++ x.c 29 Apr 2005 17:37:30 -0000 1.85
@@ -266,7 +266,36 @@
else
attr.save_under = False;
win = XCreateWindow(disp, parent, x, y, w, h, 0,
- CopyFromParent, InputOutput, CopyFromParent,
+ VRoot.depth, InputOutput, VRoot.vis,
+ CWOverrideRedirect | CWSaveUnder | CWBackingStore |
+ CWColormap | CWBackPixmap | CWBorderPixel, &attr);
+ EXidSet(win, parent, x, y, w, h, VRoot.depth);
+
+ return win;
+}
+
+/* Creates a window, but takes the visual, depth and the colormap from c_attr.
*/
+Window
+ECreateVisualWindow(Window parent, int x, int y, int w, int h, int saveunder,
+ XWindowAttributes * c_attr)
+{
+ Window win;
+ XSetWindowAttributes attr;
+
+ attr.backing_store = NotUseful;
+ attr.override_redirect = True;
+ attr.border_pixel = 0;
+ attr.colormap = c_attr->colormap;
+/* attr.background_pixel = 0; */
+ attr.background_pixmap = None;
+ if ((saveunder == 1) && (Conf.save_under))
+ attr.save_under = True;
+ else if (saveunder == 2)
+ attr.save_under = True;
+ else
+ attr.save_under = False;
+ win = XCreateWindow(disp, parent, x, y, w, h, 0,
+ c_attr->depth, InputOutput, c_attr->visual,
CWOverrideRedirect | CWSaveUnder | CWBackingStore |
CWColormap | CWBackPixmap | CWBorderPixel, &attr);
EXidSet(win, parent, x, y, w, h, VRoot.depth);
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs