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..b775e33 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -3,11 +3,6 @@ #include -// 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 -#endif - #include "../common.h" extern GtkApplication *app;