1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Set WM_CLASS window hint for Xorg

This commit is contained in:
kwolekr 2014-12-15 13:47:31 -05:00
parent 8fe1d3fc2e
commit 8661b3587b
3 changed files with 32 additions and 1 deletions

View file

@ -36,6 +36,16 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <sys/utsname.h>
#endif
#if !defined(_WIN32) && !defined(__APPLE__) && \
!defined(__ANDROID__) && !defined(SERVER)
#define XORG_USED
#endif
#ifdef XORG_USED
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
#include "config.h"
#include "debug.h"
#include "filesys.h"
@ -545,6 +555,20 @@ void initIrrlicht(irr::IrrlichtDevice * _device) {
device = _device;
}
void setXorgClassHint(const video::SExposedVideoData &video_data,
const std::string &name)
{
#ifdef XORG_USED
XClassHint *classhint = XAllocClassHint();
classhint->res_name = (char *)name.c_str();
classhint->res_class = (char *)name.c_str();
XSetClassHint((Display *)video_data.OpenGLLinux.X11Display,
video_data.OpenGLLinux.X11Window, classhint);
XFree(classhint);
#endif
}
#ifndef SERVER
v2u32 getWindowSize() {
return device->getVideoDriver()->getScreenSize();