[vim/vim] GTK4: the shell becomes smaller than requested (PR #21006)

h_east (Vim Github Repository) <[email protected]> Tue, 11 Aug 2026 04:10:48 -0700
Newsgroups gmane.editors.vim.devel
Message-ID <vim/vim/pull/[email protected]>
```
Problem:  With the GTK4 GUI the shell loses a few columns on every resize,
          and the window can also be made smaller than asked for when the
          compositor does not report which monitor it is on.
Solution: Account for the width of the client side decorations, like is
          already done for the height, and fall back to the first monitor
          instead of assuming an 800x600 screen.
```

---

related: #20920

Note that I could not verify this locally: on my machine the decorations have
no width, so the shrinking does not reproduce. The GTK4 CI job added in
9.2.0931 is the only place where it shows up, so that job is the check for
this change.

What that job shows, e.g. in run 31428173009: within a single gvim session the
terminal opened by RunVimInTerminal() gets narrower on every call, while the
number of rows stays correct.

    Test_popupwin_cursorline_1   75 columns (passed)
    Test_popupwin_cursorline_2   74
    Test_popupwin_cursorline_3   72
    Test_popupwin_cursorline_4   72
    Test_popupwin_cursorline_5   70
    Test_popupwin_cursorline_6   70
    Test_popupwin_cursorline_7   68
    Test_popupwin_cursorline_8   66

All of them expect 75 columns, and every one of these dumps has the expected
number of rows. The height is already compensated with "gui.decor_height",
the width had no equivalent.
You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/21006

-- Commit Summary --

  * GTK4: the shell becomes smaller than requested

-- File Changes --

    M src/gui.c (2)
    M src/gui.h (2)
    M src/gui_gtk4.c (61)
    M src/proto/gui_gtk4.pro (2)

-- Patch Links --

https://github.com/vim/vim/pull/21006.patch
https://github.com/vim/vim/pull/21006.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/vim/vim/pull/21006
You are receiving this because you are subscribed to this thread.

Message ID: <vim/vim/pull/[email protected]>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/vim_dev/vim/vim/pull/21006%40github.com.