[packages/gnome-terminal] bringing back wordseps configurability

glen glen at pld-linux.org
Tue Sep 22 10:17:38 CEST 2015


commit d7796de81cd45b08256ee7bb8264f4e9cb8f974f
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Tue Sep 22 11:15:30 2015 +0300

    bringing back wordseps configurability
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1165244#c16
    https://bugzilla.gnome.org/show_bug.cgi?id=730632#c35

 bug-730632.patch    | 187 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 gnome-terminal.spec |   8 ++-
 wordseps.patch      |  22 +++----
 3 files changed, 203 insertions(+), 14 deletions(-)
---
diff --git a/gnome-terminal.spec b/gnome-terminal.spec
index a8c3ccd..8fd7428 100644
--- a/gnome-terminal.spec
+++ b/gnome-terminal.spec
@@ -1,18 +1,19 @@
 #
 # Conditional build:
 %bcond_without	nautilus	# Nautilus extension
-#
+
 Summary:	GNOME Terminal
 Summary(pl.UTF-8):	Terminal dla GNOME
 Name:		gnome-terminal
 Version:	3.16.2
-Release:	1
+Release:	2
 License:	GPL v3+
 Group:		X11/Applications
 Source0:	http://ftp.gnome.org/pub/GNOME/sources/gnome-terminal/3.16/%{name}-%{version}.tar.xz
 # Source0-md5:	17d15e7d226826ca1853eee1c99645b0
 Patch0:		%{name}-desktop.patch
-Patch1:		wordseps.patch
+Patch1:		bug-730632.patch
+Patch2:		wordseps.patch
 URL:		http://www.gnome.org/
 BuildRequires:	GConf2-devel >= 2.32.0
 BuildRequires:	autoconf >= 2.53
@@ -75,6 +76,7 @@ w Nautilusie.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 %build
 %{__intltoolize}
diff --git a/bug-730632.patch b/bug-730632.patch
new file mode 100644
index 0000000..849e36e
--- /dev/null
+++ b/bug-730632.patch
@@ -0,0 +1,187 @@
+--- a/src/profile-editor.c	
++++ a/src/profile-editor.c	
+@@ -755,6 +755,29 @@ bool_to_scrollbar_policy (const GValue *value,
+   return g_variant_new_string (g_value_get_boolean (value) ? "always" : "never");
+ }
+ 
++static gboolean
++maybestring_to_string (GValue *value,
++                       GVariant *variant,
++                       gpointer user_data)
++{
++  const char *default_value = (const char *) user_data;
++  gs_free const char *str;
++
++  g_variant_get (variant, "ms", &str);
++  g_value_set_string (value, str != NULL ? str : default_value);
++
++  return TRUE;
++}
++
++static GVariant *
++string_to_maybestring (const GValue *value,
++                       const GVariantType *expected_type,
++                       gpointer user_data)
++{
++  return g_variant_new_maybe(G_VARIANT_TYPE_STRING,
++                             g_variant_new_string (g_value_get_string (value)));
++}
++
+ /**
+  * terminal_profile_edit:
+  * @profile: a #GSettings
+@@ -1060,6 +1083,16 @@ terminal_profile_edit (GSettings  *profile,
+                    gtk_builder_get_object (builder,
+                                            "use-theme-colors-checkbutton"),
+                    "active", G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET);
++  g_settings_bind_with_mapping (profile,
++                                TERMINAL_PROFILE_WORD_CHAR_EXCEPTIONS_KEY,
++                                gtk_builder_get_object (builder,
++                                                        "word-char-exceptions-entry"),
++                                "text",
++                                G_SETTINGS_BIND_GET | G_SETTINGS_BIND_SET,
++                                (GSettingsBindGetMapping) maybestring_to_string,
++                                (GSettingsBindSetMapping) string_to_maybestring,
++                                (gpointer) g_strdup (GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT),  /* work around const-ness issue */
++                                g_free);
+   g_settings_bind (profile, TERMINAL_PROFILE_AUDIBLE_BELL_KEY,
+                    gtk_builder_get_object (builder, "bell-checkbutton"),
+                    "active",
+--- a/src/profile-preferences.ui	
++++ a/src/profile-preferences.ui	
+@@ -424,6 +424,35 @@ 
+                       </packing>
+                     </child>
+                     <child>
++                      <object class="GtkLabel" id="word-char-exceptions-entry-label">
++                        <property name="visible">True</property>
++                        <property name="can_focus">False</property>
++                        <property name="xalign">0</property>
++                        <property name="label" translatable="yes">_Word characters:</property>
++                        <property name="use_underline">True</property>
++                        <property name="justify">center</property>
++                        <property name="mnemonic_widget">word-char-exceptions-entry</property>
++                      </object>
++                      <packing>
++                        <property name="left_attach">0</property>
++                        <property name="right_attach">1</property>
++                        <property name="top_attach">4</property>
++                        <property name="bottom_attach">5</property>
++                      </packing>
++                    </child>
++                    <child>
++                      <object class="GtkEntry" id="word-char-exceptions-entry">
++                        <property name="visible">True</property>
++                        <property name="can_focus">True</property>
++                      </object>
++                      <packing>
++                        <property name="left_attach">1</property>
++                        <property name="right_attach">4</property>
++                        <property name="top_attach">4</property>
++                        <property name="bottom_attach">5</property>
++                      </packing>
++                    </child>
++                    <child>
+                       <object class="GtkCheckButton" id="bell-checkbutton">
+                         <property name="label" translatable="yes">Terminal _bell</property>
+                         <property name="visible">True</property>
+@@ -434,8 +463,8 @@ 
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">4</property>
+-                        <property name="top_attach">4</property>
+-                        <property name="bottom_attach">5</property>
++                        <property name="top_attach">5</property>
++                        <property name="bottom_attach">6</property>
+                       </packing>
+                     </child>
+                     <child>
+@@ -452,8 +481,8 @@ 
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+-                        <property name="top_attach">5</property>
+-                        <property name="bottom_attach">6</property>
++                        <property name="top_attach">6</property>
++                        <property name="bottom_attach">7</property>
+                       </packing>
+                     </child>
+                     <child>
+@@ -468,8 +497,8 @@ 
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+-                        <property name="top_attach">6</property>
+-                        <property name="bottom_attach">7</property>
++                        <property name="top_attach">7</property>
++                        <property name="bottom_attach">8</property>
+                       </packing>
+                     </child>
+                     <child>
+@@ -484,8 +513,8 @@ 
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+-                        <property name="top_attach">7</property>
+-                        <property name="bottom_attach">8</property>
++                        <property name="top_attach">8</property>
++                        <property name="bottom_attach">9</property>
+                       </packing>
+                     </child>
+                     <child>
+@@ -500,8 +529,8 @@ 
+                       <packing>
+                         <property name="left_attach">0</property>
+                         <property name="right_attach">1</property>
+-                        <property name="top_attach">8</property>
+-                        <property name="bottom_attach">9</property>
++                        <property name="top_attach">9</property>
++                        <property name="bottom_attach">10</property>
+                       </packing>
+                     </child>
+                     <child>
+@@ -517,8 +546,8 @@ 
+                       <packing>
+                         <property name="left_attach">1</property>
+                         <property name="right_attach">4</property>
+-                        <property name="top_attach">8</property>
+-                        <property name="bottom_attach">9</property>
++                        <property name="top_attach">9</property>
++                        <property name="bottom_attach">10</property>
+                       </packing>
+                     </child>
+                   </object>
+--- a/src/terminal-app.h	
++++ a/src/terminal-app.h	
+@@ -33,6 +33,20 @@ G_BEGIN_DECLS
+ 
+ #define MONOSPACE_FONT_KEY_NAME                 "monospace-font-name"
+ 
++/* Vte allows to set either a string, or NULL.  In the latter case (which is
++ * its default on startup) it uses a built-in set.  This is a reasonable
++ * behavior for all the apps out there that don't wish to bother with this
++ * setting.  However, there's no way to query what that string is (the getter
++ * API call returns NULL) and we can't safely assume that it won't change over
++ * time.  So for a graphical frontend that wants to expose this option to the
++ * user, either the UI becomes too complicated and user-unfriendly (with a
++ * checkbox whether to use the default, which is then not shown), or it
++ * forgets about vte's default and always set a non-NULL value.  Go for the
++ * latter approach of course, yet copy vte-0.40's default to be our default
++ * too.
++ */
++#define GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT "-#%&+,./=?@\\_~\302\267"
++
+ /* TerminalApp */
+ 
+ #define TERMINAL_TYPE_APP              (terminal_app_get_type ())
+--- a/src/terminal-screen.c	
++++ a/src/terminal-screen.c	
+@@ -801,6 +801,8 @@ terminal_screen_profile_changed_cb (GSettings     *profile,
+     {
+       gs_free char *word_char_exceptions;
+       g_settings_get (profile, TERMINAL_PROFILE_WORD_CHAR_EXCEPTIONS_KEY, "ms", &word_char_exceptions);
++      if (word_char_exceptions == NULL)
++        word_char_exceptions = g_strdup (GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT);
+       vte_terminal_set_word_char_exceptions (vte_terminal, word_char_exceptions);
+     }
+ 
diff --git a/wordseps.patch b/wordseps.patch
index d5bec58..0dfdabb 100644
--- a/wordseps.patch
+++ b/wordseps.patch
@@ -4,14 +4,14 @@ similar patches:
 - lxterminal: http://git.pld-linux.org/?p=packages/lxterminal.git;a=blob;f=wordseps.patch
 - mate-terminal: http://git.pld-linux.org/?p=packages/mate-terminal.git;a=blob;f=wordseps.patch
 
---- gnome-terminal-3.12.0/src/org.gnome.Terminal.gschema.xml.orig	2014-03-31 19:33:38.703984906 +0200
-+++ gnome-terminal-3.12.0/src/org.gnome.Terminal.gschema.xml	2014-03-31 19:34:14.883788826 +0200
-@@ -126,7 +126,7 @@
-       <summary>Whether to ring the terminal bell</summary>
-     </key>
-     <key name="word-chars" type="s">
--      <default>'-A-Za-z0-9,./?%&#:_=+@~'</default>
-+      <default>'-A-Za-z0-9,./?%&#:_=+@~;'</default>
-       <summary>Characters that are considered "part of a word"</summary>
-       <description>When selecting text by word, sequences of these characters are considered single words. Ranges can be given as "A-Z". Literal hyphen (not expressing a range) should be the first character given.</description>
-     </key>
+--- gnome-terminal-3.16.2/src/terminal-app.h~	2015-09-22 11:00:23.000000000 +0300
++++ gnome-terminal-3.16.2/src/terminal-app.h	2015-09-22 11:09:54.219125137 +0300
+@@ -45,7 +45,7 @@
+  * latter approach of course, yet copy vte-0.40's default to be our default
+  * too.
+  */
+-#define GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT "-#%&+,./=?@\\_~\302\267"
++#define GNOME_TERMINAL_WORD_CHAR_EXCEPTIONS_DEFAULT "-#%&+,./=?@:;\\_~\302\267"
+ 
+ /* TerminalApp */
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gnome-terminal.git/commitdiff/d7796de81cd45b08256ee7bb8264f4e9cb8f974f



More information about the pld-cvs-commit mailing list