Bug 474730 - Window placement "Centered" doesn't work correctly
Summary: Window placement "Centered" doesn't work correctly
Status: CLOSED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 5.27.7
Platform: Debian unstable Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-20 10:22 UTC by Matthias Heinz
Modified: 2023-09-20 19:40 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 Matthias Heinz 2023-09-20 10:22:43 UTC
SUMMARY
When having window placement set to "Centered" new windows should be always centered. This doesn't work correctly. Newly starting e.g. konsole puts it centered on the screen, but when opening another window of konsole the new window is not centered, but cascade slightly right-down below. This is either an undocumented feature (that should be configurable) or a bug.

This was tested with a new user on a clean session with window placement set to "Centered" (which was the default) and allowing applications to handle the window placement on their own switched off.

STEPS TO REPRODUCE
1. Set window placement to "Centered"
2. Start konsole
3. Use e.g. the shortcut in konsole to open more windows.

OBSERVED RESULT

The first konsole window will get centered, the second maybe, but then they get cascaded.

EXPECTED RESULT

All windows get centered, when window placement is set to "Centered". (And if the application itself is not allowed to control their own positioning on the screen).

---

Yes, I have seen https://bugs.kde.org/show_bug.cgi?id=58063 and other reports that this might be intentional. But it is not documented. And I find it very VERY annoying to have something named "Centered", which doesn't actually center. So either call it "smart center" or document it somewhere, where it is obvious what will happen. And add an option where new windows are always centered. (Yes I like my windows centered. All of them.)

Many thanks.
Comment 1 Nate Graham 2023-09-20 18:57:00 UTC
This is indeed intentional. If you open two of the same size windows when using Centered mode, they'll overlap 100% and that's not exactly helpful and it's very confusing for non-experts. We're not planning to offer an opt-out for this.

I also don't think this it worth documenting anywhere as it's self-documenting: the first time you see a window opened centered but cascaded, you learn about the cascading behavior.
Comment 2 Matthias Heinz 2023-09-20 19:26:39 UTC
(In reply to Nate Graham from comment #1)
> This is indeed intentional. If you open two of the same size windows when
> using Centered mode, they'll overlap 100% and that's not exactly helpful and
> it's very confusing for non-experts. We're not planning to offer an opt-out
> for this.

I know. And you added it, because your wife got used to it from using MacOS and that's why you are personally attached to this feature. (This is meant as a non-emotional statement of the current situation and not as an insult. Don't get me wrong here.)

Still the name is missleading. I would expect the name to open all windows centered. And minimized windows aren't taken into account at all (this could be intentional, but defeats the logic of cascading windows with the same size). And it fights with some applications that set their own window position, but could be a bug on their side not kwin. (Like konsole apparently).
Comment 3 Nate Graham 2023-09-20 19:40:57 UTC
If you're referring to the logic used to justify this change in https://invent.kde.org/plasma/kwin/-/commit/6b949cac02c5a7216bb07b55c347194647030307, let me quote the full paragraph for context:

> As a result, I commonly see Plasma users open windows and then
> immediately, reflexively grab the window's titlebar and drag it to the
> center of the screen. I have seen my wife do this. I have seen every
> YouTube reviewer of Plasma do this. I have even see fellow KDE
> developers at sprints do this. It seems like quite a common impulse
> to want a newly-opened window to appear in the center of the screen,
> which is where the user is likely to already be looking.

The feature does not fight with windows that set their own position. On X11, such windows override the KWin window positioning behavior, which is only invoked when the windows does not set its own position. On Wayland, windows cannot set their own positions and KWin is always in charge, so again, no fighting with one another.

If the cascading behavior causes windows to be cascaded when they would overlap with windows occupying the same location that are minimized, that's a bug that we should fix, rather than intentional behavior. But I can't reproduce it on Plasma 6 Wayland.