From 9962557cc612e22cb72b6971b8f8a7ae214fbca6 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 27 Aug 2003 21:06:04 +0000 Subject: added support for _NET_WM_STATE_MAXIMIZE_VERT and _NET_WM_STATE_MAXIMIZE_HORZ, Thanks stephan wezel --- src/Ewmh.cc | 27 +++++++++++++++++++++++---- src/Ewmh.hh | 3 ++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 31db7c5..6b38e86 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.31 2003/08/11 14:51:15 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.32 2003/08/27 21:06:04 fluxgen Exp $ #include "Ewmh.hh" @@ -74,6 +74,8 @@ void Ewmh::initForScreen(BScreen &screen) { // states that we support: m_net_wm_state_sticky, m_net_wm_state_shaded, + m_net_wm_state_maximized_horz, + m_net_wm_state_maximized_vert, m_net_wm_desktop, @@ -407,7 +409,9 @@ void Ewmh::createAtoms() { m_net_wm_state = XInternAtom(disp, "_NET_WM_STATE", False); m_net_wm_state_sticky = XInternAtom(disp, "_NET_WM_STATE_STICKY", False); m_net_wm_state_shaded = XInternAtom(disp, "_NET_WM_STATE_SHADED", False); - + m_net_wm_state_maximized_horz = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_HORZ", False); + m_net_wm_state_maximized_vert = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_VERT", False); + m_net_wm_strut = XInternAtom(disp, "_NET_WM_STRUT", False); m_net_wm_icon_geometry = XInternAtom(disp, "_NET_WM_ICON_GEOMETRY", False); m_net_wm_icon = XInternAtom(disp, "_NET_WM_ICON", False); @@ -428,7 +432,16 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) const { if ((value && !win.isShaded()) || (!value && win.isShaded())) win.shade(); - } + } else if (state == m_net_wm_state_maximized_horz ) { // maximized Horizontal + if ((value && !win.isMaximized()) || + (!value && win.isMaximized())) + win.maximizeHorizontal(); + } else if (state == m_net_wm_state_maximized_vert) { // maximized Vertical + if ((value && !win.isMaximized()) || + (!value && win.isMaximized())) + win.maximizeVertical(); + } + } @@ -436,8 +449,14 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) const { void Ewmh::toggleState(FluxboxWindow &win, Atom state) const { if (state == m_net_wm_state_sticky) { win.stick(); - } else if (state == m_net_wm_state_shaded) + } else if (state == m_net_wm_state_shaded){ win.shade(); + } else if (state == m_net_wm_state_maximized_horz ) { // maximized Horizontal + win.maximizeHorizontal(); + } else if (state == m_net_wm_state_maximized_vert) { // maximized Vertical + win.maximizeVertical(); + } + } diff --git a/src/Ewmh.hh b/src/Ewmh.hh index ffc660f..08de6cf 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.hh,v 1.10 2003/07/28 15:06:33 rathnor Exp $ +// $Id: Ewmh.hh,v 1.11 2003/08/27 21:06:04 fluxgen Exp $ #include "AtomHandler.hh" @@ -75,6 +75,7 @@ private: // application window properties Atom m_net_properties, m_net_wm_name, m_net_wm_desktop, m_net_wm_window_type, m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded, + m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert, m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid, m_net_wm_handled_icons; -- cgit v0.11.2