Track top-level window shepedness.

SVN revision: 19969
This commit is contained in:
Kim Woelders 2006-01-22 18:25:41 +00:00
parent b32a8c914f
commit 55d6bdbb3c
7 changed files with 53 additions and 22 deletions

View File

@ -112,6 +112,7 @@ EobjSetFloating(EObj * eo, int floating)
EobjSetLayer(eo, eo->layer);
}
#if 1 /* FIXME - Remove */
int
EobjIsShaped(const EObj * eo)
{
@ -123,6 +124,7 @@ EobjIsShaped(const EObj * eo)
return ((EWin *) eo)->state.shaped;
}
}
#endif
void
EobjInit(EObj * eo, int type, Window win, int x, int y, int w, int h,
@ -148,6 +150,7 @@ EobjInit(EObj * eo, int type, Window win, int x, int y, int w, int h,
eo->y = y;
eo->w = w;
eo->h = h;
eo->shaped = -1;
if (type == EOBJ_TYPE_EXT)
eo->name = ecore_x_icccm_title_get(win);
@ -277,6 +280,7 @@ EobjRegister(Window win, int type)
#if 1 /* FIXME - TBD */
if (type == EOBJ_TYPE_EXT)
{
eo->shaped = 0; /* FIXME - Assume unshaped for now */
EobjSetFloating(eo, 1);
EobjSetLayer(eo, 4);
}
@ -311,6 +315,9 @@ EobjMap(EObj * eo, int raise)
if (eo->stacked <= 0 || raise > 1)
DeskRestack(eo->desk);
if (eo->shaped < 0)
EobjShapeUpdate(eo, 0);
EMapWindow(eo->win);
#if USE_COMPOSITE
ECompMgrWinMap(eo);
@ -442,13 +449,22 @@ EobjLower(EObj * eo)
}
void
EobjChangeShape(EObj * eo)
EobjShapeUpdate(EObj * eo, int propagate)
{
int was_shaped = eo->shaped;
if (propagate)
eo->shaped = EShapePropagate(eo->win) != 0;
#if USE_COMPOSITE
else
eo->shaped = EShapeCheck(eo->win) != 0;
if (was_shaped <= 0 && eo->shaped <= 0)
return;
/* Shape may still be unchanged. Well ... */
if (eo->shown && eo->cmhook)
ECompMgrWinChangeShape(eo);
#else
eo = NULL;
#endif
}

View File

@ -37,6 +37,7 @@ struct _eobj
int x, y;
int w, h;
signed char stacked;
signed char shaped;
char sticky;
char floating;
unsigned external:1;
@ -119,7 +120,7 @@ struct _eobj
#define EoReparent(eo, d, x, y) EobjReparent(EoObj(eo), d, x, y)
#define EoRaise(eo) EobjRaise(EoObj(eo))
#define EoLower(eo) EobjLower(EoObj(eo))
#define EoChangeShape(eo) EobjChangeShape(EoObj(eo))
#define EoShapeUpdate(eo, p) EobjShapeUpdate(EoObj(eo), p)
/* eobj.c */
void EobjInit(EObj * eo, int type, Window win, int x, int y,
@ -143,7 +144,7 @@ void EobjMoveResize(EObj * eo, int x, int y, int w, int h);
void EobjReparent(EObj * eo, EObj * dst, int x, int y);
int EobjRaise(EObj * eo);
int EobjLower(EObj * eo);
void EobjChangeShape(EObj * eo);
void EobjShapeUpdate(EObj * eo, int propagate);
void EobjsRepaint(void);
Pixmap EobjGetPixmap(const EObj * eo);
void EobjChangeOpacity(EObj * eo, unsigned int opacity);

View File

@ -640,8 +640,7 @@ EwinPropagateShapes(EWin * ewin)
Eprintf("EwinPropagateShapes %#lx frame=%#lx shaped=%d\n",
_EwinGetClientXwin(ewin), EoGetWin(ewin), ewin->state.shaped);
EShapePropagate(EoGetWin(ewin));
EoChangeShape(ewin);
EoShapeUpdate(ewin, 1);
ewin->update.shape = 0;
}

View File

@ -1061,19 +1061,21 @@ IPC_ObjInfo(const char *params __UNUSED__, Client * c __UNUSED__)
lst = EobjListStackGet(&num);
IpcPrintf("Num window T V D S F L pos size C R Name\n");
IpcPrintf
("Num window T V Sh Dsk S F L pos size C R Name\n");
for (i = 0; i < num; i++)
{
eo = lst[i];
IpcPrintf(" %2d %#9lx %d %d %2d %d %d %3d %5d,%5d %4dx%4d %d %d %s\n",
i, eo->win, eo->type, eo->shown, eo->desk->num, eo->sticky,
eo->floating, eo->ilayer, eo->x, eo->y, eo->w, eo->h,
IpcPrintf
(" %2d %#9lx %d %d %2d %3d %d %d %3d %5d,%5d %4dx%4d %d %d %s\n",
i, eo->win, eo->type, eo->shown, eo->shaped, eo->desk->num,
eo->sticky, eo->floating, eo->ilayer, eo->x, eo->y, eo->w, eo->h,
#if USE_COMPOSITE
(eo->cmhook) ? 1 : 0, !eo->noredir
(eo->cmhook) ? 1 : 0, !eo->noredir
#else
0, 0
0, 0
#endif
, eo->name);
, eo->name);
}
}

View File

@ -242,8 +242,7 @@ WarpFocusWinPaint(WarpFocusWin * fw)
}
/* FIXME - Check shape */
EShapePropagate(EoGetWin(fw));
EoChangeShape(fw);
EoShapeUpdate(fw, 1);
}
static void

23
src/x.c
View File

@ -1147,7 +1147,7 @@ ExShapeCopy(EXID * xdst, EXID * xsrc)
return rn != 0;
}
static void
static int
ExShapePropagate(EXID * xid)
{
EXID *xch;
@ -1159,7 +1159,7 @@ ExShapePropagate(EXID * xid)
XWindowAttributes att;
if (!xid || xid->w <= 0 || xid->h <= 0)
return;
return 0;
#if DEBUG_SHAPE_PROPAGATE
Eprintf("ExShapePropagate %#lx %d,%d %dx%d\n", win, xid->x, xid->y, xid->w,
@ -1168,7 +1168,7 @@ ExShapePropagate(EXID * xid)
XQueryTree(disp, xid->win, &rt, &par, &list, &num);
if (!list)
return;
return 0;
num_rects = 0;
rects = NULL;
@ -1251,6 +1251,8 @@ ExShapePropagate(EXID * xid)
ExShapeCombineRectangles(xid, ShapeBounding, 0, 0, NULL, 0, ShapeSet,
Unsorted);
}
return xid->num_rect;
}
void
@ -1304,13 +1306,24 @@ EShapeCopy(Window dst, Window src)
return ExShapeCopy(xdst, xsrc);
}
void
int
EShapePropagate(Window win)
{
EXID *xid;
xid = EXidFind(win);
ExShapePropagate(xid);
return ExShapePropagate(xid);
}
int
EShapeCheck(Window win)
{
EXID *xid;
xid = EXidFind(win);
return xid->num_rect;
}
Pixmap

View File

@ -104,7 +104,8 @@ void EShapeCombineShape(Window win, int dest, int x, int y,
XRectangle *EShapeGetRectangles(Window win, int dest, int *rn,
int *ord);
int EShapeCopy(Window dst, Window src);
void EShapePropagate(Window win);
int EShapePropagate(Window win);
int EShapeCheck(Window win);
Pixmap EWindowGetShapePixmap(Window win);
#define ECreatePixmap(draw, w, h, depth) XCreatePixmap(disp, draw, w, h, depth)