From c9917d3ca1eab7087822617ce9f34820ff8bb45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Wed, 17 Aug 2011 14:51:17 -0400 Subject: [PATCH] xfreerdp: drawing of multiple RAIL windows --- client/X11/xf_window.c | 20 +++++++++++++++++--- client/X11/xf_window.h | 1 + client/X11/xfreerdp.c | 4 +++- client/X11/xfreerdp.h | 1 + libfreerdp-rail/window_list.c | 1 + 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index 5a96b038f..100c89ca9 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -121,6 +121,18 @@ boolean window_GetWorkArea(xfInfo* xfi) return True; } +void window_move(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height) +{ + XWindowChanges changes; + + changes.x = x; + changes.y = y; + changes.width = width; + changes.height = height; + + XConfigureWindow(xfi->display, window->handle, CWX | CWY | CWWidth | CWHeight, &changes); +} + void window_show_decorations(xfInfo* xfi, xfWindow* window, boolean show) { Atom atom; @@ -145,7 +157,7 @@ void window_show_decorations(xfInfo* xfi, xfWindow* window, boolean show) } } - window->decorations = False; + window->decorations = show; } xfWindow* window_create(xfInfo* xfi, char* name) @@ -164,7 +176,7 @@ xfWindow* window_create(xfInfo* xfi, char* name) window->fullscreen = False; window->handle = XCreateWindow(xfi->display, RootWindowOfScreen(xfi->screen), - 0, 0, xfi->width, xfi->height, 0, xfi->depth, InputOutput, xfi->visual, + xfi->workArea.x, xfi->workArea.y, xfi->width, xfi->height, 0, xfi->depth, InputOutput, xfi->visual, CWBackPixel | CWBackingStore | CWOverrideRedirect | CWColormap | CWBorderPixel, &xfi->attribs); @@ -219,7 +231,7 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char XSizeHints* size_hints; XClassHint* class_hints; - window->decorations = True; + window->decorations = False; window->fullscreen = False; window->handle = XCreateWindow(xfi->display, RootWindowOfScreen(xfi->screen), @@ -263,6 +275,8 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char 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); + + window_move(xfi, window, x, y, width, height); } return window; diff --git a/client/X11/xf_window.h b/client/X11/xf_window.h index ca819ecae..c090cd269 100644 --- a/client/X11/xf_window.h +++ b/client/X11/xf_window.h @@ -43,6 +43,7 @@ boolean window_GetCurrentDesktop(xfInfo* xfi); boolean window_GetWorkArea(xfInfo* xfi); void window_fullscreen(xfInfo* xfi, xfWindow* window, boolean fullscreen); +void window_move(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height); void window_show_decorations(xfInfo* xfi, xfWindow* window, boolean show); xfWindow* window_create(xfInfo* xfi, char* name); diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index 1500369ca..f71b1ac36 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -75,7 +75,8 @@ void xf_end_paint(rdpUpdate* update) XCopyArea(xfi->display, xfi->primary, xfi->window->handle, xfi->gc_default, x, y, w, h, x, y); XFlush(xfi->display); - xf_rail_paint(xfi, update->rail); + if (xfi->remote_app == True) + xf_rail_paint(xfi, update->rail); } boolean xf_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount) @@ -160,6 +161,7 @@ boolean xf_pre_connect(freerdp* instance) xfi->mouse_motion = True; xfi->decoration = settings->decorations; + xfi->remote_app = settings->remote_app; window_GetWorkArea(xfi); diff --git a/client/X11/xfreerdp.h b/client/X11/xfreerdp.h index 6f52fa6d2..9f93f488b 100644 --- a/client/X11/xfreerdp.h +++ b/client/X11/xfreerdp.h @@ -71,6 +71,7 @@ struct xf_info xfWindow* window; xfWorkArea workArea; int current_desktop; + boolean remote_app; GC gc_mono; GC gc_default; diff --git a/libfreerdp-rail/window_list.c b/libfreerdp-rail/window_list.c index 3941d46a3..4393548a1 100644 --- a/libfreerdp-rail/window_list.c +++ b/libfreerdp-rail/window_list.c @@ -91,6 +91,7 @@ void window_list_create(rdpWindowList* list, WINDOW_ORDER_INFO* orderInfo, WINDO else { window->prev = list->tail; + list->tail->next = window; window->next = NULL; list->tail = window; }