diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/WinClient.cc | 33 | ||||
-rw-r--r-- | src/WinClient.hh | 3 |
2 files changed, 25 insertions, 11 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc index fe06245..a31094e 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.40 2004/06/07 11:46:04 rathnor Exp $ | 22 | // $Id: WinClient.cc,v 1.41 2004/08/10 13:36:07 fluxgen Exp $ |
23 | 23 | ||
24 | #include "WinClient.hh" | 24 | #include "WinClient.hh" |
25 | 25 | ||
@@ -157,7 +157,10 @@ bool WinClient::acceptsFocus() const { | |||
157 | bool WinClient::sendFocus() { | 157 | bool WinClient::sendFocus() { |
158 | if (!send_focus_message) | 158 | if (!send_focus_message) |
159 | return false; | 159 | return false; |
160 | 160 | #ifdef DEBUG | |
161 | cerr<<"WinClient::"<<__FUNCTION__<<": this = "<<this<< | ||
162 | " window = 0x"<<hex<<window()<<dec<<endl; | ||
163 | #endif // DEBUG | ||
161 | Display *disp = FbTk::App::instance()->display(); | 164 | Display *disp = FbTk::App::instance()->display(); |
162 | // setup focus msg | 165 | // setup focus msg |
163 | XEvent ce; | 166 | XEvent ce; |
@@ -199,10 +202,6 @@ void WinClient::sendClose(bool forceful) { | |||
199 | } | 202 | } |
200 | } | 203 | } |
201 | 204 | ||
202 | void WinClient::reparent(Window win, int x, int y) { | ||
203 | XReparentWindow(FbTk::App::instance()->display(), window(), win, x, y); | ||
204 | } | ||
205 | |||
206 | bool WinClient::getAttrib(XWindowAttributes &attr) const { | 205 | bool WinClient::getAttrib(XWindowAttributes &attr) const { |
207 | return XGetWindowAttributes(FbTk::App::instance()->display(), window(), &attr); | 206 | return XGetWindowAttributes(FbTk::App::instance()->display(), window(), &attr); |
208 | } | 207 | } |
@@ -248,8 +247,12 @@ void WinClient::updateWMClassHint() { | |||
248 | } | 247 | } |
249 | 248 | ||
250 | void WinClient::updateTransientInfo() { | 249 | void WinClient::updateTransientInfo() { |
250 | #ifdef DEBUG | ||
251 | cerr<<__FUNCTION__<<": m_win = "<<m_win<<endl; | ||
252 | #endif // DEBUG | ||
251 | if (m_win == 0) | 253 | if (m_win == 0) |
252 | return; | 254 | return; |
255 | |||
253 | // remove us from parent | 256 | // remove us from parent |
254 | if (transientFor() != 0) { | 257 | if (transientFor() != 0) { |
255 | transientFor()->transientList().remove(this); | 258 | transientFor()->transientList().remove(this); |
@@ -258,13 +261,21 @@ void WinClient::updateTransientInfo() { | |||
258 | transient_for = 0; | 261 | transient_for = 0; |
259 | Display *disp = FbTk::App::instance()->display(); | 262 | Display *disp = FbTk::App::instance()->display(); |
260 | // determine if this is a transient window | 263 | // determine if this is a transient window |
261 | Window win; | 264 | Window win = 0; |
262 | if (!XGetTransientForHint(disp, window(), &win)) | 265 | if (!XGetTransientForHint(disp, window(), &win)) { |
266 | #ifdef DEBUG | ||
267 | cerr<<__FUNCTION__<<": window() = 0x"<<hex<<window()<<dec<<"Failed to read transient for hint."<<endl; | ||
268 | #endif // DEBUG | ||
263 | return; | 269 | return; |
270 | } | ||
264 | 271 | ||
265 | // we can't be transient to ourself | 272 | // we can't be transient to ourself |
266 | if (win == window()) | 273 | if (win == window()) { |
274 | #ifdef DEBUG | ||
275 | cerr<<__FUNCTION__<<": transient to ourself"<<endl; | ||
276 | #endif // DEBUG | ||
267 | return; | 277 | return; |
278 | } | ||
268 | 279 | ||
269 | if (win != None && m_win->screen().rootWindow() == win) { | 280 | if (win != None && m_win->screen().rootWindow() == win) { |
270 | // transient for root window... = transient for group | 281 | // transient for root window... = transient for group |
@@ -275,6 +286,10 @@ void WinClient::updateTransientInfo() { | |||
275 | 286 | ||
276 | transient_for = Fluxbox::instance()->searchWindow(win); | 287 | transient_for = Fluxbox::instance()->searchWindow(win); |
277 | 288 | ||
289 | #ifdef DEBUG | ||
290 | cerr<<__FUNCTION__<<": transient_for window = 0x"<<hex<<win<<dec<<endl; | ||
291 | cerr<<__FUNCTION__<<": transient_for = "<<transient_for<<endl; | ||
292 | #endif // DEBUG | ||
278 | // make sure we don't have deadlock loop in transient chain | 293 | // make sure we don't have deadlock loop in transient chain |
279 | for (WinClient *w = this; w != 0; w = w->transient_for) { | 294 | for (WinClient *w = this; w != 0; w = w->transient_for) { |
280 | if (w == w->transient_for) { | 295 | if (w == w->transient_for) { |
diff --git a/src/WinClient.hh b/src/WinClient.hh index af912e1..3f2dc95 100644 --- a/src/WinClient.hh +++ b/src/WinClient.hh | |||
@@ -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.hh,v 1.17 2004/04/28 14:59:12 rathnor Exp $ | 22 | // $Id: WinClient.hh,v 1.18 2004/08/10 13:36:07 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef WINCLIENT_HH | 24 | #ifndef WINCLIENT_HH |
25 | #define WINCLIENT_HH | 25 | #define WINCLIENT_HH |
@@ -58,7 +58,6 @@ public: | |||
58 | void sendClose(bool forceful = false); | 58 | void sendClose(bool forceful = false); |
59 | // not aware of anything that makes this false at present | 59 | // not aware of anything that makes this false at present |
60 | inline bool isClosable() const { return true; } | 60 | inline bool isClosable() const { return true; } |
61 | void reparent(Window win, int x, int y); | ||
62 | 61 | ||
63 | void addModal(); // some transient of ours (or us) is modal | 62 | void addModal(); // some transient of ours (or us) is modal |
64 | void removeModal(); // some transient (or us) is no longer modal | 63 | void removeModal(); // some transient (or us) is no longer modal |