/* This doesn't do anything if the initial unhide already happened */ static gboolean mate_panel_applet_queue_initial_unhide_toplevels (gpointer user_data) { GSList *l; if (mate_panel_applet_unhide_toplevels_timeout != 0) { g_source_remove (mate_panel_applet_unhide_toplevels_timeout); mate_panel_applet_unhide_toplevels_timeout = 0; } for (l = panel_toplevel_list_toplevels (); l != NULL; l = l->next) panel_toplevel_queue_initial_unhide ((PanelToplevel *) l->data); return FALSE; }
static void panel_session_handle_die_request (GnomeClient *client) { GSList *toplevels_to_destroy, *l; g_return_if_fail (GNOME_IS_CLIENT (client)); toplevels_to_destroy = g_slist_copy (panel_toplevel_list_toplevels ()); for (l = toplevels_to_destroy; l; l = l->next) gtk_widget_destroy (l->data); g_slist_free (toplevels_to_destroy); panel_shell_unregister (); gtk_main_quit (); }
static void panel_layout_ensure_toplevel_per_screen (void) { GSList *toplevels; GSList *empty_screens = NULL; GSList *l; GdkDisplay *display; int n_screens, i; char *default_layout_file; toplevels = panel_toplevel_list_toplevels (); display = gdk_display_get_default (); n_screens = gdk_display_get_n_screens (display); for (i = 0; i < n_screens; i++) { GdkScreen *screen; screen = gdk_display_get_screen (display, i); for (l = toplevels; l; l = l->next) if (gtk_window_get_screen (l->data) == screen) break; if (!l) empty_screens = g_slist_prepend (empty_screens, screen); } if (empty_screens == NULL) return; default_layout_file = panel_layout_get_default_layout_file (); for (l = empty_screens; l; l = l->next) panel_layout_append_from_file_for_screen (default_layout_file, l->data); g_free (default_layout_file); g_slist_free (empty_screens); }
static void panel_layout_changed_toplevel (void) { char **ids; GSList *to_remove; gboolean loading; gboolean found; const char *id; GSList *l; int i; ids = g_settings_get_strv (layout_settings, PANEL_LAYOUT_TOPLEVEL_ID_LIST_KEY); /* Remove what is not in the layout anymore */ to_remove = NULL; for (l = panel_toplevel_list_toplevels (); l != NULL; l = l->next) { id = panel_toplevel_get_id (l->data); found = FALSE; for (i = 0; ids[i] != NULL; i++) { if (g_strcmp0 (ids[i], id) == 0) { found = TRUE; break; } } if (!found) to_remove = g_slist_prepend (to_remove, l->data); } for (l = to_remove; l != NULL; l = l->next) gtk_widget_destroy (GTK_WIDGET (l->data)); g_slist_free (to_remove); /* Add what appeared in the layout */ loading = FALSE; for (i = 0; ids[i] != NULL; i++) { found = FALSE; for (l = panel_toplevel_list_toplevels (); l != NULL; l = l->next) { id = panel_toplevel_get_id (l->data); if (g_strcmp0 (ids[i], id) == 0) { found = TRUE; break; } } if (!found) { panel_layout_load_toplevel (ids[i]); loading = TRUE; } } g_strfreev (ids); /* Reload list of objects to get those that might be on the new * toplevels */ if (loading) panel_layout_changed_object (); }