action_interactive_cancel_act();
run_i = TRUE;
if (i_run != this_run && act->i_pre)
- run_i = act->i_pre(data->state, act->options);
+ run_i = act->i_pre(data->mod_state, act->options);
}
run = TRUE;
if (run_i) {
- run = action_interactive_begin_act(act, data->state);
+ run = action_interactive_begin_act(act, data->mod_state);
ran_interactive = TRUE;
}
if (action_is_interactive(act))
action_interactive_end_act();
/* XXX else if (client_set_contains(focus_client)) */
- else if (data->client && data->client == focus_client)
+ else if (data->target && data->target == focus_client)
event_update_user_time();
}
}
if (start)
ignore_start = event_start_ignore_all_enters();
else if (config_focus_follow &&
- data->context != OB_FRAME_CONTEXT_CLIENT)
+ data->pointer_context != OB_FRAME_CONTEXT_CLIENT)
{
- if (data->uact == OB_USER_ACTION_MOUSE_PRESS) {
- struct _ObClient *c;
-
+ if (data->user_act == OB_USER_ACTION_MOUSE_PRESS) {
/* usually this is sorta redundant, but with a press action
that moves windows our from under the cursor, the enter
event will come as a GrabNotify which is ignored, so this
should be ignored
*/
if (!grab_on_pointer()) {
- if ((c = client_under_pointer()) && c != data->client) {
+ struct _ObClient *under = client_under_pointer();
+ if (under && under != data->pointer_over) {
ob_debug_type(OB_DEBUG_FOCUS,
"Generating fake enter because we did a "
"mouse-event action");
- event_enter_client(c);
+ event_enter_client(under);
}
- else if (!c && c != data->client) {
+ else if (!under && under != data->pointer_over) {
ob_debug_type(OB_DEBUG_FOCUS,
"Generating fake leave because we did a "
"mouse-event action");
- event_enter_client(data->client);
+ event_enter_client(data->target);
}
}
}
- else if (!data->button && !config_focus_under_mouse)
+ else if (!data->pointer_button && !config_focus_under_mouse)
event_end_ignore_all_enters(ignore_start);
}
}
if (x < 0 && y < 0)
screen_pointer_pos(&x, &y);
- action_data.uact = uact;
- action_data.state = state;
- action_data.x = x;
- action_data.y = y;
- action_data.button = button;
- action_data.context = con;
- action_data.client = client;
+ action_data.user_act = uact;
+ action_data.mod_state = state;
+ action_data.pointer_x = x;
+ action_data.pointer_y = y;
+ action_data.pointer_button = button;
+ action_data.pointer_context = con;
+ action_data.target = client;
/* if a pointer started the event clicking on a window, it must be under
the pointer */
action_data.pointer_over = client ? client : client_under_pointer();
if (!myset) {
switch (action_default_filter(acts->u.action)) {
case OB_ACTION_DEFAULT_FILTER_SINGLE:
- myset = client_set_single(data->client); break;
+ myset = client_set_single(data->target); break;
case OB_ACTION_DEFAULT_FILTER_EMPTY:
myset = client_set_empty(); break;
case OB_ACTION_DEFAULT_FILTER_ALL:
it.
*/
struct _ObActionListRun {
- ObUserAction uact;
- guint state;
+ ObUserAction user_act;
+ guint mod_state;
- gint x;
- gint y;
- gint button;
- ObFrameContext context;
- struct _ObClient *client;
+ gint pointer_x;
+ gint pointer_y;
+ gint pointer_button;
+ ObFrameContext pointer_context;
struct _ObClient *pointer_over;
+
+ struct _ObClient *target;
};
/*! Run an action list.
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client) client_close(data->client);
+ if (data->target) client_close(data->target);
return FALSE;
}
/* Always return FALSE because its not interactive */
static gboolean run_func_on(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_set_undecorated(data->client, FALSE);
+ client_set_undecorated(data->target, FALSE);
action_client_move(data, FALSE);
}
return FALSE;
/* Always return FALSE because its not interactive */
static gboolean run_func_off(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_set_undecorated(data->client, TRUE);
+ client_set_undecorated(data->target, TRUE);
action_client_move(data, FALSE);
}
return FALSE;
/* Always return FALSE because its not interactive */
static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_set_undecorated(data->client, !data->client->undecorated);
+ client_set_undecorated(data->target, !data->target->undecorated);
action_client_move(data, FALSE);
}
return FALSE;
if (d < screen_num_desktops &&
(d != screen_desktop ||
- (data->client && data->client->desktop != screen_desktop))) {
+ (data->target && data->target->desktop != screen_desktop))) {
gboolean go = TRUE;
action_client_move(data, TRUE);
- if (o->send && data->client && client_normal(data->client)) {
- client_set_desktop(data->client, d, o->follow, FALSE);
+ if (o->send && data->target && client_normal(data->target)) {
+ client_set_desktop(data->target, d, o->follow, FALSE);
go = o->follow;
}
if (go) {
screen_set_desktop(d, TRUE);
- if (data->client)
- client_bring_helper_windows(data->client);
+ if (data->target)
+ client_bring_helper_windows(data->target);
}
action_client_move(data, FALSE);
Options *o = options;
if (!o->interactive)
- end_cycle(FALSE, data->state, o);
+ end_cycle(FALSE, data->mod_state, o);
else {
struct _ObClient *ft;
for (it = prompt_opts; it; it = g_slist_next(it)) {
Options *o = it->data;
- if (o->data->client == client)
- o->data->client = NULL;
+ if (o->data->target == client)
+ o->data->target = NULL;
}
}
return FALSE;
}
- if (data->client) {
+ if (data->target) {
gchar *c, *before, *expand;
/* replace occurrences of $pid and $wid */
expand = g_strdup_printf("%s%s%u",
(expand ? expand : ""),
before,
- data->client->pid);
+ data->target->pid);
g_free(tmp);
before = c + 4; /* 4 = strlen("$pid") */
expand = g_strdup_printf("%s%s%lu",
(expand ? expand : ""),
before,
- data->client->window);
+ data->target->window);
g_free(tmp);
before = c + 4; /* 4 = strlen("$wid") */
/* If there is a keyboard grab going on then we need to cancel
it so the application can grab things */
- if (data->uact != OB_USER_ACTION_MENU_SELECTION)
+ if (data->user_act != OB_USER_ACTION_MENU_SELECTION)
event_cancel_all_key_grabs();
e = NULL;
{
Options *o = options;
- if (data->client) {
+ if (data->target) {
/*
ob_debug("button %d focusable %d context %d %d %d\n",
data->button, client_mouse_focusable(data->client),
data->context,
OB_FRAME_CONTEXT_CLIENT, OB_FRAME_CONTEXT_FRAME);
*/
- if (data->button == 0 || client_mouse_focusable(data->client) ||
- (data->context != OB_FRAME_CONTEXT_CLIENT &&
- data->context != OB_FRAME_CONTEXT_FRAME))
+ if (data->pointer_button == 0 ||
+ client_mouse_focusable(data->target) ||
+ (data->pointer_context != OB_FRAME_CONTEXT_CLIENT &&
+ data->pointer_context != OB_FRAME_CONTEXT_FRAME))
{
if (o->stop_int)
action_interactive_cancel_act();
action_client_move(data, TRUE);
- client_activate(data->client, TRUE, o->here, FALSE, FALSE, TRUE);
+ client_activate(data->target, TRUE, o->here, FALSE, FALSE, TRUE);
action_client_move(data, FALSE);
}
- } else if (data->context == OB_FRAME_CONTEXT_DESKTOP) {
+ } else if (data->pointer_context == OB_FRAME_CONTEXT_DESKTOP) {
if (o->stop_int)
action_interactive_cancel_act();
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client)
- focus_order_to_bottom(data->client);
+ if (data->target)
+ focus_order_to_bottom(data->target);
return FALSE;
}
/* Always return FALSE because its not interactive */
static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_fullscreen(data->client, !data->client->fullscreen);
+ client_fullscreen(data->target, !data->target->fullscreen);
action_client_move(data, FALSE);
}
return FALSE;
realw = w;
realh = h;
- client_try_configure(data->client, &x, &y, &realw, &realh,
+ client_try_configure(data->target, &x, &y, &realw, &realh,
&lw, &lh, TRUE);
/* if it's going to be resized smaller than it intended, don't
move the window over */
- if (x != data->client->area.x) x += w - realw;
- if (y != data->client->area.y) y += h - realh;
+ if (x != data->target->area.x) x += w - realw;
+ if (y != data->target->area.y) y += h - realh;
- if (x != data->client->area.x || y != data->client->area.y ||
- realw != data->client->area.width ||
- realh != data->client->area.height)
+ if (x != data->target->area.x || y != data->target->area.y ||
+ realw != data->target->area.width ||
+ realh != data->target->area.height)
{
action_client_move(data, TRUE);
- client_move_resize(data->client, x, y, realw, realh);
+ client_move_resize(data->target, x, y, realw, realh);
action_client_move(data, FALSE);
return TRUE;
}
ObDirection opp;
gint half;
- if (!data->client ||
+ if (!data->target ||
/* don't allow vertical resize if shaded */
((o->dir == OB_DIRECTION_NORTH || o->dir == OB_DIRECTION_SOUTH) &&
- data->client->shaded))
+ data->target->shaded))
{
return FALSE;
}
if (!o->shrink) {
/* try grow */
- client_find_resize_directional(data->client, o->dir, TRUE,
+ client_find_resize_directional(data->target, o->dir, TRUE,
&x, &y, &w, &h);
if (do_grow(data, x, y, w, h))
return FALSE;
(o->dir == OB_DIRECTION_SOUTH ? OB_DIRECTION_NORTH :
(o->dir == OB_DIRECTION_EAST ? OB_DIRECTION_WEST :
OB_DIRECTION_EAST)));
- client_find_resize_directional(data->client, opp, FALSE,
+ client_find_resize_directional(data->target, opp, FALSE,
&x, &y, &w, &h);
switch (opp) {
case OB_DIRECTION_NORTH:
- half = data->client->area.y + data->client->area.height / 2;
+ half = data->target->area.y + data->target->area.height / 2;
if (y > half) {
h += y - half;
y = half;
}
break;
case OB_DIRECTION_SOUTH:
- half = data->client->area.height / 2;
+ half = data->target->area.height / 2;
if (h < half)
h = half;
break;
case OB_DIRECTION_WEST:
- half = data->client->area.x + data->client->area.width / 2;
+ half = data->target->area.x + data->target->area.width / 2;
if (x > half) {
w += x - half;
x = half;
}
break;
case OB_DIRECTION_EAST:
- half = data->client->area.width / 2;
+ half = data->target->area.width / 2;
if (w < half)
w = half;
break;
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_iconify(data->client, TRUE, TRUE, FALSE);
+ client_iconify(data->target, TRUE, TRUE, FALSE);
action_client_move(data, FALSE);
}
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client)
- client_kill(data->client);
+ if (data->target)
+ client_kill(data->target);
return FALSE;
}
{
Options *o = options;
- if (data->client) {
- ObClient *c = data->client;
+ if (data->target) {
+ ObClient *c = data->target;
action_client_move(data, TRUE);
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- stacking_lower(CLIENT_AS_WINDOW(data->client));
+ stacking_lower(CLIENT_AS_WINDOW(data->target));
action_client_move(data, FALSE);
}
static gboolean run_func_on(const ObActionListRun *data, gpointer options)
{
Options *o = options;
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_maximize(data->client, TRUE, o->dir);
+ client_maximize(data->target, TRUE, o->dir);
action_client_move(data, FALSE);
}
return FALSE;
static gboolean run_func_off(const ObActionListRun *data, gpointer options)
{
Options *o = options;
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_maximize(data->client, FALSE, o->dir);
+ client_maximize(data->target, FALSE, o->dir);
action_client_move(data, FALSE);
}
return FALSE;
static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
{
Options *o = options;
- if (data->client) {
+ if (data->target) {
gboolean toggle;
action_client_move(data, TRUE);
- toggle = ((o->dir == HORZ && !data->client->max_horz) ||
- (o->dir == VERT && !data->client->max_vert) ||
+ toggle = ((o->dir == HORZ && !data->target->max_horz) ||
+ (o->dir == VERT && !data->target->max_vert) ||
(o->dir == BOTH &&
- !(data->client->max_horz && data->client->max_vert)));
- client_maximize(data->client, toggle, o->dir);
+ !(data->target->max_horz && data->target->max_vert)));
+ client_maximize(data->target, toggle, o->dir);
action_client_move(data, FALSE);
}
return FALSE;
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
guint32 corner;
- corner = data->button != 0 ?
+ corner = data->pointer_button != 0 ?
OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE) :
OBT_PROP_ATOM(NET_WM_MOVERESIZE_MOVE_KEYBOARD);
- moveresize_start(data->client, data->x, data->y, data->button, corner);
+ moveresize_start(data->target, data->pointer_x, data->pointer_y,
+ data->pointer_button, corner);
}
return FALSE;
{
Options *o = options;
- if (data->client) {
+ if (data->target) {
ObClient *c;
gint x, y, lw, lh, w, h;
- c = data->client;
+ c = data->target;
x = o->x;
y = o->y;
if (o->x_denom || o->y_denom) {
{
Options *o = options;
- if (data->client) {
+ if (data->target) {
Rect *area, *carea;
ObClient *c;
guint mon, cmon;
gint x, y, lw, lh, w, h;
- c = data->client;
+ c = data->target;
mon = o->monitor;
cmon = client_monitor(c);
switch (mon) {
{
Options *o = options;
- if (data->client) {
+ if (data->target) {
gint x, y;
- client_find_move_directional(data->client, o->dir, &x, &y);
- if (x != data->client->area.x || y != data->client->area.y) {
+ client_find_move_directional(data->target, o->dir, &x, &y);
+ if (x != data->target->area.x || y != data->target->area.y) {
action_client_move(data, TRUE);
- client_move(data->client, x, y);
+ client_move(data->target, x, y);
action_client_move(data, FALSE);
}
}
/* Always return FALSE because its not interactive */
static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_set_desktop(data->client,
- data->client->desktop == DESKTOP_ALL ?
+ client_set_desktop(data->target,
+ data->target->desktop == DESKTOP_ALL ?
screen_desktop : DESKTOP_ALL, FALSE, TRUE);
action_client_move(data, FALSE);
}
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- stacking_raise(CLIENT_AS_WINDOW(data->client));
+ stacking_raise(CLIENT_AS_WINDOW(data->target));
action_client_move(data, FALSE);
}
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- stacking_restack_request(data->client, NULL, Opposite);
+ stacking_restack_request(data->target, NULL, Opposite);
action_client_move(data, FALSE);
}
{
Options *o = options;
- if (data->client) {
- ObClient *c = data->client;
+ if (data->target) {
+ ObClient *c = data->target;
guint32 corner;
- if (!data->button)
+ if (!data->pointer_button)
corner = OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_KEYBOARD);
else if (o->corner_specified)
corner = o->corner; /* it was specified in the binding */
else
- corner = pick_corner(data->x, data->y,
+ corner = pick_corner(data->pointer_x, data->pointer_y,
c->frame->area.x, c->frame->area.y,
/* use the client size because the frame
can be differently sized (shaded
c->area.height + c->frame->size.top +
c->frame->size.bottom, c->shaded);
- moveresize_start(c, data->x, data->y, data->button, corner);
+ moveresize_start(c, data->pointer_x, data->pointer_y,
+ data->pointer_button, corner);
}
return FALSE;
{
Options *o = options;
- if (data->client) {
- ObClient *c = data->client;
+ if (data->target) {
+ ObClient *c = data->target;
gint x, y, ow, xoff, nw, oh, yoff, nh, lw, lh;
gint left = o->left, right = o->right, top = o->top, bottom = o->bottom;
/* Always return FALSE because its not interactive */
static gboolean run_func_on(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_shade(data->client, TRUE);
+ client_shade(data->target, TRUE);
action_client_move(data, FALSE);
}
return FALSE;
/* Always return FALSE because its not interactive */
static gboolean run_func_off(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_shade(data->client, FALSE);
+ client_shade(data->target, FALSE);
action_client_move(data, FALSE);
}
return FALSE;
/* Always return FALSE because its not interactive */
static gboolean run_func_toggle(const ObActionListRun *data, gpointer options)
{
- if (data->client) {
+ if (data->target) {
action_client_move(data, TRUE);
- client_shade(data->client, !data->client->shaded);
+ client_shade(data->target, !data->target->shaded);
action_client_move(data, FALSE);
}
return FALSE;
Options *o = options;
/* you cannot call ShowMenu from inside a menu */
- if (data->uact != OB_USER_ACTION_MENU_SELECTION && o->name)
- menu_show(o->name, data->x, data->y, data->button != 0, data->client);
+ if (data->user_act != OB_USER_ACTION_MENU_SELECTION && o->name)
+ menu_show(o->name, data->pointer_x, data->pointer_y,
+ data->pointer_button != 0, data->target);
return FALSE;
}
/* Always return FALSE because its not interactive */
static gboolean run_func(const ObActionListRun *data, gpointer options)
{
- if (data->client && data->client == focus_client)
+ if (data->target && data->target == focus_client)
focus_fallback(FALSE, FALSE, TRUE, FALSE);
return FALSE;
}
static ObClientSet* filter(gboolean invert, const ObActionListRun *data,
gpointer setup_data)
{
- ObClientSet *set = client_set_single(data->client);
+ ObClientSet *set = client_set_single(data->target);
if (invert) set = client_set_minus(client_set_all(), set);
return set;
}