Bug 463237 - Unresponsive windows become responsive when losing focus
Summary: Unresponsive windows become responsive when losing focus
Status: REPORTED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: master
Platform: unspecified Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-19 15:22 UTC by Oliver Beard
Modified: 2023-01-05 18:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Beard 2022-12-19 15:22:56 UTC
SUMMARY
When a window is unresponsive, the frozenapp effect is applied and the title has '(Not Responding)' appended. It takes time to determine that a window is unresponsive when a window is focused. When it is marked unresponsive, when it loses focus, it is marked responsive again, unless it loses focus before the unresponsive state is recognised.

I could not determine why this issue occurs. I am not sure if this is a regression, but I suspect that this is not the intended behaviour. Please move the issue from general if this is not the appropriate component.


STEPS TO REPRODUCE
1. Open kwrite
2. `kill -SIGSTOP $(pidof kwrite)`
3. Focus kwrite, becomes unresponsive
4. Unfocus kwrite, window incorrectly loses unresponsive state
5. Focus again, window is now unresponsive
--
6. When refocusing a window, if the window is unfocused again *before* being recognised as unresponsive, it will be correctly recognised as unresponsive in the background, and if focused and unfocused, loses that state as above.


EXPECTED RESULT
The window should not lose its unresponsive state when it is unresponsive and loses focus.


ADDITIONAL INFORMATION
A window becoming responsive is not an issue, regardless of focus (SIGCONT).

Add qDebug() << "unresponsive state: " << (unresponsive ? "true" : "false"); just beneath https://invent.kde.org/plasma/kwin/-/blob/master/src/window.cpp#L3432 to help identify how the unresponsive state changes. Also/alternatively pay attention to the window title, as this change is immediate whereas the frozenapp effect is animated.

This issue is for Wayland. It likely exists on X11 - I have not tested it.