Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h borders.c focus.c gnome.c ipc.c sticky.c
Log Message:
Simplify border update code, partial fix to border updates after desk switch.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.243
retrieving revision 1.244
diff -u -3 -r1.243 -r1.244
--- E.h 9 Apr 2004 12:59:54 -0000 1.243
+++ E.h 9 Apr 2004 13:45:59 -0000 1.244
@@ -1702,9 +1702,8 @@
void SyncBorderToEwin(EWin * ewin);
void UpdateBorderInfo(EWin * ewin);
void RealiseEwinWinpart(EWin * ewin, int i);
-int DrawEwinWinpart(EWin * ewin, int i);
-int ChangeEwinWinpart(EWin * ewin, int i);
-void DrawEwin(EWin * ewin);
+void ChangeEwinWinpart(EWin * ewin, int i);
+void EwinBorderDraw(EWin * ewin, int do_shape, int queue_off);
int ChangeEwinWinpartContents(EWin * ewin, int i);
EWin *EwinCreate(void);
void EwinDestroy(EWin * ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -3 -r1.163 -r1.164
--- borders.c 9 Apr 2004 12:59:54 -0000 1.163
+++ borders.c 9 Apr 2004 13:45:59 -0000 1.164
@@ -347,7 +347,6 @@
EWin *const *lst;
int i, k, num, speed, fx, fy, x, y;
char doslide, manplace;
- char pq;
char cangrab = 0;
EDBUG(3, "AddToFamily");
@@ -563,11 +562,7 @@
/* if the window asked to be iconified at the start */
if (ewin->iconified)
{
- pq = Mode.queue_up;
- Mode.queue_up = 0;
- DrawEwin(ewin);
- PropagateShapes(ewin->win);
- Mode.queue_up = pq;
+ EwinBorderDraw(ewin, 1, 1);
MoveEwinToDesktopAt(ewin, ewin->desktop, x, y);
RaiseEwin(ewin);
ShowEwin(ewin);
@@ -596,12 +591,8 @@
ewin->client.already_placed = 1;
x = Mode.x + 1;
y = Mode.y + 1;
- pq = Mode.queue_up;
- Mode.queue_up = 0;
- DrawEwin(ewin);
ICCCM_Configure(ewin);
- PropagateShapes(ewin->win);
- Mode.queue_up = pq;
+ EwinBorderDraw(ewin, 1, 1);
MoveEwinToDesktop(ewin, ewin->desktop);
RaiseEwin(ewin);
MoveEwin(ewin, x, y);
@@ -640,11 +631,7 @@
fx = root.w;
fy = (rand() % (root.h)) - ewin->h;
}
- pq = Mode.queue_up;
- Mode.queue_up = 0;
- DrawEwin(ewin);
- PropagateShapes(ewin->win);
- Mode.queue_up = pq;
+ EwinBorderDraw(ewin, 1, 1);
MoveEwinToDesktop(ewin, ewin->desktop);
RaiseEwin(ewin);
MoveEwin(ewin, fx, fy);
@@ -654,11 +641,7 @@
}
else
{
- pq = Mode.queue_up;
- Mode.queue_up = 0;
- DrawEwin(ewin);
- PropagateShapes(ewin->win);
- Mode.queue_up = pq;
+ EwinBorderDraw(ewin, 1, 1);
MoveEwinToDesktopAt(ewin, ewin->desktop, x, y);
RaiseEwin(ewin);
ShowEwin(ewin);
@@ -679,7 +662,6 @@
void (*init) (EWin * ewin, void *ptr))
{
EWin *ewin;
- char pq;
Border *b;
EDBUG(3, "AddInternalToFamily");
@@ -703,12 +685,7 @@
init(ewin, ptr); /* Type specific initialisation */
ICCCM_Configure(ewin);
-
- pq = Mode.queue_up;
- Mode.queue_up = 0;
- DrawEwin(ewin);
- PropagateShapes(ewin->win);
- Mode.queue_up = pq;
+ EwinBorderDraw(ewin, 1, 1);
UngrabX();
@@ -760,29 +737,37 @@
EDBUG_RETURN_;
}
-int
+static void
+EwinWinpartITclassApply(EWin * ewin, int i)
+{
+ IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
+ ewin->bits[i].w, ewin->bits[i].h, ewin->active,
+ ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose);
+
+ if (ewin->border->part[i].flags == FLAG_TITLE)
+ TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
+ ewin->bits[i].w, ewin->bits[i].h, ewin->active,
+ ewin->sticky, ewin->bits[i].state, ewin->bits[i].expose,
+ ewin->border->part[i].tclass, EwinGetTitle(ewin));
+
+}
+
+static int
DrawEwinWinpart(EWin * ewin, int i)
{
- int move = 0, resize = 0, state = 0, ret = 0;
+ int move = 0, resize = 0, ret = 0;
EDBUG(4, "DrawEwinWinpart");
- if ((ewin->bits[i].x != ewin->bits[i].cx)
- || (ewin->bits[i].y != ewin->bits[i].cy))
+ if ((ewin->bits[i].x != ewin->bits[i].cx) ||
+ (ewin->bits[i].y != ewin->bits[i].cy))
move = 1;
- if ((ewin->bits[i].w != ewin->bits[i].cw)
- || (ewin->bits[i].h != ewin->bits[i].ch))
+ if ((ewin->bits[i].w != ewin->bits[i].cw) ||
+ (ewin->bits[i].h != ewin->bits[i].ch))
resize = 1;
if ((resize) || (ewin->bits[i].expose))
{
- state = ewin->bits[i].state;
- IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, state, ewin->bits[i].expose);
- if (ewin->border->part[i].flags == FLAG_TITLE)
- TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, state, ewin->bits[i].expose,
- ewin->border->part[i].tclass, EwinGetTitle(ewin));
+ EwinWinpartITclassApply(ewin, i);
+ ewin->bits[i].expose = 0;
ret = 1;
}
if ((move) || (resize))
@@ -793,68 +778,49 @@
ewin->bits[i].cw = ewin->bits[i].w;
ewin->bits[i].ch = ewin->bits[i].h;
}
- ewin->bits[i].expose = 0;
EDBUG_RETURN(ret);
}
-int
+void
ChangeEwinWinpart(EWin * ewin, int i)
{
- int state = 0, ret = 0;
-
EDBUG(3, "ChangeEwinWinpart");
- state = ewin->bits[i].state;
- IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky,
- state, ewin->bits[i].expose);
- if (ewin->border->part[i].flags == FLAG_TITLE)
- TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, state, ewin->bits[i].expose,
- ewin->border->part[i].tclass, EwinGetTitle(ewin));
+
+ EwinWinpartITclassApply(ewin, i);
if (ewin->bits[i].win)
ChangeEwinWinpartContents(ewin, i);
- if (!ewin->shapedone)
+
+ if (!ewin->shapedone || ewin->border->changes_shape)
PropagateShapes(ewin->win);
- else
- {
- if (ewin->border->changes_shape)
- PropagateShapes(ewin->win);
- }
ewin->shapedone = 1;
- ret = 1;
- EDBUG_RETURN(ret);
+
+ EDBUG_RETURN_;
}
void
-DrawEwin(EWin * ewin)
+EwinBorderDraw(EWin * ewin, int do_shape, int queue_off)
{
- int i, state;
+ int i, pq;
- EDBUG(4, "DrawEwin");
+ EDBUG(4, "EwinBorderDraw");
if (!ewin)
EDBUG_RETURN_;
+
+ pq = Mode.queue_up;
+ if (queue_off)
+ Mode.queue_up = 0;
+
for (i = 0; i < ewin->border->num_winparts; i++)
- {
- state = ewin->bits[i].state;
- IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, state, ewin->bits[i].expose);
- if (ewin->border->part[i].flags == FLAG_TITLE)
- TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
- ewin->bits[i].w, ewin->bits[i].h, ewin->active,
- ewin->sticky, state, ewin->bits[i].expose,
- ewin->border->part[i].tclass, EwinGetTitle(ewin));
- }
- if (!ewin->shapedone)
+ EwinWinpartITclassApply(ewin, i);
+
+ if (do_shape || !ewin->shapedone || ewin->border->changes_shape)
PropagateShapes(ewin->win);
- else
- {
- if (ewin->border->changes_shape)
- PropagateShapes(ewin->win);
- }
ewin->shapedone = 1;
+
+ if (queue_off)
+ Mode.queue_up = pq;
+
EDBUG_RETURN_;
}
@@ -1675,7 +1641,7 @@
return;
if (Conf.theme.transparency)
- DrawEwin(ewin); /* Update the border */
+ EwinBorderDraw(ewin, 0, 0); /* Update the border */
if (ewin->Refresh)
ewin->Refresh(ewin);
@@ -1690,10 +1656,7 @@
DetermineEwinArea(ewin);
if (Conf.theme.transparency)
- {
- DrawEwin(ewin); /* Update the border */
- PropagateShapes(ewin->win);
- }
+ EwinBorderDraw(ewin, 1, 0); /* Update the border */
if (ewin->MoveResize)
ewin->MoveResize(ewin, resize);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/focus.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- focus.c 8 Apr 2004 15:51:26 -0000 1.64
+++ focus.c 9 Apr 2004 13:45:59 -0000 1.65
@@ -178,7 +178,7 @@
FocusEwinSetActive(EWin * ewin, int active)
{
ewin->active = active;
- DrawEwin(ewin);
+ EwinBorderDraw(ewin, 0, 1);
FocusEwinSetGrabs(ewin);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/gnome.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- gnome.c 31 Mar 2004 19:00:19 -0000 1.36
+++ gnome.c 9 Apr 2004 13:45:59 -0000 1.37
@@ -849,7 +849,7 @@
{
ewin->sticky = 1;
RaiseEwin(ewin);
- DrawEwin(ewin);
+ EwinBorderDraw(ewin, 0, 0);
}
}
else
@@ -858,7 +858,7 @@
{
ewin->sticky = 0;
RaiseEwin(ewin);
- DrawEwin(ewin);
+ EwinBorderDraw(ewin, 0, 0);
}
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -3 -r1.150 -r1.151
--- ipc.c 9 Apr 2004 12:59:55 -0000 1.150
+++ ipc.c 9 Apr 2004 13:45:59 -0000 1.151
@@ -3738,7 +3738,7 @@
strcpy(ewin->icccm.wm_name, ptr);
XStoreName(disp, ewin->client.win, ewin->icccm.wm_name);
- DrawEwin(ewin);
+ EwinBorderDraw(ewin, 0, 0);
}
}
else
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/sticky.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -3 -r1.18 -r1.19
--- sticky.c 19 Jan 2004 22:30:34 -0000 1.18
+++ sticky.c 9 Apr 2004 13:45:59 -0000 1.19
@@ -37,7 +37,7 @@
MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y);
ewin->sticky = 0;
RaiseEwin(ewin);
- DrawEwin(ewin);
+ EwinBorderDraw(ewin, 0, 0);
HintsSetWindowState(ewin);
@@ -79,7 +79,7 @@
}
MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y);
RaiseEwin(ewin);
- DrawEwin(ewin);
+ EwinBorderDraw(ewin, 0, 0);
HintsSetWindowState(ewin);
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs