From 900a56f2890c0eb28be8bd354f84fa916e7444cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Moreau?= Date: Sun, 21 Aug 2011 23:54:02 -0400 Subject: [PATCH] xfreerdp: fix window classes --- client/X11/xf_rail.c | 5 ++++- client/X11/xf_window.c | 18 +++++++++++------- client/X11/xf_window.h | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/client/X11/xf_rail.c b/client/X11/xf_rail.c index 3f8d5eecb..ce9e9c9ed 100644 --- a/client/X11/xf_rail.c +++ b/client/X11/xf_rail.c @@ -80,7 +80,10 @@ void xf_rail_CreateWindow(rdpRail* rail, rdpWindow* window) xfw = xf_CreateWindow((xfInfo*) rail->extra, window->windowOffsetX + xfi->workArea.x, window->windowOffsetY + xfi->workArea.y, - window->windowWidth, window->windowHeight, window->title); + window->windowWidth, window->windowHeight, + window->windowId); + + XStoreName(xfi->display, xfw->handle, window->title); window->extra = (void*) xfw; window->extraId = (void*) xfw->handle; diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index b802bd129..6bd59e589 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -205,7 +205,9 @@ xfWindow* desktop_create(xfInfo* xfi, char* name) return window; } -xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char* name) +char rail_window_class[] = "RAIL:00000000"; + +xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, uint32 id) { xfWindow* window; @@ -235,10 +237,14 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char if (class_hints != NULL) { - class_hints->res_name = "rail"; - class_hints->res_class = "freerdp"; + char* class; + class = xmalloc(sizeof(rail_window_class)); + snprintf(class, sizeof(rail_window_class), "RAIL:%08X", id); + class_hints->res_name = "RAIL"; + class_hints->res_class = class; XSetClassHint(xfi->display, window->handle, class_hints); XFree(class_hints); + xfree(class); } size_hints = XAllocSizeHints(); @@ -264,8 +270,6 @@ xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char window->gc = XCreateGC(xfi->display, window->handle, GCGraphicsExposures, &gcv); window->surface = XCreatePixmap(xfi->display, window->handle, window->width, window->height, xfi->depth); - XStoreName(xfi->display, window->handle, name); - xf_MoveWindow(xfi, window, x, y, width, height); } @@ -311,12 +315,12 @@ void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int h void xf_ShowWindow(xfInfo* xfi, xfWindow* window, uint8 state) { - printf("xf_ShowWindow:%d\n", state); + //printf("xf_ShowWindow:%d\n", state); switch (state) { case WINDOW_HIDE: - XIconifyWindow(xfi->display, window->handle, xfi->screen_number); + //XIconifyWindow(xfi->display, window->handle, xfi->screen_number); break; case WINDOW_SHOW_MINIMIZED: diff --git a/client/X11/xf_window.h b/client/X11/xf_window.h index 0ace1b11c..c12ba9bbc 100644 --- a/client/X11/xf_window.h +++ b/client/X11/xf_window.h @@ -49,7 +49,7 @@ void window_show_decorations(xfInfo* xfi, xfWindow* window, boolean show); xfWindow* desktop_create(xfInfo* xfi, char* name); -xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, char* name); +xfWindow* xf_CreateWindow(xfInfo* xfi, int x, int y, int width, int height, uint32 id); void xf_MoveWindow(xfInfo* xfi, xfWindow* window, int x, int y, int width, int height); void xf_ShowWindow(xfInfo* xfi, xfWindow* window, uint8 state); void xf_SetWindowIcon(xfInfo* xfi, xfWindow* window, rdpIcon* icon);