From 7796ffc130381059897f73ae788615bad9f257fd Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Fri, 15 Oct 2021 20:19:38 +0200 Subject: [PATCH] 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. --- src/steamcompmgr.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp index 03aeeac..178927c 100644 --- a/src/steamcompmgr.cpp +++ b/src/steamcompmgr.cpp @@ -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 )