mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:57:35 +00:00
LibGUI: GDialog should close its nested event loop on window close.
Make GWindow::close() so we can override it in GDialog and quit from the internal event loop when the window manager tells us to close ourselves. The dialog will return GDialog::ExecCancel in these situations.
This commit is contained in:
parent
7da5a04131
commit
d7ff2c5b86
3 changed files with 10 additions and 1 deletions
|
@ -40,3 +40,10 @@ void GDialog::done(int result)
|
||||||
dbgprintf("%s: quit event loop with result %d\n", class_name(), result);
|
dbgprintf("%s: quit event loop with result %d\n", class_name(), result);
|
||||||
m_event_loop->quit(result);
|
m_event_loop->quit(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GDialog::close()
|
||||||
|
{
|
||||||
|
GWindow::close();
|
||||||
|
m_event_loop->quit(ExecCancel);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@ public:
|
||||||
int result() const { return m_result; }
|
int result() const { return m_result; }
|
||||||
void done(int result);
|
void done(int result);
|
||||||
|
|
||||||
|
virtual void close() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit GDialog(CObject* parent);
|
explicit GDialog(CObject* parent);
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ public:
|
||||||
|
|
||||||
void show();
|
void show();
|
||||||
void hide();
|
void hide();
|
||||||
void close();
|
virtual void close();
|
||||||
void move_to_front();
|
void move_to_front();
|
||||||
|
|
||||||
void start_wm_resize();
|
void start_wm_resize();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue