ui/gtk/toolkit.c

branch
newapi
changeset 396
4cb216085479
parent 388
473c03f85197
child 411
3e91b7aff6a1
--- a/ui/gtk/toolkit.c	Wed Nov 27 18:46:45 2024 +0100
+++ b/ui/gtk/toolkit.c	Wed Nov 27 18:54:00 2024 +0100
@@ -158,13 +158,18 @@
 #endif
 
 void ui_show(UiObject *obj) {
+    gboolean visible = gtk_widget_is_visible(obj->widget);
+    
     uic_check_group_widgets(obj->ctx);
 #if GTK_MAJOR_VERSION >= 4
     gtk_window_present(GTK_WINDOW(obj->widget));
 #elif GTK_MAJOR_VERSION <= 3
     gtk_widget_show_all(obj->widget);
 #endif
-    obj->ref++;
+    
+    if(!visible) {
+        obj->ref++;
+    }
 }
 
 void ui_close(UiObject *obj) {

mercurial