Bug 493669

Summary: Kwin cannot tell if a window is full-screen
Product: [Plasma] kwin Reporter: Alberto Salvia Novella <es20490446e>
Component: scriptingAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: xaver.hugl
Priority: NOR    
Version: 6.1.5   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Alberto Salvia Novella 2024-09-26 04:20:57 UTC
Using the Kwin QML scripting API, with many full-screen apps:
- "window.fullscreen" reports false.
- "window.size" reports less size than `Workspace.workspaceSize`.

Samples:
- prodeus.exe: fullScreen: true
- firefox: fullScreen: false: QSizeF(1836, 1080) vs QSize(1920, 1080)
- dosbox-staging: fullScreen: false: QSizeF(1836, 1080) vs QSize(1920, 1080)
- The Dark Mod: fullScreen: false: QSizeF(1836, 1080) vs QSize(1920, 1080)

Since Kwin ditched the previous API, suddenly nothing works. And I can fix jeez.
Comment 1 Zamundaaa 2024-09-26 14:20:28 UTC
It sounds like those windows are maximized with a panel on the left, and not actually fullscreen?
Comment 2 Alberto Salvia Novella 2024-09-26 22:43:57 UTC
There is a panel on the left, but the window is fullscreen and the panel invisible.

My hypothesis is that most full screen windows are started windowed, and inmediately go fullscreen being the change invisible to the naked eye. But the function only catches the first state when called from a signal, as there is no delay.

But I haven't investigated it further yet.
Comment 3 Alberto Salvia Novella 2024-09-29 10:21:44 UTC
Okay, if I make the script wait 100ms it tells the correct resolution.

So I was right: "fullscreen" cannot tell the resolution if the window is being started, as first it goes windowed to fullscreen.
Comment 4 Alberto Salvia Novella 2024-09-29 14:15:49 UTC
This only happens with the signal "windowAdded", but not with "windowActivated"