summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/e_client.c33
-rw-r--r--src/bin/e_client.h4
-rw-r--r--src/bin/e_comp_x.c8
-rw-r--r--src/bin/e_hints.c20
-rw-r--r--src/bin/e_hints.h3
5 files changed, 67 insertions, 1 deletions
diff --git a/src/bin/e_client.c b/src/bin/e_client.c
index c1d8483..2b2bcf6 100644
--- a/src/bin/e_client.c
+++ b/src/bin/e_client.c
@@ -2195,6 +2195,29 @@ _e_client_eval(E_Client *ec)
2195 } 2195 }
2196 if (!ec->desktop) 2196 if (!ec->desktop)
2197 { 2197 {
2198 if (ec->steam.steam_game_id)
2199 {
2200 Efreet_Desktop *d;
2201 Eina_List *desks = efreet_util_desktop_name_glob_list("*");
2202 EINA_LIST_FREE(desks, d)
2203 {
2204 if (!d->exec) continue;
2205 if (!strncmp(d->exec, "steam ", 6))
2206 {
2207 const char *st = strstr(d->exec, "steam://rungameid/");
2208 if (st)
2209 {
2210 st += strlen("steam://rungameid/");
2211 unsigned int id = atoi(st);
2212 if (id == ec->steam.steam_game_id)
2213 ec->desktop = d;
2214 }
2215 }
2216 }
2217 }
2218 }
2219 if (!ec->desktop)
2220 {
2198 E_Exec_Instance *inst; 2221 E_Exec_Instance *inst;
2199 2222
2200 inst = e_exec_startup_id_pid_instance_find(ec->netwm.startup_id, 2223 inst = e_exec_startup_id_pid_instance_find(ec->netwm.startup_id,
@@ -2227,9 +2250,17 @@ _e_client_eval(E_Client *ec)
2227 } 2250 }
2228 if (!ec->desktop) 2251 if (!ec->desktop)
2229 { 2252 {
2253 // special case hacks for specific apps that just don't do things
2254 // right so we have to work around them
2255 if (ec->icccm.class && ec->icccm.name &&
2256 (!strcmp(ec->icccm.class, "Steam")) &&
2257 (!strcmp(ec->icccm.name, "Steam")))
2258 {
2259 ec->desktop = efreet_util_desktop_file_id_find("steam.desktop");
2260 }
2230 /* libreoffice and maybe others match window class 2261 /* libreoffice and maybe others match window class
2231 with .desktop file name */ 2262 with .desktop file name */
2232 if (ec->icccm.class) 2263 else if (ec->icccm.class)
2233 { 2264 {
2234 char buf[4096] = {0}; 2265 char buf[4096] = {0};
2235 snprintf(buf, sizeof(buf), "%s.desktop", ec->icccm.class); 2266 snprintf(buf, sizeof(buf), "%s.desktop", ec->icccm.class);
diff --git a/src/bin/e_client.h b/src/bin/e_client.h
index ceae239..adb98fc 100644
--- a/src/bin/e_client.h
+++ b/src/bin/e_client.h
@@ -568,6 +568,10 @@ struct E_Client
568 unsigned char have_property E_BITFIELD; 568 unsigned char have_property E_BITFIELD;
569 unsigned char vkbd E_BITFIELD; 569 unsigned char vkbd E_BITFIELD;
570 } vkbd; 570 } vkbd;
571
572 struct {
573 unsigned int steam_game_id;
574 } steam;
571 575
572 struct 576 struct
573 { 577 {
diff --git a/src/bin/e_comp_x.c b/src/bin/e_comp_x.c
index 0835ee9..21d139a 100644
--- a/src/bin/e_comp_x.c
+++ b/src/bin/e_comp_x.c
@@ -560,6 +560,8 @@ _e_comp_x_client_new_helper(E_Client *ec)
560 ec->e.fetch.stack = 1; 560 ec->e.fetch.stack = 1;
561 else if (atoms[i] == ATM_GTK_FRAME_EXTENTS) 561 else if (atoms[i] == ATM_GTK_FRAME_EXTENTS)
562 ec->comp_data->fetch_gtk_frame_extents = 1; 562 ec->comp_data->fetch_gtk_frame_extents = 1;
563 else if (atoms[i] == ATM_STEAM_GAME)
564 e_hints_window_steam_game_get(ec);
563 else if (ec->re_manage) 565 else if (ec->re_manage)
564 { 566 {
565 if (atoms[i] == E_ATOM_DESKTOP_FILE) 567 if (atoms[i] == E_ATOM_DESKTOP_FILE)
@@ -2200,6 +2202,12 @@ _e_comp_x_property(void *data EINA_UNUSED, int type EINA_UNUSED, Ecore_X_Event_W
2200 _e_comp_x_client_data_get(ec)->fetch_gtk_frame_extents = 1; 2202 _e_comp_x_client_data_get(ec)->fetch_gtk_frame_extents = 1;
2201 EC_CHANGED(ec); 2203 EC_CHANGED(ec);
2202 } 2204 }
2205 else if (ev->atom == ATM_STEAM_GAME)
2206 {
2207 e_hints_window_steam_game_get(ec);
2208 ec->changes.icon = 1;
2209 EC_CHANGED(ec);
2210 }
2203 2211
2204 return ECORE_CALLBACK_RENEW; 2212 return ECORE_CALLBACK_RENEW;
2205} 2213}
diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c
index f1b8f61..eabf467 100644
--- a/src/bin/e_hints.c
+++ b/src/bin/e_hints.c
@@ -15,6 +15,8 @@ E_API Ecore_X_Atom ATM_ENLIGHTENMENT_SCALE = 0;
15E_API Ecore_X_Atom ATM_NETWM_SHOW_WINDOW_MENU = 0; 15E_API Ecore_X_Atom ATM_NETWM_SHOW_WINDOW_MENU = 0;
16E_API Ecore_X_Atom ATM_NETWM_PERFORM_BUTTON_ACTION = 0; 16E_API Ecore_X_Atom ATM_NETWM_PERFORM_BUTTON_ACTION = 0;
17E_API Ecore_X_Atom ATM_GTK_FRAME_EXTENTS = 0; 17E_API Ecore_X_Atom ATM_GTK_FRAME_EXTENTS = 0;
18
19E_API Ecore_X_Atom ATM_STEAM_GAME = 0;
18#endif 20#endif
19 21
20EINTERN void 22EINTERN void
@@ -34,6 +36,7 @@ e_hints_init(Ecore_Window root, Ecore_Window propwin)
34 "_NET_WM_SHOW_WINDOW_MENU", 36 "_NET_WM_SHOW_WINDOW_MENU",
35 "_NET_WM_PERFORM_BUTTON_ACTION", 37 "_NET_WM_PERFORM_BUTTON_ACTION",
36 "_GTK_FRAME_EXTENTS", 38 "_GTK_FRAME_EXTENTS",
39 "STEAM_GAME",
37 }; 40 };
38 Ecore_X_Atom atoms[EINA_C_ARRAY_LENGTH(atom_names)]; 41 Ecore_X_Atom atoms[EINA_C_ARRAY_LENGTH(atom_names)];
39 Ecore_X_Atom supported[46]; 42 Ecore_X_Atom supported[46];
@@ -53,6 +56,7 @@ e_hints_init(Ecore_Window root, Ecore_Window propwin)
53 ATM_NETWM_SHOW_WINDOW_MENU = atoms[6]; 56 ATM_NETWM_SHOW_WINDOW_MENU = atoms[6];
54 ATM_NETWM_PERFORM_BUTTON_ACTION = atoms[7]; 57 ATM_NETWM_PERFORM_BUTTON_ACTION = atoms[7];
55 ATM_GTK_FRAME_EXTENTS = atoms[8]; 58 ATM_GTK_FRAME_EXTENTS = atoms[8];
59 ATM_STEAM_GAME = atoms[9];
56 60
57 supported_num = 0; 61 supported_num = 0;
58 /* Set what hints we support */ 62 /* Set what hints we support */
@@ -1606,6 +1610,22 @@ e_hints_window_qtopia_soft_menus_get(E_Client *ec)
1606} 1610}
1607 1611
1608E_API void 1612E_API void
1613e_hints_window_steam_game_get(E_Client *ec)
1614{
1615#ifdef HAVE_WAYLAND_ONLY
1616 (void)ec;
1617#else
1618 unsigned int val;
1619
1620 if (!e_client_has_xwindow(ec)) return;
1621 if (ecore_x_window_prop_card32_get(e_client_util_win_get(ec), ATM_STEAM_GAME, &val, 1))
1622 ec->steam.steam_game_id = val;
1623 else
1624 ec->steam.steam_game_id = 0;
1625#endif
1626}
1627
1628E_API void
1609e_hints_window_virtual_keyboard_state_get(E_Client *ec) 1629e_hints_window_virtual_keyboard_state_get(E_Client *ec)
1610{ 1630{
1611#ifdef HAVE_WAYLAND_ONLY 1631#ifdef HAVE_WAYLAND_ONLY
diff --git a/src/bin/e_hints.h b/src/bin/e_hints.h
index 5fa1f3f..38854ae 100644
--- a/src/bin/e_hints.h
+++ b/src/bin/e_hints.h
@@ -40,6 +40,8 @@ E_API void e_hints_window_e_state_get(E_Client *ec);
40E_API void e_hints_window_qtopia_soft_menu_get(E_Client *ec); 40E_API void e_hints_window_qtopia_soft_menu_get(E_Client *ec);
41E_API void e_hints_window_qtopia_soft_menus_get(E_Client *ec); 41E_API void e_hints_window_qtopia_soft_menus_get(E_Client *ec);
42 42
43E_API void e_hints_window_steam_game_get(E_Client *ec);
44
43E_API void e_hints_window_virtual_keyboard_state_get(E_Client *ec); 45E_API void e_hints_window_virtual_keyboard_state_get(E_Client *ec);
44E_API void e_hints_window_virtual_keyboard_get(E_Client *ec); 46E_API void e_hints_window_virtual_keyboard_get(E_Client *ec);
45 47
@@ -58,6 +60,7 @@ extern E_API Ecore_X_Atom ATM_ENLIGHTENMENT_SCALE;
58extern E_API Ecore_X_Atom ATM_NETWM_SHOW_WINDOW_MENU; 60extern E_API Ecore_X_Atom ATM_NETWM_SHOW_WINDOW_MENU;
59extern E_API Ecore_X_Atom ATM_NETWM_PERFORM_BUTTON_ACTION; 61extern E_API Ecore_X_Atom ATM_NETWM_PERFORM_BUTTON_ACTION;
60extern E_API Ecore_X_Atom ATM_GTK_FRAME_EXTENTS; 62extern E_API Ecore_X_Atom ATM_GTK_FRAME_EXTENTS;
63extern E_API Ecore_X_Atom ATM_STEAM_GAME;
61#endif 64#endif
62 65
63#ifdef HAVE_WAYLAND 66#ifdef HAVE_WAYLAND