From 6448e1f504e4046f1fe337733b5b1070b6bda6cb Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 22 Sep 2007 10:21:18 +0000 Subject: [PATCH] Startup id bits. SVN revision: 31781 --- src/E.h | 2 ++ src/actions.c | 20 ++++++++++++++++++++ src/ewmh.c | 10 +++++----- src/mod-misc.c | 3 ++- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/src/E.h b/src/E.h index 64311640..4a49fcfe 100644 --- a/src/E.h +++ b/src/E.h @@ -423,6 +423,7 @@ typedef struct char argb_clients_inherit_attr; int image_cache_size; int mask_alpha_threshold; + char enable_startup_id; } testing; char autosave; @@ -565,6 +566,7 @@ void About(void); /* actions.c */ #define EXEC_SET_LANG 0x01 +#define EXEC_SET_STARTUP_ID 0x02 int execApplication(const char *params, int flags); void Espawn(int argc, char **argv); void EspawnCmd(const char *cmd); diff --git a/src/actions.c b/src/actions.c index 4b3096e7..cd35bb2e 100644 --- a/src/actions.c +++ b/src/actions.c @@ -22,9 +22,25 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "E.h" +#include "desktops.h" #include "file.h" #include "user.h" +static void +StartupIdExport(void) +{ + char buf[128]; + Desk *dsk; + int ax, ay; + + dsk = DesksGetCurrent(); + DeskGetArea(dsk, &ax, &ay); + + Esnprintf(buf, sizeof(buf), "e16/%d:%d:%d,%d", Mode.apps.startup_id, + dsk->num, ax, ay); + Esetenv("DESKTOP_STARTUP_ID", buf); +} + static void ExecSetupEnv(int flags) { @@ -39,6 +55,9 @@ ExecSetupEnv(int flags) /* Set up env stuff */ if (flags & EXEC_SET_LANG) LangExport(); + if (flags & EXEC_SET_STARTUP_ID) + StartupIdExport(); + #if USE_ROOTHACKLIB if (Mode.wm.window) Esetenv("LD_PRELOAD", ENLIGHTENMENT_LIB "/e16/libhack.so"); @@ -60,6 +79,7 @@ execApplication(const char *params, int flags) if (exe[0] == '\0') return -1; + Mode.apps.startup_id++; if (fork()) return 0; diff --git a/src/ewmh.c b/src/ewmh.c index 9a1dbfd8..730cccd3 100644 --- a/src/ewmh.c +++ b/src/ewmh.c @@ -658,17 +658,17 @@ EWMH_GetWindowUserTime(EWin * ewin) static void EWMH_GetWindowStartupId(EWin * ewin) { -#if 0 /* TBD */ #define TryGroup(e) (((e)->icccm.group != None) && ((e)->icccm.group != EwinGetClientXwin(e))) char *str; + if (!Conf.testing.enable_startup_id) + return; + ecore_x_netwm_startup_id_get(EwinGetClientXwin(ewin), &str); if (!str && TryGroup(ewin)) ecore_x_netwm_startup_id_get(ewin->icccm.group, &str); - Eprintf("Startup id: %s: %s\n", EwinGetTitle(ewin), str); -#else - ewin = NULL; -#endif + if (str && EDebug(1)) + Eprintf("Startup id: %s: %s\n", EwinGetTitle(ewin), str); } static void diff --git a/src/mod-misc.c b/src/mod-misc.c index 6f9250fb..55246481 100644 --- a/src/mod-misc.c +++ b/src/mod-misc.c @@ -194,6 +194,7 @@ static const CfgItem MiscCfgItems[] = { CFG_ITEM_BOOL(Conf, testing.argb_internal_clients, 0), CFG_ITEM_BOOL(Conf, testing.argb_clients, 0), CFG_ITEM_BOOL(Conf, testing.argb_clients_inherit_attr, 0), + CFG_ITEM_BOOL(Conf, testing.enable_startup_id, 1), CFG_FUNC_INT(Conf, testing.image_cache_size, -1, _CfgImageCacheSize), CFG_ITEM_INT(Conf, testing.mask_alpha_threshold, 8), @@ -207,7 +208,7 @@ static void MiscIpcExec(const char *params) { if (params) - execApplication(params, EXEC_SET_LANG); + execApplication(params, EXEC_SET_LANG | EXEC_SET_STARTUP_ID); else IpcPrintf("exec what?\n"); }