revert 7246 and simplify action_raiselower a bit, turns out 7246 wasn't needed for that after all

This commit is contained in:
Mikael Magnusson 2007-06-01 23:39:52 +00:00
parent 3547fe26ed
commit 47529e777f
3 changed files with 9 additions and 36 deletions

View file

@ -1329,31 +1329,10 @@ void action_focus_order_to_bottom(union ActionData *data)
void action_raiselower(union ActionData *data) void action_raiselower(union ActionData *data)
{ {
ObClient *c = data->client.any.c; ObClient *c = data->client.any.c;
GList *it;
gboolean raise = FALSE;
for (it = stacking_list; it; it = g_list_next(it)) { client_action_start(data);
if (WINDOW_IS_CLIENT(it->data)) { stacking_restack_request(c, NULL, Opposite, FALSE);
ObClient *cit = it->data; client_action_end(data);
if (cit == c) break;
if (client_normal(cit) == client_normal(c) &&
cit->layer == c->layer &&
cit->frame->visible &&
!client_search_transient(c, cit))
{
if (RECT_INTERSECTS_RECT(cit->frame->area, c->frame->area)) {
raise = TRUE;
break;
}
}
}
}
if (raise)
action_raise(data);
else
action_lower(data);
} }
void action_raise(union ActionData *data) void action_raise(union ActionData *data)

View file

@ -545,8 +545,8 @@ static gboolean stacking_occludes(ObClient *client, ObClient *sibling)
return occludes; return occludes;
} }
gboolean stacking_restack_request(ObClient *client, ObClient *sibling, void stacking_restack_request(ObClient *client, ObClient *sibling,
gint detail, gboolean activate) gint detail, gboolean activate)
{ {
switch (detail) { switch (detail) {
case Below: case Below:
@ -563,8 +563,6 @@ gboolean stacking_restack_request(ObClient *client, ObClient *sibling,
lower it to the bottom */ lower it to the bottom */
if (stacking_occludes(client, sibling)) if (stacking_occludes(client, sibling))
stacking_lower(CLIENT_AS_WINDOW(client)); stacking_lower(CLIENT_AS_WINDOW(client));
else
return FALSE;
break; break;
case Above: case Above:
ob_debug("Restack request Above for client %s sibling %s\n", ob_debug("Restack request Above for client %s sibling %s\n",
@ -586,8 +584,7 @@ gboolean stacking_restack_request(ObClient *client, ObClient *sibling,
client_activate(client, FALSE, TRUE); client_activate(client, FALSE, TRUE);
else else
stacking_raise(CLIENT_AS_WINDOW(client)); stacking_raise(CLIENT_AS_WINDOW(client));
} else }
return FALSE;
break; break;
case Opposite: case Opposite:
ob_debug("Restack request Opposite for client %s sibling " ob_debug("Restack request Opposite for client %s sibling "
@ -605,5 +602,4 @@ gboolean stacking_restack_request(ObClient *client, ObClient *sibling,
stacking_lower(CLIENT_AS_WINDOW(client)); stacking_lower(CLIENT_AS_WINDOW(client));
break; break;
} }
return TRUE;
} }

View file

@ -67,13 +67,11 @@ void stacking_below(ObWindow *window, ObWindow *below);
@param detail One of Above, Below, TopIf, BottomIf, Opposite @param detail One of Above, Below, TopIf, BottomIf, Opposite
@param activate If TRUE, and if the window is going to be raised, it will @param activate If TRUE, and if the window is going to be raised, it will
be activated instead be activated instead
@return false if given TopIf or BottomIf and no action was taken,
true otherwise
See http://tronche.com/gui/x/xlib/window/configure.html for details on See http://tronche.com/gui/x/xlib/window/configure.html for details on
how each detail works with and without a sibling. how each detail works with and without a sibling.
*/ */
gboolean stacking_restack_request(struct _ObClient *client, void stacking_restack_request(struct _ObClient *client,
struct _ObClient *sibling, struct _ObClient *sibling,
gint detail, gboolean activate); gint detail, gboolean activate);
#endif #endif