Bug 384091 - Add a window placement mode that remembers prior window position
Summary: Add a window placement mode that remembers prior window position
Status: RESOLVED DUPLICATE of bug 15329
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: git master
Platform: Neon Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-27 23:47 UTC by Nate Graham
Modified: 2019-08-28 15:26 UTC (History)
2 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 Nate Graham 2017-08-27 23:47:13 UTC
in System Settings> Window Management > Advanced > Placement, there are many window placement modes you can choose. But none of them will remember the prior location of a window when considering where to open it next time.

If you have a *specific* location where you want a window to *always* spawn, you can of course set a KWin rule to force that position. But there is no mode that will, in an ad-hoc manner, remember window positions for you--which is the default behavior in most other platforms' Window managers (macOS, Windows, GNOME), and arguably what average novice users expect vis-a-vis window positioning.

This leads up undesired behavior wherein you deliberately move an application window to some location to do some work, close it, re-open it later, and find that it has spawned in a different location from where it was before. It would be nice if you could tell KWin to always remember window positions for you, automatically.
Comment 1 Nate Graham 2017-08-27 23:48:00 UTC
*** Bug 380799 has been marked as a duplicate of this bug. ***
Comment 2 Martin Flöser 2017-08-28 04:20:54 UTC
Implementing this in the window manager in a reliable and working way is hardly possible as it is difficult to recognize Windows if an application is restarted.

Most applications on X11 Store their position and open there again. This is good enough for most cases.
Comment 3 Brennan Kinney 2018-05-15 03:01:04 UTC
(In reply to Martin Flöser from comment #2)
> Implementing this in the window manager in a reliable and working way is
> hardly possible as it is difficult to recognize Windows if an application is
> restarted.
> 
> Most applications on X11 Store their position and open there again. This is
> good enough for most cases.

You state most X11 applications will store position and open there again, but is that the case with windows being managed by kwin? Under system-settings WindowManagement -> WindowBehaviour -> Advanced tab, there is the Placement dropbox, listing options of:

Smart, Maximizing, Cascade, Random, Centered, Zero-Cornered, Under Mouse.

None of these seem to imply they'd respect that default X11 window position behaviour for most applications on X11 you're stating?

I understand that it might not be perfect, but if it's as reliable as the kwin rule can be "Remember" perhaps making that an option instead of requiring a user to manually enforce the window rule, it could be listed with the rest of those placement options?

What is the situation with Wayland? Better or worse for implementing it? This desired behaviour recently came up on r/kde.
Comment 4 Martin Flöser 2018-05-15 04:18:21 UTC
The placement strategies are only used for windows not requesting a position.
Comment 5 Nate Graham 2018-05-15 04:28:12 UTC
Would it be feasible to add a placement mode that overrides apps' own requested placement requests and always uses KWin to handle placement? I think that's basically what's desired here.
Comment 6 Martin Flöser 2018-05-15 18:45:32 UTC
(In reply to Nate Graham from comment #5)
> Would it be feasible to add a placement mode that overrides apps' own
> requested placement requests and always uses KWin to handle placement? I
> think that's basically what's desired here.

No, as that would be an X11 specific feature and KWin is feature frozen for X11. On Wayland using the placement strategy is the default.
Comment 7 Martin Flöser 2018-05-15 19:27:44 UTC
(In reply to Nate Graham from comment #5)
> Would it be feasible to add a placement mode that overrides apps' own
> requested placement requests and always uses KWin to handle placement? I
> think that's basically what's desired here.

oh and by the way: that already exists. Just create a catch-all window rule that ignores the application specified position.
Comment 8 Nate Graham 2018-05-16 02:53:26 UTC
Wow, so I can.
Comment 9 Brennan Kinney 2018-05-18 14:43:10 UTC
(In reply to Martin Flöser from comment #7)
> (In reply to Nate Graham from comment #5)
> > Would it be feasible to add a placement mode that overrides apps' own
> > requested placement requests and always uses KWin to handle placement? I
> > think that's basically what's desired here.
> 
> oh and by the way: that already exists. Just create a catch-all window rule
> that ignores the application specified position.

Is there any harm in still supporting it as a drop down placement mode or similar for the window position behaviour? 

It would be more intuitive and discoverable to the user I assume if it was available as an option there with the other related window position settings than having the user know/discover that they can use a kwin rule for it? Although rather than ignoring the apps position it'd be more of a remember position.

I think I could see that being useful for most apps as an available option and selectively adding a kwin window rule to apps where it's not as desirable(multiple instances like terminal or web browser, unless the rule/placement mode can be smart enough to only apply the remembered position to the first window instance and use a fallback placement mode for additional instances??)
Comment 10 Martin Flöser 2018-05-18 17:15:30 UTC
(In reply to Brennan Kinney from comment #9)
> (In reply to Martin Flöser from comment #7)
> > (In reply to Nate Graham from comment #5)
> > > Would it be feasible to add a placement mode that overrides apps' own
> > > requested placement requests and always uses KWin to handle placement? I
> > > think that's basically what's desired here.
> > 
> > oh and by the way: that already exists. Just create a catch-all window rule
> > that ignores the application specified position.
> 
> Is there any harm in still supporting it as a drop down placement mode or
> similar for the window position behaviour? 

This is not a placement strategy. Thus it does not belong in a drop down of the placement strategies.

It's totally fine that some features require things like rules or scripts. KWin is an easy to use window manager, but provides a steep learning curve for advanced features. If you want to use the advanced features, you need to learn them.
Comment 11 Nate Graham 2018-05-24 02:48:44 UTC
I couldn't get a blanket window rule to work. It worked for app windows, but kept undesirably matching Plasma windows too, so I'd get Kicker and KRunner appearing in the center of the screen. I struggled with it off and on for three days before eventually giving up. Is this in fact possible?
Comment 12 Nate Graham 2019-08-28 15:26:56 UTC

*** This bug has been marked as a duplicate of bug 15329 ***