From 5390aef3fc7deca225dd76db15021dc5c4ab53f2 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 7 May 2022 11:00:19 +0100 Subject: [PATCH] GTK: make explicit text controls selectable. This doesn't apply to every GtkLabel I instantiate: only the ones constructed as part of implementing the cross-platform CTRL_TEXT. Those labels contain information that the dialog box is deliberately communicating to the user, so it seems a sensible idea to make sure they can be copy-pasted. By default, this also seems to cause them to become able to take the input focus, so I've reverted that. You can select them with the mouse, but I think having them appear in the tab order is an awkwardness too far, since they're not active in any other way. --- unix/dialog.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unix/dialog.c b/unix/dialog.c index 8038a2e5..aa547aa7 100644 --- a/unix/dialog.c +++ b/unix/dialog.c @@ -2506,6 +2506,8 @@ GtkWidget *layout_ctrls( */ uc->text = w = gtk_label_new(uc->ctrl->label); #endif + gtk_label_set_selectable(GTK_LABEL(w), true); + gtk_widget_set_can_focus(w, false); align_label_left(GTK_LABEL(w)); gtk_label_set_line_wrap(GTK_LABEL(w), true); break;