simon-git: putty (main): Ben Harris

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Dec 15 00:41:37 GMT 2024


TL;DR:
  09095a7d Avoid treating non-X GDK display names as X ones

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Ben Harris <bjh21 at bjh21.me.uk>
Date:           2024-12-15 00:41:37

commit 09095a7d9261676871a881aff7df4b39bd2802b4
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=09095a7d9261676871a881aff7df4b39bd2802b4;hp=1ce8ec9c825dd3432a515c25b7e01b808b2ad004
Author: Ben Harris <bjh21 at bjh21.me.uk>
Date:   Sat Jul 15 21:05:41 2023 +0100

    Avoid treating non-X GDK display names as X ones
    
    When running on Wayland, gdk_display_get_name() can return things like
    "wayland-0" rather than valid X display names.  PuTTY nonetheless
    treated them as X display names, meaning that when running under
    Wayland, pterm would set DISPLAY to "wayland-0" in subprocesses, and
    PuTTY's X forwarding wouldn't work properly.
    
    To fix this, places that call gdk_display_get_name() now only do so on
    displays for which GDK_IS_X_DISPLAY() is true.  As with
    GDK_IS_X_WINDOW(), this requires some backward-compatibility for GDK
    versions where everything is implicitly running on X.
    
    To make this work usefully, pterm now also won't unset DISPLAY if it
    can't get an X display name and instead will pass through whatever value
    of DISPLAY it received.  I think that's better behaviour anyway.
    
    There are two separate parts of PuTTY that call gdk_display_get_name().
    platform_get_x_display() in unix/putty.c is used for X forwarding, while
    gtk_seat_get_x_display() in unix/window.c is used used for setting DISPLAY
    and recording in utmp.  I've updated both of them.

 unix/gtkcompat.h |  1 +
 unix/pty.c       |  2 --
 unix/putty.c     |  9 ++++++++-
 unix/window.c    | 11 +++++++----
 4 files changed, 16 insertions(+), 7 deletions(-)



More information about the tartarus-commits mailing list