Skip to content

Commit 8c5b51a

Browse files
Dialog fix for windows
1 parent 53cc635 commit 8c5b51a

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

build/windows/collect_dlls.sh

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ if [ ! -d "$OUTPUT_DIR" ]; then
3838
exit 1
3939
fi
4040

41+
# Derive GTK directory from DLL directory (typically /mingw64/bin -> /mingw64)
42+
GTK_DIR=$(dirname "$DLL_SOURCE_DIR")
43+
4144
# Function to get direct dependencies of a file
4245
get_dependencies() {
4346
local file="$1"
@@ -55,6 +58,64 @@ declare -A processed_dlls
5558
declare -a dlls_to_process
5659
declare -a missing_dlls
5760

61+
# Create necessary GTK directories
62+
echo "Creating GTK directory structure..."
63+
mkdir -p "$OUTPUT_DIR/share/glib-2.0/schemas"
64+
mkdir -p "$OUTPUT_DIR/share/icons"
65+
mkdir -p "$OUTPUT_DIR/share/themes"
66+
mkdir -p "$OUTPUT_DIR/lib/gdk-pixbuf-2.0"
67+
mkdir -p "$OUTPUT_DIR/lib/gtk-3.0"
68+
69+
# Copy GTK related files
70+
echo "Copying GTK files..."
71+
echo "Looking for schemas in: $GTK_DIR/share/glib-2.0/schemas/"
72+
ls -l "$GTK_DIR/share/glib-2.0/schemas/" || echo "Directory not found"
73+
74+
# Try multiple possible locations for gschemas.compiled
75+
SCHEMA_LOCATIONS=(
76+
"$GTK_DIR/share/glib-2.0/schemas/gschemas.compiled"
77+
"$DLL_SOURCE_DIR/../share/glib-2.0/schemas/gschemas.compiled"
78+
"/usr/x86_64-w64-mingw32/sys-root/mingw/share/glib-2.0/schemas/gschemas.compiled"
79+
"/mingw64/share/glib-2.0/schemas/gschemas.compiled"
80+
)
81+
82+
SCHEMA_FOUND=0
83+
for schema_path in "${SCHEMA_LOCATIONS[@]}"; do
84+
echo "Checking for schema at: $schema_path"
85+
if [ -f "$schema_path" ]; then
86+
echo "Found schema file at: $schema_path"
87+
cp "$schema_path" "$OUTPUT_DIR/share/glib-2.0/schemas/"
88+
SCHEMA_FOUND=1
89+
break
90+
fi
91+
done
92+
93+
if [ $SCHEMA_FOUND -eq 0 ]; then
94+
echo "Warning: Could not find gschemas.compiled in any of the expected locations"
95+
fi
96+
97+
# Copy theme-related files if they exist
98+
if [ -d "$GTK_DIR/share/icons/hicolor" ]; then
99+
cp -r "$GTK_DIR/share/icons/hicolor" "$OUTPUT_DIR/share/icons/"
100+
fi
101+
if [ -d "$GTK_DIR/share/themes/default" ]; then
102+
cp -r "$GTK_DIR/share/themes/default" "$OUTPUT_DIR/share/themes/"
103+
fi
104+
if [ -d "$GTK_DIR/share/themes/emacs" ]; then
105+
cp -r "$GTK_DIR/share/themes/emacs" "$OUTPUT_DIR/share/themes/"
106+
fi
107+
108+
# Create GTK settings file
109+
cat > "$OUTPUT_DIR/settings.ini" << EOF
110+
[Settings]
111+
gtk-theme-name = default
112+
gtk-icon-theme-name = hicolor
113+
gtk-font-name = Segoe UI 9
114+
gtk-menu-images = true
115+
gtk-button-images = true
116+
gtk-toolbar-style = both-horiz
117+
EOF
118+
58119
# Get initial dependencies
59120
echo "Analyzing dependencies for $(basename "$EXE_PATH")..."
60121
initial_dlls=$(get_dependencies "$EXE_PATH")

0 commit comments

Comments
 (0)