Force a redraw if the window focus changes.

Otherwise if all of the windows in the new situation never redraw
we never update to show the new focus configuration.

This change avoids things like stuck overlays and notification
windows if the underlying game is stuck.
This commit is contained in:
Bas Nieuwenhuizen 2021-10-15 20:19:38 +02:00 committed by Simon Ser
parent 26aeebf11d
commit 7796ffc130

View file

@ -1597,6 +1597,8 @@ determine_and_apply_focus(Display *dpy, MouseCursor *cursor)
gameFocused = false;
Window prevFocusWindow = currentFocusWindow;
Window prevOverlayWindow = currentOverlayWindow;
Window prevNotificationWindow = currentNotificationWindow;
currentFocusWindow = None;
currentFocusWin = nullptr;
currentOverlayWindow = None;
@ -1637,6 +1639,12 @@ determine_and_apply_focus(Display *dpy, MouseCursor *cursor)
}
}
if ( prevOverlayWindow != currentOverlayWindow ||
prevNotificationWindow != currentNotificationWindow )
{
hasRepaint = true;
}
std::vector< unsigned long > focusable_appids;
std::vector< unsigned long > focusable_windows;
@ -1781,6 +1789,8 @@ found:
PropModeReplace, (unsigned char *)wmState,
sizeof(wmState) / sizeof(wmState[0]));
hasRepaint = true;
gpuvis_trace_printf( "determine_and_apply_focus focus %lu", focus->id );
if ( debugFocus == true )