[Xfce4-commits] [apps/xfce4-terminal] 01/01: Refine the MiscMiddleClickOpensUri option again: set if off by default

noreply at xfce.org noreply at xfce.org
Thu Jul 28 16:22:45 CEST 2016


This is an automated email from the git hooks/post-receive script.

f2404 pushed a commit to branch master
in repository apps/xfce4-terminal.

commit f5f1927a35603ccb71cb5b486c9b8d09278bf540
Author: Igor <f2404 at yandex.ru>
Date:   Thu Jul 28 17:18:00 2016 +0300

    Refine the MiscMiddleClickOpensUri option again: set if off by default
    
    It seems that opening URIs by middle click brings a lot of inconvenience to
    users as the same button is used for selection paste. Besides, other terminal
    emulators, such as gnome-terminal or qterminal, appear not to be using middle
    click for this action.
    This change makes Ctrl + left click the default action for opening URIs,
    providing users with a possibility to change it to middle click via a hidden
    preference.
---
 terminal/terminal-preferences.c |  2 +-
 terminal/terminal-widget.c      | 36 +++++++++++++++++++-----------------
 2 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index bc65a99..0cfad95 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -803,7 +803,7 @@ terminal_preferences_class_init (TerminalPreferencesClass *klass)
       g_param_spec_boolean ("misc-middle-click-opens-uri",
                             NULL,
                             "MiscMiddleClickOpensUri",
-                            TRUE,
+                            FALSE,
                             G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
 
   /**
diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index 5d859d1..e4cd713 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -401,26 +401,28 @@ terminal_widget_button_press_event (GtkWidget       *widget,
   guint    signal_id = 0;
   gint     tag;
 
-  /* check whether to use ctrl-click or middle click to open URI */
-  g_object_get (G_OBJECT (TERMINAL_WIDGET (widget)->preferences),
-      "misc-middle-click-opens-uri", &middle_click_opens_uri, NULL);
-
-  if ((middle_click_opens_uri ? (event->button == 2) : (event->button == 1 && event->state == GDK_CONTROL_MASK)) &&
-      event->type == GDK_BUTTON_PRESS)
+  if (event->type == GDK_BUTTON_PRESS)
     {
-      /* clicking on an URI fires the responsible application */
-      match = vte_terminal_match_check_event (VTE_TERMINAL (widget), (GdkEvent *) event, &tag);
-      if (G_UNLIKELY (match != NULL))
+      /* check whether to use ctrl-click or middle click to open URI */
+      g_object_get (G_OBJECT (TERMINAL_WIDGET (widget)->preferences),
+          "misc-middle-click-opens-uri", &middle_click_opens_uri, NULL);
+
+      if (middle_click_opens_uri ? (event->button == 2) : (event->button == 1 && event->state == GDK_CONTROL_MASK))
         {
-          terminal_widget_open_uri (TERMINAL_WIDGET (widget), match, tag);
-          g_free (match);
-          return TRUE;
+          /* clicking on an URI fires the responsible application */
+          match = vte_terminal_match_check_event (VTE_TERMINAL (widget), (GdkEvent *) event, &tag);
+          if (G_UNLIKELY (match != NULL))
+            {
+              terminal_widget_open_uri (TERMINAL_WIDGET (widget), match, tag);
+              g_free (match);
+              return TRUE;
+            }
+        }
+      else if (event->button == 3)
+        {
+          signal_id = g_signal_connect (G_OBJECT (widget), "commit",
+                                        G_CALLBACK (terminal_widget_commit), &committed);
         }
-    }
-  else if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
-    {
-      signal_id = g_signal_connect (G_OBJECT (widget), "commit",
-                                    G_CALLBACK (terminal_widget_commit), &committed);
     }
 
   (*GTK_WIDGET_CLASS (terminal_widget_parent_class)->button_press_event) (widget, event);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list