When creating a surface and setting it as fullscreen before attaching its buffer, KWin does not know the original dimensions of the surface and tries to use an invalid value when unsetting the fullscreen flag. This patch fixes this by sending a configure with the size of 0,0 - which according to xdg-shell spec means that the client is requested to set its size by itself.
- Group Reviewers
- R108:7bf2c1d73eb9: [wayland] Fix window sizing when restoring a window that was initially…
- Create a fullscreen Wayland window.
- Toggle fullscreen off.
- KWin should send a configure event with size 0,0 instead of 1,1.
why should it be 4?
I don't see why the top left should always be 0,0.
That's writing tests for what the current code happens to do, not testing for what things should be doing. Arguably the window could be placed according to the placement algorithm.
Lets just check the size.
Well, you could get coordinates of the top-left corner of the placement area for the client, though I personally think it would be better to place the client. If I recall correctly, we do something like that on X11 when maximize restore geometry is not valid.
Something like this?
diff --git a/shell_client.cpp b/shell_client.cpp index 66956aed3..5e314ef22 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -986,6 +986,8 @@ void ShellClient::setFullScreen(bool set, bool user) // this can happen when the window was first shown already fullscreen, // so let the client set the size by itself setGeometry(QRect(QPoint(0, 0), QSize(0, 0))); + QRect area = workspace()->clientArea(PlacementArea, this); + placeIn(area); } } updateWindowRules(Rules::Fullscreen|Rules::Position|Rules::Size);
Those two (0,0)s above feel hacky, should I set the position to the placement area corner regardless of placing the window afterwards? Or is there a better way to send configure request with (0,0) size to the client?