diff --git a/legacy/ecore/src/lib/ecore_desktop/Ecore_Desktop.h b/legacy/ecore/src/lib/ecore_desktop/Ecore_Desktop.h index edf7a19e4b..1c32696b8f 100644 --- a/legacy/ecore/src/lib/ecore_desktop/Ecore_Desktop.h +++ b/legacy/ecore/src/lib/ecore_desktop/Ecore_Desktop.h @@ -55,9 +55,11 @@ struct _Ecore_Desktop char *URL; char *file; char *deletiondate; - char *startup; char *window_class; - int allocated; /* FIXME: NoDisplay, Hidden */ + unsigned char startup : 1; + unsigned char hidden : 1; + unsigned char no_display : 1; + unsigned char allocated : 1; /* Actually calling this st_mtime causes compile issues, must be some strange macros at work. */ time_t mtime; /* For checking if the cache is valid. */ }; diff --git a/legacy/ecore/src/lib/ecore_desktop/ecore_desktop.c b/legacy/ecore/src/lib/ecore_desktop/ecore_desktop.c index 01d0ce9320..962e5139b6 100644 --- a/legacy/ecore/src/lib/ecore_desktop/ecore_desktop.c +++ b/legacy/ecore/src/lib/ecore_desktop/ecore_desktop.c @@ -337,14 +337,22 @@ ecore_desktop_get(const char *file, const char *lang) (char *)ecore_hash_get(result->group, "X-KDE-StartupNotify"); if (value) - result->startup = - (!strcmp(value, "true")) ? "1" : "0"; + result->startup = (strcmp(value, "true") == 0); value = (char *)ecore_hash_get(result->group, "StartupNotify"); if (value) - result->startup = - (!strcmp(value, "true")) ? "1" : "0"; + result->startup = (strcmp(value, "true") == 0); + value = + (char *)ecore_hash_get(result->group, + "NoDisplay"); + if (value) + result->no_display = (strcmp(value, "true") == 0); + value = + (char *)ecore_hash_get(result->group, + "Hidden"); + if (value) + result->hidden = (strcmp(value, "true") == 0); /* * icon/class is a list of standard icons from the theme that can override the icon created above. @@ -500,13 +508,18 @@ ecore_desktop_save(Ecore_Desktop * desktop) if (desktop->window_class) ecore_hash_set(desktop->group, strdup("StartupWMClass"), strdup(desktop->window_class)); if (desktop->categories) ecore_hash_set(desktop->group, strdup("Categories"), strdup(desktop->categories)); ecore_hash_remove(desktop->group, "X-KDE-StartupNotify"); - if (desktop->startup) - { - if (desktop->startup[0] == '1') - ecore_hash_set(desktop->group, strdup("StartupNotify"), strdup("true")); - else - ecore_hash_set(desktop->group, strdup("StartupNotify"), strdup("false")); - } + if (desktop->startup) + ecore_hash_set(desktop->group, strdup("StartupNotify"), strdup("true")); + else + ecore_hash_remove(desktop->group, "StartupNotify"); + if (desktop->no_display) + ecore_hash_set(desktop->group, strdup("NoDisplay"), strdup("true")); + else + ecore_hash_remove(desktop->group, "NoDisplay"); + if (desktop->hidden) + ecore_hash_set(desktop->group, strdup("Hidden"), strdup("true")); + else + ecore_hash_remove(desktop->group, "Hidden"); /* FIXME: deal with the ShowIn's. */