From c4d1f735f6cccfec39750af36886dc66a3ce7ba3 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 17 Apr 2003 14:16:20 +0000 Subject: doing an extra remove to make sure this window is removed from eventmanager --- src/FbTk/FbWindow.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/FbTk/FbWindow.cc b/src/FbTk/FbWindow.cc index 7d07957..1eabd69 100644 --- a/src/FbTk/FbWindow.cc +++ b/src/FbTk/FbWindow.cc @@ -19,9 +19,10 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbWindow.cc,v 1.9 2003/04/16 16:02:14 fluxgen Exp $ +// $Id: FbWindow.cc,v 1.10 2003/04/17 14:16:20 fluxgen Exp $ #include "FbWindow.hh" +#include "EventManager.hh" #include "Color.hh" #include "App.hh" @@ -59,8 +60,8 @@ FbWindow::FbWindow(const FbWindow &parent, long eventmask, bool override_redirect, int depth, int class_type): - m_parent(&parent), - m_screen_num(parent.screenNumber()), m_destroy(true) { + m_parent(&parent), + m_screen_num(parent.screenNumber()), m_destroy(true) { create(parent.window(), x, y, width, height, eventmask, override_redirect, depth, class_type); @@ -74,8 +75,13 @@ FbWindow::FbWindow(Window client):m_parent(0), m_window(client), } FbWindow::~FbWindow() { - if (m_window != 0 && m_destroy) - XDestroyWindow(s_display, m_window); + + if (m_window != 0) { + // so we don't get any dangling eventhandler for this window + FbTk::EventManager::instance()->remove(m_window); + if (m_destroy) + XDestroyWindow(s_display, m_window); + } } -- cgit v0.11.2