diff options
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r-- | src/WinClient.cc | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc index 3f048d0..b731c34 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc | |||
@@ -77,7 +77,8 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): | |||
77 | initial_state(0), | 77 | initial_state(0), |
78 | normal_hint_flags(0), | 78 | normal_hint_flags(0), |
79 | wm_hint_flags(0), | 79 | wm_hint_flags(0), |
80 | m_modal(0), | 80 | m_modal_count(0), |
81 | m_modal(false), | ||
81 | send_focus_message(false), | 82 | send_focus_message(false), |
82 | send_close_message(false), | 83 | send_close_message(false), |
83 | m_win_gravity(0), | 84 | m_win_gravity(0), |
@@ -133,13 +134,14 @@ WinClient::~WinClient() { | |||
133 | 134 | ||
134 | Fluxbox *fluxbox = Fluxbox::instance(); | 135 | Fluxbox *fluxbox = Fluxbox::instance(); |
135 | 136 | ||
136 | |||
137 | // | 137 | // |
138 | // clear transients and transient_for | 138 | // clear transients and transient_for |
139 | // | 139 | // |
140 | if (transient_for != 0) { | 140 | if (transient_for != 0) { |
141 | assert(transient_for != this); | 141 | assert(transient_for != this); |
142 | transient_for->transientList().remove(this); | 142 | transient_for->transientList().remove(this); |
143 | if (m_modal) | ||
144 | transient_for->removeModal(); | ||
143 | transient_for = 0; | 145 | transient_for = 0; |
144 | } | 146 | } |
145 | 147 | ||
@@ -276,6 +278,8 @@ void WinClient::updateTransientInfo() { | |||
276 | // remove this from parent | 278 | // remove this from parent |
277 | if (transientFor() != 0) { | 279 | if (transientFor() != 0) { |
278 | transientFor()->transientList().remove(this); | 280 | transientFor()->transientList().remove(this); |
281 | if (m_modal) | ||
282 | transientFor()->removeModal(); | ||
279 | } | 283 | } |
280 | 284 | ||
281 | transient_for = 0; | 285 | transient_for = 0; |
@@ -337,6 +341,8 @@ void WinClient::updateTransientInfo() { | |||
337 | // we need to add ourself to the right client in | 341 | // we need to add ourself to the right client in |
338 | // the transientFor() window so we search client | 342 | // the transientFor() window so we search client |
339 | transient_for->transientList().push_back(this); | 343 | transient_for->transientList().push_back(this); |
344 | if (m_modal) | ||
345 | transient_for->addModal(); | ||
340 | } | 346 | } |
341 | 347 | ||
342 | } | 348 | } |
@@ -672,16 +678,21 @@ bool WinClient::hasGroupLeftWindow() const { | |||
672 | return false; | 678 | return false; |
673 | } | 679 | } |
674 | 680 | ||
675 | void WinClient::addModal() { | 681 | void WinClient::setStateModal(bool state) { |
676 | ++m_modal; | 682 | if (state == m_modal) |
677 | if (transient_for) | 683 | return; |
678 | transient_for->addModal(); | 684 | |
679 | } | 685 | m_modal = state; |
686 | if (transient_for) { | ||
687 | if (state) | ||
688 | transient_for->addModal(); | ||
689 | else | ||
690 | transient_for->removeModal(); | ||
691 | } | ||
680 | 692 | ||
681 | void WinClient::removeModal() { | 693 | // TODO: we're not implementing the following part of EWMH spec: |
682 | --m_modal; | 694 | // "if WM_TRANSIENT_FOR is not set or set to the root window the dialog is |
683 | if (transient_for) | 695 | // modal for its window group." |
684 | transient_for->removeModal(); | ||
685 | } | 696 | } |
686 | 697 | ||
687 | bool WinClient::validateClient() const { | 698 | bool WinClient::validateClient() const { |