From: Manuel Bachmann Date: Fri, 13 Feb 2015 16:14:47 +0000 (+0100) Subject: X11 backend: fix window behavior with multiple show() calls X-Git-Tag: accepted/tizen/3.0.2014.q4/common/20150224.150710^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=inline;p=platform%2Fupstream%2Flibwlmessage.git X11 backend: fix window behavior with multiple show() calls When libwlmessage was called multiple times within a single program (with the X11 backend), the first window would not disappear after validation because the main loop was being exited without a proper destroy call. This also prevented other windows from showing up. Fixed. Change-Id: I07836b1de1ca8725a941b9d988e525c11e7740e3 Signed-off-by: Manuel Bachmann --- diff --git a/libwlmessage-x11.c b/libwlmessage-x11.c index 5714334..df2646b 100644 --- a/libwlmessage-x11.c +++ b/libwlmessage-x11.c @@ -664,6 +664,7 @@ wlmessage_show (struct wlmessage *wlmessage, char **input_text) struct message_window *message_window = wlmessage->message_window; Widget form, label, entry, form_b; + XEvent ev; XWindowChanges wc; XSizeHints sh; WMHints wm_hints; @@ -804,6 +805,11 @@ form: /* main loop */ XtAppMainLoop (wlmessage->app); + /* last iteration to destroy the window */ + XtUnrealizeWidget (message_window->window); + XtAppNextEvent (wlmessage->app, &ev); + XtDispatchEvent (&ev); + if (entry) { XawTextBlock buffer; XawTextSourceRead (XawTextGetSource(entry), 0, &buffer, 30);