|
@@ -182,8 +182,38 @@ void OS_X11::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi
|
|
|
|
|
|
// borderless fullscreen window mode
|
|
|
if (current_videomode.fullscreen) {
|
|
|
+#ifndef EXPERIMENTAL_WM_API
|
|
|
+ // needed for lxde/openbox, possibly others
|
|
|
+ Hints hints;
|
|
|
+ Atom property;
|
|
|
+ hints.flags = 2;
|
|
|
+ hints.decorations = 0;
|
|
|
+ property = XInternAtom(x11_display, "_MOTIF_WM_HINTS", True);
|
|
|
+ XChangeProperty(x11_display, x11_window, property, property, 32, PropModeReplace, (unsigned char *)&hints, 5);
|
|
|
+ XMapRaised(x11_display, x11_window);
|
|
|
+ XWindowAttributes xwa;
|
|
|
+ XGetWindowAttributes(x11_display, DefaultRootWindow(x11_display), &xwa);
|
|
|
+ XMoveResizeWindow(x11_display, x11_window, 0, 0, xwa.width, xwa.height);
|
|
|
+
|
|
|
+ // code for netwm-compliants
|
|
|
+ XEvent xev;
|
|
|
+ Atom wm_state = XInternAtom(x11_display, "_NET_WM_STATE", False);
|
|
|
+ Atom fullscreen = XInternAtom(x11_display, "_NET_WM_STATE_FULLSCREEN", False);
|
|
|
+
|
|
|
+ memset(&xev, 0, sizeof(xev));
|
|
|
+ xev.type = ClientMessage;
|
|
|
+ xev.xclient.window = x11_window;
|
|
|
+ xev.xclient.message_type = wm_state;
|
|
|
+ xev.xclient.format = 32;
|
|
|
+ xev.xclient.data.l[0] = 1;
|
|
|
+ xev.xclient.data.l[1] = fullscreen;
|
|
|
+ xev.xclient.data.l[2] = 0;
|
|
|
+
|
|
|
+ XSendEvent(x11_display, DefaultRootWindow(x11_display), False, SubstructureNotifyMask, &xev);
|
|
|
+#else
|
|
|
set_wm_border(false);
|
|
|
set_wm_fullscreen(true);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
// disable resizeable window
|
|
@@ -496,6 +526,7 @@ void OS_X11::get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen) cons
|
|
|
|
|
|
}
|
|
|
|
|
|
+#ifdef EXPERIMENTAL_WM_API
|
|
|
void OS_X11::set_wm_border(bool p_enabled) {
|
|
|
// needed for lxde/openbox, possibly others
|
|
|
Hints hints;
|
|
@@ -639,6 +670,7 @@ void OS_X11::set_fullscreen(bool p_enabled,int p_screen) {
|
|
|
bool OS_X11::is_fullscreen() const {
|
|
|
return current_videomode.fullscreen;
|
|
|
}
|
|
|
+#endif
|
|
|
|
|
|
InputModifierState OS_X11::get_key_modifier_state(unsigned int p_x11_state) {
|
|
|
|