summaryrefslogtreecommitdiff
path: root/applets/wncklet/workspace-switcher.c
diff options
context:
space:
mode:
authorlukefromdc <[email protected]>2017-07-26 01:56:46 -0400
committerlukefromdc <[email protected]>2017-08-13 14:37:24 -0400
commit9f43dd5c7c37b84960d06a98a4738ee40d8bfd50 (patch)
tree17303dcfb3aa90302b968c07ae0959acfd3a73e9 /applets/wncklet/workspace-switcher.c
parent4d347a9afca23731a4751f8761b1974e4f1ef16f (diff)
downloadmate-panel-9f43dd5c7c37b84960d06a98a4738ee40d8bfd50.tar.bz2
mate-panel-9f43dd5c7c37b84960d06a98a4738ee40d8bfd50.tar.xz
wncklet: stop segfaults, warnings on removing in-process switcher, window-list
Fixes window list, workspace switcher. Window menu and show desktop no warnings or segfaults on removal when built in process
Diffstat (limited to 'applets/wncklet/workspace-switcher.c')
-rw-r--r--applets/wncklet/workspace-switcher.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/applets/wncklet/workspace-switcher.c b/applets/wncklet/workspace-switcher.c
index f9d422ab..05ca4432 100644
--- a/applets/wncklet/workspace-switcher.c
+++ b/applets/wncklet/workspace-switcher.c
@@ -86,6 +86,7 @@ typedef struct {
static void display_properties_dialog(GtkAction* action, PagerData* pager);
static void display_help_dialog(GtkAction* action, PagerData* pager);
static void display_about_dialog(GtkAction* action, PagerData* pager);
+static void destroy_pager(GtkWidget* widget, PagerData* pager);
static void pager_update(PagerData* pager)
{
@@ -319,16 +320,6 @@ static gboolean applet_scroll(MatePanelApplet* applet, GdkEventScroll* event, Pa
return TRUE;
}
-static void destroy_pager(GtkWidget* widget, PagerData* pager)
-{
- g_object_unref (pager->settings);
-
- if (pager->properties_dialog)
- gtk_widget_destroy(pager->properties_dialog);
-
- g_free(pager);
-}
-
static const GtkActionEntry pager_menu_actions[] = {
{
"PagerPreferences",
@@ -967,3 +958,24 @@ static void display_properties_dialog(GtkAction* action, PagerData* pager)
gtk_window_set_screen(GTK_WINDOW(pager->properties_dialog), gtk_widget_get_screen(pager->applet));
gtk_window_present(GTK_WINDOW(pager->properties_dialog));
}
+
+static void destroy_pager(GtkWidget* widget, PagerData* pager)
+{
+ g_signal_handlers_disconnect_by_func (pager->settings,
+ G_CALLBACK (num_rows_changed),
+ pager);
+ g_signal_handlers_disconnect_by_func (pager->settings,
+ G_CALLBACK (display_workspace_names_changed),
+ pager);
+ g_signal_handlers_disconnect_by_func (pager->settings,
+ G_CALLBACK (all_workspaces_changed),
+ pager);
+ g_signal_handlers_disconnect_by_func (pager->settings,
+ G_CALLBACK (wrap_workspaces_changed),
+ pager);
+ g_object_unref (pager->settings);
+
+ if (pager->properties_dialog)
+ gtk_widget_destroy(pager->properties_dialog);
+ g_free(pager);
+}