aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-06-30 16:54:05 (GMT)
committermarkt <markt>2007-06-30 16:54:05 (GMT)
commit0f9f19344466cf25170750f768815daf3bdfd2ae (patch)
tree65584eade13f0135102e0284b1981c3ee8ba6282 /src/WinClient.cc
parent8e75ace959d2a5d56d30cb6a06ce895f397c1f19 (diff)
downloadfluxbox_pavel-0f9f19344466cf25170750f768815daf3bdfd2ae.zip
fluxbox_pavel-0f9f19344466cf25170750f768815daf3bdfd2ae.tar.bz2
fixed implementation of _NET_WM_STATE_MODAL
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index 250a0b8..fd1944b 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -76,7 +76,8 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::Fb
76 normal_hint_flags(0), 76 normal_hint_flags(0),
77 wm_hint_flags(0), 77 wm_hint_flags(0),
78 m_win(fbwin), 78 m_win(fbwin),
79 m_modal(0), 79 m_modal_count(0),
80 m_modal(false),
80 send_focus_message(false), 81 send_focus_message(false),
81 send_close_message(false), 82 send_close_message(false),
82 m_win_gravity(0), 83 m_win_gravity(0),
@@ -136,13 +137,14 @@ WinClient::~WinClient() {
136 137
137 Fluxbox *fluxbox = Fluxbox::instance(); 138 Fluxbox *fluxbox = Fluxbox::instance();
138 139
139
140 // 140 //
141 // clear transients and transient_for 141 // clear transients and transient_for
142 // 142 //
143 if (transient_for != 0) { 143 if (transient_for != 0) {
144 assert(transient_for != this); 144 assert(transient_for != this);
145 transient_for->transientList().remove(this); 145 transient_for->transientList().remove(this);
146 if (m_modal)
147 transient_for->removeModal();
146 transient_for = 0; 148 transient_for = 0;
147 } 149 }
148 150
@@ -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}
@@ -663,16 +669,21 @@ bool WinClient::hasGroupLeftWindow() const {
663 return false; 669 return false;
664} 670}
665 671
666void WinClient::addModal() { 672void WinClient::setStateModal(bool state) {
667 ++m_modal; 673 if (state == m_modal)
668 if (transient_for) 674 return;
669 transient_for->addModal(); 675
670} 676 m_modal = state;
677 if (transient_for) {
678 if (state)
679 transient_for->addModal();
680 else
681 transient_for->removeModal();
682 }
671 683
672void WinClient::removeModal() { 684 // TODO: we're not implementing the following part of EWMH spec:
673 --m_modal; 685 // "if WM_TRANSIENT_FOR is not set or set to the root window the dialog is
674 if (transient_for) 686 // modal for its window group."
675 transient_for->removeModal();
676} 687}
677 688
678bool WinClient::validateClient() const { 689bool WinClient::validateClient() const {