diff options
author | markt <markt> | 2007-03-21 21:48:34 (GMT) |
---|---|---|
committer | markt <markt> | 2007-03-21 21:48:34 (GMT) |
commit | 51bcee666516ffdbe205b0e74ca209f82fcb1f31 (patch) | |
tree | 6f4b21b34882178962958bf64ef9c9072abced50 /src/WinClient.cc | |
parent | 54dee2bff7242b2f6d3f6814679d0024e3189e86 (diff) | |
download | fluxbox-51bcee666516ffdbe205b0e74ca209f82fcb1f31.zip fluxbox-51bcee666516ffdbe205b0e74ca209f82fcb1f31.tar.bz2 |
added Focusable.hh -- a base class for all focusable windows
Diffstat (limited to 'src/WinClient.cc')
-rw-r--r-- | src/WinClient.cc | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/WinClient.cc b/src/WinClient.cc index bb8a25c..83f2af3 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc | |||
@@ -57,7 +57,8 @@ using std::dec; | |||
57 | 57 | ||
58 | WinClient::TransientWaitMap WinClient::s_transient_wait; | 58 | WinClient::TransientWaitMap WinClient::s_transient_wait; |
59 | 59 | ||
60 | WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::FbWindow(win), | 60 | WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin): |
61 | Focusable(fbwin), FbTk::FbWindow(win), | ||
61 | transient_for(0), | 62 | transient_for(0), |
62 | window_group(0), | 63 | window_group(0), |
63 | x(0), y(0), old_bw(0), | 64 | x(0), y(0), old_bw(0), |
@@ -70,12 +71,10 @@ WinClient::WinClient(Window win, BScreen &screen, FluxboxWindow *fbwin):FbTk::Fb | |||
70 | initial_state(0), | 71 | initial_state(0), |
71 | normal_hint_flags(0), | 72 | normal_hint_flags(0), |
72 | wm_hint_flags(0), | 73 | wm_hint_flags(0), |
73 | m_win(fbwin), | ||
74 | m_modal(0), | 74 | m_modal(0), |
75 | send_focus_message(false), | 75 | send_focus_message(false), |
76 | send_close_message(false), | 76 | send_close_message(false), |
77 | m_win_gravity(0), | 77 | m_win_gravity(0), |
78 | m_title(""), m_icon_title(""), | ||
79 | m_class_name(""), m_instance_name(""), | 78 | m_class_name(""), m_instance_name(""), |
80 | m_title_override(false), | 79 | m_title_override(false), |
81 | m_icon_title_override(false), | 80 | m_icon_title_override(false), |
@@ -118,8 +117,8 @@ WinClient::~WinClient() { | |||
118 | 117 | ||
119 | clearStrut(); | 118 | clearStrut(); |
120 | 119 | ||
121 | if (m_win != 0) | 120 | if (fbwindow() != 0) |
122 | m_win->removeClient(*this); | 121 | fbwindow()->removeClient(*this); |
123 | 122 | ||
124 | // this takes care of any focus issues | 123 | // this takes care of any focus issues |
125 | m_diesig.notify(); | 124 | m_diesig.notify(); |
@@ -161,8 +160,6 @@ WinClient::~WinClient() { | |||
161 | 160 | ||
162 | if (window()) | 161 | if (window()) |
163 | fluxbox->removeWindowSearch(window()); | 162 | fluxbox->removeWindowSearch(window()); |
164 | |||
165 | m_win = 0; | ||
166 | } | 163 | } |
167 | 164 | ||
168 | bool WinClient::acceptsFocus() const { | 165 | bool WinClient::acceptsFocus() const { |
@@ -264,9 +261,9 @@ void WinClient::updateWMClassHint() { | |||
264 | 261 | ||
265 | void WinClient::updateTransientInfo() { | 262 | void WinClient::updateTransientInfo() { |
266 | #ifdef DEBUG | 263 | #ifdef DEBUG |
267 | cerr<<__FUNCTION__<<": m_win = "<<m_win<<endl; | 264 | cerr<<__FUNCTION__<<": fbwindow() = "<<fbwindow()<<endl; |
268 | #endif // DEBUG | 265 | #endif // DEBUG |
269 | if (m_win == 0) | 266 | if (fbwindow() == 0) |
270 | return; | 267 | return; |
271 | 268 | ||
272 | 269 | ||
@@ -293,7 +290,7 @@ void WinClient::updateTransientInfo() { | |||
293 | return; | 290 | return; |
294 | } | 291 | } |
295 | 292 | ||
296 | if (win != None && m_win->screen().rootWindow() == win) { | 293 | if (win != None && fbwindow()->screen().rootWindow() == win) { |
297 | // transient for root window... = transient for group | 294 | // transient for root window... = transient for group |
298 | // I don't think we are group-aware yet | 295 | // I don't think we are group-aware yet |
299 | return; | 296 | return; |
@@ -336,7 +333,7 @@ void WinClient::updateTransientInfo() { | |||
336 | transient_for->transientList().push_back(this); | 333 | transient_for->transientList().push_back(this); |
337 | 334 | ||
338 | if (transientFor()->fbwindow() && transientFor()->fbwindow()->isStuck()) | 335 | if (transientFor()->fbwindow() && transientFor()->fbwindow()->isStuck()) |
339 | m_win->stick(); | 336 | fbwindow()->stick(); |
340 | } | 337 | } |
341 | 338 | ||
342 | } | 339 | } |
@@ -362,8 +359,8 @@ void WinClient::updateTitle() { | |||
362 | void WinClient::setTitle(FbTk::FbString &title) { | 359 | void WinClient::setTitle(FbTk::FbString &title) { |
363 | m_title = title; | 360 | m_title = title; |
364 | m_title_override = true; | 361 | m_title_override = true; |
365 | if (m_win) | 362 | if (fbwindow()) |
366 | m_win->updateTitleFromClient(*this); | 363 | fbwindow()->updateTitleFromClient(*this); |
367 | } | 364 | } |
368 | 365 | ||
369 | void WinClient::setIconTitle(FbTk::FbString &icon_title) { | 366 | void WinClient::setIconTitle(FbTk::FbString &icon_title) { |
@@ -412,7 +409,7 @@ void WinClient::saveBlackboxAttribs(FluxboxWindow::BlackboxAttributes &blackbox_ | |||
412 | } | 409 | } |
413 | 410 | ||
414 | void WinClient::setFluxboxWindow(FluxboxWindow *win) { | 411 | void WinClient::setFluxboxWindow(FluxboxWindow *win) { |
415 | m_win = win; | 412 | m_fbwin = win; |
416 | } | 413 | } |
417 | 414 | ||
418 | void WinClient::updateBlackboxHints() { | 415 | void WinClient::updateBlackboxHints() { |
@@ -523,7 +520,7 @@ void WinClient::updateWMHints() { | |||
523 | else | 520 | else |
524 | m_icon_mask = 0; | 521 | m_icon_mask = 0; |
525 | 522 | ||
526 | if (m_win) { | 523 | if (fbwindow()) { |
527 | if (wmhint->flags & XUrgencyHint) { | 524 | if (wmhint->flags & XUrgencyHint) { |
528 | Fluxbox::instance()->attentionHandler().addAttention(*this); | 525 | Fluxbox::instance()->attentionHandler().addAttention(*this); |
529 | } else { | 526 | } else { |
@@ -703,10 +700,10 @@ void WinClient::clearStrut() { | |||
703 | } | 700 | } |
704 | 701 | ||
705 | bool WinClient::focus() { | 702 | bool WinClient::focus() { |
706 | if (m_win == 0) | 703 | if (fbwindow() == 0) |
707 | return false; | 704 | return false; |
708 | else | 705 | else |
709 | return m_win->setCurrentClient(*this, true); | 706 | return fbwindow()->setCurrentClient(*this, true); |
710 | } | 707 | } |
711 | 708 | ||
712 | void WinClient::updateWMProtocols() { | 709 | void WinClient::updateWMProtocols() { |
@@ -730,8 +727,8 @@ void WinClient::updateWMProtocols() { | |||
730 | } | 727 | } |
731 | 728 | ||
732 | XFree(proto); | 729 | XFree(proto); |
733 | if (m_win) | 730 | if (fbwindow()) |
734 | m_win->updateFunctions(); | 731 | fbwindow()->updateFunctions(); |
735 | #ifdef DEBUG | 732 | #ifdef DEBUG |
736 | } else { | 733 | } else { |
737 | cerr<<"Warning: Failed to read WM Protocols. "<<endl; | 734 | cerr<<"Warning: Failed to read WM Protocols. "<<endl; |