client_get_state(self);
client_update_wmhints(self);
- client_update_transient_for(self);
+ /* this may have already been called from client_update_wmhints */
+ if (self->transient_for == NULL)
+ client_update_transient_for(self);
client_get_startup_id(self);
client_get_desktop(self);/* uses transient data/group/startup id if a
desktop is not specified */
client_update_strut(self);
client_update_icons(self);
client_update_user_time(self);
+ client_update_icon_geometry(self);
}
static void client_get_startup_id(ObClient *self)
self->below = TRUE;
else if (state[i] == prop_atoms.net_wm_state_demands_attention)
self->demands_attention = TRUE;
- else if (state[i] == prop_atoms.ob_wm_state_undecorated)
+ else if (state[i] == prop_atoms.openbox_wm_state_undecorated)
self->undecorated = TRUE;
}
}
}
}
- } else if (self->group) {
- if (self->type == OB_CLIENT_TYPE_DIALOG ||
- self->type == OB_CLIENT_TYPE_TOOLBAR ||
- self->type == OB_CLIENT_TYPE_MENU ||
- self->type == OB_CLIENT_TYPE_UTILITY)
- {
- self->transient = TRUE;
+ } else if (self->type == OB_CLIENT_TYPE_DIALOG ||
+ self->type == OB_CLIENT_TYPE_TOOLBAR ||
+ self->type == OB_CLIENT_TYPE_MENU ||
+ self->type == OB_CLIENT_TYPE_UTILITY)
+ {
+ self->transient = TRUE;
+ if (self->group)
target = OB_TRAN_GROUP;
- }
} else
self->transient = FALSE;
/** Remove the client from the transient tree wherever it has changed **/
+ /* If the window is becoming a direct transient for a window in its group
+ then that window can't be a child of this window anymore */
+ if (oldparent != newparent &&
+ newparent != NULL && newparent != OB_TRAN_GROUP &&
+ newparent->transient_for == OB_TRAN_GROUP &&
+ newgroup != NULL && newgroup == oldgroup)
+ {
+ self->transients = g_slist_remove(self->transients, newparent);
+ }
+
+
/* If the group changed then we need to remove any old group transient
windows from our children. But if we're transient for the group, then
other group transients are not our children. */
transient for eachother.
*/
else if (newparent != NULL && newparent != OB_TRAN_GROUP &&
- newparent != newparent &&
+ newparent != oldparent &&
/* don't make ourself its child if it is already our child */
!client_is_direct_child(self, newparent))
newparent->transients = g_slist_prepend(newparent->transients, self);
- /* If the group changed then we need to add any old group transient
+ /* If the group changed then we need to add any new group transient
windows to our children. But if we're transient for the group, then
other group transients are not our children.
void client_update_wmhints(ObClient *self)
{
XWMHints *hints;
- GSList *it;
/* assume a window takes input if it doesnt specify */
self->can_focus = TRUE;
*/
if (self->transient &&
((self->transient_for == NULL && oldgroup == NULL) ||
- self->transient_for == OB_TRAN_GROUP && self->group == NULL))
+ (self->transient_for == OB_TRAN_GROUP && !self->group)))
client_update_transient_for(self);
}
}
}
+void client_update_icon_geometry(ObClient *self)
+{
+ guint num;
+ guint32 *data;
+
+ RECT_SET(self->icon_geometry, 0, 0, 0, 0);
+
+ if (PROP_GETA32(self->window, net_wm_icon_geometry, cardinal, &data, &num)
+ && num == 4)
+ {
+ /* don't let them set it with an area < 0 */
+ RECT_SET(self->icon_geometry, data[0], data[1],
+ MAX(data[2],0), MAX(data[3],0));
+ }
+}
+
static void client_get_client_machine(ObClient *self)
{
gchar *data = NULL;
old = self->wmstate;
- if (self->shaded || self->iconic || !self->frame->visible)
+ if (self->shaded || !self->frame->visible)
self->wmstate = IconicState;
else
self->wmstate = NormalState;
if (self->demands_attention)
netstate[num++] = prop_atoms.net_wm_state_demands_attention;
if (self->undecorated)
- netstate[num++] = prop_atoms.ob_wm_state_undecorated;
+ netstate[num++] = prop_atoms.openbox_wm_state_undecorated;
PROP_SETA32(self->window, net_wm_state, atom, netstate, num);
if (self->frame)
if (changed) {
client_change_state(self);
+ if (ob_state() != OB_STATE_STARTING && config_animate_iconify)
+ frame_begin_iconify_animation(self->frame, iconic);
+ /* do this after starting the animation so it doesn't flash */
client_showhide(self);
- if (STRUT_EXISTS(self->strut))
- screen_update_areas();
}
/* iconify all direct transients, and deiconify all transients
action = self->demands_attention ?
prop_atoms.net_wm_state_remove :
prop_atoms.net_wm_state_add;
- else if (state == prop_atoms.ob_wm_state_undecorated)
+ else if (state == prop_atoms.openbox_wm_state_undecorated)
action = undecorated ? prop_atoms.net_wm_state_remove :
prop_atoms.net_wm_state_add;
}
self->below = TRUE;
} else if (state == prop_atoms.net_wm_state_demands_attention) {
demands_attention = TRUE;
- } else if (state == prop_atoms.ob_wm_state_undecorated) {
+ } else if (state == prop_atoms.openbox_wm_state_undecorated) {
undecorated = TRUE;
}
self->below = FALSE;
} else if (state == prop_atoms.net_wm_state_demands_attention) {
demands_attention = FALSE;
- } else if (state == prop_atoms.ob_wm_state_undecorated) {
+ } else if (state == prop_atoms.openbox_wm_state_undecorated) {
undecorated = FALSE;
}
}
event_halt_focus_delay();
if (client_normal(self) && screen_showing_desktop)
- screen_show_desktop(FALSE);
+ screen_show_desktop(FALSE, FALSE);
if (self->iconic)
client_iconify(self, FALSE, here);
if (self->desktop != DESKTOP_ALL &&
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *c = WINDOW_AS_CLIENT(it->data);
if (c->frame->visible &&
- RECT_CONTAINS(c->frame->area, x, y)) {
+ /* ignore all animating windows */
+ !frame_iconify_animating(c->frame) &&
+ RECT_CONTAINS(c->frame->area, x, y))
+ {
ret = c;
break;
}