Skip to content

Commit

Permalink
Merge pull request #76 from jszczerbinsky/dev
Browse files Browse the repository at this point in the history
v2.1.1
  • Loading branch information
jszczerbinsky authored Mar 16, 2024
2 parents ade1481 + 5738949 commit e8286aa
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 16 deletions.
33 changes: 23 additions & 10 deletions distributeDLLs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 2 additions & 1 deletion src/core/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions src/core/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

#include <gtk/gtk.h>

// 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;
Expand Down

0 comments on commit e8286aa

Please sign in to comment.