xfreerdp: RemoteApp Local Move/Size improvements.

Issues:
fast mouse moving after left button pressing is create "windows shake" effect.
Slow mouse speed after left button press allows to discard this effect.
This commit is contained in:
roman-b 2011-09-03 23:38:01 +03:00
parent 69b4b0318c
commit 14ce6ae7f0
4 changed files with 40 additions and 13 deletions

View File

@ -148,7 +148,8 @@ boolean xf_event_MotionNotify(xfInfo* xfi, XEvent* event, boolean app)
x += xfw->left;
y += xfw->top;
input->MouseEvent(input, PTR_FLAGS_MOVE, x, y);
if (!xfw->isLocalMoveSizeModeEnabled)
input->MouseEvent(input, PTR_FLAGS_MOVE, x, y);
}
}
@ -430,13 +431,31 @@ boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app)
xfWindow* xfw;
xfw = (xfWindow*) window->extra;
if (xfw->isLocalMoveSizeModeEnabled)
DEBUG_X11_LMS("ConfigureNotify: send_event=%d eventWindow=0x%X window=0x%X above=0x%X rc={l=%d t=%d r=%d b=%d} "
"w=%d h=%d override_redirect=%d",
event->xconfigure.send_event,
(uint32)event->xconfigure.event,
(uint32)event->xconfigure.window,
(uint32)event->xconfigure.above,
event->xconfigure.x,
event->xconfigure.y,
event->xconfigure.x + event->xconfigure.width - 1,
event->xconfigure.y + event->xconfigure.height - 1,
event->xconfigure.width,
event->xconfigure.height,
event->xconfigure.override_redirect);
if (xfw->isLocalMoveSizeModeEnabled && event->xconfigure.above != 0)
{
uint32 left = event->xconfigure.x;
uint32 top = event->xconfigure.y;
uint32 right = event->xconfigure.y + event->xconfigure.width - 1;
uint32 right = event->xconfigure.x + event->xconfigure.width;
uint32 bottom = event->xconfigure.y + event->xconfigure.height - 1;
DEBUG_X11_LMS("MoveSendToServer: windowId=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d \n",
(uint32)xfw->handle, left, top, right, bottom, event->xconfigure.width,
event->xconfigure.height);
xf_rail_send_windowmove(xfi, window->windowId, left, top, right, bottom);
}

View File

@ -333,7 +333,7 @@ void xf_process_rail_server_minmaxinfo_event(xfInfo* xfi, rdpChanMan* chanman, R
xfWindow * window = NULL;
window = (xfWindow *) rail_window->extra;
DEBUG_X11("windowId=0x%X maxWidth=%d maxHeight=%d maxPosX=%d maxPosY=%d "
DEBUG_X11_LMS("windowId=0x%X maxWidth=%d maxHeight=%d maxPosX=%d maxPosY=%d "
"minTrackWidth=%d minTrackHeight=%d maxTrackWidth=%d maxTrackHeight=%d",
minmax->windowId, minmax->maxWidth, minmax->maxHeight,
(sint16)minmax->maxPosX, (sint16)minmax->maxPosY,
@ -373,11 +373,11 @@ void xf_process_rail_server_localmovesize_event(xfInfo* xfi, rdpChanMan* chanman
xfWindow * window = NULL;
window = (xfWindow *) rail_window->extra;
DEBUG_X11("windowId=0x%X isMoveSizeStart=%d moveSizeType=%s PosX=%d PosY=%d",
DEBUG_X11_LMS("windowId=0x%X isMoveSizeStart=%d moveSizeType=%s PosX=%d PosY=%d",
movesize->windowId, movesize->isMoveSizeStart,
movetype_names[movesize->moveSizeType], (sint16)movesize->posX, (sint16)movesize->posY);
#if 0
#ifdef WITH_DEBUG_X11_LOCAL_MOVESIZE
if (movesize->isMoveSizeStart)
xf_StartLocalMoveSize(xfi, window, movesize->moveSizeType, (int) movesize->posX, (int) movesize->posY);
else

View File

@ -367,7 +367,7 @@ void xf_SetWindowMinMaxInfo(xfInfo* xfi, xfWindow* window,
size_hints->max_height = maxTrackHeight;
/* to speedup window drawing we need to select optimal value for sizing step. */
size_hints->width_inc = size_hints->height_inc = 5;
size_hints->width_inc = size_hints->height_inc = 1;
XSetWMNormalHints(xfi->display, window->handle, size_hints);
XFree(size_hints);
@ -473,10 +473,7 @@ void xf_StopLocalMoveSize(xfInfo* xfi, xfWindow* window, uint16 moveSizeType, in
{
window->isLocalMoveSizeModeEnabled = False;
if (moveSizeType == RAIL_WMSZ_MOVE)
{
xf_MoveWindow(xfi, window, topLeftX, topLeftY, window->width, window->height);
}
xf_MoveWindow(xfi, window, topLeftX, topLeftY, window->width, window->height);
}
void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height)
@ -486,8 +483,8 @@ void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int h
if ((width * height) < 1)
return;
if (window->isLocalMoveSizeModeEnabled)
return;
DEBUG_X11_LMS("xf_MoveWindow: BEFORE correctness h=0x%X x=%d y=%d w=%d h=%d",
(uint32) window->handle, x, y, width, height);
xf_FixWindowCoordinates(xfi, &x, &y, &width, &height);
@ -504,6 +501,10 @@ void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int h
window->bottom = y + height - 1;
window->width = width;
window->height = height;
DEBUG_X11_LMS("xf_MoveWindow: window=0x%X rc={l=%d t=%d r=%d b=%d} w=%d h=%d",
(uint32)window->handle, window->left, window->top, window->right, window->bottom,
window->width, window->height);
}
void xf_ShowWindow(xfInfo* xfi, xfWindow* window, uint8 state)

View File

@ -116,4 +116,11 @@ void xf_toggle_fullscreen(xfInfo* xfi);
#define DEBUG_X11(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#endif
#ifdef WITH_DEBUG_X11_LOCAL_MOVESIZE
#define DEBUG_X11_LMS(fmt, ...) DEBUG_CLASS(X11_LMS, fmt, ## __VA_ARGS__)
#else
#define DEBUG_X11_LMS(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
#endif
#endif /* __XFREERDP_H */