156 return GTK_APPLICATION(app); |
156 return GTK_APPLICATION(app); |
157 } |
157 } |
158 #endif |
158 #endif |
159 |
159 |
160 void ui_show(UiObject *obj) { |
160 void ui_show(UiObject *obj) { |
|
161 gboolean visible = gtk_widget_is_visible(obj->widget); |
|
162 |
161 uic_check_group_widgets(obj->ctx); |
163 uic_check_group_widgets(obj->ctx); |
162 #if GTK_MAJOR_VERSION >= 4 |
164 #if GTK_MAJOR_VERSION >= 4 |
163 gtk_window_present(GTK_WINDOW(obj->widget)); |
165 gtk_window_present(GTK_WINDOW(obj->widget)); |
164 #elif GTK_MAJOR_VERSION <= 3 |
166 #elif GTK_MAJOR_VERSION <= 3 |
165 gtk_widget_show_all(obj->widget); |
167 gtk_widget_show_all(obj->widget); |
166 #endif |
168 #endif |
167 obj->ref++; |
169 |
|
170 if(!visible) { |
|
171 obj->ref++; |
|
172 } |
168 } |
173 } |
169 |
174 |
170 void ui_close(UiObject *obj) { |
175 void ui_close(UiObject *obj) { |
171 uic_context_prepare_close(obj->ctx); |
176 uic_context_prepare_close(obj->ctx); |
172 #if GTK_CHECK_VERSION(4, 0, 0) |
177 #if GTK_CHECK_VERSION(4, 0, 0) |