Bug 468260 - Regression: "workspace.clientArea(KWin.MaximizeArea, client)" returns wrong values (AKA "Move Window" KWin script broke)
Summary: Regression: "workspace.clientArea(KWin.MaximizeArea, client)" returns wrong v...
Status: RESOLVED DOWNSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: scripting (show other bugs)
Version: 5.27.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2023-04-07 23:26 UTC by Denilson F. de Sá
Modified: 2024-04-07 17:56 UTC (History)
4 users (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 Denilson F. de Sá 2023-04-07 23:26:51 UTC
SUMMARY

Since the latest KDE Plasma (5.27.3) was installed on my Manjaro Linux, the "Move Window" KWin script broke (i.e. it's not behaving properly).

STEPS TO REPRODUCE

1. Install this KWin script https://store.kde.org/p/1702170/
2. Go to KDE settings and enable that script. Observe it will map Super+Numpad to actions to move the current window to one of the 9 locations on the current screen (top/middle/bottom + left/middle/right).
3. Have two connected displays, and set then in a way that leaves some unused area. For instance, the left display in the horizontal orientation and the right display in the vertical one:

        .----.
        |    |
.-------|    |
|       |    |
'-------'----'

4. Focus on any window on the left display (or on either display).
5. Use Super+Numpad shortcuts to move the window.

OBSERVED RESULT

The window is moved to unexpected locations, places that are definitely not the center. Sometimes the window gets moved off-screen (probably in that unusable area).

EXPECTED RESULT

I should "just work", as it used to work in the previous KDE versions.

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Manjaro Linux
KDE Plasma Version: 5.27.3
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8
Graphics Plataform: X11

ADDITIONAL INFORMATION

This bug has also been reported here: https://github.com/Merrit/kwin-move-window/issues/3
However, I believe the bug is in KDE itself, and not on that KWin script (as that script is unchanged, while KDE got serious updates regarding multi-display setups).
Comment 1 Denilson F. de Sá 2023-05-05 12:08:14 UTC
It's worth mentioning this regression may potentially affect the automatic positioning of new windows. Here are a couple of examples:

* While taking a screenshot, the Spectacle main window once opened up off-screen (in the void area outside the displays).
* When using a application that usually opens a new window centered on the current display (e.g. openconnect-globalprotect), it can show up in a weird position (i.e. not centered, not aligned to any edge).

I'm mentioning this because the KWin script breaking (due to some misbehavior of the exposed KDE API) might be a symptom of some slightly deeper issue shared among both KWin scripts and the logic that auto-positions new windows.
Comment 2 Denilson F. de Sá 2024-04-07 09:22:05 UTC
Worth noting that `kwin-move-window` script was updated to fix (or work around) this issue.
https://github.com/Merrit/kwin-move-window/commit/ce3050094d9eecc7e07accc682358aa36d1b923a

I haven't used an asymmetrical layout for several months, which means I'm avoiding this bug. I can't tell you if it still exists or not. (I mean, in other applications besides that kwin script, like I mentioned in comment #1.)
Comment 3 Zamundaaa 2024-04-07 17:56:53 UTC
Afaict, the script before just ignored the x and y positions of the placement area (var areaCenterX = area.width / 2), so it was a bug in the script