summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrathnor <rathnor>2003-04-28 12:56:38 (GMT)
committerrathnor <rathnor>2003-04-28 12:56:38 (GMT)
commit93fab45accee2f5d0375f6686269e8cd9a588ab9 (patch)
treecfcec81b179d5b20d55ec1fe1431aaf1d712ac50 /src
parent5ecb2f911b4e77ccc75e8ce6f62ad3664a194c48 (diff)
downloadfluxbox_lack-93fab45accee2f5d0375f6686269e8cd9a588ab9.zip
fluxbox_lack-93fab45accee2f5d0375f6686269e8cd9a588ab9.tar.bz2
add client window to event manager
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 01f99f4..986b812 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.153 2003/04/27 14:36:04 rathnor Exp $ 25// $Id: Window.cc,v 1.154 2003/04/28 12:56:38 rathnor Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -326,6 +326,7 @@ void FluxboxWindow::init() {
326 FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(*m_client)); 326 FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(*m_client));
327 btn->setOnClick(set_client_cmd); 327 btn->setOnClick(set_client_cmd);
328 evm.add(*this, btn->window()); // we take care of button events for this 328 evm.add(*this, btn->window()); // we take care of button events for this
329 evm.add(*this, m_client->window());
329 330
330 // m_frame.reconfigure(); 331 // m_frame.reconfigure();
331 332
@@ -495,6 +496,7 @@ void FluxboxWindow::attachClient(WinClient &client) {
495 496
496 // reparent client win to this frame 497 // reparent client win to this frame
497 m_frame.setClientWindow(client); 498 m_frame.setClientWindow(client);
499 FbTk::EventManager &evm = *FbTk::EventManager::instance();
498 500
499 if (client.fbwindow() != 0) { 501 if (client.fbwindow() != 0) {
500 FluxboxWindow *old_win = client.fbwindow(); // store old window 502 FluxboxWindow *old_win = client.fbwindow(); // store old window
@@ -505,6 +507,7 @@ void FluxboxWindow::attachClient(WinClient &client) {
505 ClientList::iterator client_it_end = old_win->clientList().end(); 507 ClientList::iterator client_it_end = old_win->clientList().end();
506 for (; client_it != client_it_end; ++client_it) { 508 for (; client_it != client_it_end; ++client_it) {
507 fb->saveWindowSearch((*client_it)->window(), this); 509 fb->saveWindowSearch((*client_it)->window(), this);
510 evm.add(*this, (*client_it)->window());
508 511
509 // reparent window to this 512 // reparent window to this
510 m_frame.setClientWindow(**client_it); 513 m_frame.setClientWindow(**client_it);
@@ -522,7 +525,6 @@ void FluxboxWindow::attachClient(WinClient &client) {
522 m_labelbuttons[(*client_it)] = btn; 525 m_labelbuttons[(*client_it)] = btn;
523 m_frame.addLabelButton(*btn); 526 m_frame.addLabelButton(*btn);
524 btn->show(); 527 btn->show();
525 FbTk::EventManager &evm = *FbTk::EventManager::instance();
526 // we need motion notify so we mask it 528 // we need motion notify so we mask it
527 btn->window().setEventMask(ExposureMask | ButtonPressMask | 529 btn->window().setEventMask(ExposureMask | ButtonPressMask |
528 ButtonReleaseMask | ButtonMotionMask); 530 ButtonReleaseMask | ButtonMotionMask);
@@ -633,10 +635,13 @@ bool FluxboxWindow::removeClient(WinClient &client) {
633 if (m_client == &client && m_clientlist.size() == 0) 635 if (m_client == &client && m_clientlist.size() == 0)
634 m_client = 0; 636 m_client = 0;
635 637
638 FbTk::EventManager &evm = *FbTk::EventManager::instance();
639 evm.remove(client.window());
640
636 FbTk::Button *label_btn = m_labelbuttons[&client]; 641 FbTk::Button *label_btn = m_labelbuttons[&client];
637 if (label_btn != 0) { 642 if (label_btn != 0) {
638 m_frame.removeLabelButton(*label_btn); 643 m_frame.removeLabelButton(*label_btn);
639 FbTk::EventManager::instance()->remove(label_btn->window()); 644 evm.remove(label_btn->window());
640 delete label_btn; 645 delete label_btn;
641 label_btn = 0; 646 label_btn = 0;
642 } 647 }