summaryrefslogtreecommitdiff
path: root/src/porting.cpp
diff options
context:
space:
mode:
authorkwolekr <kwolekr@minetest.net>2014-12-15 13:47:31 -0500
committerkwolekr <kwolekr@minetest.net>2014-12-15 13:52:10 -0500
commit8661b3587b4854f18f747a5577d0bb62998e569d (patch)
tree51286cb31aa2d29c17a2c2e7eea23de976fdee0a /src/porting.cpp
parent8fe1d3fc2e4564fd30658c7008ef7a0e6161e2d3 (diff)
downloadminetest-8661b3587b4854f18f747a5577d0bb62998e569d.tar.gz
minetest-8661b3587b4854f18f747a5577d0bb62998e569d.tar.bz2
minetest-8661b3587b4854f18f747a5577d0bb62998e569d.zip
Set WM_CLASS window hint for Xorg
Diffstat (limited to 'src/porting.cpp')
-rw-r--r--src/porting.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/porting.cpp b/src/porting.cpp
index 42ee2ffe2..e1a062ecd 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -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();