summaryrefslogtreecommitdiff
path: root/src/FbTk/FbWindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/FbWindow.cc')
-rw-r--r--src/FbTk/FbWindow.cc16
1 files 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 @@
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: FbWindow.cc,v 1.9 2003/04/16 16:02:14 fluxgen Exp $ 22// $Id: FbWindow.cc,v 1.10 2003/04/17 14:16:20 fluxgen Exp $
23 23
24#include "FbWindow.hh" 24#include "FbWindow.hh"
25#include "EventManager.hh"
25 26
26#include "Color.hh" 27#include "Color.hh"
27#include "App.hh" 28#include "App.hh"
@@ -59,8 +60,8 @@ FbWindow::FbWindow(const FbWindow &parent,
59 long eventmask, 60 long eventmask,
60 bool override_redirect, 61 bool override_redirect,
61 int depth, int class_type): 62 int depth, int class_type):
62 m_parent(&parent), 63 m_parent(&parent),
63 m_screen_num(parent.screenNumber()), m_destroy(true) { 64 m_screen_num(parent.screenNumber()), m_destroy(true) {
64 65
65 create(parent.window(), x, y, width, height, eventmask, 66 create(parent.window(), x, y, width, height, eventmask,
66 override_redirect, depth, class_type); 67 override_redirect, depth, class_type);
@@ -74,8 +75,13 @@ FbWindow::FbWindow(Window client):m_parent(0), m_window(client),
74} 75}
75 76
76FbWindow::~FbWindow() { 77FbWindow::~FbWindow() {
77 if (m_window != 0 && m_destroy) 78
78 XDestroyWindow(s_display, m_window); 79 if (m_window != 0) {
80 // so we don't get any dangling eventhandler for this window
81 FbTk::EventManager::instance()->remove(m_window);
82 if (m_destroy)
83 XDestroyWindow(s_display, m_window);
84 }
79} 85}
80 86
81 87