[gtk+/wip/unfocused-fixes] Rename 'window-unfocused' to 'backdrop'



commit 1c98ff0b608bf7f320352c6de19d3299d4212840
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 c635d93..7885fde 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2009,7 +2009,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 b3ccb44..8ca21f1 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 7045f92..bd26f77 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 a830741..72bea94 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);
 
   g_signal_emit (widget, widget_signals[PARENT_SET], 0, old_parent);
   if (toplevel)
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]