From a100004b30e420d4589254eab37f799d8b04587c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szczerbi=C5=84ski?= Date: Sat, 16 Mar 2024 19:56:06 +0100 Subject: [PATCH] Fixed windows bundling --- distributeDLLs.sh | 33 +++++++++++++++++++++++---------- src/core/main.c | 3 ++- src/core/main.h | 2 +- 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/distributeDLLs.sh b/distributeDLLs.sh index 6a8d53d..0dd6b85 100644 --- a/distributeDLLs.sh +++ b/distributeDLLs.sh @@ -2,22 +2,35 @@ mkdir -p dlls mkdir -p dlls/lib -mkdir -p dlls/lib/gdk-pixbuf-2.0 -mkdir -p dlls/lib/gdk-pixbuf-2.0/2.10.0 +mkdir -p dlls/share +mkdir -p dlls/share/icons +mkdir -p dlls/share/glib-2.0 +mkdir -p dlls/share/glib-2.0/schemas echo -PS3='Choose the correct version of gdbus: ' -options=("/mingw64/bin/gdbus.exe" "/mingw32/bin/gdbus.exe") +PS3='Choose the correct version: ' +options=("mingw64" "mingw32") select opt in "${options[@]}" do - echo "Preparing gdbus.exe..." - cp $opt ./dlls/ - break; + cp /$opt/bin/gdbus.exe ./dlls/ + cp -R /$opt/lib/gdk-pixbuf-2.0 ./dlls/lib + rm ./dlls/lib/gdk-pixbuf-2.0/2.10.0/loaders/*.a + GDK_PIXBUF_MODULEDIR=./dlls/lib/gdk-pixbuf-2.0/2.10.0/loaders + gdk-pixbuf-query-loaders --update-cache + cp /$opt/bin/fc-* ./dlls/ + cp -R /$opt/share/icons/Adwaita ./dlls/share/icons + cp -R /$opt/share/icons/hicolor ./dlls/share/icons + cp /$opt/share/glib-2.0/schemas/* ./dlls/share/glib-2.0/schemas/ + glib-compile-schemas ./dlls/share/glib-2.0/schemas/ + cp /$opt/bin/librsvg-2-2.dll ./dlls + cp /$opt/bin/libxml2-2.dll ./dlls + cp /$opt/bin/libiconv-2.dll ./dlls + cp /$opt/bin/libcharset-1.dll ./dlls + cp /$opt/bin/zlib1.dll ./dlls + cp /$opt/bin/liblzma-5.dll ./dlls + break; done -echo "Preparing DLLs..." - ldd ./src/core/lwp.exe | grep '\/mingw.*\.dll' -o | xargs -I{} cp "{}" ./dlls/ -cp /mingw64/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache ./dlls/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache echo "Done" \ No newline at end of file diff --git a/src/core/main.c b/src/core/main.c index 0ecca84..afd7ed2 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -76,8 +76,9 @@ static void reloadMonitorListBox() gtk_list_box_insert(GTK_LIST_BOX(monitorListBox), row, 0); - char *nameBuff = malloc(sizeof(strlen(monitors[i].name))); + char *nameBuff = malloc(strlen(monitors[i].name)+1); strcpy(nameBuff, monitors[i].name); + g_object_set_data(G_OBJECT(row), "monitor_name", (gpointer)nameBuff); gtk_widget_show_all(row); diff --git a/src/core/main.h b/src/core/main.h index 7b9697f..2fe7376 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -5,7 +5,7 @@ // G_APPLICATION_DEFAULT_FLAGS doesn't exist in older versions of glib #ifndef G_APPLICATION_DEFAULT_FLAGS -#define G_APPLICATION_DEFAULT_FLAGS G_APPLICATION_FLAGS_NONE +//#define G_APPLICATION_DEFAULT_FLAGS G_APPLICATION_FLAGS_NONE #endif #include "../common.h"