Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h buttons.c desktops.c draw.c ecompmgr.c ecompmgr.h eobj.c
moveresize.c
Log Message:
Still more composite manager fixes.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.417
retrieving revision 1.418
diff -u -3 -r1.417 -r1.418
--- E.h 1 May 2005 11:27:34 -0000 1.417
+++ E.h 1 May 2005 22:26:00 -0000 1.418
@@ -724,7 +724,6 @@
char shaded;
char active;
char never_use_area;
- Window parent;
char shapedone;
char fixedpos;
char ignorearrange;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- buttons.c 23 Apr 2005 08:28:02 -0000 1.61
+++ buttons.c 1 May 2005 22:26:02 -0000 1.62
@@ -246,18 +246,14 @@
void
ButtonMoveToDesktop(Button * b, int desk)
{
- int pdesk;
-
if (desk < 0 || desk >= DesksGetNumber())
return;
if (EoIsSticky(b) && EoGetLayer(b) == 1)
desk = 0;
- pdesk = EoGetDesk(b);
- EoSetDesk(b, desk);
- if (desk != pdesk)
- EReparentWindow(EoGetWin(b), DeskGetWin(desk), EoGetX(b), EoGetY(b));
+ if (desk != EoGetDesk(b))
+ EoReparent(b, desk, EoGetX(b), EoGetY(b));
}
void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.141
retrieving revision 1.142
diff -u -3 -r1.141 -r1.142
--- desktops.c 25 Apr 2005 22:07:36 -0000 1.141
+++ desktops.c 1 May 2005 22:26:02 -0000 1.142
@@ -930,10 +930,7 @@
if (!EoIsSticky(ewin))
continue;
- EoSetDesk(ewin, desk);
- ewin->parent = EoGetWin(d);
- EReparentWindow(EoGetWin(ewin), ewin->parent, VRoot.w, VRoot.h);
- EMoveWindow(EoGetWin(ewin), EoGetX(ewin), EoGetY(ewin));
+ EoReparent(ewin, desk, EoGetX(ewin), EoGetY(ewin));
HintsSetWindowArea(ewin);
HintsSetWindowDesktop(ewin);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/draw.c,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- draw.c 1 May 2005 11:27:35 -0000 1.62
+++ draw.c 1 May 2005 22:26:03 -0000 1.63
@@ -1312,6 +1312,7 @@
}
if (firstlast == 2)
{
+#if 0 /* FIXME - Remove? */
/* If we're moving a group, don't do this,
* otherwise we have a lot of garbage onscreen */
if (!EoIsFloating(ewin) || !ewin->groups
@@ -1322,6 +1323,7 @@
else
MoveResizeEwin(ewin, ewin->shape_x, ewin->shape_y, pw, ph);
}
+#endif
EFreeGC(gc);
gc = 0;
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -3 -r1.24 -r1.25
--- ecompmgr.c 1 May 2005 11:27:35 -0000 1.24
+++ ecompmgr.c 1 May 2005 22:26:03 -0000 1.25
@@ -53,8 +53,6 @@
#define CAN_DO_USABLE 0
#define ENABLE_SHADOWS 1
-#if HAS_NAME_WINDOW_PIXMAP
-#endif
#define ENABLE_DEBUG 1
#if ENABLE_DEBUG
@@ -85,7 +83,14 @@
#if HAS_NAME_WINDOW_PIXMAP
Pixmap pixmap;
#endif
- XWindowAttributes a;
+ struct
+ {
+ int class; /* FIXME - Remove? */
+ int map_state; /* FIXME - Remove? */
+ int depth; /* FIXME - Remove? */
+ Visual *visual; /* FIXME - Remove? */
+ int border_width;
+ } a;
int rcx, rcy, rcw, rch;
#if CAN_DO_USABLE
Bool usable; /* mapped and all damaged at one point */
@@ -162,6 +167,7 @@
#define WINDOW_TRANS 1
#define WINDOW_ARGB 2
+static void ECompMgrWinSetPicts(EObj * eo);
static void ECompMgrDamageAll(void);
static void ECompMgrHandleRootEvent(XEvent * ev, void *prm);
static void ECompMgrHandleWindowEvent(XEvent * ev, void *prm);
@@ -706,16 +712,21 @@
XRectangle r;
#if HAS_NAME_WINDOW_PIXMAP
- cw->rcx = cw->a.x;
- cw->rcy = cw->a.y;
- cw->rcw = cw->a.width + cw->a.border_width * 2;
- cw->rch = cw->a.height + cw->a.border_width * 2;
-#else
- cw->rcx = cw->a.x + cw->a.border_width;
- cw->rcy = cw->a.y + cw->a.border_width;
- cw->rcw = cw->a.width;
- cw->rch = cw->a.height;
+ if (Mode_compmgr.use_pixmap)
+ {
+ cw->rcx = eo->x;
+ cw->rcy = eo->y;
+ cw->rcw = eo->w + cw->a.border_width * 2;
+ cw->rch = eo->h + cw->a.border_width * 2;
+ }
+ else
#endif
+ {
+ cw->rcx = eo->x + cw->a.border_width;
+ cw->rcy = eo->y + cw->a.border_width;
+ cw->rcw = eo->w;
+ cw->rch = eo->h;
+ }
r.x = cw->rcx;
r.y = cw->rcy;
@@ -895,19 +906,15 @@
D1printf("ECompMgrWinChangeOpacity: %#lx opacity=%#x\n", eo->win,
cw->opacity);
- /* Invalidate stuff changed by opacity */
- ECompMgrWinInvalidate(eo, INV_OPACITY);
-
if (eo->shown) /* FIXME - ??? */
/* Extents may be unchanged, however, we must repaint */
if (cw->extents != None)
ECompMgrDamageMerge(eo->desk, cw->extents, 0);
- if (cw->a.class == InputOnly)
- pictfmt = NULL;
- else
- pictfmt = XRenderFindVisualFormat(dpy, cw->a.visual);
+ /* Invalidate stuff changed by opacity */
+ ECompMgrWinInvalidate(eo, INV_OPACITY);
+ pictfmt = XRenderFindVisualFormat(dpy, cw->a.visual);
if (pictfmt && pictfmt->type == PictTypeDirect && pictfmt->direct.alphaMask)
mode = WINDOW_ARGB;
else if (cw->opacity != OPAQUE)
@@ -942,6 +949,8 @@
if (cw->extents == None)
cw->extents = win_extents(disp, eo);
ECompMgrDamageMerge(eo->desk, cw->extents, 0);
+
+ ECompMgrWinSetPicts(eo);
}
static void
@@ -984,8 +993,15 @@
{
ECmWinInfo *cw = eo->cmhook;
- if (cw->a.class == InputOnly)
- return;
+ if (eo->type == EOBJ_TYPE_DESK)
+ {
+ if (cw->picture == None)
+ {
+ cw->picture = DeskBackgroundPictureGet((Desk *) eo);
+ cw->damaged = 1; /* FIXME - ??? */
+ }
+ return;
+ }
#if HAS_NAME_WINDOW_PIXMAP
if (cw->pixmap != None)
@@ -997,40 +1013,26 @@
XRenderFreePicture(disp, cw->picture);
cw->picture = None;
}
+ Eprintf("*** ECompMgrWinSetPicts pixmap set!!!\n");
}
if (Mode_compmgr.use_pixmap)
cw->pixmap = XCompositeNameWindowPixmap(disp, eo->win);
#endif
-#if 0
- if (cw->picture != None)
- {
- XRenderFreePicture(disp, cw->picture);
- cw->picture = None;
- }
-#endif
if (cw->picture == None)
{
- if (eo->type == EOBJ_TYPE_DESK)
- {
- cw->picture = DeskBackgroundPictureGet((Desk *) eo);
- cw->damaged = 1; /* FIXME - ??? */
- }
- else
- {
- XRenderPictFormat *pictfmt;
- XRenderPictureAttributes pa;
- Drawable draw = eo->win;
+ XRenderPictFormat *pictfmt;
+ XRenderPictureAttributes pa;
+ Drawable draw = eo->win;
#if HAS_NAME_WINDOW_PIXMAP
- if (cw->pixmap)
- draw = cw->pixmap;
+ if (cw->pixmap)
+ draw = cw->pixmap;
#endif
- pictfmt = XRenderFindVisualFormat(disp, cw->a.visual);
- pa.subwindow_mode = IncludeInferiors;
- cw->picture = XRenderCreatePicture(disp, draw,
- pictfmt, CPSubwindowMode, &pa);
- }
+ pictfmt = XRenderFindVisualFormat(disp, cw->a.visual);
+ pa.subwindow_mode = IncludeInferiors;
+ cw->picture = XRenderCreatePicture(disp, draw,
+ pictfmt, CPSubwindowMode, &pa);
D2printf("New picture %#lx\n", cw->picture);
}
}
@@ -1039,11 +1041,16 @@
ECompMgrWinNew(EObj * eo)
{
ECmWinInfo *cw;
- Status ok;
+ XWindowAttributes attr;
if (!Conf_compmgr.enable) /* FIXME - Here? */
return;
+ if (!XGetWindowAttributes(disp, eo->win, &attr))
+ return;
+ if (attr.class == InputOnly)
+ return;
+
cw = Ecalloc(1, sizeof(ECmWinInfo));
if (!cw)
return;
@@ -1052,27 +1059,16 @@
eo->cmhook = cw;
- ok = XGetWindowAttributes(disp, eo->win, &cw->a);
- if (!ok || cw->a.class == InputOnly)
- {
- free(cw);
- eo->cmhook = NULL;
- return;
- }
-
cw->damaged = 0;
#if CAN_DO_USABLE
cw->usable = False;
#endif
-#if 0
- if (cw->a.class == InputOnly)
- {
- cw->damage_sequence = 0;
- cw->damage = None;
- }
- else
-#endif
+ cw->a.class = attr.class; /* FIXME - remove */
+ cw->a.map_state = attr.map_state; /* FIXME - remove */
+ cw->a.depth = attr.depth;
+ cw->a.visual = attr.visual;
+ cw->a.border_width = attr.border_width;
if (eo->type != EOBJ_TYPE_DESK)
{
@@ -1086,7 +1082,9 @@
#if HAS_NAME_WINDOW_PIXMAP
cw->pixmap = None;
#endif
+#if 0 /* FIXME - Remove? */
ECompMgrWinSetPicts(eo);
+#endif
cw->alphaPict = None;
cw->borderSize = None;
@@ -1123,31 +1121,14 @@
}
void
-ECompMgrWinMoveResize(EObj * eo, int x, int y, int w, int h, int bw)
+ECompMgrWinMoveResize(EObj * eo, int change_xy, int change_wh, int change_bw)
{
ECmWinInfo *cw = eo->cmhook;
XserverRegion damage = None;
- int change_xy, change_wh, change_bw, invalidate;
-
- D1printf("ECompMgrWinMoveResize %#lx %#lx %d %d %d %d %d\n",
- eo->win, cw->extents, x, y, w, h, bw);
-
- /* Invalidate old window region */
-#if CAN_DO_USABLE
- if (cw->usable)
-#endif
- if (eo->shown) /* FIXME - ??? */
- {
- damage = XFixesCreateRegion(disp, 0, 0);
- if (cw->extents != None)
- XFixesCopyRegion(disp, damage, cw->extents);
- if (EventDebug(EDBUG_TYPE_COMPMGR3))
- ERegionShow("old-extents:", damage);
- }
+ int invalidate;
- change_xy = cw->a.x != x || cw->a.y != y;
- change_wh = cw->a.width != w || cw->a.height != h;
- change_bw = cw->a.border_width != bw;
+ D1printf("ECompMgrWinMoveResize %#lx xy=%d wh=%d bw=%d\n",
+ eo->win, change_xy, change_wh, change_bw);
invalidate = 0;
if (change_xy || change_bw)
@@ -1155,31 +1136,34 @@
if (change_wh || change_bw)
invalidate |= INV_SIZE;
- if (invalidate)
+ if (!invalidate)
+ return;
+
+ if (!eo->shown)
{
ECompMgrWinInvalidate(eo, invalidate);
- if (eo->shown) /* FIXME - ??? */
- if (invalidate & INV_SIZE)
- ECompMgrWinSetPicts(eo);
-
- cw->a.x = x;
- cw->a.y = y;
- cw->a.width = w;
- cw->a.height = h;
- cw->a.border_width = bw;
-
- /* Find new window region */
- if (eo->shown) /* FIXME - ??? */
- cw->extents = win_extents(disp, eo);
+ return;
}
-#if 0
- if (eo->shown) /* FIXME - ??? */
- {
- /* Hmmm. Why if not changed? */
- /* Invalidate new window region */
- XFixesUnionRegion(disp, damage, damage, cw->extents);
- }
+ /* Invalidate old window region */
+ damage = XFixesCreateRegion(disp, 0, 0);
+ if (cw->extents != None)
+ XFixesCopyRegion(disp, damage, cw->extents);
+ if (EventDebug(EDBUG_TYPE_COMPMGR3))
+ ERegionShow("old-extents:", damage);
+
+ ECompMgrWinInvalidate(eo, invalidate);
+
+ if (invalidate & INV_SIZE) /* FIXME - ??? */
+ ECompMgrWinSetPicts(eo);
+
+ /* Find new window region */
+ cw->extents = win_extents(disp, eo);
+
+#if 1
+ /* Hmmm. Why if not changed? - To get shadows painted. */
+ /* Invalidate new window region */
+ XFixesUnionRegion(disp, damage, damage, cw->extents);
#endif
if (damage != None)
@@ -1191,45 +1175,48 @@
{
ECmWinInfo *cw = eo->cmhook;
int x, y, w, h, bw;
+ int change_xy, change_wh, change_bw;
- /* Can this change ?!? */
- cw->a.override_redirect = ev->xconfigure.override_redirect;
-
- eo->x = x = ev->xconfigure.x;
- eo->y = y = ev->xconfigure.y;
- eo->w = w = ev->xconfigure.width;
- eo->h = h = ev->xconfigure.height;
+ x = ev->xconfigure.x;
+ y = ev->xconfigure.y;
+ w = ev->xconfigure.width;
+ h = ev->xconfigure.height;
bw = ev->xconfigure.border_width;
- ECompMgrWinMoveResize(eo, x, y, w, h, bw);
+ change_xy = eo->x != x || eo->y != y;
+ change_wh = eo->w != w || eo->h != h;
+ change_bw = cw->a.border_width != bw;
+
+ eo->x = x;
+ eo->y = y;
+ eo->w = w;
+ eo->h = h;
+ cw->a.border_width = bw;
+
+ ECompMgrWinMoveResize(eo, change_xy, change_wh, change_bw);
}
void
-ECompMgrWinReparent(EObj * eo, int desk, int x, int y)
+ECompMgrWinReparent(EObj * eo, int desk, int change_xy)
{
ECmWinInfo *cw = eo->cmhook;
- D1printf("ECompMgrWinReparent %#lx %#lx d=%d x,y=%d,%d\n",
- eo->win, cw->extents, desk, x, y);
+ D1printf("ECompMgrWinReparent %#lx %#lx d=%d->%d x,y=%d,%d %d\n",
+ eo->win, cw->extents, eo->desk, desk, eo->x, eo->y, change_xy);
/* Invalidate old window region */
- if (eo->shown)
- {
- if (EventDebug(EDBUG_TYPE_COMPMGR3))
- ERegionShow("old-extents:", cw->extents);
- ECompMgrDamageMerge(eo->desk, cw->extents, 0);
- }
+ if (EventDebug(EDBUG_TYPE_COMPMGR3))
+ ERegionShow("old-extents:", cw->extents);
+ ECompMgrDamageMerge(eo->desk, cw->extents, change_xy);
- if (cw->a.x != x || cw->a.y != y)
+ if (change_xy)
{
+ cw->extents = None;
ECompMgrWinInvalidate(eo, INV_POS);
- cw->a.x = x;
- cw->a.y = y;
-
/* Find new window region */
- if (eo->shown) /* FIXME - ??? */
- cw->extents = win_extents(disp, eo);
+ cw->extents = win_extents(disp, eo);
+ ECompMgrDamageMerge(desk, cw->extents, 0);
}
}
@@ -1340,8 +1327,8 @@
#endif
if (cw->damage_bounds.x <= 0 &&
cw->damage_bounds.y <= 0 &&
- cw->a.width <= cw->damage_bounds.x + cw->damage_bounds.width &&
- cw->a.height <= cw->damage_bounds.y + cw->damage_bounds.height)
+ eo->width <= cw->damage_bounds.x + cw->damage_bounds.width &&
+ eo->height <= cw->damage_bounds.y + cw->damage_bounds.height)
{
cw->usable = True;
}
@@ -1590,9 +1577,10 @@
XRenderComposite(dpy, PictOpOver,
cw->shadowPict ? cw->
shadowPict : transBlackPicture, cw->picture, pbuf,
- 0, 0, 0, 0, x + cw->rcx + cw->shadow_dx,
- y + cw->rcy + cw->shadow_dy, cw->shadow_width,
- cw->shadow_height);
+ 0, 0, 0, 0,
+ x + cw->rcx + cw->shadow_dx,
+ y + cw->rcy + cw->shadow_dy,
+ cw->shadow_width, cw->shadow_height);
break;
case ECM_SHADOWS_BLURRED:
if (cw->shadow == None)
@@ -1600,11 +1588,11 @@
ERegionSubtractOffset(cw->clip, x, y, cw->borderSize);
XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, cw->clip);
- XRenderComposite(dpy, PictOpOver, blackPicture, cw->shadow,
- pbuf, 0, 0, 0, 0,
+ XRenderComposite(dpy, PictOpOver, blackPicture, cw->shadow, pbuf,
+ 0, 0, 0, 0,
x + cw->rcx + cw->shadow_dx,
- y + cw->rcy + cw->shadow_dy, cw->shadow_width,
- cw->shadow_height);
+ y + cw->rcy + cw->shadow_dy,
+ cw->shadow_width, cw->shadow_height);
break;
}
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ecompmgr.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ecompmgr.h 1 May 2005 11:27:42 -0000 1.8
+++ ecompmgr.h 1 May 2005 22:26:03 -0000 1.9
@@ -37,9 +37,9 @@
void ECompMgrWinDel(EObj * eo, Bool gone, Bool do_fade);
void ECompMgrWinMap(EObj * eo);
void ECompMgrWinUnmap(EObj * eo);
-void ECompMgrWinMoveResize(EObj * eo, int x, int y, int w, int
h,
- int bw);
-void ECompMgrWinReparent(EObj * eo, int desk, int x, int y);
+void ECompMgrWinMoveResize(EObj * eo, int change_xy,
+ int change_wh, int change_bw);
+void ECompMgrWinReparent(EObj * eo, int desk, int change_xy);
void ECompMgrWinChangeOpacity(EObj * eo, unsigned int opacity);
Pixmap ECompMgrWinGetPixmap(const EObj * eo);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/eobj.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -3 -r1.23 -r1.24
--- eobj.c 1 May 2005 11:27:42 -0000 1.23
+++ eobj.c 1 May 2005 22:26:03 -0000 1.24
@@ -182,25 +182,6 @@
Efree(eo->name);
}
-static EObj *
-EobjCreate(Window win, int type)
-{
- EObj *eo;
- XWindowAttributes attr;
-
- if (!XGetWindowAttributes(disp, win, &attr))
- return NULL;
-
- eo = Ecalloc(1, sizeof(EObj));
- if (!eo)
- return eo;
-
- EobjInit(eo, type, win, attr.x, attr.y, attr.width, attr.height, NULL);
- eo->name = ecore_x_icccm_title_get(win);
-
- return eo;
-}
-
void
EobjDestroy(EObj * eo)
{
@@ -247,15 +228,22 @@
EobjRegister(Window win, int type)
{
EObj *eo;
+ XWindowAttributes attr;
eo = EobjListStackFind(win);
if (eo)
return eo;
- eo = EobjCreate(win, type);
+ if (!XGetWindowAttributes(disp, win, &attr))
+ return NULL;
+
+ eo = Ecalloc(1, sizeof(EObj));
if (!eo)
return eo;
+ EobjInit(eo, type, win, attr.x, attr.y, attr.width, attr.height, NULL);
+ eo->name = ecore_x_icccm_title_get(win);
+
#if 1 /* FIXME - TBD */
if (type == EOBJ_TYPE_EXT)
{
@@ -319,6 +307,10 @@
void
EobjMoveResize(EObj * eo, int x, int y, int w, int h)
{
+ int move, resize;
+
+ move = x != eo->x || y != eo->y;
+ resize = w != eo->w || h != eo->h;
eo->x = x;
eo->y = y;
eo->w = w;
@@ -339,7 +331,7 @@
}
#if USE_COMPOSITE
if (eo->cmhook)
- ECompMgrWinMoveResize(eo, x, y, w, h, 0);
+ ECompMgrWinMoveResize(eo, move, resize, 0);
#endif
}
@@ -359,18 +351,20 @@
EobjReparent(EObj * eo, int desk, int x, int y)
{
Desk *d;
+ int move;
d = DeskGet(desk);
if (!d)
return;
+ move = x != eo->x || y != eo->y;
eo->x = x;
eo->y = y;
EReparentWindow(eo->win, EoGetWin(d), x, y);
#if USE_COMPOSITE
- if (eo->cmhook)
- ECompMgrWinReparent(eo, desk, x, y);
+ if (eo->shown && eo->cmhook)
+ ECompMgrWinReparent(eo, desk, move);
#endif
EobjSetDesk(eo, desk);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/moveresize.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- moveresize.c 1 May 2005 11:27:43 -0000 1.36
+++ moveresize.c 1 May 2005 22:26:03 -0000 1.37
@@ -108,7 +108,7 @@
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup
|| Mode.move.swap, &num);
-#if 1 /* Is this OK? */
+#if 0 /* FIXME - Remove? */
if (Conf.movres.mode_move == 0)
for (i = 0; i < num; i++)
DetermineEwinFloat(gwins[i], 0, 0);
@@ -125,6 +125,8 @@
d = DesktopAt(Mode.x, Mode.y);
+ if (Conf.movres.mode_move == 0)
+ EoChangeOpacity(ewin, ewin->ewmh.opacity);
for (i = 0; i < num; i++)
{
if ((EoIsFloating(gwins[i])) || (Conf.movres.mode_move > 0))
@@ -147,7 +149,6 @@
}
}
- EoChangeOpacity(ewin, ewin->ewmh.opacity);
RaiseEwin(gwins[i]);
}
@@ -415,7 +416,8 @@
EoGetY(ewin1), ewin1->client.w, ewin1->client.h, 0);
}
Mode.mode = MODE_MOVE;
- EoChangeOpacity(ewin, OpacityExt(Conf.movres.opacity));
+ if (Conf.movres.mode_move == 0)
+ EoChangeOpacity(ewin, OpacityExt(Conf.movres.opacity));
}
dx = Mode.x - Mode.px;
-------------------------------------------------------
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