Browse Source

Panel: Remove duplicated function.

Give it a better name too, since insensitive panels are long
gone.
upstream/xfce4-panel-4.10.1
Nick Schermer 10 years ago
parent
commit
41a625f892
  1. 41
      panel/panel-application.c
  2. 4
      panel/panel-application.h
  3. 4
      panel/panel-item-dialog.c
  4. 4
      panel/panel-preferences-dialog.c

41
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));
@ -792,25 +792,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));
}
}

4
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);

4
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));

4
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);

Loading…
Cancel
Save