aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Ewmh.cc34
-rw-r--r--src/Ewmh.hh4
2 files changed, 36 insertions, 2 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 9df4967..9904dc3 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -19,7 +19,7 @@
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: Ewmh.cc,v 1.26 2003/05/19 22:40:16 fluxgen Exp $ 22// $Id: Ewmh.cc,v 1.27 2003/06/18 13:34:30 fluxgen Exp $
23 23
24#include "Ewmh.hh" 24#include "Ewmh.hh"
25 25
@@ -68,6 +68,7 @@ void Ewmh::initForScreen(BScreen &screen) {
68 //set supported atoms 68 //set supported atoms
69 Atom atomsupported[] = { 69 Atom atomsupported[] = {
70 // window properties 70 // window properties
71 m_net_wm_strut,
71 m_net_wm_state, 72 m_net_wm_state,
72 // states that we support: 73 // states that we support:
73 m_net_wm_state_sticky, 74 m_net_wm_state_sticky,
@@ -121,6 +122,9 @@ void Ewmh::setupWindow(FluxboxWindow &win) {
121 122
122 XFree(data); 123 XFree(data);
123 } 124 }
125
126 updateStrut(win);
127
124} 128}
125 129
126void Ewmh::updateClientList(BScreen &screen) { 130void Ewmh::updateClientList(BScreen &screen) {
@@ -284,6 +288,7 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, F
284 toggleState(*win, ce.data.l[1]); 288 toggleState(*win, ce.data.l[1]);
285 toggleState(*win, ce.data.l[2]); 289 toggleState(*win, ce.data.l[2]);
286 } 290 }
291
287 return true; 292 return true;
288 } else if (ce.message_type == m_net_number_of_desktops) { 293 } else if (ce.message_type == m_net_number_of_desktops) {
289 if (screen == 0) 294 if (screen == 0)
@@ -355,6 +360,15 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, F
355} 360}
356 361
357 362
363bool Ewmh::propertyNotify(FluxboxWindow &win, Atom the_property) {
364 if (the_property == m_net_wm_strut) {
365 updateStrut(win);
366 return true;
367 }
368
369 return false;
370}
371
358void Ewmh::createAtoms() { 372void Ewmh::createAtoms() {
359 Display *disp = FbTk::App::instance()->display(); 373 Display *disp = FbTk::App::instance()->display();
360 m_net_supported = XInternAtom(disp, "_NET_SUPPORTED", False); 374 m_net_supported = XInternAtom(disp, "_NET_SUPPORTED", False);
@@ -418,3 +432,21 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state) const {
418 win.shade(); 432 win.shade();
419} 433}
420 434
435
436void Ewmh::updateStrut(FluxboxWindow &win) {
437 Atom ret_type = 0;
438 int fmt = 0;
439 unsigned long nitems = 0, bytes_after = 0;
440 long *data = 0;
441 if (win.winClient().property(m_net_wm_strut, 0, 4, False, XA_CARDINAL,
442 &ret_type, &fmt, &nitems, &bytes_after,
443 (unsigned char **) &data) && data) {
444#ifdef DEBUG
445 cerr<<__FILE__<<"("<<__FUNCTION__<<"): Strut: "<<data[0]<<", "<<data[1]<<", "<<
446 data[2]<<", "<<data[3]<<endl;
447#endif // DEBUG
448 win.setStrut(win.screen().requestStrut(data[0], data[1], data[2], data[3]));
449 win.screen().updateAvailableWorkspaceArea();
450 }
451
452}
diff --git a/src/Ewmh.hh b/src/Ewmh.hh
index b21e4a4..cf81209 100644
--- a/src/Ewmh.hh
+++ b/src/Ewmh.hh
@@ -19,7 +19,7 @@
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: Ewmh.hh,v 1.6 2003/03/03 21:51:00 rathnor Exp $ 22// $Id: Ewmh.hh,v 1.7 2003/06/18 13:33:15 fluxgen Exp $
23 23
24#include "AtomHandler.hh" 24#include "AtomHandler.hh"
25 25
@@ -48,6 +48,7 @@ public:
48 bool checkClientMessage(const XClientMessageEvent &ce, 48 bool checkClientMessage(const XClientMessageEvent &ce,
49 BScreen * screen, FluxboxWindow * const win); 49 BScreen * screen, FluxboxWindow * const win);
50 50
51 bool propertyNotify(FluxboxWindow &win, Atom the_property);
51 //ignore these ones 52 //ignore these ones
52 void updateWindowClose(FluxboxWindow &win) {} 53 void updateWindowClose(FluxboxWindow &win) {}
53 54
@@ -58,6 +59,7 @@ private:
58 void setState(FluxboxWindow &win, Atom state, bool value) const; 59 void setState(FluxboxWindow &win, Atom state, bool value) const;
59 void toggleState(FluxboxWindow &win, Atom state) const; 60 void toggleState(FluxboxWindow &win, Atom state) const;
60 void createAtoms(); 61 void createAtoms();
62 void updateStrut(FluxboxWindow &win);
61 63
62 // root window properties 64 // root window properties
63 Atom m_net_supported, m_net_client_list, m_net_client_list_stacking, 65 Atom m_net_supported, m_net_client_list, m_net_client_list_stacking,