[Xfce4-commits] [apps/xfce4-terminal] 01/01: Fix Ctrl press recognition for opening URIs with Ctrl+click

noreply at xfce.org noreply at xfce.org
Fri Oct 28 13:21:02 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 9777bcfca4b32ae6343e50a9e31b8085bcc34221
Author: Igor <f2404 at yandex.ru>
Date:   Fri Oct 28 14:20:57 2016 +0300

    Fix Ctrl press recognition for opening URIs with Ctrl+click
---
 terminal/terminal-widget.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
index 8d2da66..af7f3e4 100644
--- a/terminal/terminal-widget.c
+++ b/terminal/terminal-widget.c
@@ -384,11 +384,12 @@ static gboolean
 terminal_widget_button_press_event (GtkWidget       *widget,
                                     GdkEventButton  *event)
 {
-  gboolean committed = FALSE;
-  gboolean middle_click_opens_uri;
-  gchar   *match;
-  guint    signal_id = 0;
-  gint     tag;
+  GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask ();
+  gboolean        committed = FALSE;
+  gboolean        middle_click_opens_uri;
+  gchar          *match;
+  guint           signal_id = 0;
+  gint            tag;
 
   if (event->type == GDK_BUTTON_PRESS)
     {
@@ -396,7 +397,9 @@ terminal_widget_button_press_event (GtkWidget       *widget,
       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))
+      if (middle_click_opens_uri
+            ? (event->button == 2)
+            : (event->button == 1 && (event->state & modifiers) == GDK_CONTROL_MASK))
         {
           /* clicking on an URI fires the responsible application */
           match = vte_terminal_match_check_event (VTE_TERMINAL (widget), (GdkEvent *) event, &tag);
@@ -423,7 +426,7 @@ terminal_widget_button_press_event (GtkWidget       *widget,
       /* no data (mouse actions) was committed to the terminal application
        * which means, we can safely popup a context menu now.
        */
-      if (!committed || (event->state & GDK_MODIFIER_MASK) == GDK_SHIFT_MASK)
+      if (!committed || (event->state & modifiers) == GDK_SHIFT_MASK)
         {
           terminal_widget_context_menu (TERMINAL_WIDGET (widget),
                                         event->button, event->time,

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


More information about the Xfce4-commits mailing list