21#include <freerdp/config.h>
29#include <winpr/assert.h>
30#include <winpr/path.h>
32#include <freerdp/log.h>
33#include <freerdp/locale/keyboard.h>
37#include "xf_cliprdr.h"
41#include "xf_graphics.h"
47#define TAG CLIENT_TAG("x11")
49#define CLAMP_COORDINATES(x, y) \
58const char* x11_event_string(
int event)
72 return "ButtonRelease";
75 return "MotionNotify";
90 return "KeymapNotify";
96 return "GraphicsExpose";
101 case VisibilityNotify:
102 return "VisibilityNotify";
105 return "CreateNotify";
108 return "DestroyNotify";
111 return "UnmapNotify";
120 return "ReparentNotify";
122 case ConfigureNotify:
123 return "ConfigureNotify";
125 case ConfigureRequest:
126 return "ConfigureRequest";
129 return "GravityNotify";
132 return "ResizeRequest";
134 case CirculateNotify:
135 return "CirculateNotify";
137 case CirculateRequest:
138 return "CirculateRequest";
141 return "PropertyNotify";
144 return "SelectionClear";
146 case SelectionRequest:
147 return "SelectionRequest";
149 case SelectionNotify:
150 return "SelectionNotify";
153 return "ColormapNotify";
156 return "ClientMessage";
159 return "MappingNotify";
162 return "GenericEvent";
169static BOOL xf_action_script_append(xfContext* xfc,
const char* buffer,
size_t size,
170 WINPR_ATTR_UNUSED
void* user,
const char* what,
const char* arg)
176 if (buffer || (size == 0))
179 if (!ArrayList_Append(xfc->xevents, buffer))
181 ArrayList_Clear(xfc->xevents);
187BOOL xf_event_action_script_init(xfContext* xfc)
191 xf_event_action_script_free(xfc);
193 xfc->xevents = ArrayList_New(TRUE);
198 wObject* obj = ArrayList_Object(xfc->xevents);
200 obj->fnObjectNew = winpr_ObjectStringClone;
201 obj->fnObjectFree = winpr_ObjectStringFree;
203 return run_action_script(xfc,
"xevent", NULL, xf_action_script_append, NULL);
206void xf_event_action_script_free(xfContext* xfc)
210 ArrayList_Free(xfc->xevents);
215static BOOL action_script_run(xfContext* xfc,
const char* buffer,
size_t size,
void* user,
216 const char* what,
const char* arg)
226 WLog_WARN(TAG,
"ActionScript xevent: script did not return data");
230 if (winpr_PathFileExists(buffer))
234 winpr_asprintf(&cmd, &cmdlen,
"%s %s %s", buffer, what, arg);
238 FILE* fp = popen(cmd,
"w");
242 WLog_ERR(TAG,
"Failed to execute '%s'", buffer);
246 *pstatus = pclose(fp);
249 WLog_ERR(TAG,
"Command '%s' returned %d", buffer, *pstatus);
255 WLog_WARN(TAG,
"ActionScript xevent: No such file '%s'", buffer);
262static BOOL xf_event_execute_action_script(xfContext* xfc,
const XEvent* event)
267 const char* xeventName = NULL;
269 if (!xfc->actionScriptExists || !xfc->xevents || !xfc->window)
272 if (event->type > LASTEvent)
275 xeventName = x11_event_string(event->type);
276 count = ArrayList_Count(xfc->xevents);
278 for (
size_t index = 0; index < count; index++)
280 name = (
char*)ArrayList_GetItem(xfc->xevents, index);
282 if (_stricmp(name, xeventName) == 0)
292 char command[2048] = { 0 };
293 char arg[2048] = { 0 };
294 (void)_snprintf(command,
sizeof(command),
"xevent %s", xeventName);
295 (void)_snprintf(arg,
sizeof(arg),
"%lu", (
unsigned long)xfc->window->handle);
296 return run_action_script(xfc, command, arg, action_script_run, NULL);
299void xf_adjust_coordinates_to_screen(xfContext* xfc, UINT32* x, UINT32* y)
301 if (!xfc || !xfc->common.context.settings || !y || !x)
304 rdpSettings* settings = xfc->common.context.settings;
307 if (!xfc->remote_app)
311 if (xf_picture_transform_required(xfc))
315 double xScalingFactor = xfc->scaledWidth / dw;
316 double yScalingFactor = xfc->scaledHeight / dh;
317 tx = (INT64)lround((1.0 * (*x) + xfc->offset_x) * xScalingFactor);
318 ty = (INT64)lround((1.0 * (*y) + xfc->offset_y) * yScalingFactor);
324 CLAMP_COORDINATES(tx, ty);
329void xf_event_adjust_coordinates(xfContext* xfc,
int* x,
int* y)
331 if (!xfc || !xfc->common.context.settings || !y || !x)
334 if (!xfc->remote_app)
337 rdpSettings* settings = xfc->common.context.settings;
338 if (xf_picture_transform_required(xfc))
341 (double)xfc->scaledWidth;
343 (double)xfc->scaledHeight;
344 *x = (int)((*x - xfc->offset_x) * xScalingFactor);
345 *y = (int)((*y - xfc->offset_y) * yScalingFactor);
351 CLAMP_COORDINATES(*x, *y);
354static BOOL xf_event_Expose(xfContext* xfc,
const XExposeEvent* event, BOOL app)
360 rdpSettings* settings = NULL;
365 settings = xfc->common.context.settings;
366 WINPR_ASSERT(settings);
373 w = WINPR_ASSERTING_INT_CAST(
int,
375 h = WINPR_ASSERTING_INT_CAST(
int,
388 if (xfc->common.context.gdi->gfx)
391 xfc, WINPR_ASSERTING_INT_CAST(uint32_t, x), WINPR_ASSERTING_INT_CAST(uint32_t, y),
392 WINPR_ASSERTING_INT_CAST(uint32_t, w), WINPR_ASSERTING_INT_CAST(uint32_t, h));
395 xf_draw_screen(xfc, x, y, w, h);
399 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->window);
402 xf_UpdateWindowArea(xfc, appWindow, x, y, w, h);
409static BOOL xf_event_VisibilityNotify(xfContext* xfc,
const XVisibilityEvent* event, BOOL app)
412 xfc->unobscured =
event->state == VisibilityUnobscured;
416BOOL xf_generic_MotionNotify(xfContext* xfc,
int x,
int y, Window window, BOOL app)
418 Window childWindow = None;
421 WINPR_ASSERT(xfc->common.context.settings);
426 if (!xf_AppWindowFromX11Window(xfc, window))
430 XTranslateCoordinates(xfc->display, window, RootWindowOfScreen(xfc->screen), x, y, &x, &y,
434 xf_event_adjust_coordinates(xfc, &x, &y);
435 freerdp_client_send_button_event(&xfc->common, FALSE, PTR_FLAGS_MOVE, x, y);
437 if (xfc->fullscreen && !app)
440 XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, CurrentTime);
446BOOL xf_generic_RawMotionNotify(xfContext* xfc,
int x,
int y, WINPR_ATTR_UNUSED Window window,
453 WLog_ERR(TAG,
"Relative mouse input is not supported with remoate app mode!");
457 return freerdp_client_send_button_event(&xfc->common, TRUE, PTR_FLAGS_MOVE, x, y);
460static BOOL xf_event_MotionNotify(xfContext* xfc,
const XMotionEvent* event, BOOL app)
465 xf_floatbar_set_root_y(xfc->window->floatbar, event->y);
468 (xfc->common.mouse_grabbed && freerdp_client_use_relative_mouse_events(&xfc->common)))
471 return xf_generic_MotionNotify(xfc, event->x, event->y, event->window, app);
474BOOL xf_generic_ButtonEvent(xfContext* xfc,
int x,
int y,
int button, Window window, BOOL app,
478 Window childWindow = None;
484 for (
size_t i = 0; i < ARRAYSIZE(xfc->button_map); i++)
488 if (cur->button == (UINT32)button)
497 if (flags & (PTR_FLAGS_WHEEL | PTR_FLAGS_HWHEEL))
500 freerdp_client_send_wheel_event(&xfc->common, flags);
504 BOOL extended = FALSE;
506 if (flags & (PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_BUTTON2))
511 flags |= PTR_XFLAGS_DOWN;
513 else if (flags & (PTR_FLAGS_BUTTON1 | PTR_FLAGS_BUTTON2 | PTR_FLAGS_BUTTON3))
516 flags |= PTR_FLAGS_DOWN;
522 if (!xf_AppWindowFromX11Window(xfc, window))
526 XTranslateCoordinates(xfc->display, window, RootWindowOfScreen(xfc->screen), x, y,
527 &x, &y, &childWindow);
530 xf_event_adjust_coordinates(xfc, &x, &y);
533 freerdp_client_send_extended_button_event(&xfc->common, FALSE, flags, x, y);
535 freerdp_client_send_button_event(&xfc->common, FALSE, flags, x, y);
542static BOOL xf_grab_mouse(xfContext* xfc)
551 XGrabPointer(xfc->display, xfc->window->handle, False,
552 ButtonPressMask | ButtonReleaseMask | PointerMotionMask | FocusChangeMask |
553 EnterWindowMask | LeaveWindowMask,
554 GrabModeAsync, GrabModeAsync, xfc->window->handle, None, CurrentTime);
555 xfc->common.mouse_grabbed = TRUE;
560static BOOL xf_grab_kbd(xfContext* xfc)
567 XGrabKeyboard(xfc->display, xfc->window->handle, TRUE, GrabModeAsync, GrabModeAsync,
572static BOOL xf_event_ButtonPress(xfContext* xfc,
const XButtonEvent* event, BOOL app)
577 (xfc->common.mouse_grabbed && freerdp_client_use_relative_mouse_events(&xfc->common)))
579 return xf_generic_ButtonEvent(xfc, event->x, event->y,
580 WINPR_ASSERTING_INT_CAST(
int, event->button), event->window, app,
584static BOOL xf_event_ButtonRelease(xfContext* xfc,
const XButtonEvent* event, BOOL app)
589 (xfc->common.mouse_grabbed && freerdp_client_use_relative_mouse_events(&xfc->common)))
591 return xf_generic_ButtonEvent(xfc, event->x, event->y,
592 WINPR_ASSERTING_INT_CAST(
int, event->button), event->window, app,
596static BOOL xf_event_KeyPress(xfContext* xfc,
const XKeyEvent* event, BOOL app)
599 char str[256] = { 0 };
602 const XKeyEvent* cev;
607 XLookupString(cnv.ev, str,
sizeof(str), &keysym, NULL);
608 xf_keyboard_key_press(xfc, event, keysym);
612static BOOL xf_event_KeyRelease(xfContext* xfc,
const XKeyEvent* event, BOOL app)
615 char str[256] = { 0 };
618 const XKeyEvent* cev;
624 XLookupString(cnv.ev, str,
sizeof(str), &keysym, NULL);
625 xf_keyboard_key_release(xfc, event, keysym);
631static BOOL xf_event_KeyReleaseOrIgnore(xfContext* xfc,
const XKeyEvent* event, BOOL app)
636 if ((event->type == KeyRelease) && XEventsQueued(xfc->display, QueuedAfterReading))
639 XPeekEvent(xfc->display, &nev);
641 if ((nev.type == KeyPress) && (nev.xkey.time == event->time) &&
642 (nev.xkey.keycode == event->keycode))
649 return xf_event_KeyRelease(xfc, event, app);
652static BOOL xf_event_FocusIn(xfContext* xfc,
const XFocusInEvent* event, BOOL app)
654 if (event->mode == NotifyGrab)
659 if (xfc->mouse_active && !app)
662 if (!xf_grab_kbd(xfc))
669 xf_keyboard_release_all_keypress(xfc);
671 xf_rail_send_activate(xfc, event->window, TRUE);
673 xf_pointer_update_scale(xfc);
677 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->window);
682 xf_rail_adjust_position(xfc, appWindow);
685 xf_keyboard_focus_in(xfc);
689static BOOL xf_event_FocusOut(xfContext* xfc,
const XFocusOutEvent* event, BOOL app)
691 if (event->mode == NotifyUngrab)
694 xfc->focused = FALSE;
696 if (event->mode == NotifyWhileGrabbed)
697 XUngrabKeyboard(xfc->display, CurrentTime);
699 xf_keyboard_release_all_keypress(xfc);
701 xf_rail_send_activate(xfc, event->window, FALSE);
706static BOOL xf_event_MappingNotify(xfContext* xfc,
const XMappingEvent* event, BOOL app)
710 switch (event->request)
712 case MappingModifier:
713 return xf_keyboard_update_modifier_map(xfc);
714 case MappingKeyboard:
715 WLog_VRB(TAG,
"[%d] MappingKeyboard", event->request);
716 return xf_keyboard_init(xfc);
718 WLog_VRB(TAG,
"[%d] MappingPointer", event->request);
719 xf_button_map_init(xfc);
723 "[%d] Unsupported MappingNotify::request, must be one "
724 "of[MappingModifier(%d), MappingKeyboard(%d), MappingPointer(%d)]",
725 event->request, MappingModifier, MappingKeyboard, MappingPointer);
730static BOOL xf_event_ClientMessage(xfContext* xfc,
const XClientMessageEvent* event, BOOL app)
732 if ((event->message_type == xfc->WM_PROTOCOLS) &&
733 ((Atom)event->data.l[0] == xfc->WM_DELETE_WINDOW))
737 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->window);
740 return xf_rail_send_client_system_command(xfc, appWindow->windowId, SC_CLOSE);
746 DEBUG_X11(
"Main window closed");
754static BOOL xf_event_EnterNotify(xfContext* xfc,
const XEnterWindowEvent* event, BOOL app)
761 xfc->mouse_active = TRUE;
764 XSetInputFocus(xfc->display, xfc->window->handle, RevertToPointerRoot, CurrentTime);
771 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->window);
774 xfc->appWindow = appWindow;
780static BOOL xf_event_LeaveNotify(xfContext* xfc,
const XLeaveWindowEvent* event, BOOL app)
782 if (event->mode == NotifyGrab || event->mode == NotifyUngrab)
786 xfc->mouse_active = FALSE;
787 XUngrabKeyboard(xfc->display, CurrentTime);
791 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->window);
794 if (xfc->appWindow == appWindow)
795 xfc->appWindow = NULL;
800static BOOL xf_event_ConfigureNotify(xfContext* xfc,
const XConfigureEvent* event, BOOL app)
802 Window childWindow = None;
803 xfAppWindow* appWindow = NULL;
808 const rdpSettings* settings = xfc->common.context.settings;
809 WINPR_ASSERT(settings);
811 WLog_DBG(TAG,
"x=%" PRId32
", y=%" PRId32
", w=%" PRId32
", h=%" PRId32, event->x, event->y,
812 event->width, event->height);
819 if (xfc->window->left != event->x)
820 xfc->window->left =
event->x;
822 if (xfc->window->top != event->y)
823 xfc->window->top =
event->y;
825 if (xfc->window->width != event->width || xfc->window->height != event->height)
827 xfc->window->width =
event->width;
828 xfc->window->height =
event->height;
836 xfc->scaledWidth = xfc->window->width;
837 xfc->scaledHeight = xfc->window->height;
840 WINPR_ASSERTING_INT_CAST(
842 WINPR_ASSERTING_INT_CAST(
847 xfc->scaledWidth = WINPR_ASSERTING_INT_CAST(
849 xfc->scaledHeight = WINPR_ASSERTING_INT_CAST(
858 int alignedWidth = 0;
859 int alignedHeight = 0;
860 alignedWidth = (xfc->window->width / 2) * 2;
861 alignedHeight = (xfc->window->height / 2) * 2;
863 xf_disp_handle_configureNotify(xfc, alignedWidth, alignedHeight);
868 appWindow = xf_AppWindowFromX11Window(xfc, event->window);
876 XTranslateCoordinates(xfc->display, appWindow->handle, RootWindowOfScreen(xfc->screen),
877 0, 0, &appWindow->x, &appWindow->y, &childWindow);
878 appWindow->width =
event->width;
879 appWindow->height =
event->height;
881 xf_AppWindowResize(xfc, appWindow);
889 if (appWindow->decorations)
892 xf_rail_adjust_position(xfc, appWindow);
896 if ((!event->send_event || appWindow->local_move.state == LMS_NOT_ACTIVE) &&
897 !appWindow->rail_ignore_configure && xfc->focused)
898 xf_rail_adjust_position(xfc, appWindow);
902 return xf_pointer_update_scale(xfc);
905static BOOL xf_event_MapNotify(xfContext* xfc,
const XMapEvent* event, BOOL app)
909 gdi_send_suppress_output(xfc->common.context.gdi, FALSE);
912 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->window);
922 appWindow->is_mapped = TRUE;
929static BOOL xf_event_UnmapNotify(xfContext* xfc,
const XUnmapEvent* event, BOOL app)
935 xf_keyboard_release_all_keypress(xfc);
938 gdi_send_suppress_output(xfc->common.context.gdi, TRUE);
941 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->window);
944 appWindow->is_mapped = FALSE;
950static BOOL xf_event_PropertyNotify(xfContext* xfc,
const XPropertyEvent* event, BOOL app)
960 if (((event->atom == xfc->NET_WM_STATE) && (event->state != PropertyDelete)) ||
961 ((event->atom == xfc->WM_STATE) && (event->state != PropertyDelete)))
964 BOOL minimized = FALSE;
965 BOOL minimizedChanged = FALSE;
966 unsigned long nitems = 0;
967 unsigned long bytes = 0;
968 unsigned char* prop = NULL;
969 xfAppWindow* appWindow = NULL;
973 appWindow = xf_AppWindowFromX11Window(xfc, event->window);
979 if (event->atom == xfc->NET_WM_STATE)
981 status = xf_GetWindowProperty(xfc, event->window, xfc->NET_WM_STATE, 12, &nitems,
988 appWindow->maxVert = FALSE;
989 appWindow->maxHorz = FALSE;
991 for (
unsigned long i = 0; i < nitems; i++)
993 if ((Atom)((UINT16**)prop)[i] ==
994 Logging_XInternAtom(xfc->log, xfc->display,
"_NET_WM_STATE_MAXIMIZED_VERT",
998 appWindow->maxVert = TRUE;
1001 if ((Atom)((UINT16**)prop)[i] ==
1002 Logging_XInternAtom(xfc->log, xfc->display,
"_NET_WM_STATE_MAXIMIZED_HORZ",
1006 appWindow->maxHorz = TRUE;
1014 if (event->atom == xfc->WM_STATE)
1017 xf_GetWindowProperty(xfc, event->window, xfc->WM_STATE, 1, &nitems, &bytes, &prop);
1022 if (((UINT32)*prop == 3) && !IsGnome())
1026 appWindow->minimized = TRUE;
1032 appWindow->minimized = FALSE;
1035 minimizedChanged = TRUE;
1042 WINPR_ASSERT(appWindow);
1043 if (appWindow->maxVert && appWindow->maxHorz && !appWindow->minimized)
1045 if (appWindow->rail_state != WINDOW_SHOW_MAXIMIZED)
1047 appWindow->rail_state = WINDOW_SHOW_MAXIMIZED;
1048 return xf_rail_send_client_system_command(xfc, appWindow->windowId,
1052 else if (appWindow->minimized)
1054 if (appWindow->rail_state != WINDOW_SHOW_MINIMIZED)
1056 appWindow->rail_state = WINDOW_SHOW_MINIMIZED;
1057 return xf_rail_send_client_system_command(xfc, appWindow->windowId,
1063 if (appWindow->rail_state != WINDOW_SHOW && appWindow->rail_state != WINDOW_HIDE)
1065 appWindow->rail_state = WINDOW_SHOW;
1066 return xf_rail_send_client_system_command(xfc, appWindow->windowId, SC_RESTORE);
1070 else if (minimizedChanged)
1071 gdi_send_suppress_output(xfc->common.context.gdi, minimized);
1077static BOOL xf_event_suppress_events(xfContext* xfc, xfAppWindow* appWindow,
const XEvent* event)
1079 if (!xfc->remote_app)
1082 switch (appWindow->local_move.state)
1084 case LMS_NOT_ACTIVE:
1090 if ((event->type == ConfigureNotify) && appWindow->rail_ignore_configure)
1092 appWindow->rail_ignore_configure = FALSE;
1102 switch (event->type)
1104 case ConfigureNotify:
1107 appWindow->local_move.state = LMS_ACTIVE;
1124 case VisibilityNotify:
1125 case PropertyNotify:
1140 switch (event->type)
1142 case ConfigureNotify:
1143 case VisibilityNotify:
1144 case PropertyNotify:
1152 xf_rail_end_local_move(xfc, appWindow);
1158 case LMS_TERMINATING:
1168BOOL xf_event_process(freerdp* instance,
const XEvent* event)
1172 WINPR_ASSERT(instance);
1173 WINPR_ASSERT(event);
1175 xfContext* xfc = (xfContext*)instance->context;
1178 rdpSettings* settings = xfc->common.context.settings;
1179 WINPR_ASSERT(settings);
1181 if (xfc->remote_app)
1183 xfAppWindow* appWindow = xf_AppWindowFromX11Window(xfc, event->xany.window);
1188 xfc->appWindow = appWindow;
1190 if (xf_event_suppress_events(xfc, appWindow, event))
1197 xfFloatbar* floatbar = xfc->window->floatbar;
1198 if (xf_floatbar_check_event(floatbar, event))
1200 xf_floatbar_event_process(floatbar, event);
1204 if (xf_floatbar_is_locked(floatbar))
1207 switch (event->type)
1225 xf_event_execute_action_script(xfc, event);
1227 if (event->type != MotionNotify)
1229 DEBUG_X11(
"%s Event(%d): wnd=0x%08lX", x11_event_string(event->type), event->type,
1230 (
unsigned long)event->xany.window);
1233 switch (event->type)
1236 status = xf_event_Expose(xfc, &event->xexpose, xfc->remote_app);
1239 case VisibilityNotify:
1240 status = xf_event_VisibilityNotify(xfc, &event->xvisibility, xfc->remote_app);
1244 status = xf_event_MotionNotify(xfc, &event->xmotion, xfc->remote_app);
1248 status = xf_event_ButtonPress(xfc, &event->xbutton, xfc->remote_app);
1252 status = xf_event_ButtonRelease(xfc, &event->xbutton, xfc->remote_app);
1256 status = xf_event_KeyPress(xfc, &event->xkey, xfc->remote_app);
1260 status = xf_event_KeyReleaseOrIgnore(xfc, &event->xkey, xfc->remote_app);
1264 status = xf_event_FocusIn(xfc, &event->xfocus, xfc->remote_app);
1268 status = xf_event_FocusOut(xfc, &event->xfocus, xfc->remote_app);
1272 status = xf_event_EnterNotify(xfc, &event->xcrossing, xfc->remote_app);
1276 status = xf_event_LeaveNotify(xfc, &event->xcrossing, xfc->remote_app);
1282 case GraphicsExpose:
1285 case ConfigureNotify:
1286 status = xf_event_ConfigureNotify(xfc, &event->xconfigure, xfc->remote_app);
1290 status = xf_event_MapNotify(xfc, &event->xmap, xfc->remote_app);
1294 status = xf_event_UnmapNotify(xfc, &event->xunmap, xfc->remote_app);
1297 case ReparentNotify:
1301 status = xf_event_MappingNotify(xfc, &event->xmapping, xfc->remote_app);
1305 status = xf_event_ClientMessage(xfc, &event->xclient, xfc->remote_app);
1308 case PropertyNotify:
1309 status = xf_event_PropertyNotify(xfc, &event->xproperty, xfc->remote_app);
1314 xf_disp_handle_xevent(xfc, event);
1319 xfWindow* window = xfc->window;
1320 xfFloatbar* floatbar = NULL;
1322 floatbar = window->floatbar;
1324 xf_cliprdr_handle_xevent(xfc, event);
1325 if (!xf_floatbar_check_event(floatbar, event) && !xf_floatbar_is_locked(floatbar))
1326 xf_input_handle_event(xfc, event);
1328 LogDynAndXSync(xfc->log, xfc->display, FALSE);
1332BOOL xf_generic_RawButtonEvent(xfContext* xfc,
int button, BOOL app, BOOL down)
1336 if (app || (button < 0))
1339 for (
size_t i = 0; i < ARRAYSIZE(xfc->button_map); i++)
1343 if (cur->button == (UINT32)button)
1352 if (flags & (PTR_FLAGS_WHEEL | PTR_FLAGS_HWHEEL))
1355 freerdp_client_send_wheel_event(&xfc->common, flags);
1359 BOOL extended = FALSE;
1361 if (flags & (PTR_XFLAGS_BUTTON1 | PTR_XFLAGS_BUTTON2))
1366 flags |= PTR_XFLAGS_DOWN;
1368 else if (flags & (PTR_FLAGS_BUTTON1 | PTR_FLAGS_BUTTON2 | PTR_FLAGS_BUTTON3))
1371 flags |= PTR_FLAGS_DOWN;
1375 freerdp_client_send_extended_button_event(&xfc->common, TRUE, flags, 0, 0);
1377 freerdp_client_send_button_event(&xfc->common, TRUE, flags, 0, 0);
FREERDP_API UINT32 freerdp_settings_get_uint32(const rdpSettings *settings, FreeRDP_Settings_Keys_UInt32 id)
Returns a UINT32 settings value.
FREERDP_API BOOL freerdp_settings_get_bool(const rdpSettings *settings, FreeRDP_Settings_Keys_Bool id)
Returns a boolean settings value.
This struct contains function pointer to initialize/free objects.