simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Nov 27 14:09:12 GMT 2022
TL;DR:
c14f0e02 Stop selectable GTK message boxes clobbering PRIMARY.
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-27 14:09:12
commit c14f0e02cce022c7bee77935238a4b34f3c3a261
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c14f0e02cce022c7bee77935238a4b34f3c3a261;hp=f4519b6533b089ddb8df26d9f9fddb94dd1f3dee
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Nov 27 11:14:23 2022 +0000
Stop selectable GTK message boxes clobbering PRIMARY.
I noticed today that when GTK PuTTY puts up a message box such as a
host key dialog, which calls our create_message_box function with
selectable=true (so that the host key fingerprint can be conveniently
copy-pasted), a side effect is to take the X11 PRIMARY selection away
from whoever previously had it, even though the message box isn't
actually selecting anything right now.
I don't fully understand what's going on, but it apparently has
something to do with 'select on focus' behaviour, in which tabbing
into a selectable text control automatically selects its entire
contents. That makes sense for edit boxes, but not really for this
kind of thing.
Unfortunately, GTK apparently has no per-widget configuration to turn
that off. (The closest I found is not even per _application_: it lives
in GtkSettings, whose documentation says that it's general across all
GTK apps run by a user!)
So instead I work around it by moving the gtk_label_set_selectable
call to after the focus of the new window has already been sorted out.
Ugly, but it seems to work.
unix/dialog.c | 48 ++++++++++++++++++++++++++++--------------------
1 file changed, 28 insertions(+), 20 deletions(-)
More information about the tartarus-commits
mailing list