diff options
Diffstat (limited to 'src/Ewmh.cc')
-rw-r--r-- | src/Ewmh.cc | 34 |
1 files changed, 33 insertions, 1 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 | ||
126 | void Ewmh::updateClientList(BScreen &screen) { | 130 | void 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 | ||
363 | bool 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 | |||
358 | void Ewmh::createAtoms() { | 372 | void 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 | |||
436 | void 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 | } | ||