diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2019-11-13 00:15:56 +0300 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2019-11-13 00:15:56 +0300 |
commit | bb24cee28afba4df17c0a988dd99996786f20dd6 (patch) | |
tree | 66779a407a9c72008074f47b83cb72c7689db481 /client | |
parent | 7537ada7f111a5be8363fbadc4b1ec1c77702875 (diff) |
rail: move wait for visibility into xf_CreateDesktopWindow
Diffstat (limited to 'client')
-rw-r--r-- | client/X11/xf_window.c | 8 | ||||
-rw-r--r-- | client/X11/xfreerdp.c | 10 |
2 files changed, 8 insertions, 10 deletions
diff --git a/client/X11/xf_window.c b/client/X11/xf_window.c index 6bd221c..c246ee2 100644 --- a/client/X11/xf_window.c +++ b/client/X11/xf_window.c @@ -272,6 +272,7 @@ void ui_grab_keys(Display* dis, Window wnd) xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height, tbool decorations) { xfWindow* window; + XEvent xevent; window = (xfWindow*) xzalloc(sizeof(xfWindow)); @@ -321,6 +322,13 @@ xfWindow* xf_CreateDesktopWindow(xfInfo* xfi, char* name, int width, int height, if ((xfi->rail_flags & 1) == 0) /* is window visible */ { XMapWindow(xfi->display, window->handle); + /* wait for VisibilityNotify */ + do + { + XMaskEvent(xfi->display, VisibilityChangeMask, &xevent); + } + while (xevent.type != VisibilityNotify); + xfi->unobscured = (xevent.xvisibility.state == VisibilityUnobscured); } } diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index 1d9e77c..8cb3805 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -277,7 +277,6 @@ tbool xf_check_fds(freerdp* instance, fd_set* set) void xf_create_window(xfInfo* xfi) { - XEvent xevent; char* win_title; int width, height; @@ -316,15 +315,6 @@ void xf_create_window(xfInfo* xfi) if (xfi->fullscreen) xf_SetWindowFullscreen(xfi, xfi->window, xfi->fullscreen); - /* wait for VisibilityNotify */ - do - { - XMaskEvent(xfi->display, VisibilityChangeMask, &xevent); - } - while (xevent.type != VisibilityNotify); - - xfi->unobscured = (xevent.xvisibility.state == VisibilityUnobscured); - XSetWMProtocols(xfi->display, xfi->window->handle, &(xfi->WM_DELETE_WINDOW), 1); xfi->drawable = xfi->window->handle; } |