Merge pull request #264 from sunds/master

fixes to rail drawing issues
This commit is contained in:
Marc-André Moreau 2011-12-09 12:46:35 -08:00
commit 0d6be282ee
3 changed files with 23 additions and 23 deletions

View File

@ -454,7 +454,8 @@ boolean xf_event_ConfigureNotify(xfInfo* xfi, XEvent* event, boolean app)
// ConfigureNotify coordinates are expressed relative to the window parent.
// Translate these to root window coordinates.
Window childWindow;
XTranslateCoordinates(xfi->display, xfw->handle, DefaultRootWindow(xfi->display),
XTranslateCoordinates(xfi->display, xfw->handle,
RootWindowOfScreen(xfi->screen),
0, 0, &xfw->left, &xfw->top, &childWindow);
xfw->width = event->xconfigure.width;
@ -593,8 +594,9 @@ boolean xf_event_suppress_events(xfInfo *xfi, rdpWindow *window, XEvent*event)
break;
case VisibilityNotify:
case PropertyNotify:
case Expose:
// Allow these events to pass
return false;
break;
default:
// Eat any other events
return true;
@ -608,10 +610,9 @@ boolean xf_event_suppress_events(xfInfo *xfi, rdpWindow *window, XEvent*event)
case ConfigureNotify:
case VisibilityNotify:
case PropertyNotify:
case Expose:
// Keep us up to date on position
break;
case Expose:
return true;
default:
// Any other event terminates move
xf_rail_end_local_move(xfi, window);

View File

@ -262,14 +262,6 @@ void xf_rail_adjust_position(xfInfo* xfi, rdpWindow *window)
if (! xfw->is_mapped || xfw->local_move.state != LMS_NOT_ACTIVE)
return;
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u"
" RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
(uint32) xfw->handle, xfw->left, xfw->top,
xfw->right, xfw->bottom, xfw->width, xfw->height,
window->windowId,
window->windowOffsetX, window->windowOffsetY,
window->windowWidth, window->windowHeight);
// If current window position disagrees with RDP window position, send
// update to RDP server
if ( xfw->left != window->windowOffsetX ||
@ -283,6 +275,14 @@ void xf_rail_adjust_position(xfInfo* xfi, rdpWindow *window)
window_move.right = xfw->right;
window_move.bottom = xfw->bottom;
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d} w=%u h=%u"
" RDP=0x%X rc={l=%d t=%d} w=%d h=%d",
(uint32) xfw->handle, xfw->left, xfw->top,
xfw->right, xfw->bottom, xfw->width, xfw->height,
window->windowId,
window->windowOffsetX, window->windowOffsetY,
window->windowWidth, window->windowHeight);
xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &window_move);
}
}
@ -306,7 +306,7 @@ void xf_rail_end_local_move(xfInfo* xfi, rdpWindow *window)
window_move.right = xfw->right + 1; // In the update to RDP the position is one past the window
window_move.bottom = xfw->bottom + 1;
DEBUG_X11_LMS("ClientWindowMove: window=0x%X rc={l=%d t=%d r=%d b=%d}",
DEBUG_X11_LMS("window=0x%X rc={l=%d t=%d r=%d b=%d}",
(uint32) xfw->handle, xfw->left, xfw->top, xfw->right, xfw->bottom);
xf_send_rail_client_event(channels, RDP_EVENT_TYPE_RAIL_CLIENT_WINDOW_MOVE, &window_move);
@ -487,7 +487,8 @@ void xf_process_rail_server_localmovesize_event(xfInfo* xfi, rdpChannels* channe
break;
case RAIL_WMSZ_MOVE: //0x9
direction = _NET_WM_MOVERESIZE_MOVE;
XTranslateCoordinates(xfi->display, xfw->handle, DefaultRootWindow(xfi->display),
XTranslateCoordinates(xfi->display, xfw->handle,
RootWindowOfScreen(xfi->screen),
movesize->posX, movesize->posY, &x, &y, &child_window);
break;
case RAIL_WMSZ_KEYMOVE: //0xA
@ -506,8 +507,6 @@ void xf_process_rail_server_localmovesize_event(xfInfo* xfi, rdpChannels* channe
{
xf_StartLocalMoveSize(xfi, xfw, direction, x, y);
} else {
xf_MoveWindow(xfi, xfw, movesize->posX, movesize->posY,
xfw->width, xfw->height);
xf_EndLocalMoveSize(xfi, xfw, false);
}
}

View File

@ -97,7 +97,7 @@ void xf_SendClientEvent(xfInfo *xfi, xfWindow* window, Atom atom, unsigned int n
}
DEBUG_X11("Send ClientMessage Event: wnd=0x%04X", (unsigned int) xevent.xclient.window);
XSendEvent(xfi->display, DefaultRootWindow(xfi->display), False,
XSendEvent(xfi->display, RootWindowOfScreen(xfi->screen), False,
SubstructureRedirectMask | SubstructureNotifyMask, &xevent);
XSync(xfi->display, False);
@ -237,6 +237,7 @@ void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, uint32 style, uint32 ex_st
attrs.override_redirect = True;
XChangeWindowAttributes(xfi->display, window->handle, CWOverrideRedirect, &attrs);
window->is_transient = true;
xf_SetWindowUnlisted(xfi, window);
window_type = xfi->_NET_WM_WINDOW_TYPE_POPUP;
}
@ -245,6 +246,7 @@ void xf_SetWindowStyle(xfInfo* xfi, xfWindow* window, uint32 style, uint32 ex_st
// This includes dialogs, popups, etc, that need to be
// full-fledged windows
window_type = xfi->_NET_WM_WINDOW_TYPE_DIALOG;
xf_SetWindowUnlisted(xfi, window);
}
else
{
@ -393,11 +395,6 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width,
window->is_mapped = false;
window->is_transient = false;
// Proper behavior of tooltips, dropdown menus, etc, depend on the local window
// manager not modify them. Set override_redirect on these windows. RDP window
// styles don't map 1 to 1 to X window styles, but the presence of WM_POPUP
// appears to be sufficient for setting override_redirect.
window->handle = XCreateWindow(xfi->display, RootWindowOfScreen(xfi->screen),
x, y, window->width, window->height, 0, xfi->depth, InputOutput, xfi->visual,
CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap |
@ -491,7 +488,7 @@ void xf_StartLocalMoveSize(xfInfo* xfi, xfWindow* window, int direction, int x,
window->local_move.root_y = y;
window->local_move.state = LMS_STARTING;
XTranslateCoordinates(xfi->display, DefaultRootWindow(xfi->display), window->handle,
XTranslateCoordinates(xfi->display, RootWindowOfScreen(xfi->screen), window->handle,
window->local_move.root_x,
window->local_move.root_y,
&window->local_move.window_x,
@ -551,6 +548,9 @@ void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int h
if ((width * height) < 1)
return;
if (window->local_move.state != LMS_NOT_ACTIVE)
return;
if ((window->width != width) || (window->height != height))
resize = true;