mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-13 10:33:51 -05:00

While re-testing on Wayland after all this churn of the window resizing code, I discovered that the window constantly came out a few pixels too small, losing a character cell in width and height. This stopped happening once I experimentally stopped setting geometry hints. Source-diving in GTK, it turns out that this is because the GDK Wayland backend is applying the geometry hints to the size of the window including 'margins', which are a very large extra space around a window beyond even the visible 'non-client-area' furniture like the title bar. And I have no idea how you find out the size of those margins, so I can't allow for them in the geometry hints. I also noticed that gtk_window_set_geometry_hints is removed in GTK 4, which suggests that GTK upstream are probably not interested in fiddling with them until they work more usefully (even if they would agree with me that this is a bug in the first place, which I have no idea). A simpler workaround is to avoid setting geometry hints at all on any GDK backend other than X11. So, that's what this commit does. On Wayland (or other backends), the window can now be resized a pixel at a time, and if its size doesn't work out to a whole number of character cells, then you just get some dead space at the edges. Not especially nice, but better than the alternatives I can see. One other job the geometry hints were doing was to forbid resizing if the backend sets the BACKEND_RESIZE_FORBIDDEN flag (which SUPDUP does). That's now done at window creation time, via gtk_window_set_resizable.
This is the README for PuTTY, a free Windows and Unix Telnet and SSH client. PuTTY is built using CMake <https://cmake.org/>. To compile in the simplest way (on any of Linux, Windows or Mac), run these commands in the source directory: cmake . cmake --build . Documentation (in various formats including Windows Help and Unix `man' pages) is built from the Halibut (`.but') files in the `doc' subdirectory using `doc/Makefile'. If you aren't using one of our source snapshots, you'll need to do this yourself. Halibut can be found at <https://www.chiark.greenend.org.uk/~sgtatham/halibut/>. The PuTTY home web site is https://www.chiark.greenend.org.uk/~sgtatham/putty/ If you want to send bug reports or feature requests, please read the Feedback section of the web site before doing so. Sending one-line reports saying `it doesn't work' will waste your time as much as ours. See the file LICENCE for the licence conditions.
Description
Languages
C
89.7%
Python
8%
Perl
0.9%
CMake
0.8%
Shell
0.4%
Other
0.1%