Line 0
Link Here
|
|
|
1 |
--- common/xrdp_constants.h.orig 2017-09-28 02:25:19 UTC |
2 |
+++ common/xrdp_constants.h |
3 |
@@ -189,13 +189,21 @@ |
4 |
#define RDP_KEYPRESS 0 |
5 |
#define RDP_KEYRELEASE (KBD_FLAG_DOWN | KBD_FLAG_UP) |
6 |
|
7 |
-#define MOUSE_FLAG_MOVE 0x0800 |
8 |
-#define MOUSE_FLAG_BUTTON1 0x1000 |
9 |
-#define MOUSE_FLAG_BUTTON2 0x2000 |
10 |
-#define MOUSE_FLAG_BUTTON3 0x4000 |
11 |
-#define MOUSE_FLAG_BUTTON4 0x0280 |
12 |
-#define MOUSE_FLAG_BUTTON5 0x0380 |
13 |
-#define MOUSE_FLAG_DOWN 0x8000 |
14 |
+/* Mouse Event (MS-RDPBCGR 2.2.8.1.1.3.1.1.3) */ |
15 |
+#define PTRFLAGS_HWHEEL 0x0400 |
16 |
+#define PTRFLAGS_WHEEL 0x0200 |
17 |
+#define PTRFLAGS_WHEEL_NEGATIVE 0x0100 |
18 |
+#define WheelRotationMask 0x01FF |
19 |
+#define PTRFLAGS_MOVE 0x0800 |
20 |
+#define PTRFLAGS_DOWN 0x8000 |
21 |
+#define PTRFLAGS_BUTTON1 0x1000 |
22 |
+#define PTRFLAGS_BUTTON2 0x2000 |
23 |
+#define PTRFLAGS_BUTTON3 0x4000 |
24 |
+ |
25 |
+/* Mouse Event (MS-RDPBCGR 2.2.8.1.1.3.1.1.4) */ |
26 |
+#define PTRXFLAGS_DOWN 0x8000 |
27 |
+#define PTRXFLAGS_BUTTON1 0x0001 |
28 |
+#define PTRXFLAGS_BUTTON2 0x0002 |
29 |
|
30 |
/* Raster operation masks */ |
31 |
#define ROP2_S(rop3) (rop3 & 0xf) |
32 |
@@ -594,11 +602,16 @@ |
33 |
#define SOLIDPATTERNBRUSHONLY 0x0040 |
34 |
#define ORDERFLAGS_EXTRA_FLAGS 0x0080 |
35 |
|
36 |
-#define INPUT_FLAG_SCANCODES 0x0001 |
37 |
-#define INPUT_FLAG_MOUSEX 0x0004 |
38 |
-#define INPUT_FLAG_FASTPATH_INPUT 0x0008 |
39 |
-#define INPUT_FLAG_UNICODE 0x0010 |
40 |
-#define INPUT_FLAG_FASTPATH_INPUT2 0x0020 |
41 |
+/* Input Capability Set (MS-RDPBCGR 2.2.7.1.6) */ |
42 |
+#define INPUT_FLAG_SCANCODES 0x0001 |
43 |
+#define INPUT_FLAG_MOUSEX 0x0004 |
44 |
+#define INPUT_FLAG_FASTPATH_INPUT 0x0008 |
45 |
+#define INPUT_FLAG_UNICODE 0x0010 |
46 |
+#define INPUT_FLAG_FASTPATH_INPUT2 0x0020 |
47 |
+#define INPUT_FLAG_UNUSED1 0x0040 |
48 |
+#define INPUT_FLAG_UNUSED2 0x0080 |
49 |
+#define TS_INPUT_FLAG_MOUSE_HWHEEL 0x0100 |
50 |
+#define TS_INPUT_FLAG_QOE_TIMESTAMPS 0x0200 |
51 |
|
52 |
#define COMPDESK_NOT_SUPPORTED 0x0000 |
53 |
#define COMPDESK_SUPPORTED 0x0001 |
54 |
--- libxrdp/xrdp_caps.c.orig 2017-09-28 02:25:19 UTC |
55 |
+++ libxrdp/xrdp_caps.c |
56 |
@@ -924,7 +924,11 @@ xrdp_caps_send_demand_active(struct xrdp |
57 |
out_uint16_le(s, RDP_CAPSET_INPUT); /* 13(0xd) */ |
58 |
out_uint16_le(s, RDP_CAPLEN_INPUT); /* 88(0x58) */ |
59 |
|
60 |
- flags = INPUT_FLAG_SCANCODES | INPUT_FLAG_MOUSEX | INPUT_FLAG_UNICODE; |
61 |
+ flags = INPUT_FLAG_SCANCODES | |
62 |
+ INPUT_FLAG_MOUSEX | |
63 |
+ INPUT_FLAG_UNICODE | |
64 |
+ TS_INPUT_FLAG_MOUSE_HWHEEL; |
65 |
+ |
66 |
if (self->client_info.use_fast_path & 2) |
67 |
{ |
68 |
flags |= INPUT_FLAG_FASTPATH_INPUT | INPUT_FLAG_FASTPATH_INPUT2; |
69 |
--- xrdp/xrdp_wm.c.orig 2017-09-28 02:25:19 UTC |
70 |
+++ xrdp/xrdp_wm.c |
71 |
@@ -1264,6 +1264,8 @@ xrdp_wm_mouse_click(struct xrdp_wm *self |
72 |
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON3UP, x, y, 0, 0); |
73 |
} |
74 |
|
75 |
+ /* vertical scroll */ |
76 |
+ |
77 |
if (but == 4) |
78 |
{ |
79 |
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON4DOWN, |
80 |
@@ -1279,21 +1281,23 @@ xrdp_wm_mouse_click(struct xrdp_wm *self |
81 |
self->mm->mod->mod_event(self->mm->mod, WM_BUTTON5UP, |
82 |
self->mouse_x, self->mouse_y, 0, 0); |
83 |
} |
84 |
- if (but == 6 && down) |
85 |
- { |
86 |
- self->mm->mod->mod_event(self->mm->mod, WM_BUTTON6DOWN, x, y, 0, 0); |
87 |
- } |
88 |
- else if (but == 6 && !down) |
89 |
- { |
90 |
- self->mm->mod->mod_event(self->mm->mod, WM_BUTTON6UP, x, y, 0, 0); |
91 |
- } |
92 |
- if (but == 7 && down) |
93 |
+ |
94 |
+ /* horizontal scroll */ |
95 |
+ |
96 |
+ if (but == 6) |
97 |
{ |
98 |
- self->mm->mod->mod_event(self->mm->mod, WM_BUTTON7DOWN, x, y, 0, 0); |
99 |
+ self->mm->mod->mod_event(self->mm->mod, WM_BUTTON6DOWN, |
100 |
+ self->mouse_x, self->mouse_y, 0, 0); |
101 |
+ self->mm->mod->mod_event(self->mm->mod, WM_BUTTON6UP, |
102 |
+ self->mouse_x, self->mouse_y, 0, 0); |
103 |
} |
104 |
- else if (but == 7 && !down) |
105 |
+ |
106 |
+ if (but == 7) |
107 |
{ |
108 |
- self->mm->mod->mod_event(self->mm->mod, WM_BUTTON7UP, x, y, 0, 0); |
109 |
+ self->mm->mod->mod_event(self->mm->mod, WM_BUTTON7DOWN, |
110 |
+ self->mouse_x, self->mouse_y, 0, 0); |
111 |
+ self->mm->mod->mod_event(self->mm->mod, WM_BUTTON7UP, |
112 |
+ self->mouse_x, self->mouse_y, 0, 0); |
113 |
} |
114 |
} |
115 |
} |
116 |
@@ -1638,14 +1642,14 @@ xrdp_wm_process_input_mouse(struct xrdp_ |
117 |
{ |
118 |
DEBUG(("mouse event flags %4.4x x %d y %d", device_flags, x, y)); |
119 |
|
120 |
- if (device_flags & MOUSE_FLAG_MOVE) /* 0x0800 */ |
121 |
+ if (device_flags & PTRFLAGS_MOVE) |
122 |
{ |
123 |
xrdp_wm_mouse_move(self, x, y); |
124 |
} |
125 |
|
126 |
- if (device_flags & MOUSE_FLAG_BUTTON1) /* 0x1000 */ |
127 |
+ if (device_flags & PTRFLAGS_BUTTON1) |
128 |
{ |
129 |
- if (device_flags & MOUSE_FLAG_DOWN) /* 0x8000 */ |
130 |
+ if (device_flags & PTRFLAGS_DOWN) |
131 |
{ |
132 |
xrdp_wm_mouse_click(self, x, y, 1, 1); |
133 |
} |
134 |
@@ -1655,9 +1659,9 @@ xrdp_wm_process_input_mouse(struct xrdp_ |
135 |
} |
136 |
} |
137 |
|
138 |
- if (device_flags & MOUSE_FLAG_BUTTON2) /* 0x2000 */ |
139 |
+ if (device_flags & PTRFLAGS_BUTTON2) |
140 |
{ |
141 |
- if (device_flags & MOUSE_FLAG_DOWN) /* 0x8000 */ |
142 |
+ if (device_flags & PTRFLAGS_DOWN) |
143 |
{ |
144 |
xrdp_wm_mouse_click(self, x, y, 2, 1); |
145 |
} |
146 |
@@ -1667,9 +1671,9 @@ xrdp_wm_process_input_mouse(struct xrdp_ |
147 |
} |
148 |
} |
149 |
|
150 |
- if (device_flags & MOUSE_FLAG_BUTTON3) /* 0x4000 */ |
151 |
+ if (device_flags & PTRFLAGS_BUTTON3) |
152 |
{ |
153 |
- if (device_flags & MOUSE_FLAG_DOWN) /* 0x8000 */ |
154 |
+ if (device_flags & PTRFLAGS_DOWN) |
155 |
{ |
156 |
xrdp_wm_mouse_click(self, x, y, 3, 1); |
157 |
} |
158 |
@@ -1679,9 +1683,10 @@ xrdp_wm_process_input_mouse(struct xrdp_ |
159 |
} |
160 |
} |
161 |
|
162 |
- if (device_flags & 0x200) /* PTRFLAGS_WHEEL */ |
163 |
+ /* vertical mouse wheel */ |
164 |
+ if (device_flags & PTRFLAGS_WHEEL) |
165 |
{ |
166 |
- if (device_flags & 0x100) /* PTRFLAGS_WHEEL_NEGATIVE */ |
167 |
+ if (device_flags & PTRFLAGS_WHEEL_NEGATIVE) |
168 |
{ |
169 |
xrdp_wm_mouse_click(self, 0, 0, 5, 0); |
170 |
} |
171 |
@@ -1691,6 +1696,24 @@ xrdp_wm_process_input_mouse(struct xrdp_ |
172 |
} |
173 |
} |
174 |
|
175 |
+ /* horizontal mouse wheel */ |
176 |
+ |
177 |
+ /** |
178 |
+ * As mstsc does MOUSE not MOUSEX for horizontal scrolling, |
179 |
+ * PTRFLAGS_HWHEEL must be handled here. |
180 |
+ */ |
181 |
+ if (device_flags & PTRFLAGS_HWHEEL) |
182 |
+ { |
183 |
+ if (device_flags & PTRFLAGS_WHEEL_NEGATIVE) |
184 |
+ { |
185 |
+ xrdp_wm_mouse_click(self, 0, 0, 6, 0); |
186 |
+ } |
187 |
+ else |
188 |
+ { |
189 |
+ xrdp_wm_mouse_click(self, 0, 0, 7, 0); |
190 |
+ } |
191 |
+ } |
192 |
+ |
193 |
return 0; |
194 |
} |
195 |
|
196 |
@@ -1699,24 +1722,24 @@ static int |
197 |
xrdp_wm_process_input_mousex(struct xrdp_wm* self, int device_flags, |
198 |
int x, int y) |
199 |
{ |
200 |
- if (device_flags & 0x8000) /* PTRXFLAGS_DOWN */ |
201 |
+ if (device_flags & PTRXFLAGS_DOWN) |
202 |
{ |
203 |
- if (device_flags & 0x0001) /* PTRXFLAGS_BUTTON1 */ |
204 |
+ if (device_flags & PTRXFLAGS_BUTTON1) |
205 |
{ |
206 |
xrdp_wm_mouse_click(self, x, y, 6, 1); |
207 |
} |
208 |
- else if (device_flags & 0x0002) /* PTRXFLAGS_BUTTON2 */ |
209 |
+ else if (device_flags & PTRXFLAGS_BUTTON2) |
210 |
{ |
211 |
xrdp_wm_mouse_click(self, x, y, 7, 1); |
212 |
} |
213 |
} |
214 |
else |
215 |
{ |
216 |
- if (device_flags & 0x0001) /* PTRXFLAGS_BUTTON1 */ |
217 |
+ if (device_flags & PTRXFLAGS_BUTTON1) |
218 |
{ |
219 |
xrdp_wm_mouse_click(self, x, y, 6, 0); |
220 |
} |
221 |
- else if (device_flags & 0x0002) /* PTRXFLAGS_BUTTON2 */ |
222 |
+ else if (device_flags & PTRXFLAGS_BUTTON2) |
223 |
{ |
224 |
xrdp_wm_mouse_click(self, x, y, 7, 0); |
225 |
} |