about summary refs log tree commit diff
path: root/pkgs/desktops/xfce
diff options
context:
space:
mode:
authorYegor Timoshenko <yegortimoshenko@gmail.com>2017-12-18 17:20:19 +0000
committerYegor Timoshenko <yegortimoshenko@gmail.com>2017-12-20 00:40:26 +0300
commitc1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23 (patch)
tree444f78d65e9728fc299a5fed1ebfdf4c67471fb3 /pkgs/desktops/xfce
parentba007d32c989a4e7b770a300098e8affadd8cead (diff)
downloadnixlib-c1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23.tar
nixlib-c1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23.tar.gz
nixlib-c1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23.tar.bz2
nixlib-c1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23.tar.lz
nixlib-c1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23.tar.xz
nixlib-c1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23.tar.zst
nixlib-c1cc1a701e8c8e5c57af7ebe6d77c597a33f7f23.zip
mousepad: backport fix of issue 12134, resolves #14862
https://bugzilla.xfce.org/show_bug.cgi?id=12134
Diffstat (limited to 'pkgs/desktops/xfce')
-rw-r--r--pkgs/desktops/xfce/applications/mousepad-12134.patch90
-rw-r--r--pkgs/desktops/xfce/applications/mousepad.nix2
2 files changed, 92 insertions, 0 deletions
diff --git a/pkgs/desktops/xfce/applications/mousepad-12134.patch b/pkgs/desktops/xfce/applications/mousepad-12134.patch
new file mode 100644
index 000000000000..74a28ecf61af
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/mousepad-12134.patch
@@ -0,0 +1,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);
+ }
+ 
+ 
diff --git a/pkgs/desktops/xfce/applications/mousepad.nix b/pkgs/desktops/xfce/applications/mousepad.nix
index c15ab310f47b..a2b91aaaa79e 100644
--- a/pkgs/desktops/xfce/applications/mousepad.nix
+++ b/pkgs/desktops/xfce/applications/mousepad.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
   };
   name = "${p_name}-${ver_maj}.${ver_min}";
 
+  patches = [ ./mousepad-12134.patch ];
+
   buildInputs =
     [ pkgconfig intltool libxfce4util
       gtk gtksourceview dbus dbus_glib makeWrapper