Skip to content

Commit

Permalink
[x11] Impl Window::setVisible/isVisible() (fix #99)
Browse files Browse the repository at this point in the history
  • Loading branch information
dacap committed Jul 2, 2024
1 parent 87fe104 commit 98142d9
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions os/x11/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,13 +476,20 @@ void WindowX11::setScale(const int scale)

bool WindowX11::isVisible() const
{
// TODO
return true;
XWindowAttributes attr;
memset(&attr, 0, sizeof(attr));
Status status = XGetWindowAttributes(m_display, m_window, &attr);
return ((attr.map_state & IsViewable) == IsViewable);
}

void WindowX11::setVisible(bool visible)
{
// TODO
if (visible) {
XMapWindow(m_display, m_window);
}
else {
XUnmapWindow(m_display, m_window);
}
}

void WindowX11::activate()
Expand Down

0 comments on commit 98142d9

Please sign in to comment.