You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
evolution/SOURCES/webkitgtk-2.46.1-middle-cli...

37 lines
1.6 KiB

diff -up evolution-3.28.5/src/modules/webkit-editor/e-webkit-editor.c.webkitgtk-2.46.1 evolution-3.28.5/src/modules/webkit-editor/e-webkit-editor.c
--- evolution-3.28.5/src/modules/webkit-editor/e-webkit-editor.c.webkitgtk-2.46.1 2024-10-15 11:38:18.575614628 +0200
+++ evolution-3.28.5/src/modules/webkit-editor/e-webkit-editor.c 2024-10-15 11:46:23.334317025 +0200
@@ -6327,6 +6327,24 @@ webkit_editor_button_press_event (GtkWid
}
static gboolean
+webkit_editor_button_release_event (GtkWidget *widget,
+ GdkEventButton *event)
+{
+ if (event->button == 2) {
+ /* WebKitGTK 2.46.1 changed the middle-click paste behavior and moved
+ the paste handler from the button-press event into the button-release
+ event, which causes double paste of the clipboard content. As the paste
+ is handled in the webkit_editor_button_press_event() above, make sure
+ the release handler is not called here regardless whether the user
+ uses the changed WebkitGTK or not. */
+ return TRUE;
+ }
+
+ /* Chain up to parent's method. */
+ return GTK_WIDGET_CLASS (e_webkit_editor_parent_class)->button_release_event (widget, event);
+}
+
+static gboolean
webkit_editor_key_press_event (GtkWidget *widget,
GdkEventKey *event)
{
@@ -6402,6 +6420,7 @@ e_webkit_editor_class_init (EWebKitEdito
widget_class = GTK_WIDGET_CLASS (class);
widget_class->button_press_event = webkit_editor_button_press_event;
+ widget_class->button_release_event = webkit_editor_button_release_event;
widget_class->key_press_event = webkit_editor_key_press_event;
g_object_class_install_property (