mirror of
https://github.com/AxioDL/boo.git
synced 2025-05-15 03:41:23 +00:00
Restore state checking for fullscreen toggle
This commit is contained in:
parent
ea922183cc
commit
86491e5585
@ -367,7 +367,7 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct WindowXlib : IWindow
|
class WindowXlib : public IWindow
|
||||||
{
|
{
|
||||||
Display* m_xDisp;
|
Display* m_xDisp;
|
||||||
IWindowCallback* m_callback;
|
IWindowCallback* m_callback;
|
||||||
@ -389,7 +389,8 @@ struct WindowXlib : IWindow
|
|||||||
/* Cached window rectangle (to avoid repeated X queries) */
|
/* Cached window rectangle (to avoid repeated X queries) */
|
||||||
int m_wx, m_wy, m_ww, m_wh;
|
int m_wx, m_wy, m_ww, m_wh;
|
||||||
float m_pixelFactor;
|
float m_pixelFactor;
|
||||||
|
bool m_inFs = false;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
WindowXlib(const std::string& title,
|
WindowXlib(const std::string& title,
|
||||||
@ -570,7 +571,7 @@ public:
|
|||||||
{
|
{
|
||||||
return m_pixelFactor;
|
return m_pixelFactor;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isFullscreen() const
|
bool isFullscreen() const
|
||||||
{
|
{
|
||||||
unsigned long nitems;
|
unsigned long nitems;
|
||||||
@ -593,12 +594,16 @@ public:
|
|||||||
XFree(vals);
|
XFree(vals);
|
||||||
return fullscreen;
|
return fullscreen;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setFullscreen(bool fs)
|
void setFullscreen(bool fs)
|
||||||
{
|
{
|
||||||
XEvent fsEvent;
|
if (fs == m_inFs)
|
||||||
|
return;
|
||||||
|
|
||||||
|
XEvent fsEvent = {0};
|
||||||
fsEvent.xclient.type = ClientMessage;
|
fsEvent.xclient.type = ClientMessage;
|
||||||
fsEvent.xclient.window = m_windowId;
|
fsEvent.xclient.window = m_windowId;
|
||||||
fsEvent.xclient.message_type = XInternAtom(m_xDisp, "_NET_WM_STATE", False);
|
fsEvent.xclient.message_type = XInternAtom(m_xDisp, "_NET_WM_STATE", False);
|
||||||
@ -608,6 +613,7 @@ public:
|
|||||||
fsEvent.xclient.data.l[2] = 0;
|
fsEvent.xclient.data.l[2] = 0;
|
||||||
XSendEvent(m_xDisp, DefaultRootWindow(m_xDisp), False,
|
XSendEvent(m_xDisp, DefaultRootWindow(m_xDisp), False,
|
||||||
StructureNotifyMask | SubstructureRedirectMask, (XEvent*)&fsEvent);
|
StructureNotifyMask | SubstructureRedirectMask, (XEvent*)&fsEvent);
|
||||||
|
m_inFs = fs;
|
||||||
}
|
}
|
||||||
|
|
||||||
void waitForRetrace()
|
void waitForRetrace()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user