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

@@ -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));