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

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

No files matched your search

@@ -8,4 +8,4 @@ Terminal=false
Categories=Graphics;Viewer;RasterGraphics; Categories=Graphics;Viewer;RasterGraphics;
MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp; MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp;
StartupNotify=false StartupNotify=false
StartupWMClass=com.example.imajviewer StartupWMClass=Com.example.imajviewer
+9
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
BIN
View File
Binary file not shown.
+4
View File
@@ -27,6 +27,10 @@ echo "• .desktop dosyası kaynaktan kopyalanıyor…"
DESKTOP_FILE="$TMPDIR/pkg/usr/share/applications/${APP}.desktop" DESKTOP_FILE="$TMPDIR/pkg/usr/share/applications/${APP}.desktop"
cp "${PROJECT_DIR}/deb/usr/share/applications/${APP}.desktop" "$DESKTOP_FILE" 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…" echo "• Yeni .deb paketi oluşturuluyor…"
fakeroot dpkg-deb --build "$TMPDIR/pkg" "${DEB}.tmp" >/dev/null fakeroot dpkg-deb --build "$TMPDIR/pkg" "${DEB}.tmp" >/dev/null
mv "${DEB}.tmp" "$DEB" mv "${DEB}.tmp" "$DEB"
+17 -1
View File
@@ -63,6 +63,22 @@ else
ok "İkon zaten mevcut" ok "İkon zaten mevcut"
fi 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ı ── # ── .desktop dosyası ──
info ".desktop dosyası oluşturuluyor…" info ".desktop dosyası oluşturuluyor…"
cat > "$DESKTOP_FILE" << EOF cat > "$DESKTOP_FILE" << EOF
@@ -76,7 +92,7 @@ Terminal=false
Categories=Graphics;Viewer;RasterGraphics; Categories=Graphics;Viewer;RasterGraphics;
MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp; MimeType=image/png;image/jpeg;image/webp;image/bmp;image/gif;image/jpg;image/vnd.wap.wbmp;
StartupNotify=false StartupNotify=false
StartupWMClass=com.example.imajviewer StartupWMClass=Com.example.imajviewer
EOF EOF
ok "${DESKTOP_FILE}" ok "${DESKTOP_FILE}"
+6
View File
@@ -121,6 +121,12 @@ install(CODE "
install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 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. # Install the AOT library on non-Debug builds only.
if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") if(NOT CMAKE_BUILD_TYPE MATCHES "Debug")
install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
+14
View File
@@ -156,6 +156,20 @@ MyApplication* my_application_new() {
// the application to be recognized beyond its binary name. // the application to be recognized beyond its binary name.
g_set_prgname(APPLICATION_ID); 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(), return MY_APPLICATION(g_object_new(my_application_get_type(),
"application-id", APPLICATION_ID, "flags", "application-id", APPLICATION_ID, "flags",
G_APPLICATION_NON_UNIQUE, nullptr)); G_APPLICATION_NON_UNIQUE, nullptr));
Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

After

Width:  |  Height:  |  Size: 105 KiB