diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index fe6a36505..e5298fb79 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -202,7 +202,6 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height) if (window != NULL) { int input_mask; - XSizeHints* size_hints; XClassHint* class_hints; window->width = width; @@ -227,16 +226,7 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height) XFree(class_hints); } - size_hints = XAllocSizeHints(); - - if (size_hints) - { - size_hints->flags = PMinSize | PMaxSize; - size_hints->min_width = size_hints->max_width = xfi->width; - size_hints->min_height = size_hints->max_height = xfi->height; - XSetWMNormalHints(xfi->display, window->handle, size_hints); - XFree(size_hints); - } + xf_ResizeDesktopWindow(xfi, window, width, height); input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | @@ -250,6 +240,22 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height) return window; } +void xf_ResizeDesktopWindow(xfInfo* xfi, xfWindow* window, int width, int height) +{ + XSizeHints* size_hints; + + size_hints = XAllocSizeHints(); + + if (size_hints) + { + size_hints->flags = PMinSize | PMaxSize; + size_hints->min_width = size_hints->max_width = xfi->width; + size_hints->min_height = size_hints->max_height = xfi->height; + XSetWMNormalHints(xfi->display, window->handle, size_hints); + XFree(size_hints); + } +} + void xf_FixWindowCoordinates(xfInfo* xfi, int* x, int* y, int* width, int* height) { int vscreen_width; diff --git a/client/X11/xf_window.h b/client/X11/xf_window.h index 60a4947aa..759465c1e 100644 --- a/client/X11/xf_window.h +++ b/client/X11/xf_window.h @@ -55,6 +55,7 @@ void xf_SetWindowDecorations(xfInfo* xfi, xfWindow* window, boolean show); void xf_SetWindowUnlisted(xfInfo* xfi, xfWindow* window); xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height); +void xf_ResizeDesktopWindow(xfInfo* xfi, xfWindow* window, int width, int height); xfWindow* xf_CreateWindow(xfInfo* xfi, xfWindow* parent, 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); diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index b3bce5e7d..448ed76b7 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -127,6 +127,20 @@ void xf_end_paint(rdpUpdate* update) } } +void xf_desktop_resize(rdpUpdate* update) +{ + xfInfo* xfi; + rdpSettings* settings; + + xfi = GET_XFI(update); + settings = xfi->instance->settings; + xfi->width = settings->width; + xfi->height = settings->height; + + if (xfi->window) + xf_ResizeDesktopWindow(xfi, xfi->window, settings->width, settings->height); +} + boolean xf_get_fds(freerdp* instance, void** rfds, int* rcount, void** wfds, int* wcount) { xfInfo* xfi = GET_XFI(instance); @@ -393,6 +407,7 @@ boolean xf_post_connect(freerdp* instance) instance->update->BeginPaint = xf_begin_paint; instance->update->EndPaint = xf_end_paint; + instance->update->DesktopResize = xf_desktop_resize; xfi->rail = rail_new(instance->settings); instance->update->rail = (void*) xfi->rail;