cleanups for how we display iconic state in the hints, and choose it in the mapping process. make things work with gnome-panel's restore-to-native/current-workspace

This commit is contained in:
Dana Jansens 2003-01-23 14:16:30 +00:00
parent bb303c7404
commit b6defb3c1a

View file

@ -37,9 +37,7 @@ Client::Client(int screen, Window window)
// update EVERYTHING the first time!! // update EVERYTHING the first time!!
// we default to NormalState, visible // we default to NormalState, visible
_wmstate = NormalState; _iconic = false; _wmstate = NormalState;
// no default decors or functions, each has to be enabled
_decorations = _functions = 0;
// start unfocused // start unfocused
_focused = false; _focused = false;
// not a transient by default of course // not a transient by default of course
@ -54,8 +52,7 @@ Client::Client(int screen, Window window)
getType(); getType();
getMwmHints(); getMwmHints();
getState(); // gets all the states except for iconic, which is found from getState();
// the desktop == ICONIC_DESKTOP
getShaped(); getShaped();
updateProtocols(); updateProtocols();
@ -66,23 +63,19 @@ Client::Client(int screen, Window window)
getGravity(); // get the attribute gravity getGravity(); // get the attribute gravity
updateNormalHints(); // this may override the attribute gravity updateNormalHints(); // this may override the attribute gravity
updateWMHints(true); // also get the initial_state and set _iconic // also get the initial_state and set _iconic if we aren't "starting"
// when we're "starting" that means we should use whatever state was already
// on the window over the initial map state, because it was already mapped
updateWMHints(openbox->state() != Openbox::State_Starting);
updateTitle(); updateTitle();
updateIconTitle(); updateIconTitle();
updateClass(); updateClass();
updateStrut(); updateStrut();
// this makes sure that these windows: // this makes sure that these windows appear on all desktops
// a) appear on all desktops if (_type == Type_Dock || _type == Type_Desktop)
// b) don't start iconified
if (_type == Type_Dock || _type == Type_Desktop) {
_desktop = 0xffffffff; _desktop = 0xffffffff;
}
// restores iconic state when we restart.
// this will override the initial_state if that was set
if (_desktop == ICONIC_DESKTOP) _iconic = true;
// set the desktop hint, to make sure that it always exists, and to reflect // set the desktop hint, to make sure that it always exists, and to reflect
// any changes we've made here // any changes we've made here
otk::Property::set(_window, otk::Property::atoms.net_wm_desktop, otk::Property::set(_window, otk::Property::atoms.net_wm_desktop,
@ -307,7 +300,7 @@ void Client::getArea()
void Client::getState() void Client::getState()
{ {
_modal = _shaded = _max_horz = _max_vert = _fullscreen = _above = _below = _modal = _shaded = _max_horz = _max_vert = _fullscreen = _above = _below =
_skip_taskbar = _skip_pager = false; _iconic = _skip_taskbar = _skip_pager = false;
unsigned long *state; unsigned long *state;
unsigned long num = (unsigned) -1; unsigned long num = (unsigned) -1;
@ -319,6 +312,8 @@ void Client::getState()
_modal = true; _modal = true;
else if (state[i] == otk::Property::atoms.net_wm_state_shaded) else if (state[i] == otk::Property::atoms.net_wm_state_shaded)
_shaded = true; _shaded = true;
else if (state[i] == otk::Property::atoms.net_wm_state_hidden)
_iconic = true;
else if (state[i] == otk::Property::atoms.net_wm_state_skip_taskbar) else if (state[i] == otk::Property::atoms.net_wm_state_skip_taskbar)
_skip_taskbar = true; _skip_taskbar = true;
else if (state[i] == otk::Property::atoms.net_wm_state_skip_pager) else if (state[i] == otk::Property::atoms.net_wm_state_skip_pager)
@ -676,9 +671,10 @@ void Client::setDesktop(long target)
_desktop = target; _desktop = target;
// set the desktop hint // set the desktop hint, but not if we're iconifying
otk::Property::set(_window, otk::Property::atoms.net_wm_desktop, if (_desktop != ICONIC_DESKTOP)
otk::Property::atoms.cardinal, (unsigned)_desktop); otk::Property::set(_window, otk::Property::atoms.net_wm_desktop,
otk::Property::atoms.cardinal, (unsigned)_desktop);
// 'move' the window to the new desktop // 'move' the window to the new desktop
if (_desktop == openbox->screen(_screen)->desktop() || if (_desktop == openbox->screen(_screen)->desktop() ||
@ -1166,8 +1162,8 @@ void Client::applyStartupState()
// these are in a carefully crafted order.. // these are in a carefully crafted order..
if (_iconic) { if (_iconic) {
printf("MAP ICONIC\n");
_iconic = false; _iconic = false;
_desktop = 0; // set some other source desktop so this goes through
setDesktop(ICONIC_DESKTOP); setDesktop(ICONIC_DESKTOP);
} }
if (_fullscreen) { if (_fullscreen) {