Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Mar 2026 07:48:06 +0000
From:      Guido Falsi <madpilot@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: c817f73f135b - main - x11/xfce4-terminal: Fix unsafe paste confirmation dialog functionality
Message-ID:  <69bbaa36.3e3da.7f77c58d@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c817f73f135b6e7ce87d0f48e69449b3979505f8

commit c817f73f135b6e7ce87d0f48e69449b3979505f8
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2026-03-19 07:46:14 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2026-03-19 07:48:02 +0000

    x11/xfce4-terminal: Fix unsafe paste confirmation dialog functionality
    
    Reverting upstream change that causes the unsafe paste confirmation
    dialog to not show up when pasting multi line selection with the
    middle mouse button.
    
    Issue reported upstream here: https://gitlab.xfce.org/apps/xfce4-terminal/-/issues/385
    
    Reported by:    Marek Zarychta (via irc, nick mzar)
---
 x11/xfce4-terminal/Makefile                        |  1 +
 x11/xfce4-terminal/files/patch-revert-mmb-handling | 51 ++++++++++++++++++++++
 2 files changed, 52 insertions(+)

diff --git a/x11/xfce4-terminal/Makefile b/x11/xfce4-terminal/Makefile
index 8639ef912cc4..3413f142a433 100644
--- a/x11/xfce4-terminal/Makefile
+++ b/x11/xfce4-terminal/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	xfce4-terminal
 PORTVERSION=	1.2.0
+PORTREVISION=	1
 CATEGORIES=	x11 xfce
 MASTER_SITES=	XFCE/apps
 DIST_SUBDIR=	xfce4
diff --git a/x11/xfce4-terminal/files/patch-revert-mmb-handling b/x11/xfce4-terminal/files/patch-revert-mmb-handling
new file mode 100644
index 000000000000..1bda729a82ed
--- /dev/null
+++ b/x11/xfce4-terminal/files/patch-revert-mmb-handling
@@ -0,0 +1,51 @@
+diff --git a/terminal/terminal-widget.c b/terminal/terminal-widget.c
+index 6c0f97b8..130c6a68 100644
+--- terminal/terminal-widget.c
++++ terminal/terminal-widget.c
+@@ -575,7 +575,6 @@ terminal_widget_button_press_event (GtkWidget *widget,
+   const GdkModifierType modifiers = gtk_accelerator_get_default_mod_mask ();
+   gboolean committed = FALSE;
+   gboolean intercept = FALSE;
+-  gboolean handled = FALSE;
+   gboolean middle_click_opens_uri;
+   guint signal_id = 0;
+ 
+@@ -598,7 +597,13 @@ terminal_widget_button_press_event (GtkWidget *widget,
+             }
+         }
+ 
+-      if (event->button == 3)
++      /* intercept middle button click that would paste the selection */
++      if (event->button == 2)
++        {
++          g_signal_emit (G_OBJECT (widget), widget_signals[PASTE_SELECTION_REQUEST], 0, NULL);
++          return TRUE;
++        }
++      else if (event->button == 3)
+         {
+           if ((event->state & modifiers) == GDK_SHIFT_MASK)
+             intercept = TRUE;
+@@ -609,21 +614,9 @@ terminal_widget_button_press_event (GtkWidget *widget,
+     }
+ 
+   if (!intercept)
+-    handled = (*GTK_WIDGET_CLASS (terminal_widget_parent_class)->button_press_event) (widget, event);
++    (*GTK_WIDGET_CLASS (terminal_widget_parent_class)->button_press_event) (widget, event);
+ 
+-  if (event->button == 2 && event->type == GDK_BUTTON_PRESS)
+-    {
+-      /* if handled is true, it means the VteTerminal's handler either already
+-       * pasted the selection on its own or passed the middle button click event
+-       * to the terminal application. In both cases we are done. Otherwise,
+-       * we need to paste the selection now.
+-       */
+-      if (!handled)
+-        {
+-          g_signal_emit (G_OBJECT (widget), widget_signals[PASTE_SELECTION_REQUEST], 0, NULL);
+-        }
+-    }
+-  else if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
++  if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
+     {
+       if (signal_id != 0)
+         g_signal_handler_disconnect (G_OBJECT (widget), signal_id);


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69bbaa36.3e3da.7f77c58d>