summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2015-02-13 17:14:47 +0100
committerManuel Bachmann <manuel.bachmann@open.eurogiciel.org>2015-02-13 17:14:47 +0100
commit65ae4ac8844bd1eb0baab85dd210929ffd34e2b8 (patch)
tree69b3858ab920076b963963464d3f221774e0d2c3
parent8b80a7ea57d818510ef386e296676b3356aecbf5 (diff)
downloadlibwlmessage-65ae4ac8844bd1eb0baab85dd210929ffd34e2b8.tar.gz
libwlmessage-65ae4ac8844bd1eb0baab85dd210929ffd34e2b8.tar.bz2
libwlmessage-65ae4ac8844bd1eb0baab85dd210929ffd34e2b8.zip
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 <manuel.bachmann@open.eurogiciel.org>
-rw-r--r--libwlmessage-x11.c6
1 files changed, 6 insertions, 0 deletions
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);