simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Wed May 9 09:22:18 BST 2018


TL;DR:
  7fee4e9 Basic support for running under GDK Wayland back end.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2018-05-09 09:22:18

commit 7fee4e9b43ea7d72e373b08cfd4afce8e031d0ef
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=7fee4e9b43ea7d72e373b08cfd4afce8e031d0ef;hp=5788226460c10f76c2a29eed2a08b26390c67c26
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed May 9 09:18:20 2018 +0100

    Basic support for running under GDK Wayland back end.
    
    GTK 3 PuTTY/pterm has always assumed that if it was compiled with
    _support_ for talking to the raw X11 layer underneath GTK and GDK,
    then it was entitled to expect that raw X11 layer to exist at all
    times, i.e. that GDK_DISPLAY_XDISPLAY would return a meaningful X
    display that it could do useful things with. So if you ran it over the
    GDK Wayland backend, it would immediately segfault.
    
    Modern GTK applications need to cope with multiple GDK backends at run
    time. It's fine for GTK PuTTY to _contain_ the code to find and use
    underlying X11 primitives like the display and the X window id, but it
    should be prepared to find that it's running on Wayland (or something
    else again!) so those functions don't return anything useful - in
    which case it should degrade gracefully to the subset of functionality
    that can be accessed through backend-independent GTK calls.
    
    Accordingly, I've centralised the use of GDK_DISPLAY_XDISPLAY into a
    support function get_x_display() in gtkmisc.c, which starts by
    checking that there actually is one first. All previous direct uses of
    GDK_*_XDISPLAY now go via that function, and check the result for NULL
    afterwards. (To save faffing about calling that function too many
    times, I'm also caching the display pointer in more places, and
    passing it as an extra argument to various subfunctions, mostly in
    gtkfont.c.)
    
    Similarly, the get_windowid() function that retrieves the window id to
    put in the environment of pterm's child process has to be prepared for
    there not to be a window id.
    
    This isn't a complete fix for all Wayland-related problems. The other
    one I'm currently aware of is that the default font is "server:fixed",
    which is a bad default now that it won't be available on all backends.
    And I expect that further problems will show up with more testing. But
    it's a start.

 unix/gtkcompat.h |   4 +++
 unix/gtkdlg.c    |   6 +++-
 unix/gtkfont.c   | 103 +++++++++++++++++++++++++++++-----------------------
 unix/gtkmain.c   |   7 ++--
 unix/gtkmisc.c   |  16 +++++++++
 unix/gtkwin.c    | 107 ++++++++++++++++++++++++++++++-------------------------
 unix/unix.h      |   2 +-
 unix/uxpty.c     |   5 +--
 unix/x11misc.h   |   5 +++
 9 files changed, 156 insertions(+), 99 deletions(-)



More information about the tartarus-commits mailing list