Skip to content

Commit

Permalink
Steam related conditions to border properties
Browse files Browse the repository at this point in the history
  • Loading branch information
thewaiter committed Nov 14, 2024
1 parent 5b5c581 commit c6dbca7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/bin/e_border.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/bin/e_border.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c6dbca7

Please sign in to comment.