summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-04-21 23:44:43 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2017-04-21 23:44:43 +0200
commit6e2b4f4bdd36844721f50b71d0cbc159363ba25f (patch)
tree5c1dfa9c266e5aa1893f200d0488426d2c24edf9 /plugingui
parent1d7e0a638c9735d1b8a678df7f48183d046cc3e7 (diff)
Distinguish between widget and window wrt. visible().
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/eventhandler.cc3
-rw-r--r--plugingui/window.cc7
-rw-r--r--plugingui/window.h1
3 files changed, 4 insertions, 7 deletions
diff --git a/plugingui/eventhandler.cc b/plugingui/eventhandler.cc
index decca01..4200d49 100644
--- a/plugingui/eventhandler.cc
+++ b/plugingui/eventhandler.cc
@@ -67,7 +67,8 @@ void EventHandler::processEvents()
bool block_interaction{false};
for(auto dialog : dialogs)
{
- if(dialog->visible())
+ // Check if the dialog nativewindow (not the contained widget) is visible
+ if(dialog->native->visible())
{
block_interaction |= dialog->isModal();
dialog->eventHandler()->processEvents();
diff --git a/plugingui/window.cc b/plugingui/window.cc
index 3840643..099cb91 100644
--- a/plugingui/window.cc
+++ b/plugingui/window.cc
@@ -71,6 +71,8 @@ Window::Window(void* native_window)
#endif // !UI_PUGL
eventhandler = new EventHandler(*native, *this);
+
+ setVisible(true); // The root widget is always visible.
}
Window::~Window()
@@ -118,11 +120,6 @@ void Window::hide()
Widget::hide();
}
-bool Window::visible() const
-{
- return native->visible();
-}
-
Window* Window::window()
{
return this;
diff --git a/plugingui/window.h b/plugingui/window.h
index e248b69..218beec 100644
--- a/plugingui/window.h
+++ b/plugingui/window.h
@@ -52,7 +52,6 @@ public:
void move(int x, int y) override;
void show() override;
void hide() override;
- bool visible() const override;
Window* window() override;
ImageCache& getImageCache() override;