Tiling rects fixes - #471
Merged
Merged
Conversation
The maximize flags were applied before move_resize_frame(), which made mutter keep control of the window geometry. As a result the move to the other tile was ignored while the window was still flagged as vertically maximized, so it stayed at its previous x position (overlapping the neighbouring tile) even though tiledRect reported the intended tile. Move and resize the window first and only then communicate the semi-maximize flags, so mutter just has to adjust the edges of a window that is already in place. Fixes the regression introduced in 204c662.
…a edges addGaps() insets the tile from the work area edges whenever gaps are enabled, but the semi-maximize decision was still made on the ungapped rect. So with, for example, a vertical screen gap, a full-height tile was flagged as vertically maximized even though the window was not meant to reach the edges. Mutter then resizes it back to the whole work area and applies the maximized look, overriding the gap. Decide from the rect that is actually applied, so a window is only semi-maximized when it still touches both edges of that axis. Fixes: #448
The Tiling Popup computes the free screen space immediately after tiling a window, but on Wayland move_resize_frame() is applied asynchronously, so get_frame_rect() can still report the previous geometry at that point. Wait for the window's size-changed signal before collecting the tile group, with a timeout as fallback in case the resize was applied synchronously before the signal was connected. The wait is skipped when the window is already at the requested size.
tiledRect is the tile a window was asked to use and can be smaller than what the window actually occupies when the app cannot shrink below its minimum size (e.g. terminals or wide apps). Compute the space used for adapting tiles and for the Tiling Popup from the union of tiledRect and the real frame, so the next window uses the space that is actually free. A tile that would end up smaller than half of the default tile (or that still overlaps another tile) falls back to the default tile to avoid snapping into a tiny leftover.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The maximize flags were applied before move_resize_frame(), which made
mutter keep control of the window geometry. As a result the move to
the other tile was ignored while the window was still flagged as
vertically maximized, so it stayed at its previous x position
(overlapping the neighbouring tile) even though tiledRect reported the
intended tile.
Move and resize the window first and only then communicate the
semi-maximize flags, so mutter just has to adjust the edges of a
window that is already in place.
Fixes the regression introduced in 204c662.
Closes: #448