aboutsummaryrefslogtreecommitdiff
path: root/src/WinClient.cc
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-05-07 16:21:26 (GMT)
committerrathnor <rathnor>2003-05-07 16:21:26 (GMT)
commitd63bf127ad6391f3e8408ddfd0ba79c4841a1ecf (patch)
tree5888bcda58581a3c8f94bc4bac4197d585c0b459 /src/WinClient.cc
parentde68c88ed8ff8c7a887495a74de004f9da7f56df (diff)
downloadfluxbox_pavel-d63bf127ad6391f3e8408ddfd0ba79c4841a1ecf.zip
fluxbox_pavel-d63bf127ad6391f3e8408ddfd0ba79c4841a1ecf.tar.bz2
transient fixes by making them WinClients
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r--src/WinClient.cc82
1 files changed, 24 insertions, 58 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc
index ac84c91..1b468d1 100644
--- a/src/WinClient.cc
+++ b/src/WinClient.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: WinClient.cc,v 1.6 2003/05/04 23:38:06 rathnor Exp $ 22// $Id: WinClient.cc,v 1.7 2003/05/07 16:21:26 rathnor Exp $
23 23
24#include "WinClient.hh" 24#include "WinClient.hh"
25 25
@@ -54,6 +54,7 @@ WinClient::WinClient(Window win, FluxboxWindow &fbwin):FbTk::FbWindow(win),
54 mwm_hint(0), 54 mwm_hint(0),
55 blackbox_hint(0), 55 blackbox_hint(0),
56 m_win(&fbwin), 56 m_win(&fbwin),
57 modal(false),
57 m_title(""), m_icon_title(""), 58 m_title(""), m_icon_title(""),
58 m_diesig(*this) { } 59 m_diesig(*this) { }
59 60
@@ -62,42 +63,22 @@ WinClient::~WinClient() {
62 cerr<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl; 63 cerr<<__FILE__<<"(~"<<__FUNCTION__<<")[this="<<this<<"]"<<endl;
63#endif // DEBUG 64#endif // DEBUG
64 65
66 // this takes care of any focus issues
65 m_diesig.notify(); 67 m_diesig.notify();
66 68
67 Fluxbox *fluxbox = Fluxbox::instance(); 69 Fluxbox *fluxbox = Fluxbox::instance();
68 70
69 if (transient_for != 0) { 71 if (transient_for != 0) {
70 if (transientFor() == m_win) { 72 assert(transient_for != this);
71 transient_for = 0; 73 transient_for->transientList().remove(this);
72 } 74 transient_for = 0;
73
74 if (transient_for != 0) {
75 FluxboxWindow::ClientList::iterator client_it =
76 transientFor()->clientList().begin();
77 FluxboxWindow::ClientList::iterator client_it_end =
78 transientFor()->clientList().end();
79 for (; client_it != client_it_end; ++client_it) {
80 (*client_it)->transientList().remove(m_win);
81 }
82
83 transient_for->setInputFocus();
84 transient_for = 0;
85 }
86 } 75 }
87
88 while (!transients.empty()) {
89 FluxboxWindow::ClientList::iterator it =
90 transients.back()->clientList().begin();
91 FluxboxWindow::ClientList::iterator it_end =
92 transients.back()->clientList().end();
93 for (; it != it_end; ++it) {
94 if ((*it)->transientFor() == m_win)
95 (*it)->transient_for = 0;
96 }
97 76
77 while (!transients.empty()) {
78 transients.back()->transient_for = 0;
98 transients.pop_back(); 79 transients.pop_back();
99 } 80 }
100 81
101 if (window_group != 0) { 82 if (window_group != 0) {
102 fluxbox->removeGroupSearch(window_group); 83 fluxbox->removeGroupSearch(window_group);
103 window_group = 0; 84 window_group = 0;
@@ -199,17 +180,7 @@ void WinClient::updateTransientInfo() {
199 return; 180 return;
200 // remove us from parent 181 // remove us from parent
201 if (transientFor() != 0) { 182 if (transientFor() != 0) {
202 //!! TODO 183 transientFor()->transientList().remove(this);
203 // since we don't know which client in transientFor()
204 // that we're transient for then we just remove us
205 // from every client in transientFor() clientlist
206 FluxboxWindow::ClientList::iterator client_it =
207 transientFor()->clientList().begin();
208 FluxboxWindow::ClientList::iterator client_it_end =
209 transientFor()->clientList().end();
210 for (; client_it != client_it_end; ++client_it) {
211 (*client_it)->transientList().remove(m_win);
212 }
213 } 184 }
214 185
215 transient_for = 0; 186 transient_for = 0;
@@ -223,21 +194,19 @@ void WinClient::updateTransientInfo() {
223 if (win == window()) 194 if (win == window())
224 return; 195 return;
225 196
226 if (win != 0 && m_win->getScreen().getRootWindow() == win) { 197 if (win != None && m_win->getScreen().getRootWindow() == win) {
227 m_win->modal = true; 198 modal = true;
228 return; 199 return; // transient for root window...
229 } 200 }
230 201
231 transient_for = Fluxbox::instance()->searchWindow(win); 202 FluxboxWindow *transient_win = Fluxbox::instance()->searchWindow(win);
232 if (transient_for != 0 && 203 if (transient_win)
233 window_group != None && win == window_group) { 204 transient_for = transient_win->findClient(win);
234 transient_for = Fluxbox::instance()->searchGroup(win, m_win); 205
235 }
236
237 // make sure we don't have deadlock loop in transient chain 206 // make sure we don't have deadlock loop in transient chain
238 for (FluxboxWindow *w = m_win; w != 0; w = w->m_client->transient_for) { 207 for (WinClient *w = this; w != 0; w = w->transient_for) {
239 if (w == w->m_client->transient_for) { 208 if (w == w->transient_for) {
240 w->m_client->transient_for = 0; 209 w->transient_for = 0;
241 break; 210 break;
242 } 211 }
243 } 212 }
@@ -245,13 +214,10 @@ void WinClient::updateTransientInfo() {
245 if (transientFor() != 0) { 214 if (transientFor() != 0) {
246 // we need to add ourself to the right client in 215 // we need to add ourself to the right client in
247 // the transientFor() window so we search client 216 // the transientFor() window so we search client
248 WinClient *client = transientFor()->findClient(win); 217 transient_for->transientList().push_back(this);
249 assert(client != 0); 218
250 client->transientList().push_back(m_win); 219 if (transientFor()->fbwindow() && transientFor()->fbwindow()->isStuck())
251 // make sure we only have on instance of this 220 m_win->stick();
252 client->transientList().unique();
253 if (transientFor()->isStuck())
254 m_win->stick();
255 } 221 }
256} 222}
257 223