File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ void GWindow::close()
47
47
{
48
48
if (should_exit_event_loop_on_close ())
49
49
GEventLoop::current ().quit (0 );
50
- delete_later ();
50
+ if (should_destroy_on_close ())
51
+ delete_later ();
51
52
}
52
53
53
54
void GWindow::move_to_front ()
@@ -421,7 +422,7 @@ void GWindow::collect_keyboard_activation_targets()
421
422
422
423
bool GWindow::is_visible () const
423
424
{
424
- return false ;
425
+ return m_window_id != 0 ;
425
426
}
426
427
427
428
void GWindow::update (const Rect& a_rect)
Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ class GWindow : public CObject {
53
53
Color background_color () const { return m_background_color; }
54
54
void set_background_color (Color color) { m_background_color = color; }
55
55
56
+ bool should_destroy_on_close () { return m_destroy_on_close; }
57
+ void set_should_destroy_on_close (bool b) { m_destroy_on_close = b; }
58
+
56
59
int x () const { return rect ().x (); }
57
60
int y () const { return rect ().y (); }
58
61
int width () const { return rect ().width (); }
@@ -158,6 +161,7 @@ class GWindow : public CObject {
158
161
GWindowType m_window_type { GWindowType::Normal };
159
162
bool m_is_active { false };
160
163
bool m_should_exit_app_on_close { false };
164
+ bool m_destroy_on_close { true };
161
165
bool m_has_alpha_channel { false };
162
166
bool m_double_buffering_enabled { true };
163
167
bool m_modal { false };
You can’t perform that action at this time.
0 commit comments