Bug 500422 - KWin scripts have no window "maximized" property
Summary: KWin scripts have no window "maximized" property
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: scripts (other bugs)
Version First Reported In: 6.2.4
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-19 15:37 UTC by Saul Fautley
Modified: 2025-02-19 19:57 UTC (History)
0 users

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 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.