Commit eca46270 authored by cutealien's avatar cutealien

Reverted r4918 (fullscreen window manager on Linux) as it has several problems...

Reverted r4918 (fullscreen window manager on Linux) as it has several problems on KDE which make it behave a lot worse than before.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4932 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 508172dd
...@@ -5,7 +5,6 @@ Changes in 1.9 (not yet released) ...@@ -5,7 +5,6 @@ Changes in 1.9 (not yet released)
- Added helper functions for converting between wchar and utf-8. Patch provided by Hendu. - Added helper functions for converting between wchar and utf-8. Patch provided by Hendu.
- Added sphere frustum culling support. Patch provided by Hendu. - Added sphere frustum culling support. Patch provided by Hendu.
- Fixed issues with setViewPort method under OpenGL. (reported by anontypist) - Fixed issues with setViewPort method under OpenGL. (reported by anontypist)
- Added support for fullscreen window manager on linux. Patch provided by Deve.
- Fixed several selection, highlighting and clipping bugs in CGUITreeview (thx @ AReichl for the patch + test) - Fixed several selection, highlighting and clipping bugs in CGUITreeview (thx @ AReichl for the patch + test)
- Removed DllMain from the static windows build (thx @ AReichl for reporting) - Removed DllMain from the static windows build (thx @ AReichl for reporting)
- Fixed maximize/minimize under Linux by supporting NETWM hints. Patch provided by hendu. - Fixed maximize/minimize under Linux by supporting NETWM hints. Patch provided by hendu.
......
...@@ -685,20 +685,9 @@ bool CIrrDeviceLinux::createWindow() ...@@ -685,20 +685,9 @@ bool CIrrDeviceLinux::createWindow()
y = CreationParams.WindowPosition.Y; y = CreationParams.WindowPosition.Y;
} }
Atom *list = 0; // create new Window
Atom type = 0; // Remove window manager decoration in fullscreen
int form = 0; WndAttributes.override_redirect = CreationParams.Fullscreen;
unsigned long remain = 0, len = 0;
Atom WMCheck = XInternAtom(XDisplay, "_NET_SUPPORTING_WM_CHECK", false);
Status s = XGetWindowProperty(XDisplay, DefaultRootWindow(XDisplay), WMCheck, 0L, 1L, False, XA_WINDOW,
&type, &form, &len, &remain, (unsigned char **)&list);
bool netWM = (s == Success) && len;
// create new Window
// Remove window manager decoration in fullscreen
WndAttributes.override_redirect = !netWM && CreationParams.Fullscreen;
XWindow = XCreateWindow(XDisplay, XWindow = XCreateWindow(XDisplay,
RootWindow(XDisplay, VisualInfo->screen), RootWindow(XDisplay, VisualInfo->screen),
x, y, Width, Height, 0, VisualInfo->depth, x, y, Width, Height, 0, VisualInfo->depth,
...@@ -713,45 +702,14 @@ bool CIrrDeviceLinux::createWindow() ...@@ -713,45 +702,14 @@ bool CIrrDeviceLinux::createWindow()
XSetWMProtocols(XDisplay, XWindow, &wmDelete, 1); XSetWMProtocols(XDisplay, XWindow, &wmDelete, 1);
if (CreationParams.Fullscreen) if (CreationParams.Fullscreen)
{ {
if (netWM) XSetInputFocus(XDisplay, XWindow, RevertToParent, CurrentTime);
{ int grabKb = XGrabKeyboard(XDisplay, XWindow, True, GrabModeAsync,
// Workaround for Gnome which sometimes creates window smaller than display GrabModeAsync, CurrentTime);
XSizeHints *hints = XAllocSizeHints(); IrrPrintXGrabError(grabKb, "XGrabKeyboard");
hints->flags=PMinSize; int grabPointer = XGrabPointer(XDisplay, XWindow, True, ButtonPressMask,
hints->min_width=Width; GrabModeAsync, GrabModeAsync, XWindow, None, CurrentTime);
hints->min_height=Height; IrrPrintXGrabError(grabPointer, "XGrabPointer");
XSetWMNormalHints(XDisplay, XWindow, hints); XWarpPointer(XDisplay, None, XWindow, 0, 0, 0, 0, 0, 0);
XFree(hints);
// Set the fullscreen mode via the window manager. This allows alt-tabing, volume hot keys & others.
// Get the needed atom from there freedesktop names
Atom WMStateAtom = XInternAtom(XDisplay, "_NET_WM_STATE", true);
Atom WMFullscreenAtom = XInternAtom(XDisplay, "_NET_WM_STATE_FULLSCREEN", true);
// Set the fullscreen property
XChangeProperty(XDisplay, XWindow, WMStateAtom, XA_ATOM, 32, PropModeReplace, reinterpret_cast<unsigned char *>(& WMFullscreenAtom), 1);
// Notify the root window
XEvent xev = {0}; // The event should be filled with zeros before setting its attributes
xev.type = ClientMessage;
xev.xclient.window = XWindow;
xev.xclient.message_type = WMStateAtom;
xev.xclient.format = 32;
xev.xclient.data.l[0] = 1;
xev.xclient.data.l[1] = WMFullscreenAtom;
XSendEvent(XDisplay, DefaultRootWindow(XDisplay), false, SubstructureRedirectMask | SubstructureNotifyMask, &xev);
}
else
{
XSetInputFocus(XDisplay, XWindow, RevertToParent, CurrentTime);
int grabKb = XGrabKeyboard(XDisplay, XWindow, True, GrabModeAsync,
GrabModeAsync, CurrentTime);
IrrPrintXGrabError(grabKb, "XGrabKeyboard");
int grabPointer = XGrabPointer(XDisplay, XWindow, True, ButtonPressMask,
GrabModeAsync, GrabModeAsync, XWindow, None, CurrentTime);
IrrPrintXGrabError(grabPointer, "XGrabPointer");
XWarpPointer(XDisplay, None, XWindow, 0, 0, 0, 0, 0, 0);
}
} }
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment