summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI/GApplication.cpp
diff options
context:
space:
mode:
authorBrandon Scott <xeons@users.noreply.github.com>2019-10-25 00:23:35 -0500
committerAndreas Kling <awesomekling@gmail.com>2019-10-25 15:29:19 +0200
commit51e655f9033d4c14119ab2264735545d3cd85a0a (patch)
treee01a63b430192fc0ddf4d3f1e48e240eef180f4d /Libraries/LibGUI/GApplication.cpp
parent5311f8fae11cbc611abea61fda570a11ce3edee5 (diff)
downloadserenity-51e655f9033d4c14119ab2264735545d3cd85a0a.zip
LibGUI: Added window creation callback to GApplication/GWindow
Added a window creation callback to GApplication that gets called by GWindow which will reset any pending exit request in the CEventLoop. This is to prevent a bug which prevents your application from starting up if you had a message box or other dialog before showing your main application form. The bug was triggered by there being no more visible windows which was triggering a premature quit().
Diffstat (limited to 'Libraries/LibGUI/GApplication.cpp')
-rw-r--r--Libraries/LibGUI/GApplication.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GApplication.cpp b/Libraries/LibGUI/GApplication.cpp
index ef671eb032..9bdd7af840 100644
--- a/Libraries/LibGUI/GApplication.cpp
+++ b/Libraries/LibGUI/GApplication.cpp
@@ -119,6 +119,12 @@ void GApplication::hide_tooltip()
}
}
+void GApplication::did_create_window(Badge<GWindow>)
+{
+ if (m_event_loop->was_exit_requested())
+ m_event_loop->unquit();
+}
+
void GApplication::did_delete_last_window(Badge<GWindow>)
{
if (m_quit_when_last_window_deleted)