Bug 442720 - transient window cannot be focused after focusing a windowed_fullscreen game
Summary: transient window cannot be focused after focusing a windowed_fullscreen game
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.27.7
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2021-09-20 05:10 UTC by redartofcode
Modified: 2023-09-06 13:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description redartofcode 2021-09-20 05:10:28 UTC
SUMMARY
I have successfully set my overlay window above the game in windowed fullscreen by using either the "critical notification" window type or setting "transient_for" attribute with the game window id. 

BUT even if the overlay is visible, I cannot interact with it after i focus the game. The overlay window can only be interacted with IF i alt-tab to it, otherwise it just stays visible but with no way to focus it with mouse.

Is this the intended behavior or should the visible window should be focusable?

STEPS TO REPRODUCE
1. run a game in windowed_fullscreen mode.
2. create a new window the attribute transient_for set to the game window id
3. click in the game window to focus it, then try to click on the new window which will just do nothing for the transient window and instead interact with the game window.

OBSERVED RESULT
Transient Window still appears above the game, but is not clickable/focusable unless we use alt-tab

EXPECTED RESULT
Clicking on a Transient Window should focus it just like it would happen if the game was running in normal window mode.

SOFTWARE/OS VERSIONS
Linux: kernel 5.10.66
(available in About System)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
this is related to my attmept of keeping a overlay window above a windowed fullscreen window, which is how it works on windows.
https://bugs.kde.org/show_bug.cgi?id=441074
Pretty much the same issue with setting the window type to "_KDE_NET_WM_WINDOW_TYPE_CRITICAL_NOTIFICATION" which technically makes the window visible over the game window, but doesn't accept focus.
Comment 1 redartofcode 2021-09-20 11:27:19 UTC
I am not completely sure, but this could also be an issue with game window grabbing mouse pointer when it goes (windowed)fullscreen mode. but i don't have enough kde knowledge to be sure of what is happening in the background.
Comment 2 Vlad Zahorodnii 2021-09-20 14:41:32 UTC
iirc if the pointer is locked, kwin will send pointer events only to that window. alt-tab'ing breaks pointer constraints.
Comment 3 redartofcode 2021-09-21 02:45:48 UTC
(In reply to Vlad Zahorodnii from comment #2)
> iirc if the pointer is locked, kwin will send pointer events only to that
> window. alt-tab'ing breaks pointer constraints.

I just checked. it seems the game (in (windowed) fullscreen) won't even let me click on notifications which are visible above it. i used `sleep 5 && notify-send -u critical 'check clicking me'` and swapped to game. the notification popped up, but pointer remains grabbed.
Comment 4 David Edmundson 2023-09-06 10:39:02 UTC
This bug was reported against an outdated version of KWin. We have made many changes since the. 
If the issue persists in newer versions can you reopen the bug report updating the version number.
Comment 5 redartofcode 2023-09-06 13:47:00 UTC
verified that i can't click on notifications (critical) when the game is focused, EVEN if the notification is clearly above the windowed fullscreen game.
Comment 6 redartofcode 2023-09-06 13:48:27 UTC
I checked it on endeavour (arch) latest plasma update 5.27.7 in X11 session.