Avoid semi-transparent window on some compositors

This commit is contained in:
Deve 2017-11-10 22:48:48 +01:00
parent 468c24acd3
commit 252403c9cc

View File

@ -940,8 +940,6 @@ bool CIrrDeviceLinux::createWindow()
ButtonPressMask | KeyPressMask |
ButtonReleaseMask | KeyReleaseMask;
if (!CreationParams.WindowId)
{
Atom *list;
Atom type;
int form;
@ -954,6 +952,9 @@ bool CIrrDeviceLinux::createWindow()
(unsigned char **)&list);
XFree(list);
bool netWM = (s == Success) && len;
if (!CreationParams.WindowId)
{
attributes.override_redirect = !netWM && CreationParams.Fullscreen;
// create new Window
@ -1140,6 +1141,18 @@ bool CIrrDeviceLinux::createWindow()
CreationParams.WindowSize.Width = Width;
CreationParams.WindowSize.Height = Height;
if (netWM == true)
{
Atom opaque_region = XInternAtom(display, "_NET_WM_OPAQUE_REGION", true);
if (opaque_region != None)
{
unsigned long window_rect[4] = {0, 0, Width, Height};
XChangeProperty(display, window, opaque_region, XA_CARDINAL, 32,
PropModeReplace, (unsigned char*)window_rect, 4);
}
}
StdHints = XAllocSizeHints();
long num;
XGetWMNormalHints(display, window, StdHints, &num);