1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-20 21:08:08 +01:00

Avoid clip flickering when docking an appicon

In handleIconMove, when moving an appicon near the clip, all clips were
systematically shown each time the mouse moved, causing some flickering
(perhaps only perceptible on a low-end machine?). This patch introduces
a showed_all_clips boolean to expand clips only once.
This commit is contained in:
Daniel Déchelotte
2013-04-12 01:42:28 +02:00
committed by Carlos R. Mafra
parent dfe7e255b2
commit be95172c95

View File

@@ -3429,6 +3429,7 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
Bool docked;
int superfluous = wPreferences.superfluous; /* we catch it to avoid problems */
int omnipresent = aicon->omnipresent; /* this must be cached!!! */
Bool showed_all_clips = False;
Bool hasMoved = False;
if (wPreferences.flags.noupdates)
@@ -3489,13 +3490,17 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
}
}
if (omnipresent) {
if (omnipresent && !showed_all_clips) {
int i;
for (i = 0; i < scr->workspace_count; i++) {
if (i == scr->current_workspace)
continue;
wDockShowIcons(scr->workspaces[i]->clip);
/* Note: if dock is collapsed (for instance,
because it auto-collapses), its icons
still won't show up */
}
showed_all_clips = True; /* To prevent flickering */
}
x = ev.xmotion.x_root - ofs_x;
@@ -3605,7 +3610,7 @@ static Bool handleIconMove(WDock *dock, WAppIcon *aicon, XEvent *event)
XFreePixmap(dpy, ghost);
XSetWindowBackground(dpy, scr->dock_shadow, scr->white_pixel);
}
if (omnipresent) {
if (showed_all_clips) {
int i;
for (i = 0; i < scr->workspace_count; i++) {
if (i == scr->current_workspace)