https://bugs.kde.org/show_bug.cgi?id=526560
Bug ID: 526560
Summary: Window rule with position and size both set to
"remember" never restores the size on wayland
Classification: Plasma
Product: kwin
Version First 6.7.5
Reported In:
Platform: Arch Linux
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: wayland-generic
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
DESCRIPTION
When new window rules for a native wayland application are defined for both
"position" and "size" set to "remember", only the position is applied
correctly. Creating only the "size=remeber" rule works as expected.
STEPS TO REPRODUCE
1. Create a window rule for a native wayland application with
"position=remember" and "size=remember".
2. Open the application, resize the window, close it.
3. Open the application again.
OBSERVED RESULT
The position is restored, but the size is not. The size of the window is the
"default" one chosen by the application (I guess).
EXPECTED RESULT
Both position and size restored.
SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 6.7.5
KDE Frameworks Version: 6.30.0
Qt Version: 6.11.2
ADDITIONAL INFORMATION
I know I am not supposed to paste LLM output and so I filled everything I wrote
above with my own explanation of the bug. I did have claude debug the issue for
me and look at the source code and it claims it found the issue. I am a
developer myself, and a Arch Linux package maintainer so I can say at least
that it seems to me like the found culprit at the very leasy seems
plausible/makes sense.
So this below is output from Claude, ignore it if you want but I think it might
speed up fixing the bug and it's a very short explanation anyway.
Thanks!
------
Cause (from reading the v6.7.5 sources)
In XdgToplevelWindow::initialize() (src/xdgshellwindow.cpp), the window is
placed before the size rule is read:
auto position = rules()->checkPositionSafe(true).or_else(...);
if (position) {
place(*position);
}
const QSizeF forcedSize = rules()->checkSize(initialSize(sessionData), true);
if (forcedSize.isValid()) {
resize(forcedSize);
}
1. place() → move() → XdgSurfaceWindow::moveResizeInternal(..., Move) →
updateGeometry(RectF(rect.topLeft(), size())). The window is not mapped yet, so
size() is 0×0.
2. WaylandWindow::updateGeometry() (src/waylandwindow.cpp) sees the geometry
changed and calls updateWindowRules(Rules::Position | Rules::Size).
3. Rules::update() (src/rules.cpp): sizerule == Remember and the window is not
maximized, so size = c->size(), i.e. the remembered size becomes 0×0.
4. Back in initialize(), checkSize() → Rules::applySize() checks
this->size.isValid(), which is true for QSizeF(0, 0). The result is
resize(0×0), so sendRoleConfigure() sends configure(0, 0).
A rule with only Size: Remember is not affected, because without a remembered
position place() does not move the window and the remembered size is not
overwritten.
--
You are receiving this mail because:
You are watching all bug changes.