[gtk+] Rename 'window-unfocused' to 'backdrop'



commit e9adaabc5e28cd032b80457953ae1f12f5776c73
Author: Rui Matos <tiagomatos gmail com>
Date:   Thu Jan 5 17:21:03 2012 +0000

    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 b6cb329..280cd55 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 21f3437..5851af6 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 5e4c570..c5efc3f 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 033aeb0..4d7b3ba 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 7cf25f9..a9221f2 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);
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]