[Xfce4-commits] <xfce4-panel:master> Panel: Remove duplicated function.

Nick Schermer noreply at xfce.org
Mon Apr 2 22:16:02 CEST 2012


Updating branch refs/heads/master
         to 41a625f892ab9b0e49cbb0628cf156a64e77fd3b (commit)
       from 6bc083dd44973b1f7d02c451d61a837feb8c019c (commit)

commit 41a625f892ab9b0e49cbb0628cf156a64e77fd3b
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Apr 2 22:14:08 2012 +0200

    Panel: Remove duplicated function.
    
    Give it a better name too, since insensitive panels are long
    gone.

 panel/panel-application.c        |   41 ++++++++++---------------------------
 panel/panel-application.h        |    4 +-
 panel/panel-item-dialog.c        |    4 +-
 panel/panel-preferences-dialog.c |    4 +-
 4 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/panel/panel-application.c b/panel/panel-application.c
index ee5e6dc..046f109 100644
--- a/panel/panel-application.c
+++ b/panel/panel-application.c
@@ -516,8 +516,8 @@ panel_application_plugin_move_drag_end (GtkWidget        *item,
   g_signal_handlers_disconnect_by_func (G_OBJECT (item),
       G_CALLBACK (panel_application_plugin_move_drag_data_get), application);
 
-  /* make the window sensitive again */
-  panel_application_windows_sensitive (application, TRUE);
+  /* unblock autohide */
+  panel_application_windows_blocked (application, FALSE);
 }
 
 
@@ -535,8 +535,8 @@ panel_application_plugin_move (GtkWidget        *item,
   panel_return_if_fail (XFCE_IS_PANEL_PLUGIN_PROVIDER (item));
   panel_return_if_fail (PANEL_IS_APPLICATION (application));
 
-  /* make the window insensitive */
-  panel_application_windows_sensitive (application, FALSE);
+  /* block autohide */
+  panel_application_windows_blocked (application, TRUE);
 
   /* create drag context */
   target_list = gtk_target_list_new (drag_targets, G_N_ELEMENTS (drag_targets));
@@ -793,25 +793,6 @@ panel_application_plugin_insert (PanelApplication  *application,
 
 
 static void
-panel_application_windows_block_autohide (PanelApplication *application,
-                                          gboolean          blocked)
-{
-  GSList *li;
-
-  panel_return_if_fail (PANEL_IS_APPLICATION (application));
-
-  for (li = application->windows; li != NULL; li = li->next)
-    {
-      if (blocked)
-        panel_window_freeze_autohide (PANEL_WINDOW (li->data));
-      else
-        panel_window_thaw_autohide (PANEL_WINDOW (li->data));
-    }
-}
-
-
-
-static void
 panel_application_dialog_destroyed (GtkWindow        *dialog,
                                     PanelApplication *application)
 {
@@ -824,7 +805,7 @@ panel_application_dialog_destroyed (GtkWindow        *dialog,
 
   /* unblock autohide if there are no open windows anymore */
   if (application->dialogs == NULL)
-    panel_application_windows_block_autohide (application, FALSE);
+    panel_application_windows_blocked (application, FALSE);
 }
 
 
@@ -1348,7 +1329,7 @@ panel_application_take_dialog (PanelApplication *application,
 
   /* block autohide if this will be the first dialog */
   if (application->dialogs == NULL)
-    panel_application_windows_block_autohide (application, TRUE);
+    panel_application_windows_blocked (application, TRUE);
 
   /* monitor window destruction */
   g_signal_connect (G_OBJECT (dialog), "destroy",
@@ -1625,8 +1606,8 @@ panel_application_window_select (PanelApplication *application,
 
 
 void
-panel_application_windows_sensitive (PanelApplication *application,
-                                     gboolean          sensitive)
+panel_application_windows_blocked (PanelApplication *application,
+                                   gboolean          blocked)
 {
   GSList *li;
 
@@ -1636,10 +1617,10 @@ panel_application_windows_sensitive (PanelApplication *application,
   for (li = application->windows; li != NULL; li = li->next)
     {
       /* block autohide for all windows */
-      if (sensitive)
-        panel_window_thaw_autohide (PANEL_WINDOW (li->data));
-      else
+      if (blocked)
         panel_window_freeze_autohide (PANEL_WINDOW (li->data));
+      else
+        panel_window_thaw_autohide (PANEL_WINDOW (li->data));
     }
 }
 
diff --git a/panel/panel-application.h b/panel/panel-application.h
index dbc4df8..23c40a3 100644
--- a/panel/panel-application.h
+++ b/panel/panel-application.h
@@ -84,8 +84,8 @@ PanelWindow      *panel_application_get_window        (PanelApplication  *applic
 void              panel_application_window_select     (PanelApplication  *application,
                                                        PanelWindow       *window);
 
-void              panel_application_windows_sensitive (PanelApplication  *application,
-                                                       gboolean           sensitive);
+void              panel_application_windows_blocked   (PanelApplication  *application,
+                                                       gboolean           blocked);
 
 gboolean          panel_application_get_locked        (PanelApplication  *application);
 
diff --git a/panel/panel-item-dialog.c b/panel/panel-item-dialog.c
index 98dd04a..fe7e9ff 100644
--- a/panel/panel-item-dialog.c
+++ b/panel/panel-item-dialog.c
@@ -179,7 +179,7 @@ panel_item_dialog_init (PanelItemDialog *dialog)
   panel_application_take_dialog (dialog->application, GTK_WINDOW (dialog));
 
   /* make the application windows insensitive */
-  panel_application_windows_sensitive (dialog->application, FALSE);
+  panel_application_windows_blocked (dialog->application, TRUE);
 
   dialog->factory = panel_module_factory_get ();
 
@@ -299,7 +299,7 @@ panel_item_dialog_finalize (GObject *object)
       panel_item_dialog_unique_changed, dialog);
 
   /* make the windows sensitive again */
-  panel_application_windows_sensitive (dialog->application, TRUE);
+  panel_application_windows_blocked (dialog->application, FALSE);
 
   g_object_unref (G_OBJECT (dialog->store));
   g_object_unref (G_OBJECT (dialog->factory));
diff --git a/panel/panel-preferences-dialog.c b/panel/panel-preferences-dialog.c
index 84d2d6f..865d7f3 100644
--- a/panel/panel-preferences-dialog.c
+++ b/panel/panel-preferences-dialog.c
@@ -181,7 +181,7 @@ panel_preferences_dialog_init (PanelPreferencesDialog *dialog)
   dialog->application = panel_application_get ();
 
   /* block autohide */
-  panel_application_windows_sensitive (dialog->application, FALSE);
+  panel_application_windows_blocked (dialog->application, TRUE);
 
   /* load the builder data into the object */
   gtk_builder_add_from_string (GTK_BUILDER (dialog), panel_preferences_dialog_ui,
@@ -290,7 +290,7 @@ panel_preferences_dialog_finalize (GObject *object)
   GtkWidget              *itembar;
 
   /* unblock autohide */
-  panel_application_windows_sensitive (dialog->application, TRUE);
+  panel_application_windows_blocked (dialog->application, FALSE);
 
   /* free bindings list */
   g_slist_free (dialog->bindings);


More information about the Xfce4-commits mailing list