Skip to content

Commit

Permalink
window-x11.c: Handle a special case for sending a ConfigureNotify
Browse files Browse the repository at this point in the history
event.

Windows tiled to the right or bottom-right corner were getting
skipped if their window geometry already matched the tiled size,
since with northwest gravity, the client window position wasn't
changing either (relative to the frame window).

Fixes #705
Fixes #659

Thanks @PCVFaust for help troubleshooting this.
  • Loading branch information
mtwebster committed Oct 24, 2024
1 parent 9aefdd4 commit c083b7e
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/x11/window-x11.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,14 +1436,27 @@ meta_window_x11_move_resize_internal (MetaWindow *window,
priv->border_width != 0))
need_configure_notify = TRUE;

/* We must send configure notify if we move but don't resize, since
* the client window may not get a real event
/* When tiling a window, the frame sizes changes - which edges depend on
* the tile direction. For every direction but META_TILE_RIGHT and
* META_TILE_LRC (lower-right-corner), the client position needs to be
* shifted in at least one direction relative to the frame window, and
* will need to tell the client window about it.
*/
if ((need_move_client || need_move_frame) &&
!(need_resize_client || need_resize_frame) &&
window->type != META_WINDOW_TOOLTIP)
need_configure_notify = TRUE;

/* For META_TILE_RIGHT and META_TILE_LRC, the right border and
* bottom border (for lrc) are removed, but the client size may not
* change, if it was already the tiled size. The client position
* won't need to change either, from the frame's upper-left-corner,
* so the window may not be notified.
*/

if (need_resize_frame && !need_resize_client && window->type != META_WINDOW_TOOLTIP)
need_configure_notify = TRUE;

/* MapRequest events with a PPosition or UPosition hint with a frame
* are moved by mutter without resizing; send a configure notify
* in such cases. See #322840. (Note that window->constructing is
Expand Down

0 comments on commit c083b7e

Please sign in to comment.