From c6dbca70beb92c05fa2c054d976ff5ed45f6da9a Mon Sep 17 00:00:00 2001 From: thewaiter Date: Thu, 14 Nov 2024 09:54:41 +0100 Subject: [PATCH] Steam related conditions to border properties --- src/bin/e_border.c | 29 ++++++++++++++++++++++++++++- src/bin/e_border.h | 4 ++++ 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 704bbd974..35b838ad0 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -9338,6 +9338,29 @@ _e_border_eval(E_Border *bd) if (!bd->desktop) bd->desktop = efreet_util_desktop_name_find(desktop); } + if (!bd->desktop) + { + if (bd->steam.steam_game_id) + { + Efreet_Desktop *d; + Eina_List *desks = efreet_util_desktop_name_glob_list("*"); + EINA_LIST_FREE(desks, d) + { + if (!d->exec) continue; + if (!strncmp(d->exec, "steam ", 6)) + { + const char *st = strstr(d->exec, "steam://rungameid/"); + if (st) + { + st += strlen("steam://rungameid/"); + unsigned int id = atoi(st); + if (id == bd->steam.steam_game_id) + bd->desktop = d; + } + } + } + } + } if (!bd->desktop) { if ((bd->client.icccm.name) && (bd->client.icccm.class)) @@ -9354,9 +9377,13 @@ _e_border_eval(E_Border *bd) } if (!bd->desktop) { + if (bd->client.icccm.class && bd->client.icccm.name && + (!strcmp(bd->client.icccm.class, "Steam")) && + (!strcmp(bd->client.icccm.name, "Steam"))) + bd->desktop = efreet_util_desktop_file_id_find("steam.desktop"); /* libreoffice and maybe others match window class with .desktop file name */ - if (bd->client.icccm.class) + else if (bd->client.icccm.class) { char buf[128]; snprintf(buf, sizeof(buf), "%s.desktop", bd->client.icccm.class); diff --git a/src/bin/e_border.h b/src/bin/e_border.h index cc9dca257..23833b713 100644 --- a/src/bin/e_border.h +++ b/src/bin/e_border.h @@ -501,6 +501,10 @@ struct _E_Border Ecore_X_Window_Attributes initial_attributes; } client; + struct { + unsigned int steam_game_id; + } steam; + E_Container_Shape *shape; unsigned int visible : 1;