merge r6176-6182 from 3.4-working

This commit is contained in:
Dana Jansens 2007-05-08 21:57:36 +00:00
parent aae4f66f68
commit 1e4215c5c6
5 changed files with 42 additions and 53 deletions

View file

@ -2994,8 +2994,7 @@ void client_hilite(ObClient *self, gboolean hilite)
void client_set_desktop_recursive(ObClient *self,
guint target,
gboolean donthide,
gboolean focus_nonintrusive)
gboolean donthide)
{
guint old;
GSList *it;
@ -3006,10 +3005,6 @@ void client_set_desktop_recursive(ObClient *self,
g_assert(target < screen_num_desktops || target == DESKTOP_ALL);
/* remove from the old desktop(s) */
if (!focus_nonintrusive)
focus_order_remove(self);
old = self->desktop;
self->desktop = target;
PROP_SET32(self->window, net_wm_desktop, cardinal, target);
@ -3024,14 +3019,6 @@ void client_set_desktop_recursive(ObClient *self,
if (STRUT_EXISTS(self->strut))
screen_update_areas();
/* add to the new desktop(s) */
if (!focus_nonintrusive) {
if (config_focus_new)
focus_order_to_top(self);
else
focus_order_to_bottom(self);
}
/* call the notifies */
GSList *it;
for (it = client_desktop_notifies; it; it = g_slist_next(it)) {
@ -3049,7 +3036,7 @@ void client_set_desktop_recursive(ObClient *self,
}
void client_set_desktop(ObClient *self, guint target,
gboolean donthide, gboolean focus_nonintrusive)
gboolean donthide)
{
self = client_search_top_normal_parent(self);
client_set_desktop_recursive(self, target, donthide, focus_nonintrusive);
@ -3460,7 +3447,8 @@ static void client_bring_helper_windows_recursive(ObClient *self,
if (client_helper(self) &&
self->desktop != desktop && self->desktop != DESKTOP_ALL)
{
client_set_desktop(self, desktop, FALSE, TRUE);
client_set_desktop(self, desktop, FALSE);
>>>>>>> .merge-right.r6182
}
}
@ -3902,17 +3890,3 @@ gboolean client_has_group_siblings(ObClient *self)
{
return self->group && self->group->members->next;
}
gboolean client_has_non_helper_group_siblings(ObClient *self)
{
GSList *it;
if (!self->group) return FALSE;
for (it = self->group->members; it; it = g_slist_next(it)) {
ObClient *c = it->data;
if (c != self && client_normal(c) && !client_helper(c))
return TRUE;
}
return FALSE;
}

View file

@ -464,13 +464,9 @@ void client_kill(ObClient *self);
/*! Sends the window to the specified desktop
@param donthide If TRUE, the window will not be shown/hidden after its
desktop has been changed. Generally this should be FALSE.
@param focus_nonintrusive If TRUE, the window will not be moved in the
focus order at all. Do this when moving windows to a desktop in
the "background" or something. It can be used to make a window share
multiple desktops. Generally this should be FALSE. */
void client_set_desktop(ObClient *self, guint target,
gboolean donthide, gboolean focus_nonintrusive);
desktop has been changed. Generally this should be FALSE.
*/
void client_set_desktop(ObClient *self, guint target, gboolean donthide);
/*! Show the client if it should be shown. */
void client_show(ObClient *self);
@ -665,8 +661,4 @@ ObClient* client_under_pointer();
gboolean client_has_group_siblings(ObClient *self);
/*! Returns if a client has an group siblings which are main application
windows (not helper or non-normal windows) */
gboolean client_has_non_helper_group_siblings(ObClient *self);
#endif

View file

@ -43,7 +43,6 @@
#include "translate.h"
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include <X11/Xatom.h>
#include <glib.h>

View file

@ -37,7 +37,7 @@
#include <glib.h>
#include <assert.h>
#define FOCUS_INDICATOR_WIDTH 5
#define FOCUS_INDICATOR_WIDTH 6
ObClient *focus_client = NULL;
GList *focus_order = NULL;
@ -528,6 +528,28 @@ void focus_cycle_draw_indicator()
}
}
static gboolean has_valid_group_siblings_on_desktop(ObClient *ft,
gboolean all_desktops)
{
GSList *it;
if (!ft->group) return FALSE;
for (it = ft->group->members; it; it = g_slist_next(it)) {
ObClient *c = it->data;
/* check that it's not a helper window to avoid infinite recursion */
if (c != ft && !client_helper(ft) &&
valid_focus_target(ft, all_desktops, FALSE))
{
return TRUE;
}
}
return FALSE;
}
/*! @param allow_helpers This is used for calling itself recursively while
checking helper windows. */
static gboolean valid_focus_target(ObClient *ft,
gboolean all_desktops,
gboolean dock_windows)
@ -548,16 +570,17 @@ static gboolean valid_focus_target(ObClient *ft,
if (dock_windows)
ok = ok && ft->type == OB_CLIENT_TYPE_DOCK;
else
ok = ok && (ft->type == OB_CLIENT_TYPE_NORMAL ||
ft->type == OB_CLIENT_TYPE_DIALOG ||
((ft->type == OB_CLIENT_TYPE_TOOLBAR ||
ft->type == OB_CLIENT_TYPE_MENU ||
ft->type == OB_CLIENT_TYPE_UTILITY) &&
/* let alt-tab go to these windows when a window in its
group already has focus ... */
((focus_client && ft->group == focus_client->group) ||
/* ... or if there are no main windows in its group */
!client_has_non_helper_group_siblings(ft))));
/* normal non-helper windows are valid targets */
ok = ok &&
((client_normal(ft) && !client_helper(ft))
||
/* helper windows are valid targets it... */
(client_helper(ft) &&
/* ...a window in its group already has focus ... */
((focus_client && ft->group == focus_client->group) ||
/* ... or if there are no other windows in its group
that can be cycled to instead */
!has_valid_group_siblings_on_desktop(ft, all_desktops))));
/* it's not set to skip the taskbar (unless it is a type that would be
expected to set this hint */

View file

@ -20,6 +20,7 @@
#include "openbox.h"
#include <X11/Xlib.h>
#include <X11/keysym.h>
/* These masks are constants and the modifier keys are bound to them as
anyone sees fit: