Restore state checking for fullscreen toggle

This commit is contained in:
Phillip Stephens 2015-11-04 20:52:33 -08:00
parent ea922183cc
commit 86491e5585

View File

@ -367,7 +367,7 @@ public:
};
struct WindowXlib : IWindow
class WindowXlib : public IWindow
{
Display* m_xDisp;
IWindowCallback* m_callback;
@ -389,6 +389,7 @@ struct WindowXlib : IWindow
/* Cached window rectangle (to avoid repeated X queries) */
int m_wx, m_wy, m_ww, m_wh;
float m_pixelFactor;
bool m_inFs = false;
public:
@ -593,12 +594,16 @@ public:
XFree(vals);
return fullscreen;
}
return false;
}
void setFullscreen(bool fs)
{
XEvent fsEvent;
if (fs == m_inFs)
return;
XEvent fsEvent = {0};
fsEvent.xclient.type = ClientMessage;
fsEvent.xclient.window = m_windowId;
fsEvent.xclient.message_type = XInternAtom(m_xDisp, "_NET_WM_STATE", False);
@ -608,6 +613,7 @@ public:
fsEvent.xclient.data.l[2] = 0;
XSendEvent(m_xDisp, DefaultRootWindow(m_xDisp), False,
StructureNotifyMask | SubstructureRedirectMask, (XEvent*)&fsEvent);
m_inFs = fs;
}
void waitForRetrace()