gettext.h \
openbox/actions/all.c \
openbox/actions/all.h \
+ openbox/actions/cyclewindows.c \
openbox/actions/debug.c \
openbox/actions/execute.c \
openbox/actions/exit.c \
(*a)->data.desktopdir.wrap = TRUE;
}
-void setup_action_cycle_windows_next(ObAction **a, ObUserAction uact)
-{
- (*a)->data.cycle.inter.any.interactive = TRUE;
- (*a)->data.cycle.linear = FALSE;
- (*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;
-}
-
-void setup_action_cycle_windows_previous(ObAction **a, ObUserAction uact)
-{
- (*a)->data.cycle.inter.any.interactive = TRUE;
- (*a)->data.cycle.linear = 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;
-}
-
void setup_action_movefromedge_north(ObAction **a, ObUserAction uact)
{
(*a)->data.diraction.any.client_action = OB_CLIENT_ACTION_ALWAYS;
action_toggle_layer,
setup_action_bottom_layer
},
- {
- "nextwindow",
- action_cycle_windows,
- setup_action_cycle_windows_next
- },
- {
- "previouswindow",
- action_cycle_windows,
- setup_action_cycle_windows_previous
- },
{
"movefromedgenorth",
action_movetoedge,
} else if (act->func == action_activate) {
if ((n = parse_find_node("here", node->xmlChildrenNode)))
act->data.activate.here = parse_bool(doc, n);
- } else if (act->func == action_cycle_windows) {
- if ((n = parse_find_node("linear", node->xmlChildrenNode)))
- act->data.cycle.linear = parse_bool(doc, n);
- if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
- 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);
} else if (act->func == action_directional_focus) {
if ((n = parse_find_node("dialog", node->xmlChildrenNode)))
act->data.interdiraction.dialog = parse_bool(doc, n);
moveresize_start(c, data->any.x, data->any.y, data->any.button, corner);
}
-void action_cycle_windows(union ActionData *data)
-{
- /* if using focus_delay, stop the timer now so that focus doesn't go moving
- on us */
- event_halt_focus_delay();
-
- 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);
-}
-
void action_directional_focus(union ActionData *data)
{
/* if using focus_delay, stop the timer now so that focus doesn't go moving
static void actions_setup_data(ObActionsData *data,
ObUserAction uact,
- Time time,
guint state,
gint x,
gint y,
struct _ObClient *client)
{
data->uact = uact;
- data->time = time;
data->state = state;
data->x = x;
data->y = y;
void actions_run_acts(GSList *acts,
ObUserAction uact,
- Time time,
guint state,
gint x,
gint y,
ObActionsAct *act = it->data;
gboolean ok = TRUE;
- actions_setup_data(&data, uact, time, state, x, y, con, client);
+ actions_setup_data(&data, uact, state, x, y, con, client);
if (actions_act_is_interactive(act) &&
(!interactive_act || interactive_act->def != act->def))
struct _ObActionsData {
ObUserAction uact;
- Time time;
guint state;
gint x;
gint y;
*/
void actions_run_acts(GSList *acts,
ObUserAction uact,
- Time time,
guint state,
gint x,
gint y,
action_reconfigure_startup();
action_exit_startup();
action_restart_startup();
+ action_cyclewindows_startup();
}
void action_reconfigure_startup();
void action_exit_startup();
void action_restart_startup();
+void action_cyclewindows_startup();
#endif
/* sets up the environment */
sn_setup_spawn_environment(program, o->sn_name, o->sn_icon,
/* launch it on the current desktop */
- screen_desktop,
- data->time);
+ screen_desktop);
}
if (!g_spawn_async(NULL, argv, NULL,
}
static void menu_execute(ObMenuEntry *self, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
if (self->id == -1) {
if (self->data.normal.data) /* it's set to NULL if its destroyed */
}
static void desk_menu_execute(ObMenuEntry *self, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
if (self->id == -1) {
if (self->data.normal.data) /* it's set to NULL if its destroyed */
}
static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
gint x, y;
gulong ignore_start;
}
static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
gulong ignore_start;
}
static void send_to_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
- ObClient *c, guint state, gpointer data,
- Time time)
+ ObClient *c, guint state, gpointer data)
{
g_assert(c);
if (frame->child)
menu_frame_select_next(frame->child);
else if (frame->selected)
- menu_entry_frame_execute(frame->selected, state, ev->xkey.time);
+ menu_entry_frame_execute(frame->selected, state);
}
else if (keycode == ob_keycode(OB_KEY_LEFT) && ev->xkey.state == 0) {
menu_frame_select(frame, found, TRUE);
usleep(50000); /* highlight the item for a short bit so the
user can see what happened */
- menu_entry_frame_execute(found, state, ev->xkey.time);
+ menu_entry_frame_execute(found, state);
} else {
menu_frame_select(frame, found, TRUE);
if (num_found == 1)
ev->xbutton.y_root)))
{
menu_frame_select(e->frame, e, TRUE);
- menu_entry_frame_execute(e, ev->xbutton.state,
- ev->xbutton.time);
+ menu_entry_frame_execute(e, ev->xbutton.state);
}
else
menu_frame_hide_all();
}
}
-void focus_cycle(gboolean forward, gboolean all_desktops,
- gboolean dock_windows, gboolean desktop_windows,
- gboolean linear, gboolean interactive,
- gboolean dialog, gboolean done, gboolean cancel)
+ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
+ gboolean dock_windows, gboolean desktop_windows,
+ gboolean linear, gboolean interactive,
+ gboolean dialog, gboolean done, gboolean cancel)
{
static ObClient *t = NULL;
static GList *order = NULL;
GList *it, *start, *list;
ObClient *ft = NULL;
+ ObClient *ret = NULL;
if (interactive) {
if (cancel) {
} while (it != start);
done_cycle:
- if (done && focus_cycle_target)
- client_activate(focus_cycle_target, FALSE, TRUE);
+ if (done && !cancel) ret = focus_cycle_target;
t = NULL;
focus_cycle_target = NULL;
focus_cycle_popup_hide();
}
- return;
+ return ret;
}
/* this be mostly ripped from fvwm */
void focus_cycle_shutdown(gboolean reconfig);
/*! Cycle focus amongst windows. */
-void focus_cycle(gboolean forward, gboolean all_desktops,
- gboolean dock_windows, gboolean desktop_windows,
- gboolean linear, gboolean interactive,
- gboolean dialog, gboolean done, gboolean cancel);
+struct _ObClient* focus_cycle(gboolean forward, gboolean all_desktops,
+ gboolean dock_windows, gboolean desktop_windows,
+ gboolean linear, gboolean interactive,
+ gboolean dialog, gboolean done, gboolean cancel);
void focus_directional_cycle(ObDirection dir, gboolean dock_windows,
gboolean desktop_windows, gboolean interactive,
gboolean dialog, gboolean done, gboolean cancel);
keyboard_reset_chains(0);
actions_run_acts(p->actions, OB_USER_ACTION_KEYBOARD_KEY,
- e->xkey.time, e->xkey.state,
- e->xkey.x_root, e->xkey.y_root,
+ e->xkey.state, e->xkey.x_root, e->xkey.y_root,
OB_FRAME_CONTEXT_NONE, client);
}
break;
typedef void (*ObMenuExecuteFunc)(struct _ObMenuEntry *entry,
struct _ObMenuFrame *frame,
struct _ObClient *client,
- guint state, gpointer data, Time time);
+ guint state, gpointer data);
typedef void (*ObMenuDestroyFunc)(struct _ObMenu *menu, gpointer data);
/*! @param x is the mouse x coordinate. on return it should be the x coordinate
for the menu
menu_frame_show_submenu(f, self->frame, self);
}
-void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state, Time time)
+void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state)
{
if (self->entry->type == OB_MENU_ENTRY_TYPE_NORMAL &&
self->entry->data.normal.enabled)
}
if (func)
- func(entry, frame, client, state, data, time);
+ func(entry, frame, client, state, data);
else
actions_run_acts(acts, OB_USER_ACTION_MENU_SELECTION,
- time, state, -1, -1, OB_FRAME_CONTEXT_NONE,
- client);
+ state, -1, -1, OB_FRAME_CONTEXT_NONE, client);
}
}
void menu_entry_frame_show_submenu(ObMenuEntryFrame *self);
-void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state, Time time);
+void menu_entry_frame_execute(ObMenuEntryFrame *self, guint state);
#endif
static gboolean fire_binding(ObMouseAction a, ObFrameContext context,
ObClient *c, guint state,
- guint button, gint x, gint y, Time time)
+ guint button, gint x, gint y)
{
GSList *it;
ObMouseBinding *b;
if (it == NULL) return FALSE;
actions_run_acts(b->actions[a], mouse_action_to_user_action(a),
- time, state, x, y, context, c);
+ state, x, y, context, c);
return TRUE;
}
fire_binding(OB_MOUSE_ACTION_PRESS, context,
client, e->xbutton.state,
e->xbutton.button,
- e->xbutton.x_root, e->xbutton.y_root,
- e->xbutton.time);
+ e->xbutton.x_root, e->xbutton.y_root);
/* if the bindings grab the pointer, there won't be a ButtonRelease
event for us */
client, e->xbutton.state,
e->xbutton.button,
e->xbutton.x_root,
- e->xbutton.y_root,
- e->xbutton.time);
+ e->xbutton.y_root);
if (click)
fire_binding(OB_MOUSE_ACTION_CLICK, context,
client, e->xbutton.state,
e->xbutton.button,
e->xbutton.x_root,
- e->xbutton.y_root,
- e->xbutton.time);
+ e->xbutton.y_root);
if (dclick)
fire_binding(OB_MOUSE_ACTION_DOUBLE_CLICK, context,
client, e->xbutton.state,
e->xbutton.button,
e->xbutton.x_root,
- e->xbutton.y_root,
- e->xbutton.time);
+ e->xbutton.y_root);
break;
case MotionNotify:
break;
fire_binding(OB_MOUSE_ACTION_MOTION, context,
- client, state, button, px, py, e->xmotion.time);
+ client, state, button, px, py);
button = 0;
state = 0;
}
#include "startupnotify.h"
#include "gettext.h"
+#include "event.h"
#include <stdlib.h>
}
void sn_setup_spawn_environment(gchar *program, gchar *name,
- gchar *icon_name, gint desktop,
- Time time)
+ gchar *icon_name, gint desktop)
{
gchar *desc;
const char *id;
sn_launcher_context_set_binary_name(sn_launcher, program);
if (desktop >= 0 && (unsigned) desktop < screen_num_desktops)
sn_launcher_context_set_workspace(sn_launcher, (signed) desktop);
- sn_launcher_context_initiate(sn_launcher, "openbox", program, time);
+ sn_launcher_context_initiate(sn_launcher, "openbox", program,
+ event_curtime);
id = sn_launcher_context_get_startup_id(sn_launcher);
/* 20 second timeout for apps to start */
/* Get the environment to run the program in, with startup notification */
void sn_setup_spawn_environment(gchar *program, gchar *name,
- gchar *icon_name, gint desktop,
- Time time);
+ gchar *icon_name, gint desktop);
/* Tell startup notification we're not actually running the program we
told it we were