mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[client,x11] log mouse event types and call stack
This commit is contained in:
@@ -55,6 +55,8 @@
|
||||
(y) = 0; \
|
||||
} while (0)
|
||||
|
||||
static const DWORD mouseLogLevel = WLOG_TRACE;
|
||||
|
||||
const char* x11_event_string(int event)
|
||||
{
|
||||
switch (event)
|
||||
@@ -425,10 +427,16 @@ static BOOL xf_event_VisibilityNotify(xfContext* xfc, const XVisibilityEvent* ev
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, Window window, BOOL app)
|
||||
BOOL xf_generic_MotionNotify_(xfContext* xfc, int x, int y, Window window, BOOL app,
|
||||
const char* file, const char* fkt, size_t line)
|
||||
{
|
||||
Window childWindow = None;
|
||||
|
||||
if (WLog_IsLevelActive(xfc->log, mouseLogLevel))
|
||||
WLog_PrintTextMessage(xfc->log, mouseLogLevel, line, file, fkt,
|
||||
"%s: x=%d, y=%d, window=0x%08lx, app=%d", __func__, x, y, window,
|
||||
app);
|
||||
|
||||
WINPR_ASSERT(xfc);
|
||||
WINPR_ASSERT(xfc->common.context.settings);
|
||||
|
||||
@@ -455,11 +463,16 @@ BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, Window window, BOOL a
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL xf_generic_RawMotionNotify(xfContext* xfc, int x, int y, WINPR_ATTR_UNUSED Window window,
|
||||
BOOL app)
|
||||
BOOL xf_generic_RawMotionNotify_(xfContext* xfc, int x, int y, WINPR_ATTR_UNUSED Window window,
|
||||
BOOL app, const char* file, const char* fkt, size_t line)
|
||||
{
|
||||
WINPR_ASSERT(xfc);
|
||||
|
||||
if (WLog_IsLevelActive(xfc->log, mouseLogLevel))
|
||||
WLog_PrintTextMessage(xfc->log, mouseLogLevel, line, file, fkt,
|
||||
"%s: x=%d, y=%d, window=0x%08lx, app=%d", __func__, x, y, window,
|
||||
app);
|
||||
|
||||
if (app)
|
||||
{
|
||||
WLog_ERR(TAG, "Relative mouse input is not supported with remoate app mode!");
|
||||
@@ -483,12 +496,17 @@ static BOOL xf_event_MotionNotify(xfContext* xfc, const XMotionEvent* event, BOO
|
||||
return xf_generic_MotionNotify(xfc, event->x, event->y, event->window, app);
|
||||
}
|
||||
|
||||
BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, Window window, BOOL app,
|
||||
BOOL down)
|
||||
BOOL xf_generic_ButtonEvent_(xfContext* xfc, int x, int y, int button, Window window, BOOL app,
|
||||
BOOL down, const char* file, const char* fkt, size_t line)
|
||||
{
|
||||
UINT16 flags = 0;
|
||||
Window childWindow = None;
|
||||
|
||||
if (WLog_IsLevelActive(xfc->log, mouseLogLevel))
|
||||
WLog_PrintTextMessage(xfc->log, mouseLogLevel, line, file, fkt,
|
||||
"%s: x=%d, y=%d, button=%d, window=0x%08lx, app=%d, down=%d",
|
||||
__func__, x, y, button, window, app, down);
|
||||
|
||||
WINPR_ASSERT(xfc);
|
||||
if (button < 0)
|
||||
return FALSE;
|
||||
@@ -1343,10 +1361,15 @@ BOOL xf_event_process(freerdp* instance, const XEvent* event)
|
||||
return status;
|
||||
}
|
||||
|
||||
BOOL xf_generic_RawButtonEvent(xfContext* xfc, int button, BOOL app, BOOL down)
|
||||
BOOL xf_generic_RawButtonEvent_(xfContext* xfc, int button, BOOL app, BOOL down, const char* file,
|
||||
const char* fkt, size_t line)
|
||||
{
|
||||
UINT16 flags = 0;
|
||||
|
||||
if (WLog_IsLevelActive(xfc->log, mouseLogLevel))
|
||||
WLog_PrintTextMessage(xfc->log, mouseLogLevel, line, file, fkt,
|
||||
"%s: button=%d, app=%d, down=%d", __func__, button, app, down);
|
||||
|
||||
if (app || (button < 0))
|
||||
return FALSE;
|
||||
|
||||
|
||||
@@ -37,10 +37,25 @@ void xf_event_SendClientEvent(xfContext* xfc, xfWindow* window, Atom atom, unsig
|
||||
void xf_event_adjust_coordinates(xfContext* xfc, int* x, int* y);
|
||||
void xf_adjust_coordinates_to_screen(xfContext* xfc, UINT32* x, UINT32* y);
|
||||
|
||||
BOOL xf_generic_MotionNotify(xfContext* xfc, int x, int y, Window window, BOOL app);
|
||||
BOOL xf_generic_RawMotionNotify(xfContext* xfc, int x, int y, Window window, BOOL app);
|
||||
BOOL xf_generic_ButtonEvent(xfContext* xfc, int x, int y, int button, Window window, BOOL app,
|
||||
BOOL down);
|
||||
BOOL xf_generic_RawButtonEvent(xfContext* xfc, int button, BOOL app, BOOL down);
|
||||
#define xf_generic_MotionNotify(xfc, x, y, window, app) \
|
||||
xf_generic_MotionNotify_((xfc), (x), (y), (window), (app), __FILE__, __func__, __LINE__)
|
||||
BOOL xf_generic_MotionNotify_(xfContext* xfc, int x, int y, Window window, BOOL app,
|
||||
const char* file, const char* fkt, size_t line);
|
||||
|
||||
#define xf_generic_RawMotionNotify(xfc, x, y, window, app) \
|
||||
xf_generic_RawMotionNotify_((xfc), (x), (y), (window), (app), __FILE__, __func__, __LINE__)
|
||||
BOOL xf_generic_RawMotionNotify_(xfContext* xfc, int x, int y, Window window, BOOL app,
|
||||
const char* file, const char* fkt, size_t line);
|
||||
|
||||
#define xf_generic_ButtonEvent(xfc, x, y, button, window, app, down) \
|
||||
xf_generic_ButtonEvent_((xfc), (x), (y), (button), (window), (app), (down), __FILE__, \
|
||||
__func__, __LINE__)
|
||||
BOOL xf_generic_ButtonEvent_(xfContext* xfc, int x, int y, int button, Window window, BOOL app,
|
||||
BOOL down, const char* file, const char* fkt, size_t line);
|
||||
|
||||
#define xf_generic_RawButtonEvent(xfc, button, app, down) \
|
||||
xf_generic_RawButtonEvent_((xfc), (button), (app), (down), __FILE__, __func__, __LINE__)
|
||||
BOOL xf_generic_RawButtonEvent_(xfContext* xfc, int button, BOOL app, BOOL down, const char* file,
|
||||
const char* fkt, size_t line);
|
||||
|
||||
#endif /* FREERDP_CLIENT_X11_EVENT_H */
|
||||
|
||||
Reference in New Issue
Block a user