forked from e16/e16
1
0
Fork 0

Stuff for checking if various XSync's are really needed.

SVN revision: 33741
This commit is contained in:
Kim Woelders 2008-02-13 21:31:29 +00:00
parent 5ab71de162
commit c9b1c47dfe
21 changed files with 48 additions and 32 deletions

View File

@ -428,6 +428,7 @@ typedef struct
int mask_alpha_threshold; int mask_alpha_threshold;
char enable_startup_id; char enable_startup_id;
char use_render_for_scaling; char use_render_for_scaling;
unsigned int no_sync_mask;
} testing; } testing;
char autosave; char autosave;

View File

@ -1291,7 +1291,7 @@ DeskRaise(unsigned int desk)
ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL); ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL);
ESync(); ESync(ESYNC_DESKS);
} }
static void static void
@ -1327,7 +1327,7 @@ DeskLower(unsigned int desk)
HintsSetCurrentDesktop(); HintsSetCurrentDesktop();
EUngrabServer(); EUngrabServer();
ESync(); ESync(ESYNC_DESKS);
} }
#if 0 /* Unused */ #if 0 /* Unused */

View File

@ -2523,7 +2523,7 @@ ECompMgrStart(void)
#endif #endif
_ECM_SET_CLIP_CHANGED(); _ECM_SET_CLIP_CHANGED();
EUngrabServer(); EUngrabServer();
ESync(); ESync(0);
} }
static void static void
@ -2587,7 +2587,7 @@ ECompMgrStop(void)
DesksBackgroundRefresh(NULL, DESK_BG_RECONFIGURE_ALL); DesksBackgroundRefresh(NULL, DESK_BG_RECONFIGURE_ALL);
#endif #endif
EUngrabServer(); EUngrabServer();
ESync(); ESync(0);
} }
void void

View File

@ -658,9 +658,11 @@ void
EobjsRepaint(void) EobjsRepaint(void)
{ {
#if USE_COMPOSITE #if USE_COMPOSITE
ECompMgrRepaint(); if (ECompMgrIsActive())
ECompMgrRepaint();
else
#endif #endif
ESync(); ESync(0);
} }
#if USE_COMPOSITE #if USE_COMPOSITE

View File

@ -1053,7 +1053,7 @@ EwinWithdraw(EWin * ewin, Win to)
} }
ICCCM_Withdraw(ewin); ICCCM_Withdraw(ewin);
ESync(); ESync(0);
EUngrabServer(); EUngrabServer();
} }

View File

@ -73,7 +73,7 @@ ExtInitWinMain(void)
XSelectInput(disp, win, StructureNotifyMask); XSelectInput(disp, win, StructureNotifyMask);
EUngrabServer(); EUngrabServer();
ESync(); ESync(0);
{ {
Window w2, ww; Window w2, ww;
@ -133,7 +133,7 @@ ExtInitWinMain(void)
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = 50000; tv.tv_usec = 50000;
select(0, NULL, NULL, NULL, &tv); select(0, NULL, NULL, NULL, &tv);
ESync(); ESync(0);
} }
} }
@ -156,7 +156,7 @@ ExtInitWinCreate(void)
Eprintf("ExtInitWinCreate\n"); Eprintf("ExtInitWinCreate\n");
a = XInternAtom(disp, "ENLIGHTENMENT_RESTART_SCREEN", False); a = XInternAtom(disp, "ENLIGHTENMENT_RESTART_SCREEN", False);
ESync(); ESync(0);
if (fork()) if (fork())
{ {

View File

@ -628,9 +628,9 @@ FocusHandleClick(EWin * ewin, Win win)
EwinGetContainerXwin(ewin)); EwinGetContainerXwin(ewin));
if (win == EwinGetContainerWin(ewin)) if (win == EwinGetContainerWin(ewin))
{ {
ESync(); ESync(ESYNC_FOCUS);
XAllowEvents(disp, ReplayPointer, CurrentTime); XAllowEvents(disp, ReplayPointer, CurrentTime);
ESync(); ESync(ESYNC_FOCUS);
} }
} }

View File

@ -139,7 +139,7 @@ IB_Animate_A(char iconify, EWin * ewin, EWin * ibox)
XDrawLine(disp, root, gc, x3, y3, x4, y4); XDrawLine(disp, root, gc, x3, y3, x4, y4);
XDrawLine(disp, root, gc, x4, y4, x1, y1); XDrawLine(disp, root, gc, x4, y4, x1, y1);
ESync(); ESync(ESYNC_ICONIFY);
IB_Animate_Sleep(t0, a); IB_Animate_Sleep(t0, a);
XDrawLine(disp, root, gc, x1, y1, x2, y2); XDrawLine(disp, root, gc, x1, y1, x2, y2);
@ -216,7 +216,7 @@ IB_Animate_B(char iconify, EWin * ewin, EWin * ibox)
h = (int)(fh + a * (th - fh)); h = (int)(fh + a * (th - fh));
XDrawRectangle(disp, root, gc, x, y, w, h); XDrawRectangle(disp, root, gc, x, y, w, h);
ESync(); ESync(ESYNC_ICONIFY);
IB_Animate_Sleep(t0, a); IB_Animate_Sleep(t0, a);
XDrawRectangle(disp, root, gc, x, y, w, h); XDrawRectangle(disp, root, gc, x, y, w, h);

View File

@ -279,7 +279,7 @@ main(int argc, char **argv)
/* let's make sure we set this up and go to our desk anyways */ /* let's make sure we set this up and go to our desk anyways */
DeskGoto(DesksGetCurrent()); DeskGoto(DesksGetCurrent());
ESync(); ESync(ESYNC_MAIN);
#ifdef SIGCONT #ifdef SIGCONT
for (i = 0; i < Mode.wm.child_count; i++) for (i = 0; i < Mode.wm.child_count; i++)

View File

@ -372,7 +372,7 @@ MenuShow(Menu * m, char noshow)
Eprintf("Mode_menus.context_ewin set %s\n", Eprintf("Mode_menus.context_ewin set %s\n",
EwinGetTitle(Mode_menus.context_ewin)); EwinGetTitle(Mode_menus.context_ewin));
#endif #endif
ESync(); ESync(ESYNC_MENUS);
Mode_menus.first = m; Mode_menus.first = m;
MenuShowMasker(m); MenuShowMasker(m);
TooltipsEnable(0); TooltipsEnable(0);

View File

@ -158,7 +158,7 @@ ETimedLoopInit(int k1, int k2, int speed)
etl_fac = (k2 - k1) * (double)speed / 1000.; etl_fac = (k2 - k1) * (double)speed / 1000.;
gettimeofday(&etl_tv_start, NULL); gettimeofday(&etl_tv_start, NULL);
ESync(); ESync(ESYNC_TLOOP);
} }
int int

View File

@ -200,6 +200,7 @@ static const CfgItem MiscCfgItems[] = {
CFG_ITEM_INT(Conf, testing.mask_alpha_threshold, 8), CFG_ITEM_INT(Conf, testing.mask_alpha_threshold, 8),
CFG_ITEM_BOOL(Conf, testing.enable_startup_id, 1), CFG_ITEM_BOOL(Conf, testing.enable_startup_id, 1),
CFG_ITEM_BOOL(Conf, testing.use_render_for_scaling, 0), CFG_ITEM_BOOL(Conf, testing.use_render_for_scaling, 0),
CFG_ITEM_HEX(Conf, testing.no_sync_mask, 0),
CFG_ITEM_BOOL(Conf, autosave, 1), CFG_ITEM_BOOL(Conf, autosave, 1),
CFG_ITEM_BOOL(Conf, memory_paranoia, 1), CFG_ITEM_BOOL(Conf, memory_paranoia, 1),

View File

@ -186,7 +186,7 @@ ActionMoveEnd(EWin * ewin)
Efree(gwins); Efree(gwins);
ESync(); ESync(ESYNC_MOVRES);
done: done:
Mode.mode = MODE_NONE; Mode.mode = MODE_NONE;
@ -458,7 +458,7 @@ ActionResizeEnd(EWin * ewin)
ewin->shape_w, ewin->shape_h); ewin->shape_w, ewin->shape_h);
} }
ESync(); ESync(ESYNC_MOVRES);
done: done:
if (Mode_mr.grab_server) if (Mode_mr.grab_server)

View File

@ -109,7 +109,7 @@ EDestroyPixImg(PixImg * pi)
{ {
if (!pi) if (!pi)
return; return;
ESync(); ESync(0);
XShmDetach(disp, pi->shminfo); XShmDetach(disp, pi->shminfo);
shmdt(pi->shminfo->shmaddr); shmdt(pi->shminfo->shmaddr);
shmctl(pi->shminfo->shmid, IPC_RMID, 0); shmctl(pi->shminfo->shmid, IPC_RMID, 0);
@ -222,7 +222,7 @@ EBlendPixImg(Win win, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
if ((w <= 0) || (h <= 0)) if ((w <= 0) || (h <= 0))
return; return;
ESync(); ESync(0);
switch (dst->xim->bits_per_pixel) switch (dst->xim->bits_per_pixel)
{ {

View File

@ -518,7 +518,7 @@ doSMExit(int mode, const char *params)
EwinsSetFree(); EwinsSetFree();
XSelectInput(disp, VRoot.xwin, 0); XSelectInput(disp, VRoot.xwin, 0);
ExtInitWinKill(); ExtInitWinKill();
ESync(); ESync(0);
/* Forget about cleaning up if no disp */ /* Forget about cleaning up if no disp */
ModulesSignal(ESIGNAL_EXIT, NULL); ModulesSignal(ESIGNAL_EXIT, NULL);

View File

@ -158,7 +158,7 @@ SetupX(const char *dstr)
mask = mask =
StructureNotifyMask | SubstructureNotifyMask | SubstructureRedirectMask; StructureNotifyMask | SubstructureNotifyMask | SubstructureRedirectMask;
ESelectInput(VRoot.win, mask); ESelectInput(VRoot.win, mask);
ESync(); ESync(0);
if (!Mode.wm.xselect) if (!Mode.wm.xselect)
{ {
AlertX(_("Another Window Manager is already running"), AlertX(_("Another Window Manager is already running"),

View File

@ -188,7 +188,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win)
for (i = 0; i < s->num_objs; i++) for (i = 0; i < s->num_objs; i++)
EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1); EoMoveResize(s, xx, yy, 1, 1);
ESync(); ESync(ESYNC_SLIDEOUT);
EoMap(s, 2); EoMap(s, 2);
EobjSlideSizeTo(EoObj(s), xx + sw, yy, xx, yy, 1, sh, sw, sh, EobjSlideSizeTo(EoObj(s), xx + sw, yy, xx, yy, 1, sh, sw, sh,
Conf.place.slidespeedmap); Conf.place.slidespeedmap);
@ -200,7 +200,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win)
for (i = 0; i < s->num_objs; i++) for (i = 0; i < s->num_objs; i++)
EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1); EoMoveResize(s, xx, yy, 1, 1);
ESync(); ESync(ESYNC_SLIDEOUT);
EoMap(s, 2); EoMap(s, 2);
EobjSlideSizeTo(EoObj(s), xx, yy, xx, yy, 1, sh, sw, sh, EobjSlideSizeTo(EoObj(s), xx, yy, xx, yy, 1, sh, sw, sh,
Conf.place.slidespeedmap); Conf.place.slidespeedmap);
@ -212,7 +212,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win)
for (i = 0; i < s->num_objs; i++) for (i = 0; i < s->num_objs; i++)
EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1); EoMoveResize(s, xx, yy, 1, 1);
ESync(); ESync(ESYNC_SLIDEOUT);
EoMap(s, 2); EoMap(s, 2);
EobjSlideSizeTo(EoObj(s), xx, yy + sh, xx, yy, sw, 1, sw, sh, EobjSlideSizeTo(EoObj(s), xx, yy + sh, xx, yy, sw, 1, sw, sh,
Conf.place.slidespeedmap); Conf.place.slidespeedmap);
@ -224,7 +224,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win)
for (i = 0; i < s->num_objs; i++) for (i = 0; i < s->num_objs; i++)
EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1); EoMoveResize(s, xx, yy, 1, 1);
ESync(); ESync(ESYNC_SLIDEOUT);
EoMap(s, 2); EoMap(s, 2);
EobjSlideSizeTo(EoObj(s), xx, yy, xx, yy, sw, 1, sw, sh, EobjSlideSizeTo(EoObj(s), xx, yy, xx, yy, sw, 1, sw, sh,
Conf.place.slidespeedmap); Conf.place.slidespeedmap);

View File

@ -166,6 +166,6 @@ StartupWindowsOpen(void)
return; return;
Mode.place.enable_features--; Mode.place.enable_features--;
ESync(); ESync(ESYNC_STARTUP);
AnimatorAdd(doStartupWindowsOpen, NULL); AnimatorAdd(doStartupWindowsOpen, NULL);
} }

View File

@ -1784,8 +1784,10 @@ EFlush(void)
} }
void void
ESync(void) ESync(unsigned int mask)
{ {
if (mask & Conf.testing.no_sync_mask)
return;
XSync(disp, False); XSync(disp, False);
} }

View File

@ -32,7 +32,17 @@ void EGrabServer(void);
void EUngrabServer(void); void EUngrabServer(void);
int EServerIsGrabbed(void); int EServerIsGrabbed(void);
void EFlush(void); void EFlush(void);
void ESync(void);
#define ESYNC_MAIN 0x0001
#define ESYNC_DESKS 0x0002
#define ESYNC_MENUS 0x0004
#define ESYNC_MOVRES 0x0008
#define ESYNC_FOCUS 0x0010
#define ESYNC_ICONIFY 0x0020
#define ESYNC_TLOOP 0x0040
#define ESYNC_SLIDEOUT 0x0080
#define ESYNC_STARTUP 0x0100
void ESync(unsigned int mask);
#if USE_COMPOSITE #if USE_COMPOSITE
int EVisualIsARGB(Visual * vis); int EVisualIsARGB(Visual * vis);

View File

@ -219,7 +219,7 @@ Zoom(EWin * ewin)
EDestroyWindow(zoom_mask_4); EDestroyWindow(zoom_mask_4);
SwitchRes(0, 0, 0, 0, 0); SwitchRes(0, 0, 0, 0, 0);
EwinWarpTo(ewin); EwinWarpTo(ewin);
ESync(); ESync(0);
zoom_last_ewin = NULL; zoom_last_ewin = NULL;
} }
return; return;
@ -262,7 +262,7 @@ Zoom(EWin * ewin)
zoom_mask_2 = ZoomMask(0, 0, mode->hdisplay, y1); zoom_mask_2 = ZoomMask(0, 0, mode->hdisplay, y1);
zoom_mask_3 = ZoomMask(x1 + ewin->client.w, 0, x2, mode->vdisplay); zoom_mask_3 = ZoomMask(x1 + ewin->client.w, 0, x2, mode->vdisplay);
zoom_mask_4 = ZoomMask(0, y1 + ewin->client.h, mode->hdisplay, y2); zoom_mask_4 = ZoomMask(0, y1 + ewin->client.h, mode->hdisplay, y2);
ESync(); ESync(0);
} }
} }