Bug 500422

Summary: KWin scripts have no window "maximized" property
Product: [Plasma] kwin Reporter: Saul Fautley <saulfautley>
Component: scriptsAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: minor    
Priority: NOR    
Version First Reported In: 6.2.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Saul Fautley 2025-02-19 15:37:22 UTC
Window objects in KWin JS scripts should have a "maximized" property to indicate if the window is maximized. Or at least "maximized_horizontal" and "maximized_vertical".

They have "minimized", "fullScreen" and "maximizable", but no "maximized". I'm not sure if this is just an oversight or a bug.

There are also two signals documented, "maximizedAboutToChange(MaximizeMode mode)" and "maximizedChanged()", but they appear to not work at all. No signals are received from them when changing the maximized state of a window.

There doesn't appear to be any way currently to tell if a window is maximized in KWin JS scripts.
Comment 1 Vlad Zahorodnii 2025-02-19 15:40:00 UTC
There's a `maximizeMode` property, perhaps the documentation doesn't reflect it
Comment 2 Saul Fautley 2025-02-19 15:42:32 UTC
(In reply to Vlad Zahorodnii from comment #1)
> There's a `maximizeMode` property, perhaps the documentation doesn't reflect it

Are you certain? `window.maximizeMode` is undefined for me.
Comment 3 Vlad Zahorodnii 2025-02-19 15:44:36 UTC
Hmm, that's odd... https://invent.kde.org/plasma/kwin/-/commit/6c345acb009ae940397c4b39e6a46564f50a2029
Comment 4 Saul Fautley 2025-02-19 19:57:09 UTC
(In reply to Vlad Zahorodnii from comment #3)
> Hmm, that's odd...
> https://invent.kde.org/plasma/kwin/-/commit/6c345acb009ae940397c4b39e6a46564f50a2029

Well this just shows you the importance of selecting the correct version on your bug report. I was still on KDE 6.2.4. After updating to 6.3.1 it works! Thanks for the help.

Documentation would be great, but that's another issue.