diff --git a/gfx/context/glx_ctx.c b/gfx/context/glx_ctx.c index e43260734f..11afa9f2db 100644 --- a/gfx/context/glx_ctx.c +++ b/gfx/context/glx_ctx.c @@ -296,7 +296,7 @@ static bool gfx_ctx_set_video_mode( XSetWindowBackground(g_dpy, g_win, 0); gfx_ctx_update_window_title(true); - x11_set_window_icon(g_dpy, g_win); + x11_set_window_attr(g_dpy, g_win); if (fullscreen) x11_hide_mouse(g_dpy, g_win); diff --git a/gfx/context/x11_common.c b/gfx/context/x11_common.c index 67cd53a9a0..90d49b38ab 100644 --- a/gfx/context/x11_common.c +++ b/gfx/context/x11_common.c @@ -97,7 +97,15 @@ void x11_move_window(Display *dpy, Window win, int x, int y, &xev); } -void x11_set_window_icon(Display *dpy, Window win) +static void x11_set_window_class(Display *dpy, Window win) +{ + XClassHint hint = {0}; + hint.res_name = "retroarch"; + hint.res_class = "retroarch"; + XSetClassHint(dpy, win, &hint); +} + +static void x11_set_window_icon(Display *dpy, Window win) { XA_INIT(_NET_WM_ICON); @@ -131,6 +139,12 @@ void x11_set_window_icon(Display *dpy, Window win) RARCH_ERR("[X11]: Failed to load icon from: %s\n", path); } +void x11_set_window_attr(Display *dpy, Window win) +{ + x11_set_window_icon(dpy, win); + x11_set_window_class(dpy, win); +} + void x11_suspend_screensaver(Window wnd) { char cmd[64]; diff --git a/gfx/context/x11_common.h b/gfx/context/x11_common.h index 222f16357e..d21c48313a 100644 --- a/gfx/context/x11_common.h +++ b/gfx/context/x11_common.h @@ -38,7 +38,8 @@ bool x11_enter_fullscreen(Display *dpy, unsigned width, unsigned height, XF86Vid void x11_exit_fullscreen(Display *dpy, XF86VidModeModeInfo *desktop_mode); void x11_move_window(Display *dpy, Window win, int x, int y, unsigned width, unsigned height); -void x11_set_window_icon(Display *dpy, Window win); +// Set icon, class, default stuff. +void x11_set_window_attr(Display *dpy, Window win); #ifdef HAVE_XINERAMA bool x11_get_xinerama_coord(Display *dpy, int screen, diff --git a/gfx/context/xegl_ctx.c b/gfx/context/xegl_ctx.c index e46ca1fa71..493e5d5d98 100644 --- a/gfx/context/xegl_ctx.c +++ b/gfx/context/xegl_ctx.c @@ -343,7 +343,7 @@ static bool gfx_ctx_set_video_mode( goto error; gfx_ctx_update_window_title(true); - x11_set_window_icon(g_dpy, g_win); + x11_set_window_attr(g_dpy, g_win); if (fullscreen) x11_hide_mouse(g_dpy, g_win); diff --git a/gfx/xvideo.c b/gfx/xvideo.c index 252c716671..fe7b7a9ff9 100644 --- a/gfx/xvideo.c +++ b/gfx/xvideo.c @@ -427,7 +427,7 @@ static void *xv_init(const video_info_t *video, const input_driver_t **input, vo if (gfx_window_title(buf, sizeof(buf))) XStoreName(xv->display, xv->window, buf); - x11_set_window_icon(xv->display, xv->window); + x11_set_window_attr(xv->display, xv->window); if (video->fullscreen) {