summaryrefslogtreecommitdiff
path: root/gtk/gtklabel.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-11-12 21:08:29 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-11-12 21:08:29 +0000
commitff9c2c56699814687000669029a7bfef0d7ae1ba (patch)
treea8902fa36a15b3d27bee723a58419b698ce96ceb /gtk/gtklabel.c
parent3b5d33adc78b8d548f37bb00bf774e20bfd9c5b9 (diff)
downloadgdk-pixbuf-ff9c2c56699814687000669029a7bfef0d7ae1ba.tar.gz
Add _gtk_window_unset_focus_and_default(), use to clear the focus and
Tue Nov 12 15:13:58 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkwidget.c gtk/gtkwindow.[ch]: Add _gtk_window_unset_focus_and_default(), use to clear the focus and default out of parts of the widget heirarchy that we are hiding. * gtk/gtkwidget.c (gtk_widget_propagate_screen_changed_recurse): Fix typo that was resulting in missed screen-change notifies. * gtk/gtkwindow.c (do_focus_change): Allow for widget->window == NULL. * gtk/gtklabel.c (gtk_label_screen_changed): Clear the layout here not in hierarchy changed to handle the case where the toplevel was moved between screens.
Diffstat (limited to 'gtk/gtklabel.c')
-rw-r--r--gtk/gtklabel.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index f063f1c6b..2129b50e6 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -130,6 +130,8 @@ static void set_markup (GtkLabel *label,
static void gtk_label_recalculate (GtkLabel *label);
static void gtk_label_hierarchy_changed (GtkWidget *widget,
GtkWidget *old_toplevel);
+static void gtk_label_screen_changed (GtkWidget *widget,
+ GdkScreen *old_screen);
static void gtk_label_create_window (GtkLabel *label);
static void gtk_label_destroy_window (GtkLabel *label);
@@ -244,6 +246,7 @@ gtk_label_class_init (GtkLabelClass *class)
widget_class->button_release_event = gtk_label_button_release;
widget_class->motion_notify_event = gtk_label_motion;
widget_class->hierarchy_changed = gtk_label_hierarchy_changed;
+ widget_class->screen_changed = gtk_label_screen_changed;
widget_class->mnemonic_activate = gtk_label_mnemonic_activate;
widget_class->focus = gtk_label_focus;
@@ -719,13 +722,17 @@ gtk_label_hierarchy_changed (GtkWidget *widget,
{
GtkLabel *label = GTK_LABEL (widget);
- /* in case the label has been reparented to another screen */
- gtk_label_clear_layout (label);
-
gtk_label_setup_mnemonic (label, label->mnemonic_keyval);
}
static void
+gtk_label_screen_changed (GtkWidget *widget,
+ GdkScreen *old_screen)
+{
+ gtk_label_clear_layout (GTK_LABEL (widget));
+}
+
+static void
label_mnemonic_widget_weak_notify (gpointer data,
GObject *where_the_object_was)
{