fix: linux taskbar ikonu (gtk default icon + hicolor tema indeksi + StartupWMClass), windows .ico yenilendi, .deb guncellendi

This commit is contained in:
Alhan
2026-08-03 10:33:12 +03:00
parent b6c2d9599f
commit 5c98482070
8 changed files with 51 additions and 2 deletions

View File

@@ -8,4 +8,4 @@ Terminal=false
Categories=Graphics;Viewer;RasterGraphics;
MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp;
StartupNotify=false
StartupWMClass=com.example.imajviewer
StartupWMClass=Com.example.imajviewer

View File

@@ -0,0 +1,9 @@
[Icon Theme]
Name=Hicolor
Comment=Fallback icon theme
Directories=64x64/apps
[64x64/apps]
Size=64
Context=Applications
Type=Fixed

Binary file not shown.

4
dist/rebuild-deb.sh vendored
View File

@@ -27,6 +27,10 @@ echo "• .desktop dosyası kaynaktan kopyalanıyor…"
DESKTOP_FILE="$TMPDIR/pkg/usr/share/applications/${APP}.desktop"
cp "${PROJECT_DIR}/deb/usr/share/applications/${APP}.desktop" "$DESKTOP_FILE"
echo "• İkonlar ve hicolor tema indeksi kopyalanıyor…"
mkdir -p "$TMPDIR/pkg/usr/share/icons/hicolor"
cp -r "${PROJECT_DIR}/deb/usr/share/icons/hicolor/." "$TMPDIR/pkg/usr/share/icons/hicolor/"
echo "• Yeni .deb paketi oluşturuluyor…"
fakeroot dpkg-deb --build "$TMPDIR/pkg" "${DEB}.tmp" >/dev/null
mv "${DEB}.tmp" "$DEB"

View File

@@ -63,6 +63,22 @@ else
ok "İkon zaten mevcut"
fi
# ── Hicolor tema indeksi (GTK ikon temasını tanısın) ──
if [ ! -f "${HOME}/.local/share/icons/hicolor/index.theme" ]; then
mkdir -p "${HOME}/.local/share/icons/hicolor/64x64/apps"
cat > "${HOME}/.local/share/icons/hicolor/index.theme" << 'EOF'
[Icon Theme]
Name=Hicolor
Comment=Fallback icon theme
Directories=64x64/apps
[64x64/apps]
Size=64
Context=Applications
Type=Fixed
EOF
fi
# ── .desktop dosyası ──
info ".desktop dosyası oluşturuluyor…"
cat > "$DESKTOP_FILE" << EOF
@@ -76,7 +92,7 @@ Terminal=false
Categories=Graphics;Viewer;RasterGraphics;
MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp;
StartupNotify=false
StartupWMClass=com.example.imajviewer
StartupWMClass=Com.example.imajviewer
EOF
ok "${DESKTOP_FILE}"

View File

@@ -121,6 +121,12 @@ install(CODE "
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime)
# Bundle the application icon so the runner can set the window icon at runtime.
install(FILES "${PROJECT_SOURCE_DIR}/../imajviewericon.png"
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}"
RENAME "imajviewer.png"
COMPONENT Runtime)
# Install the AOT library on non-Debug builds only.
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"

View File

@@ -156,6 +156,20 @@ MyApplication* my_application_new() {
// the application to be recognized beyond its binary name.
g_set_prgname(APPLICATION_ID);
// App-level default icon. GTK writes _NET_WM_ICON from this when windows
// are realized, so taskbars show the application icon.
g_autofree gchar* exe_path = g_file_read_link("/proc/self/exe", nullptr);
if (exe_path != nullptr) {
g_autofree gchar* bundle_dir = g_path_get_dirname(exe_path);
g_autofree gchar* icon_path =
g_build_filename(bundle_dir, "data", "imajviewer.png", nullptr);
GdkPixbuf* pixbuf = gdk_pixbuf_new_from_file(icon_path, nullptr);
if (pixbuf != nullptr) {
gtk_window_set_default_icon(pixbuf);
g_object_unref(pixbuf);
}
}
return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID, "flags",
G_APPLICATION_NON_UNIQUE, nullptr));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 105 KiB