summary refs log tree commit diff
path: root/pkgs/desktops/xfce/applications/mousepad-12134.patch
blob: 74a28ecf61afcb1eaff2c81afebf55908f6f8c16 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff -urNZ a/mousepad/mousepad-action-group.c b/mousepad/mousepad-action-group.c
--- a/mousepad/mousepad-action-group.c	2014-09-01 20:50:07.000000000 +0000
+++ b/mousepad/mousepad-action-group.c	2017-12-18 16:57:46.836538403 +0000
@@ -302,11 +302,6 @@
   gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
   self->locked = FALSE;
 
-  /* update the setting when the active action is changed */
-  self->locked = TRUE;
-  MOUSEPAD_SETTING_SET_STRING (COLOR_SCHEME, gtk_source_style_scheme_get_id (scheme));
-  self->locked = FALSE;
-
   g_object_notify (G_OBJECT (self), "active-style-scheme");
 }
 
@@ -473,6 +468,8 @@
 mousepad_action_group_style_scheme_action_activate (MousepadActionGroup       *self,
                                                     MousepadStyleSchemeAction *action)
 {
+  const gchar *scheme_name = NULL;
+
   /* only update the active action if we're not already in the process of
    * setting it and the sender action is actually active */
   if (! self->locked &&
@@ -481,7 +478,14 @@
       GtkSourceStyleScheme *scheme;
 
       scheme = mousepad_style_scheme_action_get_style_scheme (action);
-      mousepad_action_group_set_active_style_scheme (self, scheme);
+
+      /* update the setting when the active action is changed */
+      if (scheme != NULL)
+        scheme_name = gtk_source_style_scheme_get_id(scheme);
+
+      self->locked = TRUE;
+      MOUSEPAD_SETTING_SET_STRING (COLOR_SCHEME, scheme_name);
+      self->locked = FALSE;
     }
 }
 
diff -urNZ a/mousepad/mousepad-window.c b/mousepad/mousepad-window.c
--- a/mousepad/mousepad-window.c	2014-09-01 20:58:02.000000000 +0000
+++ b/mousepad/mousepad-window.c	2017-12-18 17:07:51.099321408 +0000
@@ -712,32 +712,6 @@
 
 
 static void
-mousepad_window_action_group_style_scheme_changed (MousepadWindow      *window,
-                                                   GParamSpec          *pspec,
-                                                   MousepadActionGroup *group)
-{
-  GtkSourceStyleScheme *scheme;
-  const gchar          *scheme_id;
-  gint                  npages, i;
-
-  /* get the new active language */
-  scheme = mousepad_action_group_get_active_style_scheme (group);
-  scheme_id = gtk_source_style_scheme_get_id (scheme);
-
-  /* update the color scheme on all the documents */
-  npages = gtk_notebook_get_n_pages (GTK_NOTEBOOK (window->notebook));
-  for (i = 0; i < npages; i++)
-    {
-      MousepadDocument *document;
-
-      document = MOUSEPAD_DOCUMENT (gtk_notebook_get_nth_page (GTK_NOTEBOOK (window->notebook), i));
-      mousepad_view_set_color_scheme (document->textview, scheme_id);
-    }
-}
-
-
-
-static void
 mousepad_window_create_style_schemes_menu (MousepadWindow *window)
 {
   GtkWidget           *menu, *item;
@@ -751,13 +725,6 @@
   gtk_menu_item_set_submenu (GTK_MENU_ITEM (item), menu);
   gtk_widget_show_all (menu);
   gtk_widget_show (item);
-  
-  /* watch for activations of the style schemes actions */
-  g_signal_connect_object (window->action_group,
-                           "notify::active-style-scheme",
-                           G_CALLBACK (mousepad_window_action_group_style_scheme_changed),
-                           window,
-                           G_CONNECT_SWAPPED);
 }