diff --git a/src/FocusControl.cc b/src/FocusControl.cc index 5bf113f1..383de612 100644 --- a/src/FocusControl.cc +++ b/src/FocusControl.cc @@ -53,7 +53,7 @@ namespace { bool doSkipWindow(const Focusable &win, const ClientPattern *pat) { const FluxboxWindow *fbwin = win.fbwindow(); - if (!fbwin || fbwin->isFocusHidden()) + if (!fbwin || fbwin->isFocusHidden() || fbwin->isModal()) return true; // skip if no fbwindow or if focushidden if (pat && !pat->match(win)) return true; // skip if it doesn't match the pattern diff --git a/src/Focusable.hh b/src/Focusable.hh index 679e00be..fd0705b7 100644 --- a/src/Focusable.hh +++ b/src/Focusable.hh @@ -54,8 +54,10 @@ public: /// @return true if the focusable has input focus virtual bool isFocused() const { return m_focused; } - /// @return return true if it can be focused + /// @return true if it can be focused virtual bool acceptsFocus() const { return true; } + /// @return true if temporarily prevented from being focused + virtual bool isModal() const { return false; } /// @return true if icon button should appear focused bool getAttentionState() const { return m_attention_state; } diff --git a/src/Window.cc b/src/Window.cc index f5a2fe24..3c8f87b3 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3306,6 +3306,10 @@ bool FluxboxWindow::acceptsFocus() const { return (m_client ? m_client->acceptsFocus() : false); } +bool FluxboxWindow::isModal() const { + return (m_client ? m_client->isModal() : true); +} + const FbTk::PixmapWithMask &FluxboxWindow::icon() const { return (m_client ? m_client->icon() : m_icon); } diff --git a/src/Window.hh b/src/Window.hh index 0d2cadd1..8c97c7b2 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -414,6 +414,7 @@ public: FbTk::FbWindow &parent() { return m_parent; } bool acceptsFocus() const; + bool isModal() const; const FbTk::PixmapWithMask &icon() const; const FbTk::BiDiString &title() const; const FbTk::FbString &getWMClassName() const;