diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2021-10-15 16:53:40 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2021-10-15 16:53:40 +0300 |
commit | 8b91512d8dd319dfae0a656895adf559103161b6 (patch) | |
tree | 9a49bd9e11b6f6b2786a63673fcf8eebfcddfb2a /debian/patches/0015-Fix-xf_Pointer_SetPosition-with-smart-sizing.patch | |
parent | 06e0b55ddb9c92b0f4268866875be1fe0eddebd6 (diff) |
Align to Debian/FreeRDP
Diffstat (limited to 'debian/patches/0015-Fix-xf_Pointer_SetPosition-with-smart-sizing.patch')
-rw-r--r-- | debian/patches/0015-Fix-xf_Pointer_SetPosition-with-smart-sizing.patch | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/debian/patches/0015-Fix-xf_Pointer_SetPosition-with-smart-sizing.patch b/debian/patches/0015-Fix-xf_Pointer_SetPosition-with-smart-sizing.patch new file mode 100644 index 0000000..506e940 --- /dev/null +++ b/debian/patches/0015-Fix-xf_Pointer_SetPosition-with-smart-sizing.patch @@ -0,0 +1,99 @@ +From 899be1b564ac4f4803de5b81e0711821403d9ed1 Mon Sep 17 00:00:00 2001 +From: akallabeth <akallabeth@posteo.net> +Date: Mon, 8 Mar 2021 13:52:29 +0100 +Subject: [PATCH 15/36] Fix xf_Pointer_SetPosition with smart-sizing + +(cherry picked from commit d3e3ab7b5d5ce376ba72fa1fc0aee2f25c9682b4) +--- + client/X11/xf_event.c | 31 +++++++++++++++++++++++++++++++ + client/X11/xf_event.h | 1 + + client/X11/xf_graphics.c | 5 ++++- + 3 files changed, 36 insertions(+), 1 deletion(-) + +diff --git a/client/X11/xf_event.c b/client/X11/xf_event.c +index 60fe9c6b3..99577b1a1 100644 +--- a/client/X11/xf_event.c ++++ b/client/X11/xf_event.c +@@ -262,6 +262,37 @@ static BOOL xf_event_execute_action_script(xfContext* xfc, const XEvent* event) + return TRUE; + } + ++void xf_adjust_coordinates_to_screen(xfContext* xfc, UINT32* x, UINT32* y) ++{ ++ rdpSettings* settings; ++ INT64 tx, ty; ++ ++ if (!xfc || !xfc->context.settings || !y || !x) ++ return; ++ ++ settings = xfc->context.settings; ++ tx = *x; ++ ty = *y; ++ if (!xfc->remote_app) ++ { ++#ifdef WITH_XRENDER ++ ++ if (xf_picture_transform_required(xfc)) ++ { ++ double xScalingFactor = xfc->scaledWidth / (double)settings->DesktopWidth; ++ double yScalingFactor = xfc->scaledHeight / (double)settings->DesktopHeight; ++ tx = ((tx + xfc->offset_x) * xScalingFactor); ++ ty = ((ty + xfc->offset_y) * yScalingFactor); ++ } ++ ++#endif ++ } ++ ++ CLAMP_COORDINATES(tx, ty); ++ *x = tx; ++ *y = ty; ++} ++ + void xf_event_adjust_coordinates(xfContext* xfc, int* x, int* y) + { + rdpSettings* settings; +diff --git a/client/X11/xf_event.h b/client/X11/xf_event.h +index 185c83c7c..2269d3eea 100644 +--- a/client/X11/xf_event.h ++++ b/client/X11/xf_event.h +@@ -33,6 +33,7 @@ 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, int state, Window window, BOOL app); + BOOL xf_generic_ButtonPress(xfContext* xfc, int x, int y, int button, Window window, BOOL app); +diff --git a/client/X11/xf_graphics.c b/client/X11/xf_graphics.c +index 54a4b9cc7..1700092f8 100644 +--- a/client/X11/xf_graphics.c ++++ b/client/X11/xf_graphics.c +@@ -37,6 +37,7 @@ + + #include "xf_graphics.h" + #include "xf_gdi.h" ++#include "xf_event.h" + + #include <freerdp/log.h> + #define TAG CLIENT_TAG("x11") +@@ -521,6 +522,8 @@ static BOOL xf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y) + if (xfc->remote_app && !xfc->focused) + return TRUE; + ++ xf_adjust_coordinates_to_screen(xfc, &x, &y); ++ + xf_lock_x11(xfc); + + rc = XGetWindowAttributes(xfc->display, handle, ¤t); +@@ -541,7 +544,7 @@ static BOOL xf_Pointer_SetPosition(rdpContext* context, UINT32 x, UINT32 y) + + rc = XWarpPointer(xfc->display, None, handle, 0, 0, 0, 0, x, y); + if (rc == 0) +- WLog_WARN(TAG, "xf_Pointer_SetPosition: XWrapPointer==%d", rc); ++ WLog_WARN(TAG, "xf_Pointer_SetPosition: XWarpPointer==%d", rc); + tmp.event_mask = current.your_event_mask; + rc = XChangeWindowAttributes(xfc->display, handle, CWEventMask, &tmp); + if (rc == 0) +-- +2.30.2 + |