Set WM_CLASS in X11.

This commit is contained in:
Themaister 2012-10-26 23:01:32 +02:00
parent e53dd431b4
commit bda505c95b
5 changed files with 20 additions and 5 deletions

View File

@ -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);

View File

@ -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];

View File

@ -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,

View File

@ -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);

View File

@ -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)
{