summaryrefslogtreecommitdiff
path: root/community/tint2/middle_click_on_clock.patch
blob: 800c15c449fed8f4aa19394f1ce19a3d51e1348f (plain)
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
http://code.google.com/p/tint2/issues/detail?id=430
Submitted By: David B. Cortarello (Nomius) <dcortarello at gmail dot com>
Date: 18-05-2013
Initial Package Version: subversion trunk (revision 652)
Description: Implemented middle click mouse button in the clock to execute tasks.
* Implemented middle click mouse button over the clock by accepting the button 2 in the clock_action. 
* A new configuration parameter was created called clock_mclick_command, which works in the same way 
* clock_lclick_command and clock_rclick_command does.

Index: src/clock/clock.c
===================================================================
--- src/clock/clock.c	(revision 652)
+++ src/clock/clock.c	(working copy)
@@ -39,6 +41,7 @@
 char *time_tooltip_format;
 char *time_tooltip_timezone;
 char *clock_lclick_command;
+char *clock_mclick_command;
 char *clock_rclick_command;
 struct timeval time_clock;
 PangoFontDescription *time1_font_desc;
@@ -61,6 +64,7 @@
 	time_tooltip_format = 0;
 	time_tooltip_timezone = 0;
 	clock_lclick_command = 0;
+	clock_mclick_command = 0;
 	clock_rclick_command = 0;
 	time1_font_desc = 0;
 	time2_font_desc = 0;
@@ -77,6 +81,7 @@
 	if (time2_timezone) g_free(time2_timezone);
 	if (time_tooltip_timezone) g_free(time_tooltip_timezone);
 	if (clock_lclick_command) g_free(clock_lclick_command);
+	if (clock_mclick_command) g_free(clock_mclick_command);
 	if (clock_rclick_command) g_free(clock_rclick_command);
 	if (clock_timeout) stop_timeout(clock_timeout);
 }
@@ -254,6 +263,9 @@
 		case 1:
 		command = clock_lclick_command;
 		break;
+        case 2:
+        command = clock_mclick_command;
+		break;
 		case 3:
 		command = clock_rclick_command;
 		break;
Index: src/clock/clock.h
===================================================================
--- src/clock/clock.h	(revision 652)
+++ src/clock/clock.h	(working copy)
@@ -33,6 +33,7 @@
 extern PangoFontDescription *time1_font_desc;
 extern PangoFontDescription *time2_font_desc;
 extern char *clock_lclick_command;
+extern char *clock_mclick_command;
 extern char *clock_rclick_command;
 extern int clock_enabled;
 
Index: src/config.c
===================================================================
--- src/config.c	(revision 652)
+++ src/config.c	(working copy)
@@ -396,6 +396,10 @@
 		if (strlen(value) > 0)
 			clock_lclick_command = strdup(value);
 	}
+	else if (strcmp(key, "clock_mclick_command") == 0) {
+		if (strlen(value) > 0)
+			clock_mclick_command = strdup(value);
+	}
 	else if (strcmp(key, "clock_rclick_command") == 0) {
 		if (strlen(value) > 0)
 			clock_rclick_command = strdup(value);