all repos — fluxbox @ 3d497bb7030f4698d6c55643d28cd412ed02f191

custom fork of the fluxbox windowmanager

* _NET_WM_STATE_HIDDEN is now used correctly -> if the window goes iconic, this
  state is set... what about moving it outside of the visible area? we need to
  think about this.
* mixing _NET_WM_STATE_HIDDEN and _NET_WM_STATE_SKIP_TASKBAR is solved, we
  dont do this anymore
* we dont use _NET_WM_STATE_SKIP_PAGER .. so we shouldnt delete it, thats
  handled now correctly -> look at the *State() - functions
mathias mathias
commit

3d497bb7030f4698d6c55643d28cd412ed02f191

parent

61213bed3aa0d1e926b8bd8f8616471e53611b5a

2 files changed, 33 insertions(+), 12 deletions(-)

jump to
M src/Ewmh.ccsrc/Ewmh.cc

@@ -526,7 +526,9 @@

// TODO: should we update the _NET_WM_ALLOWED_ACTIONS // here too? - std::vector<unsigned int> state; + typedef std::vector<unsigned int> StateVec; + + StateVec state; if (win.isStuck()) state.push_back(m_net_wm_state_sticky);

@@ -536,10 +538,10 @@ if (win.layerNum() == Fluxbox::instance()->getBottomLayer())

state.push_back(m_net_wm_state_below); if (win.layerNum() == Fluxbox::instance()->getAboveDockLayer()) state.push_back(m_net_wm_state_above); - if (win.isFocusHidden()) { + if (win.isIconic()) state.push_back(m_net_wm_state_hidden); + if (win.isIconHidden()) state.push_back(m_net_wm_state_skip_taskbar); - } if (win.isFullscreen()) { state.push_back(m_net_wm_state_fullscreen); }

@@ -549,9 +551,31 @@ FluxboxWindow::ClientList::iterator it_end = win.clientList().end();

it = win.clientList().begin(); for (; it != it_end; ++it) { - if (!state.empty()) + + // search the old states for _NET_WM_STATE_SKIP_PAGER and append it + // to the current state, so it wont get deleted by us. + StateVec client_state(state); + Atom ret_type; + int fmt; + unsigned long nitems, bytes_after; + unsigned char *data = 0; + + (*it)->property(m_net_wm_state, 0, 0x7fffffff, False, XA_ATOM, + &ret_type, &fmt, &nitems, &bytes_after, + &data); + if (data) { + Atom *old_states = (Atom *)data; + for (unsigned long i=0; i < nitems; ++i) + if (old_states[i] == m_net_wm_state_skip_pager) { + client_state.push_back(m_net_wm_state_skip_pager); + } + XFree(data); + } + + if (!client_state.empty()) (*it)->changeProperty(m_net_wm_state, XA_ATOM, 32, PropModeReplace, - reinterpret_cast<unsigned char*>(&state.front()), state.size()); + reinterpret_cast<unsigned char*>(&client_state.front()), + client_state.size()); else (*it)->deleteProperty(m_net_wm_state); }

@@ -777,6 +801,7 @@ m_net_wm_state_maximized_vert = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_VERT", False);

m_net_wm_state_fullscreen = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); m_net_wm_state_hidden = XInternAtom(disp, "_NET_WM_STATE_HIDDEN", False); m_net_wm_state_skip_taskbar = XInternAtom(disp, "_NET_WM_STATE_SKIP_TASKBAR", False); + m_net_wm_state_skip_pager = XInternAtom(disp, "_NET_WM_STATE_SKIP_PAGER", False); m_net_wm_state_above = XInternAtom(disp, "_NET_WM_STATE_ABOVE", False); m_net_wm_state_below = XInternAtom(disp, "_NET_WM_STATE_BELOW", False);

@@ -860,9 +885,7 @@ } else if (state == m_net_wm_state_fullscreen) { // fullscreen

if ((value && !win.isFullscreen()) || (!value && win.isFullscreen())) setFullscreen(win, value); - } else if (state == m_net_wm_state_hidden || - state == m_net_wm_state_skip_taskbar) { - win.setFocusHidden(value); + } else if (state == m_net_wm_state_skip_taskbar) { win.setIconHidden(value); } else if (state == m_net_wm_state_below) { // bottom layer if (value)

@@ -875,7 +898,6 @@ if (value)

win.moveToLayer(Fluxbox::instance()->getAboveDockLayer()); else win.moveToLayer(Fluxbox::instance()->getNormalLayer()); - } }

@@ -891,9 +913,7 @@ } else if (state == m_net_wm_state_maximized_vert) { // maximized Vertical

win.maximizeVertical(); } else if (state == m_net_wm_state_fullscreen) { // fullscreen setFullscreen(win, getState(win) == 0); // toggle current state - } else if (state == m_net_wm_state_hidden || - state == m_net_wm_state_skip_taskbar) { - win.setFocusHidden(!win.isFocusHidden()); + } else if (state == m_net_wm_state_skip_taskbar) { win.setIconHidden(!win.isIconHidden()); } else if (state == m_net_wm_state_below) { // bottom layer if (win.layerNum() == Fluxbox::instance()->getBottomLayer())
M src/Ewmh.hhsrc/Ewmh.hh

@@ -101,6 +101,7 @@ m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert,

m_net_wm_state_fullscreen, m_net_wm_state_hidden, m_net_wm_state_skip_taskbar, + m_net_wm_state_skip_pager, m_net_wm_state_below, m_net_wm_state_above,