set IconicState on all unmapped clients, and unmap all clients when set to IconicState
also, a little bug fix for previous commit
This commit is contained in:
parent
1dc07de318
commit
e71346bd50
3 changed files with 47 additions and 13 deletions
|
@ -1,6 +1,10 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.0rc3:
|
Changes for 1.0rc3:
|
||||||
*07/01/04:
|
*07/01/04:
|
||||||
|
* ICCCM compliance updates -- see Section 4.1.4 (Mark)
|
||||||
|
- Set IconicState on all unmapped clients
|
||||||
|
- Unmap all clients when set to IconicState
|
||||||
|
Window.cc
|
||||||
* Move minimized windows to the back of the focused list (Mark)
|
* Move minimized windows to the back of the focused list (Mark)
|
||||||
Window.cc FocusControl.cc/hh
|
Window.cc FocusControl.cc/hh
|
||||||
*07/01/03:
|
*07/01/03:
|
||||||
|
|
|
@ -154,7 +154,8 @@ void FocusControl::addFocusBack(WinClient &client) {
|
||||||
// move all clients in given window to back of focused list
|
// move all clients in given window to back of focused list
|
||||||
void FocusControl::setFocusBack(FluxboxWindow *fbwin) {
|
void FocusControl::setFocusBack(FluxboxWindow *fbwin) {
|
||||||
// do nothing if there are no windows open
|
// do nothing if there are no windows open
|
||||||
if (m_focused_list.empty())
|
// don't change focus order while cycling
|
||||||
|
if (m_focused_list.empty() || isCycling())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
FocusedWindows::iterator it = m_focused_list.begin();
|
FocusedWindows::iterator it = m_focused_list.begin();
|
||||||
|
|
|
@ -1536,6 +1536,7 @@ void FluxboxWindow::hide(bool interrupt_moving) {
|
||||||
|
|
||||||
menu().hide();
|
menu().hide();
|
||||||
frame().hide();
|
frame().hide();
|
||||||
|
setState(IconicState,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluxboxWindow::show() {
|
void FluxboxWindow::show() {
|
||||||
|
@ -1554,8 +1555,6 @@ void FluxboxWindow::iconify() {
|
||||||
|
|
||||||
iconic = true;
|
iconic = true;
|
||||||
|
|
||||||
setState(IconicState, false);
|
|
||||||
|
|
||||||
hide(true);
|
hide(true);
|
||||||
|
|
||||||
screen().focusControl().setFocusBack(this);
|
screen().focusControl().setFocusBack(this);
|
||||||
|
@ -1897,16 +1896,10 @@ void FluxboxWindow::shade() {
|
||||||
shaded = false;
|
shaded = false;
|
||||||
m_blackbox_attrib.flags ^= ATTRIB_SHADED;
|
m_blackbox_attrib.flags ^= ATTRIB_SHADED;
|
||||||
m_blackbox_attrib.attrib ^= ATTRIB_SHADED;
|
m_blackbox_attrib.attrib ^= ATTRIB_SHADED;
|
||||||
|
|
||||||
if (m_initialized)
|
|
||||||
setState(NormalState, false);
|
|
||||||
} else {
|
} else {
|
||||||
shaded = true;
|
shaded = true;
|
||||||
m_blackbox_attrib.flags |= ATTRIB_SHADED;
|
m_blackbox_attrib.flags |= ATTRIB_SHADED;
|
||||||
m_blackbox_attrib.attrib |= ATTRIB_SHADED;
|
m_blackbox_attrib.attrib |= ATTRIB_SHADED;
|
||||||
// shading is the same as iconic
|
|
||||||
if (m_initialized)
|
|
||||||
setState(IconicState, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2248,10 +2241,29 @@ void FluxboxWindow::setState(unsigned long new_state, bool setting_up) {
|
||||||
state[0] = (unsigned long) m_current_state;
|
state[0] = (unsigned long) m_current_state;
|
||||||
state[1] = (unsigned long) None;
|
state[1] = (unsigned long) None;
|
||||||
|
|
||||||
for_each(m_clientlist.begin(), m_clientlist.end(),
|
FbTk::ChangeProperty chg(display, FbAtoms::instance()->getWMStateAtom(),
|
||||||
FbTk::ChangeProperty(display, FbAtoms::instance()->getWMStateAtom(),
|
PropModeReplace, (unsigned char *)state, 2);
|
||||||
PropModeReplace,
|
|
||||||
(unsigned char *)state, 2));
|
ClientList::iterator it = m_clientlist.begin();
|
||||||
|
ClientList::iterator it_end = m_clientlist.end();
|
||||||
|
for (; it != it_end; ++it) {
|
||||||
|
chg(*it);
|
||||||
|
|
||||||
|
// ICCCM Section 4.1.4:
|
||||||
|
// Once a client's window has left the Withdrawn state, the
|
||||||
|
// window will be mapped if it is in the Normal state and the
|
||||||
|
// window will be unmapped if it is in the Iconic state.
|
||||||
|
// Reparenting window managers must unmap the client's window when
|
||||||
|
// it is in the Iconic state, even if an ancestor window being
|
||||||
|
// unmapped renders the client's window unviewable. Conversely, if a
|
||||||
|
// reparenting window manager renders the client's window unviewable
|
||||||
|
// by unmapping an ancestor, the client's window is by definition in
|
||||||
|
// the Iconic state and must also be unmapped.
|
||||||
|
if (new_state == IconicState)
|
||||||
|
(*it)->hide();
|
||||||
|
else if (new_state == NormalState)
|
||||||
|
(*it)->show();
|
||||||
|
}
|
||||||
|
|
||||||
saveBlackboxAttribs();
|
saveBlackboxAttribs();
|
||||||
//notify state changed
|
//notify state changed
|
||||||
|
@ -2566,6 +2578,23 @@ void FluxboxWindow::unmapNotifyEvent(XUnmapEvent &ue) {
|
||||||
if (client == 0)
|
if (client == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Atom atom_return;
|
||||||
|
bool ret = false;
|
||||||
|
int foo;
|
||||||
|
unsigned long *state, ulfoo, nitems;
|
||||||
|
if (client->property(FbAtoms::instance()->getWMStateAtom(),
|
||||||
|
0l, 2l, false, FbAtoms::instance()->getWMStateAtom(),
|
||||||
|
&atom_return, &foo, &nitems, &ulfoo,
|
||||||
|
(unsigned char **) &state) && state) {
|
||||||
|
|
||||||
|
if (nitems >= 1 && static_cast<unsigned long>(state[0]) != WithdrawnState);
|
||||||
|
ret = true;
|
||||||
|
|
||||||
|
XFree(static_cast<void *>(state));
|
||||||
|
if (ret)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl;
|
cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl;
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<"): title="<<client->title()<<endl;
|
cerr<<__FILE__<<"("<<__FUNCTION__<<"): title="<<client->title()<<endl;
|
||||||
|
|
Loading…
Reference in a new issue