summaryrefslogtreecommitdiff
path: root/Libraries/LibGUI
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibGUI')
-rw-r--r--Libraries/LibGUI/GApplication.cpp6
-rw-r--r--Libraries/LibGUI/GApplication.h1
-rw-r--r--Libraries/LibGUI/GWindow.cpp1
3 files changed, 8 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)
diff --git a/Libraries/LibGUI/GApplication.h b/Libraries/LibGUI/GApplication.h
index 630994561d..ad8e57e76e 100644
--- a/Libraries/LibGUI/GApplication.h
+++ b/Libraries/LibGUI/GApplication.h
@@ -33,6 +33,7 @@ public:
bool quit_when_last_window_deleted() const { return m_quit_when_last_window_deleted; }
void set_quit_when_last_window_deleted(bool b) { m_quit_when_last_window_deleted = b; }
+ void did_create_window(Badge<GWindow>);
void did_delete_last_window(Badge<GWindow>);
const String& invoked_as() const { return m_invoked_as; }
diff --git a/Libraries/LibGUI/GWindow.cpp b/Libraries/LibGUI/GWindow.cpp
index c05f7fe4b4..7620f30acc 100644
--- a/Libraries/LibGUI/GWindow.cpp
+++ b/Libraries/LibGUI/GWindow.cpp
@@ -84,6 +84,7 @@ void GWindow::show()
apply_icon();
reified_windows.set(m_window_id, this);
+ GApplication::the().did_create_window({});
update();
}