-
Notifications
You must be signed in to change notification settings - Fork 5
/
gnome-terminal.patch
79 lines (75 loc) · 2.81 KB
/
gnome-terminal.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
*** ./terminal-screen-orig.c 2018-09-24 19:04:25.000000000 +0300
--- ./terminal-screen.c 2018-09-24 19:05:47.401017584 +0300
***************
*** 152,157 ****
--- 152,159 ----
GdkEventButton *event);
static void terminal_screen_hierarchy_changed (GtkWidget *widget,
GtkWidget *previous_toplevel);
+ static gboolean terminal_screen_button_release (GtkWidget *widget,
+ GdkEventButton *event);
static gboolean terminal_screen_do_exec (TerminalScreen *screen,
FDSetupData *data,
GError **error);
***************
*** 596,601 ****
--- 598,604 ----
widget_class->style_updated = terminal_screen_style_updated;
widget_class->drag_data_received = terminal_screen_drag_data_received;
widget_class->button_press_event = terminal_screen_button_press;
+ widget_class->button_release_event = terminal_screen_button_release;
widget_class->popup_menu = terminal_screen_popup_menu;
widget_class->hierarchy_changed = terminal_screen_hierarchy_changed;
***************
*** 1851,1860 ****
if (button_press_event && button_press_event (widget, event))
return TRUE;
! terminal_screen_do_popup (screen, event, hyperlink, url, url_flavor, number_info);
! hyperlink = NULL; /* adopted to the popup info */
! url = NULL; /* ditto */
! number_info = NULL; /* ditto */
return TRUE;
}
else if (!(event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
--- 1854,1860 ----
if (button_press_event && button_press_event (widget, event))
return TRUE;
! vte_terminal_paste_clipboard (VTE_TERMINAL (screen));
return TRUE;
}
else if (!(event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)))
***************
*** 1875,1880 ****
--- 1875,1907 ----
return FALSE;
}
+ static gboolean
+ terminal_screen_button_release (GtkWidget *widget,
+ GdkEventButton *event)
+ {
+ gboolean ret;
+
+ TerminalScreen *screen = TERMINAL_SCREEN (widget);
+ gboolean (* button_release_event) (GtkWidget*, GdkEventButton*) =
+ GTK_WIDGET_CLASS (terminal_screen_parent_class)->button_release_event;
+
+ ret = FALSE;
+ if (button_release_event) {
+ ret = button_release_event (widget, event);
+ }
+
+ if (event->button == 1) {
+ gboolean can_copy;
+
+ can_copy = vte_terminal_get_has_selection (VTE_TERMINAL (screen));
+
+ if (can_copy)
+ vte_terminal_copy_clipboard (VTE_TERMINAL (screen));
+ }
+
+ return ret;
+ }
+
/**
* terminal_screen_get_current_dir:
* @screen: