(*a)->data.interdiraction.direction = OB_DIRECTION_NORTH;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_directional_focus_east(ObAction **a, ObUserAction uact)
(*a)->data.interdiraction.direction = OB_DIRECTION_EAST;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_directional_focus_south(ObAction **a, ObUserAction uact)
(*a)->data.interdiraction.direction = OB_DIRECTION_SOUTH;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_directional_focus_west(ObAction **a, ObUserAction uact)
(*a)->data.interdiraction.direction = OB_DIRECTION_WEST;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_directional_focus_northeast(ObAction **a, ObUserAction uact)
(*a)->data.interdiraction.direction = OB_DIRECTION_NORTHEAST;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_directional_focus_southeast(ObAction **a, ObUserAction uact)
(*a)->data.interdiraction.direction = OB_DIRECTION_SOUTHEAST;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_directional_focus_southwest(ObAction **a, ObUserAction uact)
(*a)->data.interdiraction.direction = OB_DIRECTION_SOUTHWEST;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_directional_focus_northwest(ObAction **a, ObUserAction uact)
(*a)->data.interdiraction.direction = OB_DIRECTION_NORTHWEST;
(*a)->data.interdiraction.dialog = TRUE;
(*a)->data.interdiraction.dock_windows = FALSE;
+ (*a)->data.interdiraction.desktop_windows = FALSE;
}
void setup_action_send_to_desktop(ObAction **a, ObUserAction uact)
(*a)->data.cycle.forward = TRUE;
(*a)->data.cycle.dialog = TRUE;
(*a)->data.cycle.dock_windows = FALSE;
+ (*a)->data.cycle.desktop_windows = FALSE;
(*a)->data.cycle.all_desktops = FALSE;
}
(*a)->data.cycle.forward = FALSE;
(*a)->data.cycle.dialog = TRUE;
(*a)->data.cycle.dock_windows = FALSE;
+ (*a)->data.cycle.desktop_windows = FALSE;
(*a)->data.cycle.all_desktops = FALSE;
}
act->data.cycle.dialog = parse_bool(doc, n);
if ((n = parse_find_node("panels", node->xmlChildrenNode)))
act->data.cycle.dock_windows = parse_bool(doc, n);
+ if ((n = parse_find_node("desktop", node->xmlChildrenNode)))
+ act->data.cycle.desktop_windows = parse_bool(doc, n);
if ((n = parse_find_node("allDesktops",
node->xmlChildrenNode)))
act->data.cycle.all_desktops = parse_bool(doc, n);
act->data.interdiraction.dialog = parse_bool(doc, n);
if ((n = parse_find_node("panels", node->xmlChildrenNode)))
act->data.interdiraction.dock_windows = parse_bool(doc, n);
+ if ((n = parse_find_node("desktop", node->xmlChildrenNode)))
+ act->data.interdiraction.desktop_windows =
+ parse_bool(doc, n);
} else if (act->func == action_raise ||
act->func == action_lower ||
act->func == action_raiselower ||
focus_cycle(data->cycle.forward,
data->cycle.all_desktops,
data->cycle.dock_windows,
+ data->cycle.desktop_windows,
data->cycle.linear, data->any.interactive,
data->cycle.dialog,
data->cycle.inter.final, data->cycle.inter.cancel);
focus_directional_cycle(data->interdiraction.direction,
data->interdiraction.dock_windows,
+ data->interdiraction.desktop_windows,
data->any.interactive,
data->interdiraction.dialog,
data->interdiraction.inter.final,
static gboolean valid_focus_target(ObClient *ft,
gboolean all_desktops,
- gboolean dock_windows);
+ gboolean dock_windows,
+ gboolean desktop_windows);
static void focus_cycle_destructor(ObClient *client, gpointer data);
static Window createWindow(Window parent, gulong mask,
be used.
*/
if (focus_cycle_target)
- focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
+ focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
focus_client = client;
}
static void popup_cycle(ObClient *c, gboolean show,
- gboolean all_desktops, gboolean dock_windows)
+ gboolean all_desktops, gboolean dock_windows,
+ gboolean desktop_windows)
{
gchar *showtext = NULL;
ObClient *showtarget;
/* build a list of all the valid focus targets */
for (it = focus_order; it; it = g_list_next(it)) {
ObClient *ft = it->data;
- if (valid_focus_target(ft, all_desktops, dock_windows)) {
+ if (valid_focus_target(ft, all_desktops, dock_windows
+ , desktop_windows))
+ {
targets = g_list_prepend(targets, ft);
++n;
}
be used
*/
if (focus_cycle_target == client)
- focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
+ focus_cycle(TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE);
}
void focus_cycle_draw_indicator()
ObClient *c = it->data;
/* check that it's not a helper window to avoid infinite recursion */
if (c != ft && !client_helper(c) &&
- valid_focus_target(c, all_desktops, FALSE))
+ valid_focus_target(c, all_desktops, FALSE, FALSE))
{
return TRUE;
}
checking helper windows. */
static gboolean valid_focus_target(ObClient *ft,
gboolean all_desktops,
- gboolean dock_windows)
+ gboolean dock_windows,
+ gboolean desktop_windows)
{
gboolean ok = FALSE;
ok = ok && (ft->can_focus || ft->focus_notify);
/* it's the right type of window */
- if (dock_windows)
- ok = ok && ft->type == OB_CLIENT_TYPE_DOCK;
+ if (dock_windows || desktop_windows)
+ ok = ok && ((dock_windows && ft->type == OB_CLIENT_TYPE_DOCK) ||
+ (desktop_windows && ft->type == OB_CLIENT_TYPE_DESKTOP));
else
/* normal non-helper windows are valid targets */
ok = ok &&
}
void focus_cycle(gboolean forward, gboolean all_desktops,
- gboolean dock_windows,
+ gboolean dock_windows, gboolean desktop_windows,
gboolean linear, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel)
{
if (it == NULL) it = g_list_last(list);
}
ft = it->data;
- if (valid_focus_target(ft, all_desktops, dock_windows)) {
+ if (valid_focus_target(ft, all_desktops, dock_windows,
+ desktop_windows))
+ {
if (interactive) {
if (ft != focus_cycle_target) { /* prevents flicker */
focus_cycle_target = ft;
focus_cycle_draw_indicator();
}
/* same arguments as valid_focus_target */
- popup_cycle(ft, dialog, all_desktops, dock_windows);
+ popup_cycle(ft, dialog, all_desktops, dock_windows,
+ desktop_windows);
return;
} else if (ft != focus_cycle_target) {
focus_cycle_target = ft;
if (interactive) {
focus_cycle_draw_indicator();
- popup_cycle(ft, FALSE, FALSE, FALSE);
+ popup_cycle(ft, FALSE, FALSE, FALSE, FALSE);
}
return;
/* this be mostly ripped from fvwm */
static ObClient *focus_find_directional(ObClient *c, ObDirection dir,
- gboolean dock_windows)
+ gboolean dock_windows,
+ gboolean desktop_windows)
{
gint my_cx, my_cy, his_cx, his_cy;
gint offset = 0;
/* the currently selected window isn't interesting */
if(cur == c)
continue;
- if (!dock_windows && !client_normal(cur))
+ if (!dock_windows && !desktop_windows && !client_normal(cur))
continue;
- if (dock_windows && cur->type != OB_CLIENT_TYPE_DOCK)
+ if (!(dock_windows && cur->type == OB_CLIENT_TYPE_DOCK) ||
+ (desktop_windows && cur->type == OB_CLIENT_TYPE_DESKTOP))
continue;
/* using c->desktop instead of screen_desktop doesn't work if the
* current window was omnipresent, hope this doesn't have any other
}
void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
- gboolean interactive,
+ gboolean desktop_windows, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel)
{
static ObClient *first = NULL;
if (!focus_cycle_target) focus_cycle_target = focus_client;
if (focus_cycle_target)
- ft = focus_find_directional(focus_cycle_target, dir, dock_windows);
+ ft = focus_find_directional(focus_cycle_target, dir, dock_windows,
+ desktop_windows);
else {
GList *it;
for (it = focus_order; it; it = g_list_next(it))
- if (valid_focus_target(it->data, FALSE, dock_windows))
+ if (valid_focus_target(it->data, FALSE, dock_windows,
+ desktop_windows))
ft = it->data;
}
}
if (focus_cycle_target) {
/* same arguments as valid_focus_target */
- popup_cycle(focus_cycle_target, dialog, FALSE, dock_windows);
+ popup_cycle(focus_cycle_target, dialog, FALSE, dock_windows,
+ desktop_windows);
if (dialog)
return;
}
focus_cycle_target = NULL;
focus_cycle_draw_indicator();
- popup_cycle(ft, FALSE, FALSE, FALSE);
+ popup_cycle(ft, FALSE, FALSE, FALSE, FALSE);
return;
}