From be2f9d6ef7c59535773efb10f59793b2d4de9eb3 Mon Sep 17 00:00:00 2001 From: "SND\\edgbla_cp" Date: Tue, 26 Jul 2011 13:40:31 +0000 Subject: WM_CLASS.WM_NAME (tschak909). git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@69222 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- plugins/dfxvideo/draw.c | 24 +++++++++++++++++++++--- plugins/peopsxgl/gpu.c | 27 +++++++++++++++++++++++---- 2 files changed, 44 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/dfxvideo/draw.c b/plugins/dfxvideo/draw.c index dce8e945..92150f35 100644 --- a/plugins/dfxvideo/draw.c +++ b/plugins/dfxvideo/draw.c @@ -1002,6 +1002,8 @@ void CreateDisplay(void) XvAdaptorInfo *ai; XvImageFormatValues *fo; + XClassHint* classHint; + // Open display display = XOpenDisplay(NULL); @@ -1230,9 +1232,25 @@ if (!myvisual) XSetWMHints(display,window,&wm_hints); XSetWMNormalHints(display,window,&hints); - if(pCaptionText) - XStoreName(display,window,pCaptionText); - else XStoreName(display,window,"P.E.Op.S SoftX PSX Gpu"); + + if(!pCaptionText) + pCaptionText = "P.E.Op.S SoftX PSX Gpu"; + + // set the WM_NAME and WM_CLASS of the window + + // set the titlebar name + XStoreName(display, window, pCaptionText); + + // set the name and class hints for the window manager to use + classHint = XAllocClassHint(); + if(classHint) + { + classHint->res_name = pCaptionText; + classHint->res_class = pCaptionText; + } + + XSetClassHint(display, window, classHint); + XFree(classHint); XDefineCursor(display,window,cursor); diff --git a/plugins/peopsxgl/gpu.c b/plugins/peopsxgl/gpu.c index 2527fe39..7955a11c 100644 --- a/plugins/peopsxgl/gpu.c +++ b/plugins/peopsxgl/gpu.c @@ -763,7 +763,10 @@ void sysdep_create_display(void) // create display int myscreen;char gammastr[14]; Screen * screen;XEvent event; XSizeHints hints;XWMHints wm_hints; - MotifWmHints mwmhints;Atom mwmatom;Atom delwindow; + MotifWmHints mwmhints; + Atom mwmatom; + Atom delwindow; + XClassHint* classHint; char *glxfx; glxfx=getenv("MESA_GLX_FX"); // 3dfx mesa fullscreen flag @@ -944,9 +947,25 @@ void sysdep_create_display(void) // create display XSetWMHints(display,window,&wm_hints); XSetWMNormalHints(display,window,&hints); - if(pCaptionText) // caption - XStoreName(display,window,pCaptionText); - else XStoreName(display,window,"Pete MesaGL PSX Gpu"); + + if(!pCaptionText) + pCaptionText = "Pete MesaGL PSX Gpu"; + + // set the WM_NAME and WM_CLASS of the window + + // set the titlebar name + XStoreName(display, window, pCaptionText); + + // set the name and class hints for the window manager to use + classHint = XAllocClassHint(); + if(classHint) + { + classHint->res_name = pCaptionText; + classHint->res_class = pCaptionText; + } + + XSetClassHint(display, window, classHint); + XFree(classHint); XDefineCursor(display,window,cursor); // cursor -- cgit v1.2.3