With emulate_raw_mouse_press, I wanted to keep our options open as Xi_RawButtonPress/Release do exist, and maybe in the future a usecase will come up where we want to use them. If we can confirm that there is no point to keeping them for either the mac or x11 driver, I'll remove it.
On Tue, 2019-07-23 at 12:16 -0400, Derek Lesho wrote:
> Well, while it is certainly possible to use actual rawinput for sending
> keyboard events and mouse presses, I don't see much of an incentive to.
> With mouse motion, the DE is bypassed so mouse acceleration and sensitivity
> are bypassed (just like on windows), but I don't think DE's modify keyboard
> events or mouse presses in any meaningful way.
Then you don't need the emulate_raw_mouse_press flag. Keyboard raw
input is another topic of course.
If you drop the emulate_raw_mouse_press flag, which isn't going to be
enabled anyway as you said, I believe your patch, and the code, will be
simpler. I think you can drop the big if and only change:
- msg_data->rawinput.mouse.x = x - desktop->cursor.x;
- msg_data->rawinput.mouse.y = y - desktop->cursor.y;
+ msg_data->rawinput.mouse.x = emulate_raw_mouse_move ? x - desktop->cursor.x : 0;
+ msg_data->rawinput.mouse.y = emulate_raw_mouse_move ? y - desktop->cursor.y : 0;
You could then conditionally call queue_hardware_message below if the
button data is empty in order to avoid sending empty events.
--
Rémi Bernon <rbernon@codeweavers.com>