Merge pull request #198 from sunds/master

Fixes for desktop properties and window placement
This commit is contained in:
Otavio Salvador 2011-11-03 12:02:14 -07:00
commit 9777833162
4 changed files with 10 additions and 48 deletions

View File

@ -106,31 +106,7 @@ boolean xf_event_Expose(xfInfo* xfi, XEvent* event, boolean app)
boolean xf_event_VisibilityNotify(xfInfo* xfi, XEvent* event, boolean app)
{
int x, y;
int w, h;
x = event->xexpose.x;
y = event->xexpose.y;
w = event->xexpose.width;
h = event->xexpose.height;
xfi->unobscured = event->xvisibility.state == VisibilityUnobscured;
if (app)
{
xfWindow* xfw;
rdpWindow* window;
rdpRail* rail = ((rdpContext*) xfi->context)->rail;
window = window_list_get_by_extra_id(rail->list, (void*) event->xvisibility.window);
if (window != NULL)
{
xfw = (xfWindow*) window->extra;
xf_UpdateWindowArea(xfi, xfw, x, y, w, h);
}
}
return True;
}

View File

@ -66,15 +66,6 @@ void xf_rail_paint(xfInfo* xfi, rdpRail* rail, uint32 uleft, uint32 utop, uint32
}
}
void xf_rail_FilterWindowInfo(rdpRail* rail, rdpWindow* window)
{
if (window->windowOffsetX < 0)
{
window->windowWidth += (window->windowOffsetX * 2);
window->windowOffsetX = 0;
}
}
void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window)
{
xfInfo* xfi;
@ -82,8 +73,6 @@ void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window)
xfi = (xfInfo*) rail->extra;
xf_rail_FilterWindowInfo(rail, window);
xfw = xf_CreateWindow((xfInfo*) rail->extra, window,
window->windowOffsetX, window->windowOffsetY,
window->windowWidth, window->windowHeight,
@ -105,8 +94,6 @@ void xf_rail_MoveWindow(rdpRail* rail, rdpWindow* window)
xfi = (xfInfo*) rail->extra;
xfw = (xfWindow*) window->extra;
xf_rail_FilterWindowInfo(rail, window);
xf_MoveWindow((xfInfo*) rail->extra, xfw,
window->windowOffsetX, window->windowOffsetY,
window->windowWidth, window->windowHeight);

View File

@ -118,8 +118,9 @@ boolean xf_GetCurrentDesktop(xfInfo* xfi)
status = xf_GetWindowProperty(xfi, DefaultRootWindow(xfi->display),
xfi->_NET_CURRENT_DESKTOP, 1, &nitems, &bytes, &prop);
if (status != True)
if (status != True) {
return False;
}
xfi->current_desktop = (int) *prop;
xfree(prop);
@ -135,16 +136,21 @@ boolean xf_GetWorkArea(xfInfo* xfi)
unsigned long bytes;
unsigned char* prop;
status = xf_GetCurrentDesktop(xfi);
if (status != True)
return False;
status = xf_GetWindowProperty(xfi, DefaultRootWindow(xfi->display),
xfi->_NET_WORKAREA, 32 * 4, &nitems, &bytes, &prop);
if (status != True)
return False;
status = xf_GetCurrentDesktop(xfi);
if (status != True)
if ((xfi->current_desktop * 4 + 3) >= nitems) {
xfree(prop);
return False;
}
plong = (long*) prop;
@ -365,7 +371,6 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, rdpWindow* wnd, int x, int y, int width,
memset(&gcv, 0, sizeof(gcv));
window->gc = XCreateGC(xfi->display, window->handle, GCGraphicsExposures, &gcv);
window->surface = XCreatePixmap(xfi->display, window->handle, window->width, window->height, xfi->depth);
xf_MoveWindow(xfi, window, x, y, width, height);
@ -463,8 +468,6 @@ void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int h
if (resize)
{
XFreePixmap(xfi->display, window->surface);
window->surface = XCreatePixmap(xfi->display, window->handle, width, height, xfi->depth);
xf_UpdateWindowArea(xfi, window, 0, 0, width, height);
}
}
@ -626,9 +629,6 @@ void xf_DestroyWindow(xfInfo* xfi, xfWindow* window)
if (window->gc)
XFreeGC(xfi->display, window->gc);
if (window->surface)
XFreePixmap(xfi->display, window->surface);
if (window->handle)
{
XUnmapWindow(xfi->display, window->handle);

View File

@ -38,7 +38,6 @@ struct xf_window
int width;
int height;
Window handle;
Pixmap surface;
boolean fullscreen;
boolean decorations;
rdpWindow* window;