ui/gtk/window.c

branch
newapi
changeset 384
8be7fd628fbc
parent 383
03599608d555
child 385
e3a01a99236d
--- a/ui/gtk/window.c	Fri Nov 15 21:16:18 2024 +0100
+++ b/ui/gtk/window.c	Fri Nov 15 21:23:16 2024 +0100
@@ -80,7 +80,11 @@
     uic_context_prepare_close(obj->ctx);
     obj->ref--;
     if(obj->ref > 0) {
+#if GTK_CHECK_VERSION(2, 18, 0)
+        gtk_widget_set_visible(obj->widget, FALSE);
+#else
         gtk_widget_hide(obj->widget);
+#endif
         return TRUE;
     } else {
         return FALSE;
@@ -100,7 +104,7 @@
 static UiObject* create_window(const char *title, void *window_data, UiBool simple) {
     CxMempool *mp = cxBasicMempoolCreate(256);
     UiObject *obj = cxCalloc(mp->allocator, 1, sizeof(UiObject));
-    obj->ref = 1;
+    obj->ref = 0;
    
 #ifdef UI_LIBADWAITA
     obj->widget = adw_application_window_new(ui_get_application());

mercurial