diff --git a/src/archutils/Unix/X11Helper.cpp b/src/archutils/Unix/X11Helper.cpp index 5f85f84493..a7c4b30b16 100644 --- a/src/archutils/Unix/X11Helper.cpp +++ b/src/archutils/Unix/X11Helper.cpp @@ -1,6 +1,8 @@ #include "global.h" #include "X11Helper.h" #include "RageLog.h" +#include "ProductInfo.h" +#include "Preference.h" #include "PrefsManager.h" // XXX: only used for m_bShowMouseCursor -aj Display *X11Helper::Dpy = NULL; @@ -9,6 +11,8 @@ Window X11Helper::Win = None; static int ErrorCallback( Display*, XErrorEvent* ); static int FatalCallback( Display* ); +static Preference g_XWMName( "XWMName", PRODUCT_ID ); + bool X11Helper::OpenXConnection() { DEBUG_ASSERT( Dpy == NULL && Win == None ); @@ -61,6 +65,16 @@ bool X11Helper::MakeWindow( Window &win, int screenNum, int depth, Visual *visua if( win == None ) return false; + XClassHint *hint = XAllocClassHint(); + if ( hint == NULL ) { + LOG->Warn("Could not set class hint for X11 Window"); + } else { + hint->res_name = (char*)g_XWMName.Get().c_str(); + hint->res_class = (char*)PRODUCT_FAMILY; + XSetClassHint(Dpy, win, hint); + XFree(hint); + } + // Hide the mouse cursor in certain situations. if( !PREFSMAN->m_bShowMouseCursor ) { diff --git a/src/archutils/Unix/X11Helper.h b/src/archutils/Unix/X11Helper.h index 255abbb76f..7cce4097bd 100644 --- a/src/archutils/Unix/X11Helper.h +++ b/src/archutils/Unix/X11Helper.h @@ -3,6 +3,7 @@ #define X11_HELPER_H #include // Window +#include namespace X11Helper { // All functions in here that return a bool return true on success, and