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

BF for "some obscured windows briefly appears when switching workspaces"

When changing workspace, mapped windows are unmapped from top to bottom
(referring to their stacking order), causing mapped but obscured windows
to briefly appear when the obscuring window is unmapped and until they
are themselves unmapped. [This might not be visible on recent hardware].
The fix is to unmap windows in reverse stacking order when changing
workspace.
This commit is contained in:
Daniel Déchelotte
2013-04-12 01:42:29 +02:00
committed by Carlos R. Mafra
parent be95172c95
commit cc02023e3e

View File

@@ -462,6 +462,8 @@ void wWorkspaceRelativeChange(WScreen * scr, int amount)
void wWorkspaceForceChange(WScreen * scr, int workspace)
{
WWindow *tmp, *foc = NULL, *foc2 = NULL;
WWindow **toUnmap;
int toUnmapSize, toUnmapCount;
if (workspace >= MAX_WORKSPACES || workspace < 0)
return;
@@ -480,6 +482,10 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
wWorkspaceMenuUpdate(scr, scr->clip_ws_menu);
toUnmapSize = 16;
toUnmapCount = 0;
toUnmap = wmalloc(toUnmapSize * sizeof(WWindow *));
if ((tmp = scr->focused_window) != NULL) {
if ((IS_OMNIPRESENT(tmp) && (tmp->flags.mapped || tmp->flags.shaded) &&
!WFLAGP(tmp, no_focusable)) || tmp->flags.changing_workspace) {
@@ -494,7 +500,12 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
/* unmap windows not on this workspace */
if ((tmp->flags.mapped || tmp->flags.shaded) &&
!IS_OMNIPRESENT(tmp) && !tmp->flags.changing_workspace) {
wWindowUnmap(tmp);
if (toUnmapCount == toUnmapSize)
{
toUnmapSize *= 2;
toUnmap = wrealloc(toUnmap, toUnmapSize * sizeof(WWindow *));
}
toUnmap[toUnmapCount++] = tmp;
}
/* also unmap miniwindows not on this workspace */
if (!wPreferences.sticky_icons && tmp->flags.miniaturized &&
@@ -543,6 +554,12 @@ void wWorkspaceForceChange(WScreen * scr, int workspace)
tmp = tmp->prev;
}
while (toUnmapCount > 0)
{
wWindowUnmap(toUnmap[--toUnmapCount]);
}
wfree(toUnmap);
/* Gobble up events unleashed by our mapping & unmapping.
* These may trigger various grab-initiated focus &
* crossing events. However, we don't care about them,