aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-06-03 20:14:33 (GMT)
committermarkt <markt>2007-06-03 20:14:33 (GMT)
commit255d96ce45bad1ef93112d45eaadeaac61df1fd2 (patch)
tree8a2657e9a2f05471df52624c0e6ba3a0434195ee
parent785f5f705b2c00c4527d6b8cf4cbbb2f6d687364 (diff)
downloadfluxbox-255d96ce45bad1ef93112d45eaadeaac61df1fd2.zip
fluxbox-255d96ce45bad1ef93112d45eaadeaac61df1fd2.tar.bz2
store the EWMH window in Screen.cc, so it gets destroyed when we destroy the screen
-rw-r--r--src/Ewmh.cc14
-rw-r--r--src/Ewmh.hh3
-rw-r--r--src/Screen.cc2
-rw-r--r--src/Screen.hh5
4 files changed, 7 insertions, 17 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 5c6d70b..5a6bdfa 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -73,13 +73,6 @@ Ewmh::Ewmh() {
73 createAtoms(); 73 createAtoms();
74} 74}
75 75
76Ewmh::~Ewmh() {
77 while (!m_windows.empty()) {
78 XDestroyWindow(FbTk::App::instance()->display(), m_windows.back());
79 m_windows.pop_back();
80 }
81}
82
83void Ewmh::initForScreen(BScreen &screen) { 76void Ewmh::initForScreen(BScreen &screen) {
84 Display *disp = FbTk::App::instance()->display(); 77 Display *disp = FbTk::App::instance()->display();
85 78
@@ -102,14 +95,9 @@ void Ewmh::initForScreen(BScreen &screen) {
102 * Window Manager is present. 95 * Window Manager is present.
103 */ 96 */
104 97
105 Window wincheck = XCreateSimpleWindow(disp, 98 Window wincheck = screen.dummyWindow().window();
106 screen.rootWindow().window(),
107 -10, -10, 5, 5, 0, 0, 0);
108 99
109 if (wincheck != None) { 100 if (wincheck != None) {
110 // store the window so we can delete it later
111 m_windows.push_back(wincheck);
112
113 screen.rootWindow().changeProperty(m_net_supporting_wm_check, XA_WINDOW, 32, 101 screen.rootWindow().changeProperty(m_net_supporting_wm_check, XA_WINDOW, 32,
114 PropModeReplace, (unsigned char *) &wincheck, 1); 102 PropModeReplace, (unsigned char *) &wincheck, 1);
115 XChangeProperty(disp, wincheck, m_net_supporting_wm_check, XA_WINDOW, 32, 103 XChangeProperty(disp, wincheck, m_net_supporting_wm_check, XA_WINDOW, 32,
diff --git a/src/Ewmh.hh b/src/Ewmh.hh
index f917390..3df66d3 100644
--- a/src/Ewmh.hh
+++ b/src/Ewmh.hh
@@ -34,7 +34,6 @@ class Ewmh:public AtomHandler {
34public: 34public:
35 35
36 Ewmh(); 36 Ewmh();
37 ~Ewmh();
38 void initForScreen(BScreen &screen); 37 void initForScreen(BScreen &screen);
39 void setupFrame(FluxboxWindow &win); 38 void setupFrame(FluxboxWindow &win);
40 void setupClient(WinClient &winclient); 39 void setupClient(WinClient &winclient);
@@ -142,7 +141,5 @@ private:
142 141
143 Atom utf8_string; 142 Atom utf8_string;
144 143
145 std::vector<Window> m_windows;
146
147 FbTk::FbString getUTF8Property(Atom property); 144 FbTk::FbString getUTF8Property(Atom property);
148}; 145};
diff --git a/src/Screen.cc b/src/Screen.cc
index 915c055..096286b 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -359,6 +359,8 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
359 0, 0, 10, 10, 359 0, 0, 10, 10,
360 false, // override redirect 360 false, // override redirect
361 true), // save under 361 true), // save under
362 m_dummy_window(scrn, -1, -1, 1, 1, 0, true, false, CopyFromParent,
363 InputOnly),
362 resource(rm, screenname, altscreenname), 364 resource(rm, screenname, altscreenname),
363 m_resource_manager(rm), 365 m_resource_manager(rm),
364 m_name(screenname), 366 m_name(screenname),
diff --git a/src/Screen.hh b/src/Screen.hh
index 602d5b9..0d2534d 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -309,6 +309,9 @@ public:
309 FbRootWindow &rootWindow() { return m_root_window; } 309 FbRootWindow &rootWindow() { return m_root_window; }
310 const FbRootWindow &rootWindow() const { return m_root_window; } 310 const FbRootWindow &rootWindow() const { return m_root_window; }
311 311
312 FbTk::FbWindow &dummyWindow() { return m_dummy_window; }
313 const FbTk::FbWindow &dummyWindow() const { return m_dummy_window; }
314
312 FbTk::MultLayers &layerManager() { return m_layermanager; } 315 FbTk::MultLayers &layerManager() { return m_layermanager; }
313 const FbTk::MultLayers &layerManager() const { return m_layermanager; } 316 const FbTk::MultLayers &layerManager() const { return m_layermanager; }
314 FbTk::ResourceManager &resourceManager() { return m_resource_manager; } 317 FbTk::ResourceManager &resourceManager() { return m_resource_manager; }
@@ -557,7 +560,7 @@ private:
557 std::auto_ptr<RootTheme> m_root_theme; 560 std::auto_ptr<RootTheme> m_root_theme;
558 561
559 FbRootWindow m_root_window; 562 FbRootWindow m_root_window;
560 FbTk::FbWindow m_geom_window, m_pos_window; 563 FbTk::FbWindow m_geom_window, m_pos_window, m_dummy_window;
561 564
562 struct ScreenResource { 565 struct ScreenResource {
563 ScreenResource(FbTk::ResourceManager &rm, const std::string &scrname, 566 ScreenResource(FbTk::ResourceManager &rm, const std::string &scrname,