added propertyNotify function and added _NET_WM_STRUT support
fluxgen fluxgen
2 files changed,
36 insertions(+),
2 deletions(-)
M
src/Ewmh.cc
→
src/Ewmh.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.26 2003/05/19 22:40:16 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.27 2003/06/18 13:34:30 fluxgen Exp $ #include "Ewmh.hh"@@ -68,6 +68,7 @@
//set supported atoms Atom atomsupported[] = { // window properties + m_net_wm_strut, m_net_wm_state, // states that we support: m_net_wm_state_sticky,@@ -121,6 +122,9 @@ win.screen().sendToWorkspace(desktop, &win, false);
XFree(data); } + + updateStrut(win); + } void Ewmh::updateClientList(BScreen &screen) {@@ -284,6 +288,7 @@ } else if (ce.data.l[0] == STATE_TOGGLE) {
toggleState(*win, ce.data.l[1]); toggleState(*win, ce.data.l[2]); } + return true; } else if (ce.message_type == m_net_number_of_desktops) { if (screen == 0)@@ -355,6 +360,15 @@ return false;
} +bool Ewmh::propertyNotify(FluxboxWindow &win, Atom the_property) { + if (the_property == m_net_wm_strut) { + updateStrut(win); + return true; + } + + return false; +} + void Ewmh::createAtoms() { Display *disp = FbTk::App::instance()->display(); m_net_supported = XInternAtom(disp, "_NET_SUPPORTED", False);@@ -418,3 +432,21 @@ } else if (state == m_net_wm_state_shaded)
win.shade(); } + +void Ewmh::updateStrut(FluxboxWindow &win) { + Atom ret_type = 0; + int fmt = 0; + unsigned long nitems = 0, bytes_after = 0; + long *data = 0; + if (win.winClient().property(m_net_wm_strut, 0, 4, False, XA_CARDINAL, + &ret_type, &fmt, &nitems, &bytes_after, + (unsigned char **) &data) && data) { +#ifdef DEBUG + cerr<<__FILE__<<"("<<__FUNCTION__<<"): Strut: "<<data[0]<<", "<<data[1]<<", "<< + data[2]<<", "<<data[3]<<endl; +#endif // DEBUG + win.setStrut(win.screen().requestStrut(data[0], data[1], data[2], data[3])); + win.screen().updateAvailableWorkspaceArea(); + } + +}
M
src/Ewmh.hh
→
src/Ewmh.hh
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.hh,v 1.6 2003/03/03 21:51:00 rathnor Exp $ +// $Id: Ewmh.hh,v 1.7 2003/06/18 13:33:15 fluxgen Exp $ #include "AtomHandler.hh"@@ -48,6 +48,7 @@
bool checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, FluxboxWindow * const win); + bool propertyNotify(FluxboxWindow &win, Atom the_property); //ignore these ones void updateWindowClose(FluxboxWindow &win) {}@@ -58,6 +59,7 @@
void setState(FluxboxWindow &win, Atom state, bool value) const; void toggleState(FluxboxWindow &win, Atom state) const; void createAtoms(); + void updateStrut(FluxboxWindow &win); // root window properties Atom m_net_supported, m_net_client_list, m_net_client_list_stacking,