From 967f555af38c52c7e4b4992491b2a4f36b873dd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Sat, 2 Oct 2021 23:46:14 +0200 Subject: [PATCH 01/13] Workarounds for inconsistent app-id set by some GNOME Apps --- src/gldit/cairo-dock-class-manager.c | 20 +++++++++++++++----- src/implementations/cairo-dock-X-utilities.c | 6 +++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/gldit/cairo-dock-class-manager.c b/src/gldit/cairo-dock-class-manager.c index e9aad7f63..3f5d4972b 100644 --- a/src/gldit/cairo-dock-class-manager.c +++ b/src/gldit/cairo-dock-class-manager.c @@ -1616,23 +1616,33 @@ static gchar *_search_desktop_file (const gchar *cDesktopFile) // file, path or g_string_printf (sDesktopFilePath, "/usr/share/applications/%s", cFileName); if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) { - g_string_printf (sDesktopFilePath, "/usr/share/applications/%c%s", g_ascii_toupper (*cFileName), cFileName+1); // handle stupid cases like Thunar.desktop + const gchar *cFileNameLower = g_ascii_strdown (cFileName, -1); + g_string_printf (sDesktopFilePath, "/usr/share/applications/%s", cFileNameLower); if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) { - g_string_printf (sDesktopFilePath, "/usr/share/applications/xfce4/%s", cFileName); + g_string_printf (sDesktopFilePath, "/usr/share/applications/%c%s", g_ascii_toupper (*cFileNameLower), cFileNameLower+1); // handle stupid cases like Thunar.desktop if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) { - g_string_printf (sDesktopFilePath, "/usr/share/applications/kde4/%s", cFileName); + g_string_printf (sDesktopFilePath, "/usr/share/applications/org.gnome.%c%s", g_ascii_toupper (*cFileNameLower), cFileNameLower+1); // handle stupid cases like org.gnome.Evince.desktop if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) { - g_string_printf (sDesktopFilePath, "%s/.local/share/applications/%s", g_getenv ("HOME"), cFileName); + g_string_printf (sDesktopFilePath, "/usr/share/applications/xfce4/%s", cFileNameLower); if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) { - bFound = FALSE; + g_string_printf (sDesktopFilePath, "/usr/share/applications/kde4/%s", cFileNameLower); + if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) + { + g_string_printf (sDesktopFilePath, "%s/.local/share/applications/%s", g_getenv ("HOME"), cFileNameLower); + if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) + { + bFound = FALSE; + } + } } } } } + g_free (cFileNameLower); } g_free (cDesktopFileName); diff --git a/src/implementations/cairo-dock-X-utilities.c b/src/implementations/cairo-dock-X-utilities.c index 26217dabc..8679d5e3d 100644 --- a/src/implementations/cairo-dock-X-utilities.c +++ b/src/implementations/cairo-dock-X-utilities.c @@ -1167,9 +1167,9 @@ gchar *cairo_dock_get_xwindow_class (Window Xid, gchar **cWMClass) cairo_dock_remove_version_from_string (cClass); // we remore number of version (e.g. Openoffice.org-3.1) - gchar *str = strchr (cClass, '.'); // we remove all .xxx otherwise we can't detect the lack of extension when looking for an icon (openoffice.org) or it's a problem when looking for an icon (jbrout.py). - if (str != NULL) - *str = '\0'; +// gchar *str = strchr (cClass, '.'); // we remove all .xxx otherwise we can't detect the lack of extension when looking for an icon (openoffice.org) or it's a problem when looking for an icon (jbrout.py). +// if (str != NULL) +// *str = '\0'; cd_debug ("got an application with class '%s'", cClass); XFree (pClassHint->res_name); From 274791d0c8ddb716e4f7a43107f83fb199abe373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Thu, 28 Sep 2023 05:56:00 +0200 Subject: [PATCH 02/13] Additional adjustments to window class handling --- src/gldit/cairo-dock-class-manager.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gldit/cairo-dock-class-manager.c b/src/gldit/cairo-dock-class-manager.c index 3f5d4972b..1efcdf54a 100644 --- a/src/gldit/cairo-dock-class-manager.c +++ b/src/gldit/cairo-dock-class-manager.c @@ -1783,10 +1783,11 @@ gchar *cairo_dock_guess_class (const gchar *cCommand, const gchar *cStartupWMCla } else { - cResult = g_ascii_strdown (cStartupWMClass, -1); + cResult = g_strdup (cStartupWMClass); +/* cResult = g_ascii_strdown (cStartupWMClass, -1); gchar *str = strchr (cResult, '.'); // we remove all .xxx otherwise we can't detect the lack of extension when looking for an icon (openoffice.org) or it's a problem when looking for an icon (jbrout.py). if (str != NULL) - *str = '\0'; + *str = '\0'; */ } cairo_dock_remove_version_from_string (cResult); cd_debug (" -> '%s'", cResult); @@ -1875,6 +1876,8 @@ gchar *cairo_dock_register_class_full (const gchar *cDesktopFile, const gchar *c //\__________________ search the desktop file's path. gchar *cDesktopFilePath = _search_desktop_file (cDesktopFile?cDesktopFile:cClass); + if (cDesktopFilePath == NULL && cWmClass != NULL) + cDesktopFilePath = _search_desktop_file (cWmClass); if (cDesktopFilePath == NULL) // couldn't find the .desktop { if (cClass != NULL) // make a class anyway to store the few info we have. From a6e08b7a722320cf104ffa4f8b0d22fd8502ba6d Mon Sep 17 00:00:00 2001 From: Daniel Kondor Date: Fri, 6 Oct 2023 21:09:54 +0200 Subject: [PATCH 03/13] Convert app-id / WM class to lowercase This reverts a previous change, since for some apps, case seems to change based on whether they run on X11 or Wayland --- src/gldit/cairo-dock-class-manager.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gldit/cairo-dock-class-manager.c b/src/gldit/cairo-dock-class-manager.c index 1efcdf54a..4675b5665 100644 --- a/src/gldit/cairo-dock-class-manager.c +++ b/src/gldit/cairo-dock-class-manager.c @@ -1783,9 +1783,9 @@ gchar *cairo_dock_guess_class (const gchar *cCommand, const gchar *cStartupWMCla } else { - cResult = g_strdup (cStartupWMClass); -/* cResult = g_ascii_strdown (cStartupWMClass, -1); - gchar *str = strchr (cResult, '.'); // we remove all .xxx otherwise we can't detect the lack of extension when looking for an icon (openoffice.org) or it's a problem when looking for an icon (jbrout.py). +// cResult = g_strdup (cStartupWMClass); + cResult = g_ascii_strdown (cStartupWMClass, -1); +/* gchar *str = strchr (cResult, '.'); // we remove all .xxx otherwise we can't detect the lack of extension when looking for an icon (openoffice.org) or it's a problem when looking for an icon (jbrout.py). if (str != NULL) *str = '\0'; */ } From af3eb0e7574c7634ad6c210e161a29b6ef7025be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Fri, 6 Oct 2023 22:49:29 +0200 Subject: [PATCH 04/13] Make sure to store the original WM class for icons --- src/gldit/cairo-dock-applications-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gldit/cairo-dock-applications-manager.c b/src/gldit/cairo-dock-applications-manager.c index 24efde009..b7992a6ae 100644 --- a/src/gldit/cairo-dock-applications-manager.c +++ b/src/gldit/cairo-dock-applications-manager.c @@ -989,6 +989,7 @@ static void init_object (GldiObject *obj, gpointer attr) icon->cName = g_strdup (actor->cName ? actor->cName : actor->cClass); icon->cClass = g_strdup (actor->cClass); // we'll register the class during the loading of the icon, since it can take some time, and we don't really need the class params right now. + icon->cWmClass = g_strdup (actor->cWmClass); icon->iface.load_image = _load_appli; icon->iface.action_on_drag_hover = _show_appli_for_drop; From 186d1442f6f1be94ec7575f7dced4621354fcf8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Fri, 6 Oct 2023 22:49:58 +0200 Subject: [PATCH 05/13] Rewrite the search for desktop files to handle more cases --- src/gldit/cairo-dock-class-manager.c | 70 +++++++++++++++++----------- 1 file changed, 44 insertions(+), 26 deletions(-) diff --git a/src/gldit/cairo-dock-class-manager.c b/src/gldit/cairo-dock-class-manager.c index 4675b5665..bec7b86ef 100644 --- a/src/gldit/cairo-dock-class-manager.c +++ b/src/gldit/cairo-dock-class-manager.c @@ -1595,6 +1595,25 @@ const CairoDockImageBuffer *cairo_dock_get_class_image_buffer (const gchar *cCla } +static gboolean _check_desktop_file_exists(GString *sDesktopFilePath, const gchar *cFileName, const char *prefix) +{ + // TODO: use XDG_DATA_DIRS instead of hard-coded values! + if (prefix) g_string_printf (sDesktopFilePath, "/usr/share/applications/%s%s", prefix, cFileName); + else g_string_printf (sDesktopFilePath, "/usr/share/applications/%s", cFileName); + if (g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) return TRUE; + + if(prefix) g_string_printf (sDesktopFilePath, "/usr/local/share/applications/%s%s", prefix, cFileName); + else g_string_printf (sDesktopFilePath, "/usr/local/share/applications/%s", cFileName); + if (g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) return TRUE; + + if(prefix) g_string_printf (sDesktopFilePath, "%s/.local/share/applications/%s%s", g_getenv ("HOME"), prefix, cFileName); + else g_string_printf (sDesktopFilePath, "%s/.local/share/applications/%s", g_getenv ("HOME"), cFileName); + if (g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) return TRUE; + + return FALSE; +} + + static gchar *_search_desktop_file (const gchar *cDesktopFile) // file, path or even class { if (cDesktopFile == NULL) @@ -1611,39 +1630,38 @@ static gchar *_search_desktop_file (const gchar *cDesktopFile) // file, path or cDesktopFileName = g_strdup_printf ("%s.desktop", cDesktopFile); const gchar *cFileName = (cDesktopFileName ? cDesktopFileName : cDesktopFile); - gboolean bFound = TRUE; + gboolean bFound; GString *sDesktopFilePath = g_string_new (""); - g_string_printf (sDesktopFilePath, "/usr/share/applications/%s", cFileName); - if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) + gchar *cFileNameLower = NULL; + + bFound = _check_desktop_file_exists (sDesktopFilePath, cFileName, NULL); + + if (! bFound) + { + cFileNameLower = g_ascii_strdown (cFileName, -1); + bFound = _check_desktop_file_exists (sDesktopFilePath, cFileNameLower, NULL); + } + if (! bFound) { - const gchar *cFileNameLower = g_ascii_strdown (cFileName, -1); - g_string_printf (sDesktopFilePath, "/usr/share/applications/%s", cFileNameLower); - if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) + const char *prefices[] = {"org.gnome.", "org.kde.", "org.freedesktop.", "xfce4/", "kde4/", NULL}; + int i, j; + for (i = 0; i < 3; i++) { - g_string_printf (sDesktopFilePath, "/usr/share/applications/%c%s", g_ascii_toupper (*cFileNameLower), cFileNameLower+1); // handle stupid cases like Thunar.desktop - if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) + /* note: third iteration is to handle very stupid cases such as + * org.gnome.Evince.desktop with app-id == "evince" (happens for + * version 42.3 that is on Ubuntu 22.04) */ + if (i == 2) cFileNameLower[0] = g_ascii_toupper (cFileNameLower[0]); + const gchar *tmp = i ? cFileNameLower : cFileName; + for (j = 0; prefices[j]; j++) { - g_string_printf (sDesktopFilePath, "/usr/share/applications/org.gnome.%c%s", g_ascii_toupper (*cFileNameLower), cFileNameLower+1); // handle stupid cases like org.gnome.Evince.desktop - if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) - { - g_string_printf (sDesktopFilePath, "/usr/share/applications/xfce4/%s", cFileNameLower); - if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) - { - g_string_printf (sDesktopFilePath, "/usr/share/applications/kde4/%s", cFileNameLower); - if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) - { - g_string_printf (sDesktopFilePath, "%s/.local/share/applications/%s", g_getenv ("HOME"), cFileNameLower); - if (! g_file_test (sDesktopFilePath->str, G_FILE_TEST_EXISTS)) - { - bFound = FALSE; - } - } - } - } + bFound = _check_desktop_file_exists (sDesktopFilePath, tmp, prefices[j]); + if (bFound) break; } + if (bFound) break; } - g_free (cFileNameLower); } + + g_free (cFileNameLower); g_free (cDesktopFileName); gchar *cResult; From 7476881c887cce55c65f93b9cc9cdd6b039fced5 Mon Sep 17 00:00:00 2001 From: Daniel Kondor Date: Sat, 21 Oct 2023 11:26:21 +0200 Subject: [PATCH 06/13] Try to show the application name on subdock icons --- src/gldit/cairo-dock-class-icon-manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gldit/cairo-dock-class-icon-manager.c b/src/gldit/cairo-dock-class-icon-manager.c index e94498392..a2a5bd7f6 100644 --- a/src/gldit/cairo-dock-class-icon-manager.c +++ b/src/gldit/cairo-dock-class-icon-manager.c @@ -101,7 +101,8 @@ static void init_object (GldiObject *obj, gpointer attr) pIcon->iface.load_image = _load_image; pIcon->iGroup = pSameClassIcon->iGroup; - pIcon->cName = g_strdup (pSameClassIcon->cClass); + const gchar *cClassName = cairo_dock_get_class_name(pSameClassIcon->cClass); + pIcon->cName = g_strdup (cClassName ? cClassName : pSameClassIcon->cClass); pIcon->cCommand = g_strdup (pSameClassIcon->cCommand); pIcon->pMimeTypes = g_strdupv (pSameClassIcon->pMimeTypes); pIcon->cClass = g_strdup (pSameClassIcon->cClass); From 1d41a2f5c3f542381de32e4a39ed19debf007c47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Sat, 24 Feb 2024 12:42:53 +0100 Subject: [PATCH 07/13] Help: properly handle whitespace --- Help/src/applet-tips-dialog.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/Help/src/applet-tips-dialog.c b/Help/src/applet-tips-dialog.c index ea3fa4943..7fe329dcc 100644 --- a/Help/src/applet-tips-dialog.c +++ b/Help/src/applet-tips-dialog.c @@ -40,7 +40,7 @@ static void _cairo_dock_get_next_tip (CDTipsData *pTips) { pTips->iNumTipKey ++; // skip the current expander to go to the current label, which will be skipped in the first iteration. const gchar *cGroupName = pTips->pGroupList[pTips->iNumTipGroup]; - gboolean bOk; + gboolean bOk = FALSE; do { pTips->iNumTipKey ++; @@ -77,8 +77,13 @@ static void _cairo_dock_get_next_tip (CDTipsData *pTips) // check if the key is an expander widget. const gchar *cKeyName = pTips->pKeyList[pTips->iNumTipKey]; gchar *cKeyComment = g_key_file_get_comment (pTips->pKeyFile, cGroupName, cKeyName, NULL); - bOk = (cKeyComment && *cKeyComment == CAIRO_DOCK_WIDGET_EXPANDER); // whether it's an expander. - g_free (cKeyComment); + if (cKeyComment) + { + gchar *tmp = cKeyComment; + while (*tmp == '\t' || *tmp == '\n' || *tmp == ' ') ++tmp; + bOk = (*tmp == CAIRO_DOCK_WIDGET_EXPANDER); // whether it's an expander. + g_free (cKeyComment); + } } while (!bOk); } @@ -87,7 +92,7 @@ static void _cairo_dock_get_previous_tip (CDTipsData *pTips) pTips->iNumTipKey --; const gchar *cGroupName = pTips->pGroupList[pTips->iNumTipGroup]; - gboolean bOk; + gboolean bOk = FALSE; do { pTips->iNumTipKey --; @@ -125,7 +130,13 @@ static void _cairo_dock_get_previous_tip (CDTipsData *pTips) // check if the key is an expander widget. const gchar *cKeyName = pTips->pKeyList[pTips->iNumTipKey]; gchar *cKeyComment = g_key_file_get_comment (pTips->pKeyFile, cGroupName, cKeyName, NULL); - bOk = (cKeyComment && *cKeyComment == CAIRO_DOCK_WIDGET_EXPANDER); // whether it's an expander. + if (cKeyComment) + { + gchar *tmp = cKeyComment; + while (*tmp == '\t' || *tmp == '\n' || *tmp == ' ') ++tmp; + bOk = (*tmp == CAIRO_DOCK_WIDGET_EXPANDER); // whether it's an expander. + g_free (cKeyComment); + } } while (!bOk); } From 104826082f38d084688c8899496f9799abd13328 Mon Sep 17 00:00:00 2001 From: Youhei SASAKI Date: Sun, 14 Oct 2012 04:33:46 +0900 Subject: [PATCH 08/13] Fix Spelling Error Signed-off-by: Youhei SASAKI --- src/cairo-dock-user-menu.c | 2 +- src/implementations/cairo-dock-X-manager.c | 2 +- src/implementations/cairo-dock-X-utilities.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cairo-dock-user-menu.c b/src/cairo-dock-user-menu.c index aa93cb900..5ed8fcd82 100644 --- a/src/cairo-dock-user-menu.c +++ b/src/cairo-dock-user-menu.c @@ -926,7 +926,7 @@ static void _cairo_dock_set_custom_appli_icon (G_GNUC_UNUSED GtkMenuItem *pMenuI } // apres la boucle, i = nbre d'elements, j = l'element qui a ete enleve. if (j != -1) // un element a ete enleve. { - cd_warning ("The class '%s' was explicitely set up to use the X icon, we'll change this behavior automatically.", icon->cClass); + cd_warning ("The class '%s' was explicitly set up to use the X icon, we'll change this behavior automatically.", icon->cClass); if (j < i - 1) // ce n'est pas le dernier { pExceptions[j] = pExceptions[i-1]; diff --git a/src/implementations/cairo-dock-X-manager.c b/src/implementations/cairo-dock-X-manager.c index 373140f9c..dfe7adeb6 100644 --- a/src/implementations/cairo-dock-X-manager.c +++ b/src/implementations/cairo-dock-X-manager.c @@ -581,7 +581,7 @@ static gboolean _cairo_dock_unstack_Xevents (G_GNUC_UNUSED gpointer data) if (xactor->bIgnored) // was ignored, simply recreate it { // remove it from the table, so that the XEvent loop detects it again - g_hash_table_remove (s_hXWindowTable, &Xid); // remove it explicitely, because the 'unref' might not free it + g_hash_table_remove (s_hXWindowTable, &Xid); // remove it explicitly, because the 'unref' might not free it xactor->iLastCheckTime = -1; _delete_actor (xactor); // unref it since we don't need it anymore } diff --git a/src/implementations/cairo-dock-X-utilities.c b/src/implementations/cairo-dock-X-utilities.c index 8679d5e3d..136c8849b 100644 --- a/src/implementations/cairo-dock-X-utilities.c +++ b/src/implementations/cairo-dock-X-utilities.c @@ -1581,7 +1581,7 @@ cairo_surface_t *cairo_dock_create_surface_from_xpixmap (Pixmap Xid, int iWidth, GdkPixbuf *pPixbuf = cairo_dock_get_pixbuf_from_pixmap (Xid, TRUE); if (pPixbuf == NULL) { - cd_warning ("No thumbnail available.\nEither the WM doesn't support this functionnality, or the window was minimized when the dock has been launched."); + cd_warning ("No thumbnail available.\nEither the WM doesn't support this explicitly, or the window was minimized when the dock has been launched."); return NULL; } From 0f96a768a92e09f270ef50754747654247dd73fd Mon Sep 17 00:00:00 2001 From: Debian Cairo-dock Maintainers Date: Mon, 15 Jun 2015 16:16:44 +0900 Subject: [PATCH 09/13] Use "gnome-calculator" instead of "gcalctool" Signed-off-by: Youhei SASAKI --- .../{01gcalctool.desktop => 01gnome-calculator.desktop} | 2 +- data/themes/default-theme-panel/launchers/CMakeLists.txt | 2 +- .../{01gcalctool.desktop => 01gnome-calculator.desktop} | 2 +- data/themes/default-theme/launchers/CMakeLists.txt | 2 +- tests/config.py | 5 +---- 5 files changed, 5 insertions(+), 8 deletions(-) rename data/themes/default-theme-panel/launchers/{01gcalctool.desktop => 01gnome-calculator.desktop} (94%) rename data/themes/default-theme/launchers/{01gcalctool.desktop => 01gnome-calculator.desktop} (94%) diff --git a/data/themes/default-theme-panel/launchers/01gcalctool.desktop b/data/themes/default-theme-panel/launchers/01gnome-calculator.desktop similarity index 94% rename from data/themes/default-theme-panel/launchers/01gcalctool.desktop rename to data/themes/default-theme-panel/launchers/01gnome-calculator.desktop index 406aeca38..c800680d6 100644 --- a/data/themes/default-theme-panel/launchers/01gcalctool.desktop +++ b/data/themes/default-theme-panel/launchers/01gnome-calculator.desktop @@ -47,4 +47,4 @@ Order=6.25 Icon Type=0 Type=Application -Origin=/usr/share/applications/gcalctool.desktop;kcalc.desktop;galculator.desktop +Origin=/usr/share/applications/gnome-calculator.desktop;kcalc.desktop diff --git a/data/themes/default-theme-panel/launchers/CMakeLists.txt b/data/themes/default-theme-panel/launchers/CMakeLists.txt index 2025d9d6d..4f31229a8 100644 --- a/data/themes/default-theme-panel/launchers/CMakeLists.txt +++ b/data/themes/default-theme-panel/launchers/CMakeLists.txt @@ -4,7 +4,7 @@ install(FILES 01container.desktop 01firefox.desktop - 01gcalctool.desktop + 01gnome-calculator.desktop 01libreoffice-calc.desktop 01libreoffice-impress.desktop 01libreoffice-writer.desktop diff --git a/data/themes/default-theme/launchers/01gcalctool.desktop b/data/themes/default-theme/launchers/01gnome-calculator.desktop similarity index 94% rename from data/themes/default-theme/launchers/01gcalctool.desktop rename to data/themes/default-theme/launchers/01gnome-calculator.desktop index 1ab6a996a..d7b7398fe 100644 --- a/data/themes/default-theme/launchers/01gcalctool.desktop +++ b/data/themes/default-theme/launchers/01gnome-calculator.desktop @@ -47,4 +47,4 @@ Order=4 Icon Type=0 Type=Application -Origin=/usr/share/applications/gcalctool.desktop;kcalc.desktop;galculator.desktop +Origin=/usr/share/applications/gnome-calculator.desktop;kcalc.desktop diff --git a/data/themes/default-theme/launchers/CMakeLists.txt b/data/themes/default-theme/launchers/CMakeLists.txt index b9566d4ba..5da53b500 100644 --- a/data/themes/default-theme/launchers/CMakeLists.txt +++ b/data/themes/default-theme/launchers/CMakeLists.txt @@ -3,7 +3,7 @@ install(FILES 01firefox.desktop - 01gcalctool.desktop + 01gnome-calculator.desktop 01gimp.desktop 01gnome-terminal.desktop 01ooo-writer.desktop diff --git a/tests/config.py b/tests/config.py index 51166b200..eb7cfe5d9 100644 --- a/tests/config.py +++ b/tests/config.py @@ -1,10 +1,7 @@ -#exe = 'galculator' # name of a program that can be launched several times, and is usually not running -#wmclass = 'galculator' # its class -#desktop_file = 'fedora-galculator.desktop' # its desktop file exe = 'gnome-calculator' # name of a program that can be launched several times, and is usually not running wmclass = 'gnome-calculator' # its class -desktop_file = 'gcalctool.desktop' # its desktop file +desktop_file = 'gnome-calculator.desktop' # its desktop file exe1 = 'gnome-session-properties' # a program that doesn't have a launcher yet wmclass1 = 'gnome-session-properties' # its class From a2542d1045feb8166dbe77ef1d4d82e5465d987d Mon Sep 17 00:00:00 2001 From: Mamoru TASAKA Date: Sun, 28 Apr 2024 13:15:50 +0900 Subject: [PATCH 10/13] Help: initialize pCategoryCombo before used cairo_dock_show_tips() calls _cairo_dock_get_next_tip(pTips) , which uses pTips->pCategoryCombo , so this must be properly created (initialized) before calling _cairo_dock_get_next_tip(pTips). --- Help/src/applet-tips-dialog.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Help/src/applet-tips-dialog.c b/Help/src/applet-tips-dialog.c index 7fe329dcc..f3b723e1b 100644 --- a/Help/src/applet-tips-dialog.c +++ b/Help/src/applet-tips-dialog.c @@ -287,10 +287,6 @@ void cairo_dock_show_tips (void) pTips->iNumTipGroup = iNumTipGroup; pTips->iNumTipKey = iNumTipKey; - // update to the next tip. - if (myData.iLastTipGroup >= 0 && myData.iLastTipKey >= 0) // a previous tip exist => take the next one; - _cairo_dock_get_next_tip (pTips); - // build a list of the available groups. GtkWidget *pInteractiveWidget = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); GtkWidget *pComboBox = gtk_combo_box_text_new (); @@ -301,6 +297,11 @@ void cairo_dock_show_tips (void) } gtk_combo_box_set_active (GTK_COMBO_BOX (pComboBox), pTips->iNumTipGroup); pTips->pCategoryCombo = pComboBox; + + // update to the next tip. + if (myData.iLastTipGroup >= 0 && myData.iLastTipKey >= 0) // a previous tip exist => take the next one; + _cairo_dock_get_next_tip (pTips); + static gpointer data_combo[2]; data_combo[0] = pTips; // the 2nd data is the dialog, we'll set it after we make it. g_signal_connect (G_OBJECT (pComboBox), "changed", G_CALLBACK(_on_tips_category_changed), data_combo); From fca293f946ed3fee08e9b59bbccdb0d0c6fce478 Mon Sep 17 00:00:00 2001 From: Daniel Kondor Date: Sun, 15 Sep 2024 19:37:54 +0200 Subject: [PATCH 11/13] Bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 43e0b22e8..72b3a6fbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ include ("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/GNUInstallDirs.cmake") ########### project ############### project ("cairo-dock") -set (VERSION "3.5.0") # no dash, only numbers, dots and maybe alpha/beta/rc, e.g.: 3.3.1 or 3.3.99.alpha1 +set (VERSION "3.5.1") # no dash, only numbers, dots and maybe alpha/beta/rc, e.g.: 3.3.1 or 3.3.99.alpha1 add_definitions (-std=c99 -Wall -Wextra -Werror-implicit-function-declaration) # -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration -Wstrict-prototypes -Wreturn-type -Wparentheses -Warray-bounds) if (NOT DEFINED CMAKE_BUILD_TYPE) From a846730a35bcbf1be305560695fb11c4f95cbe88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kondor=20D=C3=A1niel?= Date: Tue, 17 Sep 2024 20:20:22 +0200 Subject: [PATCH 12/13] remove .exe and .py suffices from app IDs These are already removed in some, but not all cases, and can be potentially problematic when matching icons or desktop files. Specific example: winecfg.exe with no .desktop file and winecfg.png as icon. This can cause issues if two apps use IDs that only differ in their suffix, but this is unlikely. --- src/gldit/cairo-dock-class-manager.c | 13 +++++++------ src/implementations/cairo-dock-X-utilities.c | 6 ++---- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gldit/cairo-dock-class-manager.c b/src/gldit/cairo-dock-class-manager.c index bec7b86ef..2f9dccb41 100644 --- a/src/gldit/cairo-dock-class-manager.c +++ b/src/gldit/cairo-dock-class-manager.c @@ -1800,14 +1800,15 @@ gchar *cairo_dock_guess_class (const gchar *cCommand, const gchar *cStartupWMCla g_free (cDefaultClass); } else - { -// cResult = g_strdup (cStartupWMClass); cResult = g_ascii_strdown (cStartupWMClass, -1); -/* gchar *str = strchr (cResult, '.'); // we remove all .xxx otherwise we can't detect the lack of extension when looking for an icon (openoffice.org) or it's a problem when looking for an icon (jbrout.py). - if (str != NULL) - *str = '\0'; */ + + if (cResult) + { + // remove some suffices that can be problematic: .exe, .py (note: cResult is already lowercase here) + if (g_str_has_suffix (cResult, ".exe")) cResult[strlen (cResult) - 4] = 0; + else if (g_str_has_suffix (cResult, ".py")) cResult[strlen (cResult) - 3] = 0; + cairo_dock_remove_version_from_string (cResult); } - cairo_dock_remove_version_from_string (cResult); cd_debug (" -> '%s'", cResult); return cResult; diff --git a/src/implementations/cairo-dock-X-utilities.c b/src/implementations/cairo-dock-X-utilities.c index 136c8849b..13af72f50 100644 --- a/src/implementations/cairo-dock-X-utilities.c +++ b/src/implementations/cairo-dock-X-utilities.c @@ -1165,11 +1165,9 @@ gchar *cairo_dock_get_xwindow_class (Window Xid, gchar **cWMClass) cClass = g_ascii_strdown (pClassHint->res_class, -1); // down case because some apps change the case depending of their windows... } + if (g_str_has_suffix (cClass, ".exe")) cClass[strlen (cClass) - 4] = 0; + else if (g_str_has_suffix (cClass, ".py")) cClass[strlen (cClass) - 3] = 0; cairo_dock_remove_version_from_string (cClass); // we remore number of version (e.g. Openoffice.org-3.1) - -// gchar *str = strchr (cClass, '.'); // we remove all .xxx otherwise we can't detect the lack of extension when looking for an icon (openoffice.org) or it's a problem when looking for an icon (jbrout.py). -// if (str != NULL) -// *str = '\0'; cd_debug ("got an application with class '%s'", cClass); XFree (pClassHint->res_name); From 4bc47b3c288838842108ba9f7decdd8859b1fe89 Mon Sep 17 00:00:00 2001 From: Daniel Kondor Date: Sun, 10 Mar 2024 18:01:34 +0100 Subject: [PATCH 13/13] gnome-session: depend on ayatana indicators (as the indicator plugin now also uses them) --- .../gnome-session-x11@cairo-dock-compiz.target | 13 +------------ .../gnome-session-x11@cairo-dock-metacity.target | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-compiz.target b/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-compiz.target index 60fc23a36..a26606b73 100644 --- a/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-compiz.target +++ b/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-compiz.target @@ -20,15 +20,4 @@ After=gnome-flashback.target BindsTo=gnome-session.target After=gnome-session.target -Requires=indicators-pre.target - -# here we list the indicators that we want to load -Wants=indicator-application.service -Wants=indicator-bluetooth.service -Wants=indicator-datetime.service -Wants=indicator-keyboard.service -Wants=indicator-messages.service -Wants=indicator-power.service -Wants=indicator-printers.service -Wants=indicator-session.service -Wants=indicator-sound.service +Wants=ayatana-indicators.target diff --git a/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-metacity.target b/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-metacity.target index 60fc23a36..a26606b73 100644 --- a/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-metacity.target +++ b/data/desktop-manager/gnome-session-3.36/gnome-session-x11@cairo-dock-metacity.target @@ -20,15 +20,4 @@ After=gnome-flashback.target BindsTo=gnome-session.target After=gnome-session.target -Requires=indicators-pre.target - -# here we list the indicators that we want to load -Wants=indicator-application.service -Wants=indicator-bluetooth.service -Wants=indicator-datetime.service -Wants=indicator-keyboard.service -Wants=indicator-messages.service -Wants=indicator-power.service -Wants=indicator-printers.service -Wants=indicator-session.service -Wants=indicator-sound.service +Wants=ayatana-indicators.target