From 5279a6f2a077d7e38adb791eb43720a7ba77520d Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 28 Aug 2019 19:11:10 +1000 Subject: [PATCH] Flush X11 message box on close and set WM_TRANSIENT_FOR hint. This means the dialog box will immediately close instead of waiting until all initial fonts have been loaded when fontscache.txt doesn't exist. Setting WM_TRANSIENT_FOR marks the message box as a dialog box on the main window, which causes it to have the desired behaviour of not appearing in the taskbar and not having a minimise box.. at least in some WMs --- src/Window.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Window.c b/src/Window.c index b843725c0..251f8aa90 100644 --- a/src/Window.c +++ b/src/Window.c @@ -1397,6 +1397,11 @@ static void X11_MessageBox(const char* title, const char* text, X11Window* w) { ok.X = width/2 - ok.Width/2; ok.Y = height - ok.Height - 10; + /* This marks the window as popup window of the main window */ + /* http://tronche.com/gui/x/icccm/sec-4.html#WM_TRANSIENT_FOR */ + /* Depending on WM, removes minimise and doesn't show in taskbar */ + if (win_handle) XSetTransientForHint(dpy, w->win, win_handle); + XFreeFontInfo(NULL, font, 1); XUnmapWindow(dpy, w->win); /* Make window non resizeable */ @@ -1457,6 +1462,7 @@ void Window_ShowDialog(const char* title, const char* msg) { X11_MessageBox(title, msg, &w); X11Window_Free(&w); + XFlush(dpy); /* flush so window disappears immediately */ } static GC fb_gc;