Fixed mouse drag handling.
This commit is contained in:
parent
3e9bfbf79d
commit
344b215554
@ -319,23 +319,24 @@ int rdp_guac_client_mouse_handler(guac_client* client, int x, int y, int mask) {
|
|||||||
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
|
rdp_guac_client_data* guac_client_data = (rdp_guac_client_data*) client->data;
|
||||||
rdpInst* rdp_inst = guac_client_data->rdp_inst;
|
rdpInst* rdp_inst = guac_client_data->rdp_inst;
|
||||||
|
|
||||||
/* If no buttons pressed */
|
/* If button mask unchanged, just send move event */
|
||||||
if (mask == 0) {
|
if (mask == guac_client_data->mouse_button_mask)
|
||||||
|
rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, PTRFLAGS_MOVE, x, y);
|
||||||
|
|
||||||
/* Send mouse move event if no buttons pressed before */
|
/* Otherwise, send events describing button change */
|
||||||
if (guac_client_data->mouse_button_mask == 0)
|
else {
|
||||||
rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, PTRFLAGS_MOVE, x, y);
|
|
||||||
|
|
||||||
/* Otherwise, send mouse up event, releasing any old buttons */
|
/* Release event */
|
||||||
else
|
if (mask == 0)
|
||||||
rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, PTRFLAGS_BUTTON1, x, y);
|
rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, PTRFLAGS_BUTTON1, x, y);
|
||||||
|
|
||||||
|
/* Press event */
|
||||||
|
else
|
||||||
|
rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, PTRFLAGS_DOWN | PTRFLAGS_BUTTON1, x, y);
|
||||||
|
|
||||||
|
guac_client_data->mouse_button_mask = mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Otherwise, send mouse down event */
|
|
||||||
else
|
|
||||||
rdp_inst->rdp_send_input(rdp_inst, RDP_INPUT_MOUSE, PTRFLAGS_DOWN | PTRFLAGS_BUTTON1, x, y);
|
|
||||||
|
|
||||||
guac_client_data->mouse_button_mask = mask;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user