mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-17 22:05:22 -05:00
wayland: take (visible) border width into account on configure events
When the compositor is asking us to resize ourselves, take our (visible) CSD borders into account. This is similar to how we already take the titlebar size into account. This fixes an issue where the window size “jumps” when the user starts an interactive resize, when csd.border-width > 0. This as been observed in GNOME.
This commit is contained in:
parent
0e477e2c5e
commit
7a0e7c6c01
2 changed files with 9 additions and 1 deletions
|
|
@ -108,6 +108,8 @@
|
|||
(https://codeberg.org/dnkl/foot/issues/1009).
|
||||
* Window geometry when CSDs are enabled and CSD border width set to a
|
||||
non-zero value. This fixes window snapping in e.g. GNOME.
|
||||
* Window size “jumping” when starting an interactive resize when CSDs
|
||||
are enabled, and CSD border width set to a non-zero value.
|
||||
|
||||
|
||||
### Security
|
||||
|
|
|
|||
|
|
@ -746,9 +746,15 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
|
|||
else if (csd_was_enabled && !enable_csd)
|
||||
csd_destroy(win);
|
||||
|
||||
if (enable_csd && new_width > 0 && new_height > 0)
|
||||
if (enable_csd && new_width > 0 && new_height > 0) {
|
||||
new_height -= win->term->conf->csd.title_height;
|
||||
|
||||
if (!win->is_maximized) {
|
||||
new_height -= 2 * win->term->conf->csd.border_width_visible;
|
||||
new_width -= 2 * win->term->conf->csd.border_width_visible;
|
||||
}
|
||||
}
|
||||
|
||||
xdg_surface_ack_configure(xdg_surface, serial);
|
||||
|
||||
#if 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue