From e9adaabc5e28cd032b80457953ae1f12f5776c73 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Thu, 5 Jan 2012 17:21:03 +0000 Subject: [PATCH] Rename 'window-unfocused' to 'backdrop' 'window-unfocused' is too long and mentions "focus" which is historically loaded with the meaning "input focus". 'backdrop' isn't generally used in GUI speak and still conveys the state the widgets in an unfocused or background toplevel window are in. --- gtk/gtkcssprovider.c | 2 +- gtk/gtkcssselector.c | 2 +- gtk/gtkenums.h | 4 ++-- gtk/gtkwidget.c | 4 ++-- gtk/gtkwindow.c | 12 ++++++------ 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index b6cb329fce..280cd554b2 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -2073,7 +2073,7 @@ parse_selector_pseudo_class (GtkCssScanner *scanner, { "inconsistent", 0, GTK_STATE_FLAG_INCONSISTENT }, { "focused", 0, GTK_STATE_FLAG_FOCUSED }, { "focus", 0, GTK_STATE_FLAG_FOCUSED }, - { "window-unfocused", 0, GTK_STATE_FLAG_WINDOW_UNFOCUSED }, + { "backdrop", 0, GTK_STATE_FLAG_BACKDROP }, { NULL, } }, nth_child_classes[] = { { "first", GTK_REGION_FIRST, 0 }, diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c index 21f3437040..5851af68fc 100644 --- a/gtk/gtkcssselector.c +++ b/gtk/gtkcssselector.c @@ -154,7 +154,7 @@ _gtk_css_selector_print (const GtkCssSelector *selector, "insensitive", "inconsistent", "focus", - "window-unfocused" + "backdrop" }; guint i; diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h index 5e4c570e8d..c5efc3fe9a 100644 --- a/gtk/gtkenums.h +++ b/gtk/gtkenums.h @@ -842,7 +842,7 @@ typedef enum * @GTK_STATE_FLAG_INSENSITIVE: Widget is insensitive. * @GTK_STATE_FLAG_INCONSISTENT: Widget is inconsistent. * @GTK_STATE_FLAG_FOCUSED: Widget has the keyboard focus. - * @GTK_STATE_FLAG_WINDOW_UNFOCUSED: Widget's toplevel window is unfocused. + * @GTK_STATE_FLAG_BACKDROP: Widget is in a background toplevel window. * * Describes a widget state. */ @@ -855,7 +855,7 @@ typedef enum GTK_STATE_FLAG_INSENSITIVE = 1 << 3, GTK_STATE_FLAG_INCONSISTENT = 1 << 4, GTK_STATE_FLAG_FOCUSED = 1 << 5, - GTK_STATE_FLAG_WINDOW_UNFOCUSED = 1 << 6 + GTK_STATE_FLAG_BACKDROP = 1 << 6 } GtkStateFlags; /** diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 033aeb00d0..4d7b3bab09 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -3783,8 +3783,8 @@ gtk_widget_unparent (GtkWidget *widget) gtk_widget_queue_compute_expand (old_parent); } - /* Unset window-unfocused since we are no longer inside a toplevel window */ - gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_WINDOW_UNFOCUSED); + /* Unset BACKDROP since we are no longer inside a toplevel window */ + gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_BACKDROP); if (priv->context) gtk_style_context_set_parent (priv->context, NULL); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 7cf25f9afe..a9221f26ed 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -478,7 +478,7 @@ static void gtk_window_get_preferred_height (GtkWidget *widget, gint *minimum_size, gint *natural_size); -static void ensure_state_flag_window_unfocused (GtkWidget *widget); +static void ensure_state_flag_backdrop (GtkWidget *widget); G_DEFINE_TYPE_WITH_CODE (GtkWindow, gtk_window, GTK_TYPE_BIN, G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, @@ -4893,7 +4893,7 @@ gtk_window_map (GtkWidget *widget) else gtk_window_set_focus_visible (window, visible_focus == GTK_POLICY_ALWAYS); - ensure_state_flag_window_unfocused (widget); + ensure_state_flag_backdrop (widget); } static gboolean @@ -5543,7 +5543,7 @@ gtk_window_state_event (GtkWidget *widget, update_grip_visibility (GTK_WINDOW (widget)); if (event->changed_mask & GDK_WINDOW_STATE_FOCUSED) - ensure_state_flag_window_unfocused (widget); + ensure_state_flag_backdrop (widget); return FALSE; } @@ -9697,7 +9697,7 @@ gtk_window_set_has_user_ref_count (GtkWindow *window, } static void -ensure_state_flag_window_unfocused (GtkWidget *widget) +ensure_state_flag_backdrop (GtkWidget *widget) { GdkWindow *window; gboolean window_focused = TRUE; @@ -9707,9 +9707,9 @@ ensure_state_flag_window_unfocused (GtkWidget *widget) window_focused = gdk_window_get_state (window) & GDK_WINDOW_STATE_FOCUSED; if (!window_focused) - gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_WINDOW_UNFOCUSED, FALSE); + gtk_widget_set_state_flags (widget, GTK_STATE_FLAG_BACKDROP, FALSE); else - gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_WINDOW_UNFOCUSED); + gtk_widget_unset_state_flags (widget, GTK_STATE_FLAG_BACKDROP); gtk_widget_queue_draw (widget); }