simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Nov 14 22:25:00 GMT 2022


TL;DR:
  fec6719a Fix duplicate call to term_resize_request_completed().

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2022-11-14 22:25:00

commit fec6719a2b7ac48372d8d44098a3b2938948fd2e
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=fec6719a2b7ac48372d8d44098a3b2938948fd2e;hp=3cfbd3df0f0e07282f3a45ccb58fa1df1ce08606
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 14 22:21:49 2022 +0000

    Fix duplicate call to term_resize_request_completed().
    
    A KDE user observed that if you 'dock' a GTK PuTTY window to the side
    of the screen (by dragging it to the RH edge, causing it to
    half-maximise over the right-hand half of the display, similarly to
    Windows), and then send a terminal resize sequence, then PuTTY fails
    the assertion in term_resize_request_completed() which expects that an
    unacknowledged resize request was currently in flight.
    
    When drawing_area_setup() calls term_resize_request_completed() in
    response to the inst->term_resize_notification_required flag, it
    resets the inst->win_resize_pending flag, but doesn't reset
    inst->term_resize_notification_required. As a result, the _next_ call
    to drawing_area_setup will find that flag still set, and make a
    duplicate call to term_resize_request_completed, after the terminal no
    longer believes it's waiting for a response to a resize request. And
    in this 'docked to the right-hand side of the display' state, KDE
    apparently triggers two calls to drawing_area_setup() in quick
    succession, making this bug manifest.
    
    I could fix this by clearing inst->term_resize_notification_required.
    But inspecting all the other call sites, it seems clear to me that my
    original intention was for inst->term_resize_notification_required to
    be a flag that's only meaningful if inst->win_resize_pending is set.
    So I think a better fix is to conditionalise the check in
    drawing_area_setup so that we don't even check
    inst->term_resize_notification_required if !inst->win_resize_pending.

 unix/window.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)



More information about the tartarus-commits mailing list