Bug 479391 - "Remember" window rules don't consider multiple application windows
Summary: "Remember" window rules don't consider multiple application windows
Status: RESOLVED DUPLICATE of bug 15329
Alias: None
Product: kwin
Classification: Plasma
Component: rules (other bugs)
Version First Reported In: 5.27.9
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-04 13:12 UTC by Dennis Marttinen
Modified: 2025-06-02 12:56 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Window Rules for a 3 window blender layout that demonstrate the bug (421.53 KB, image/png)
2025-06-02 01:09 UTC, Bloop
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dennis Marttinen 2024-01-04 13:12:22 UTC
SUMMARY

In waiting for https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/18 and/or https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/264 to materialize and propagate through the ecosystem, I tried to set KWin Wayland to remember window positions/sizes for specific applications, such as Firefox. However, if the application has multiple windows (i.e., multiple browser windows with different tabs each), the "Remember" option of the window rules for Position (and probably Size, horizontal/vertical maximization etc., basically any property with the "Remember" option) works a bit counter-intuitively. It does remember the position of *one* of the windows, and sets the position of *all* windows upon re-launch to that remembered position. In addition to the window class, I attempted substring matching based on the window title etc., but still one rule seems to only remember one set of properties. This is problematic since browser windows are dynamic, and I can't create an individual rule for every single one. In general, for multi-window applications, I would expect the "Remember" option to remember the positions of all windows of the matched application individually. Something like this already works when (un)plugging monitors.

STEPS TO REPRODUCE

1. Create window rule that matches Firefox windows by window class (and optionally title)
2. Set property "Position" to "Remember"
3. Set "Ignore requested geometry" to "Force" and "Yes" (on Wayland this does nothing except silence the warning AFAIU)
4. Open Firefox, open multiple windows and spread them around
5. Close Firefox
6. Re-open Firefox

OBSERVED RESULT

All Firefox windows are re-opened on top of each other at one of the previous window positions.

EXPECTED RESULT

The Firefox windows open at their respective previous positions.

SOFTWARE/OS VERSIONS

Operating System: Fedora Linux 38
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Comment 1 Bloop 2025-05-31 10:33:41 UTC
I'm running into this with multiwindow Blender layouts, and also unsuccesfully tried to solve it with Window Rules. Title matching doesn't seem to work with any option but Force, and with three Blender windows, the third gets instead matched as the second even though their titles don't match. The third will eventually get matched by its rule and have its Force properties applied. I played with the rule system for quite a while and wasn't able to produce a workaround to the missing window remembering functionality that should be the default.

Operating System: Fedora Linux 42
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.8-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 2 Piotr Dobrogost 2025-06-01 19:55:45 UTC
(In reply to Bloop from comment #1)
> I'm running into this with multiwindow Blender layouts, and also (…)

It's hard to understand what's going on from your description.
It would be easier if you listed all three windows and their titles, all relevant window rules with their titles and which rule matched which window (or no window at all).
Comment 3 Bloop 2025-06-02 00:55:55 UTC
(In reply to Piotr Dobrogost from comment #2)
> It would be easier if you listed all three windows and their titles, all
> relevant window rules with their titles and which rule matched which window
> (or no window at all).

Reproduction steps (I use three monitors, but also reproduces on one Shift + Dragging the windows into a tiled arrangement:

Multiwindow blender file setup:
1. Open Blender (with default single window layout)
2. Position main blender window on the center monitor/center snapping third
3. Window > New Window (This will be a 3D Viewport window by default, and the title will match that based on the current contents)
4. Drag the "3D Viewport" window to Right Monitor/Right screen snapping third
5. Window > New Window (Will also be titled "3D Viewport" by default)
6. Mouse over the interior corner in this 3D Viewport, when the cursor is a cross, click and drag towards the middle to split the window (The window title will now change to just "Blender")
7. Drag the "Blender" window to left monitor/left screen snapping third
8. Save the file as "Untitled.blend" (The main window title will now be "Untitled [<path>] - Blender <version>")

Window rules setup (Windows should rememeber their position by default, but that issue appears to be 25 years old):
1. Add new "Blender Main" window rule
2. Set "Window Class (application)" to [Exact Match] [blender]
3. Set "Window types" to [All window types]
4. Add properties "Position" and "Size" and set them both to [Remember]
5. Set "Window title" to [Substring Match] [ - Blender ] 
6. Apply, OK
7. Create new "Blender 3D Viewport" window rule
8. Duplicate or repeat 2 - 4 for window matching and position remembering
9. Set "Window title" to [Exact Match] [3D Viewport]
10. Apply, OK
11. Create new "Blender Blender" window rule
12. Duplicate or repeat 2 - 4 for window matching and position remembering
13. Set "Window title" to [Exact Match] [Blender]
14. Apply, OK
15. (Optional) Add property "Ignore requested geometry" [Force] [Yes] to all three rules

Bug steps:
1. Close Blender with the windows in the desired positions
2. Open Untitled.blend either directly, or open blender and open it through its dialogs 

Expected result:
These three windows remember their last positions and sizes when opening the Untitled.blend file

Actual result:
Random window placements, usually all three stacked using the same size and position as any one of three, but sometimes sometimes one of the windows is in a different position than the other two. Which size and position is applied to which window is inconsistent, and often different each time. "Ignore requested geometry" [Force] [Yes] seems to have no effect. There don't seem to be any other window matching properties that distinguish the windows other than their titles.


Blender 4.4.3 from Fedora Linux

Operating System: Fedora Linux 42
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.9-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 4 Bloop 2025-06-02 01:09:34 UTC
Created attachment 181963 [details]
Window Rules for a 3 window blender layout that demonstrate the bug

Screenshot showing a setup that produces inconsistent window positions every time the blend file is opened, usually but not always with all three stacked at one of the remembered positions.
Comment 5 Zamundaaa 2025-06-02 12:56:13 UTC
That's just how window rules work. They do not do anything more than what you manually set them up to do.

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