From c9b1c47dfe44036be2d9dfdb03eb2e975aa9acc4 Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Wed, 13 Feb 2008 21:31:29 +0000 Subject: [PATCH] Stuff for checking if various XSync's are really needed. SVN revision: 33741 --- src/E.h | 1 + src/desktops.c | 4 ++-- src/ecompmgr.c | 4 ++-- src/eobj.c | 6 ++++-- src/ewins.c | 2 +- src/extinitwin.c | 6 +++--- src/focus.c | 4 ++-- src/iconify.c | 4 ++-- src/main.c | 2 +- src/menus.c | 2 +- src/misc.c | 2 +- src/mod-misc.c | 1 + src/moveresize.c | 4 ++-- src/piximg.c | 4 ++-- src/session.c | 2 +- src/setup.c | 2 +- src/slideout.c | 8 ++++---- src/startup.c | 2 +- src/x.c | 4 +++- src/xwin.h | 12 +++++++++++- src/zoom.c | 4 ++-- 21 files changed, 48 insertions(+), 32 deletions(-) diff --git a/src/E.h b/src/E.h index 147d0602..9f4fe1ee 100644 --- a/src/E.h +++ b/src/E.h @@ -428,6 +428,7 @@ typedef struct int mask_alpha_threshold; char enable_startup_id; char use_render_for_scaling; + unsigned int no_sync_mask; } testing; char autosave; diff --git a/src/desktops.c b/src/desktops.c index 7cb701eb..881a254e 100644 --- a/src/desktops.c +++ b/src/desktops.c @@ -1291,7 +1291,7 @@ DeskRaise(unsigned int desk) ModulesSignal(ESIGNAL_DESK_SWITCH_DONE, NULL); - ESync(); + ESync(ESYNC_DESKS); } static void @@ -1327,7 +1327,7 @@ DeskLower(unsigned int desk) HintsSetCurrentDesktop(); EUngrabServer(); - ESync(); + ESync(ESYNC_DESKS); } #if 0 /* Unused */ diff --git a/src/ecompmgr.c b/src/ecompmgr.c index 080100f9..ac7cfedf 100644 --- a/src/ecompmgr.c +++ b/src/ecompmgr.c @@ -2523,7 +2523,7 @@ ECompMgrStart(void) #endif _ECM_SET_CLIP_CHANGED(); EUngrabServer(); - ESync(); + ESync(0); } static void @@ -2587,7 +2587,7 @@ ECompMgrStop(void) DesksBackgroundRefresh(NULL, DESK_BG_RECONFIGURE_ALL); #endif EUngrabServer(); - ESync(); + ESync(0); } void diff --git a/src/eobj.c b/src/eobj.c index 74c2046f..b53c4794 100644 --- a/src/eobj.c +++ b/src/eobj.c @@ -658,9 +658,11 @@ void EobjsRepaint(void) { #if USE_COMPOSITE - ECompMgrRepaint(); + if (ECompMgrIsActive()) + ECompMgrRepaint(); + else #endif - ESync(); + ESync(0); } #if USE_COMPOSITE diff --git a/src/ewins.c b/src/ewins.c index 649e83bb..d74c503c 100644 --- a/src/ewins.c +++ b/src/ewins.c @@ -1053,7 +1053,7 @@ EwinWithdraw(EWin * ewin, Win to) } ICCCM_Withdraw(ewin); - ESync(); + ESync(0); EUngrabServer(); } diff --git a/src/extinitwin.c b/src/extinitwin.c index 87775729..4ccfd949 100644 --- a/src/extinitwin.c +++ b/src/extinitwin.c @@ -73,7 +73,7 @@ ExtInitWinMain(void) XSelectInput(disp, win, StructureNotifyMask); EUngrabServer(); - ESync(); + ESync(0); { Window w2, ww; @@ -133,7 +133,7 @@ ExtInitWinMain(void) tv.tv_sec = 0; tv.tv_usec = 50000; select(0, NULL, NULL, NULL, &tv); - ESync(); + ESync(0); } } @@ -156,7 +156,7 @@ ExtInitWinCreate(void) Eprintf("ExtInitWinCreate\n"); a = XInternAtom(disp, "ENLIGHTENMENT_RESTART_SCREEN", False); - ESync(); + ESync(0); if (fork()) { diff --git a/src/focus.c b/src/focus.c index 7a369e2a..4cf88176 100644 --- a/src/focus.c +++ b/src/focus.c @@ -628,9 +628,9 @@ FocusHandleClick(EWin * ewin, Win win) EwinGetContainerXwin(ewin)); if (win == EwinGetContainerWin(ewin)) { - ESync(); + ESync(ESYNC_FOCUS); XAllowEvents(disp, ReplayPointer, CurrentTime); - ESync(); + ESync(ESYNC_FOCUS); } } diff --git a/src/iconify.c b/src/iconify.c index 35736813..24c48c23 100644 --- a/src/iconify.c +++ b/src/iconify.c @@ -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, x4, y4, x1, y1); - ESync(); + ESync(ESYNC_ICONIFY); IB_Animate_Sleep(t0, a); 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)); XDrawRectangle(disp, root, gc, x, y, w, h); - ESync(); + ESync(ESYNC_ICONIFY); IB_Animate_Sleep(t0, a); XDrawRectangle(disp, root, gc, x, y, w, h); diff --git a/src/main.c b/src/main.c index 980d7d4c..dfed67c5 100644 --- a/src/main.c +++ b/src/main.c @@ -279,7 +279,7 @@ main(int argc, char **argv) /* let's make sure we set this up and go to our desk anyways */ DeskGoto(DesksGetCurrent()); - ESync(); + ESync(ESYNC_MAIN); #ifdef SIGCONT for (i = 0; i < Mode.wm.child_count; i++) diff --git a/src/menus.c b/src/menus.c index ab1b02b9..e57a743f 100644 --- a/src/menus.c +++ b/src/menus.c @@ -372,7 +372,7 @@ MenuShow(Menu * m, char noshow) Eprintf("Mode_menus.context_ewin set %s\n", EwinGetTitle(Mode_menus.context_ewin)); #endif - ESync(); + ESync(ESYNC_MENUS); Mode_menus.first = m; MenuShowMasker(m); TooltipsEnable(0); diff --git a/src/misc.c b/src/misc.c index b6164f8e..cfb3117d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -158,7 +158,7 @@ ETimedLoopInit(int k1, int k2, int speed) etl_fac = (k2 - k1) * (double)speed / 1000.; gettimeofday(&etl_tv_start, NULL); - ESync(); + ESync(ESYNC_TLOOP); } int diff --git a/src/mod-misc.c b/src/mod-misc.c index 53a7829d..26205d2e 100644 --- a/src/mod-misc.c +++ b/src/mod-misc.c @@ -200,6 +200,7 @@ static const CfgItem MiscCfgItems[] = { CFG_ITEM_INT(Conf, testing.mask_alpha_threshold, 8), CFG_ITEM_BOOL(Conf, testing.enable_startup_id, 1), 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, memory_paranoia, 1), diff --git a/src/moveresize.c b/src/moveresize.c index aa4ea9a8..7c4a5773 100644 --- a/src/moveresize.c +++ b/src/moveresize.c @@ -186,7 +186,7 @@ ActionMoveEnd(EWin * ewin) Efree(gwins); - ESync(); + ESync(ESYNC_MOVRES); done: Mode.mode = MODE_NONE; @@ -458,7 +458,7 @@ ActionResizeEnd(EWin * ewin) ewin->shape_w, ewin->shape_h); } - ESync(); + ESync(ESYNC_MOVRES); done: if (Mode_mr.grab_server) diff --git a/src/piximg.c b/src/piximg.c index 327dd752..b100b642 100644 --- a/src/piximg.c +++ b/src/piximg.c @@ -109,7 +109,7 @@ EDestroyPixImg(PixImg * pi) { if (!pi) return; - ESync(); + ESync(0); XShmDetach(disp, pi->shminfo); shmdt(pi->shminfo->shmaddr); 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)) return; - ESync(); + ESync(0); switch (dst->xim->bits_per_pixel) { diff --git a/src/session.c b/src/session.c index c8add1e7..877531f9 100644 --- a/src/session.c +++ b/src/session.c @@ -518,7 +518,7 @@ doSMExit(int mode, const char *params) EwinsSetFree(); XSelectInput(disp, VRoot.xwin, 0); ExtInitWinKill(); - ESync(); + ESync(0); /* Forget about cleaning up if no disp */ ModulesSignal(ESIGNAL_EXIT, NULL); diff --git a/src/setup.c b/src/setup.c index 9cad38eb..ab576164 100644 --- a/src/setup.c +++ b/src/setup.c @@ -158,7 +158,7 @@ SetupX(const char *dstr) mask = StructureNotifyMask | SubstructureNotifyMask | SubstructureRedirectMask; ESelectInput(VRoot.win, mask); - ESync(); + ESync(0); if (!Mode.wm.xselect) { AlertX(_("Another Window Manager is already running"), diff --git a/src/slideout.c b/src/slideout.c index b47923b9..4fbd036b 100644 --- a/src/slideout.c +++ b/src/slideout.c @@ -188,7 +188,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win) for (i = 0; i < s->num_objs; i++) EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EoMoveResize(s, xx, yy, 1, 1); - ESync(); + ESync(ESYNC_SLIDEOUT); EoMap(s, 2); EobjSlideSizeTo(EoObj(s), xx + sw, yy, xx, yy, 1, sh, sw, sh, Conf.place.slidespeedmap); @@ -200,7 +200,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win) for (i = 0; i < s->num_objs; i++) EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EoMoveResize(s, xx, yy, 1, 1); - ESync(); + ESync(ESYNC_SLIDEOUT); EoMap(s, 2); EobjSlideSizeTo(EoObj(s), xx, yy, xx, yy, 1, sh, sw, sh, Conf.place.slidespeedmap); @@ -212,7 +212,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win) for (i = 0; i < s->num_objs; i++) EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EoMoveResize(s, xx, yy, 1, 1); - ESync(); + ESync(ESYNC_SLIDEOUT); EoMap(s, 2); EobjSlideSizeTo(EoObj(s), xx, yy + sh, xx, yy, sw, 1, sw, sh, Conf.place.slidespeedmap); @@ -224,7 +224,7 @@ SlideoutShow(Slideout * s, EWin * ewin, Win win) for (i = 0; i < s->num_objs; i++) EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att); EoMoveResize(s, xx, yy, 1, 1); - ESync(); + ESync(ESYNC_SLIDEOUT); EoMap(s, 2); EobjSlideSizeTo(EoObj(s), xx, yy, xx, yy, sw, 1, sw, sh, Conf.place.slidespeedmap); diff --git a/src/startup.c b/src/startup.c index f8856a79..fa7a3a41 100644 --- a/src/startup.c +++ b/src/startup.c @@ -166,6 +166,6 @@ StartupWindowsOpen(void) return; Mode.place.enable_features--; - ESync(); + ESync(ESYNC_STARTUP); AnimatorAdd(doStartupWindowsOpen, NULL); } diff --git a/src/x.c b/src/x.c index 480b5008..b03dd52a 100644 --- a/src/x.c +++ b/src/x.c @@ -1784,8 +1784,10 @@ EFlush(void) } void -ESync(void) +ESync(unsigned int mask) { + if (mask & Conf.testing.no_sync_mask) + return; XSync(disp, False); } diff --git a/src/xwin.h b/src/xwin.h index d1391c7e..b8e95b31 100644 --- a/src/xwin.h +++ b/src/xwin.h @@ -32,7 +32,17 @@ void EGrabServer(void); void EUngrabServer(void); int EServerIsGrabbed(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 int EVisualIsARGB(Visual * vis); diff --git a/src/zoom.c b/src/zoom.c index 0ccd4162..adac20f7 100644 --- a/src/zoom.c +++ b/src/zoom.c @@ -219,7 +219,7 @@ Zoom(EWin * ewin) EDestroyWindow(zoom_mask_4); SwitchRes(0, 0, 0, 0, 0); EwinWarpTo(ewin); - ESync(); + ESync(0); zoom_last_ewin = NULL; } return; @@ -262,7 +262,7 @@ Zoom(EWin * ewin) zoom_mask_2 = ZoomMask(0, 0, mode->hdisplay, y1); zoom_mask_3 = ZoomMask(x1 + ewin->client.w, 0, x2, mode->vdisplay); zoom_mask_4 = ZoomMask(0, y1 + ewin->client.h, mode->hdisplay, y2); - ESync(); + ESync(0); } }