Bug 474393 - windows always launch in random position
Summary: windows always launch in random position
Status: RESOLVED NOT A BUG
Alias: None
Product: Active Window Control
Classification: Plasma
Component: General (show other bugs)
Version: unspecified
Platform: Ubuntu Linux
: NOR minor
Target Milestone: ---
Assignee: Chris Holland
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-11 01:27 UTC by alexandrevalin2@gmail.com
Modified: 2023-09-13 17:02 UTC (History)
2 users (show)

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 alexandrevalin2@gmail.com 2023-09-11 01:27:00 UTC
SUMMARY
***
when I launch a window, it will always start in the same random position. For example, Freetube will always start in fullscreen(f11), spotify will always start in the bottom-right corner and Firefox will start maximized. I m not sure what determines the state in which the window will launch in, but they were at least one time in that position. All of the applications function as expected, but it's annoying to un-fullscreen some apps every time they launch.
***


STEPS TO REPRODUCE
1. I'm not exactly sure how to start the bug
2. launch an app. It should always launch in the same position
3. 

OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Nate Graham 2023-09-11 18:30:03 UTC
So the way window placement works is as follows:

On Wayland, all windows place themselves according to its placement policy, which is user-controllable. The setting lives in System Settings > Window Management > Window Behavior > Advanced. Feel free to change it to whatever you like best. The current default value is "Centered" which was changed in the last year or two from the old default value of "Smart" which indeed tended to place windows in a way that looked random. It sounds like you may still be using Smart? Feel free to change it.

On X11--including for XWayland apps run in a Wayland session--things are more complicated. On X11, apps are allowed to place themselves on the screen--but they aren't required to. If a window doesn't, only then does KWin place it according to its placement policy described earlier.

KWin could in theory ignore this and forcibly place X11 windows according to its placement policy, like on Wayland. But doing so unconditionally would not only break the spec, but in practice it would also break apps that were developed with the expectation of being able to place their own windows wherever they want, so instead this is an opt-in thing that you as the user have to turn on via the Window Rules system.

Because that would be annoying, many X11 apps implement their own "remember my window positions" feature. It sounds like some or all of the apps you mentioned are using that feature.
Comment 2 alexandrevalin2@gmail.com 2023-09-12 23:15:46 UTC
Sorry or not being clear. I meant that some apps will launch in random positions, but they will always launch in that position. I tried to change the window launch behaviour and it fixed some of the apps. Is there a way to fore apps to not use their "remember my window positions"?
Comment 3 Nate Graham 2023-09-13 17:02:01 UTC
For KDE apps, you can uncheck the checkbox for "allow apps to remember their window positions" which is on the same page as where you can change the default positioning mode.

For non-KDE apps, you'll have to use Window Rules. If you need help with that, I'd recommend asking in https://discuss.kde.org/c/help/6.