xfreerdp-client: proper scaling of input

This commit is contained in:
C-o-r-E 2013-05-04 16:29:22 -04:00
parent 85b057e643
commit 05bd5e9907

View File

@ -151,6 +151,13 @@ static BOOL xf_event_MotionNotify(xfInfo* xfi, XEvent* event, BOOL app)
RootWindowOfScreen(xfi->screen),
x, y, &x, &y, &childWindow);
}
/* Take scaling in to consideration */
if(xfi->scale != 1.0)
{
x = (int)(x * (1.0 / xfi->scale) );
y = (int)(y * (1.0 / xfi->scale) );
}
input->MouseEvent(input, PTR_FLAGS_MOVE, x, y);
@ -253,8 +260,16 @@ static BOOL xf_event_ButtonPress(xfInfo* xfi, XEvent* event, BOOL app)
XTranslateCoordinates(xfi->display, event->xbutton.window,
RootWindowOfScreen(xfi->screen),
x, y, &x, &y, &childWindow);
}
/* Take scaling in to consideration */
if(xfi->scale != 1.0)
{
x = (int)(x * (1.0 / xfi->scale) );
y = (int)(y * (1.0 / xfi->scale) );
}
if (extended)
input->ExtendedMouseEvent(input, flags, x, y);
else
@ -338,6 +353,13 @@ static BOOL xf_event_ButtonRelease(xfInfo* xfi, XEvent* event, BOOL app)
x, y, &x, &y, &childWindow);
}
/* Take scaling in to consideration */
if(xfi->scale != 1.0)
{
x = (int)(x * (1.0 / xfi->scale) );
y = (int)(y * (1.0 / xfi->scale) );
}
if (extended)
input->ExtendedMouseEvent(input, flags, x, y);
else