* _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
This commit is contained in:
parent
61213bed3a
commit
3d497bb703
2 changed files with 33 additions and 12 deletions
44
src/Ewmh.cc
44
src/Ewmh.cc
|
@ -526,7 +526,9 @@ void Ewmh::updateState(FluxboxWindow &win) {
|
||||||
// TODO: should we update the _NET_WM_ALLOWED_ACTIONS
|
// TODO: should we update the _NET_WM_ALLOWED_ACTIONS
|
||||||
// here too?
|
// here too?
|
||||||
|
|
||||||
std::vector<unsigned int> state;
|
typedef std::vector<unsigned int> StateVec;
|
||||||
|
|
||||||
|
StateVec state;
|
||||||
|
|
||||||
if (win.isStuck())
|
if (win.isStuck())
|
||||||
state.push_back(m_net_wm_state_sticky);
|
state.push_back(m_net_wm_state_sticky);
|
||||||
|
@ -536,10 +538,10 @@ void Ewmh::updateState(FluxboxWindow &win) {
|
||||||
state.push_back(m_net_wm_state_below);
|
state.push_back(m_net_wm_state_below);
|
||||||
if (win.layerNum() == Fluxbox::instance()->getAboveDockLayer())
|
if (win.layerNum() == Fluxbox::instance()->getAboveDockLayer())
|
||||||
state.push_back(m_net_wm_state_above);
|
state.push_back(m_net_wm_state_above);
|
||||||
if (win.isFocusHidden()) {
|
if (win.isIconic())
|
||||||
state.push_back(m_net_wm_state_hidden);
|
state.push_back(m_net_wm_state_hidden);
|
||||||
|
if (win.isIconHidden())
|
||||||
state.push_back(m_net_wm_state_skip_taskbar);
|
state.push_back(m_net_wm_state_skip_taskbar);
|
||||||
}
|
|
||||||
if (win.isFullscreen()) {
|
if (win.isFullscreen()) {
|
||||||
state.push_back(m_net_wm_state_fullscreen);
|
state.push_back(m_net_wm_state_fullscreen);
|
||||||
}
|
}
|
||||||
|
@ -549,9 +551,31 @@ void Ewmh::updateState(FluxboxWindow &win) {
|
||||||
|
|
||||||
it = win.clientList().begin();
|
it = win.clientList().begin();
|
||||||
for (; it != it_end; ++it) {
|
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,
|
(*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
|
else
|
||||||
(*it)->deleteProperty(m_net_wm_state);
|
(*it)->deleteProperty(m_net_wm_state);
|
||||||
}
|
}
|
||||||
|
@ -777,6 +801,7 @@ void Ewmh::createAtoms() {
|
||||||
m_net_wm_state_fullscreen = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", 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_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_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_above = XInternAtom(disp, "_NET_WM_STATE_ABOVE", False);
|
||||||
m_net_wm_state_below = XInternAtom(disp, "_NET_WM_STATE_BELOW", False);
|
m_net_wm_state_below = XInternAtom(disp, "_NET_WM_STATE_BELOW", False);
|
||||||
|
|
||||||
|
@ -860,9 +885,7 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) {
|
||||||
if ((value && !win.isFullscreen()) ||
|
if ((value && !win.isFullscreen()) ||
|
||||||
(!value && win.isFullscreen()))
|
(!value && win.isFullscreen()))
|
||||||
setFullscreen(win, value);
|
setFullscreen(win, value);
|
||||||
} else if (state == m_net_wm_state_hidden ||
|
} else if (state == m_net_wm_state_skip_taskbar) {
|
||||||
state == m_net_wm_state_skip_taskbar) {
|
|
||||||
win.setFocusHidden(value);
|
|
||||||
win.setIconHidden(value);
|
win.setIconHidden(value);
|
||||||
} else if (state == m_net_wm_state_below) { // bottom layer
|
} else if (state == m_net_wm_state_below) { // bottom layer
|
||||||
if (value)
|
if (value)
|
||||||
|
@ -875,7 +898,6 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) {
|
||||||
win.moveToLayer(Fluxbox::instance()->getAboveDockLayer());
|
win.moveToLayer(Fluxbox::instance()->getAboveDockLayer());
|
||||||
else
|
else
|
||||||
win.moveToLayer(Fluxbox::instance()->getNormalLayer());
|
win.moveToLayer(Fluxbox::instance()->getNormalLayer());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -891,9 +913,7 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state) {
|
||||||
win.maximizeVertical();
|
win.maximizeVertical();
|
||||||
} else if (state == m_net_wm_state_fullscreen) { // fullscreen
|
} else if (state == m_net_wm_state_fullscreen) { // fullscreen
|
||||||
setFullscreen(win, getState(win) == 0); // toggle current state
|
setFullscreen(win, getState(win) == 0); // toggle current state
|
||||||
} else if (state == m_net_wm_state_hidden ||
|
} else if (state == m_net_wm_state_skip_taskbar) {
|
||||||
state == m_net_wm_state_skip_taskbar) {
|
|
||||||
win.setFocusHidden(!win.isFocusHidden());
|
|
||||||
win.setIconHidden(!win.isIconHidden());
|
win.setIconHidden(!win.isIconHidden());
|
||||||
} else if (state == m_net_wm_state_below) { // bottom layer
|
} else if (state == m_net_wm_state_below) { // bottom layer
|
||||||
if (win.layerNum() == Fluxbox::instance()->getBottomLayer())
|
if (win.layerNum() == Fluxbox::instance()->getBottomLayer())
|
||||||
|
|
|
@ -101,6 +101,7 @@ private:
|
||||||
m_net_wm_state_fullscreen,
|
m_net_wm_state_fullscreen,
|
||||||
m_net_wm_state_hidden,
|
m_net_wm_state_hidden,
|
||||||
m_net_wm_state_skip_taskbar,
|
m_net_wm_state_skip_taskbar,
|
||||||
|
m_net_wm_state_skip_pager,
|
||||||
m_net_wm_state_below,
|
m_net_wm_state_below,
|
||||||
m_net_wm_state_above,
|
m_net_wm_state_above,
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue