void client_set_desktop_recursive(ObClient *self,
guint target,
- gboolean donthide,
- gboolean focus_nonintrusive)
+ gboolean donthide)
{
guint old;
GSList *it;
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);
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)) {
}
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);
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
}
}
{
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;
-}
/*! 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);
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
#include "translate.h"
#include <X11/Xlib.h>
-#include <X11/keysym.h>
#include <X11/Xatom.h>
#include <glib.h>
#include <glib.h>
#include <assert.h>
-#define FOCUS_INDICATOR_WIDTH 5
+#define FOCUS_INDICATOR_WIDTH 6
ObClient *focus_client = NULL;
GList *focus_order = NULL;
}
}
+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)
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 */
#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: