summaryrefslogtreecommitdiff
path: root/gtk/gtklabel.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-03-24 12:44:03 -0400
committerMatthias Clasen <mclasen@redhat.com>2011-03-24 12:45:59 -0400
commit4a86e5b1389ea1549d5cfdddddc2e4eb25e97158 (patch)
treed5f3e195b3acf71cdca38f184f36172cb073cbfd /gtk/gtklabel.c
parentc9d54298dc60c00b80c2be5e4527db84d68c4f7f (diff)
downloadgtk+-4a86e5b1389ea1549d5cfdddddc2e4eb25e97158.tar.gz
Make selectable labels work again
You can select something, but moving the focus somewhere else, or bringing up the context menu makes the selection go away. This makes it impossible to copy-paste the text. The reason for this regression is that gtk_label_state_changed was sloppy and assumed that it would only ever be called when a labels goes insensitive, which is no longer the case. The patch fixes things by explicitly checking if the widget is insensitive, and only resetting the selection in that case, which is the same behaviour we have for e.g. GtkEntry.
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r--gtk/gtklabel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 51fd17feb5..9f7c7ada06 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3808,7 +3808,9 @@ gtk_label_state_changed (GtkWidget *widget,
if (priv->select_info)
{
- gtk_label_select_region (label, 0, 0);
+ if (!gtk_widget_is_sensitive (widget))
+ gtk_label_select_region (label, 0, 0);
+
gtk_label_update_cursor (label);
}