}
void action_run_full(ObAction *a, struct _ObClient *c,
- ObFrameContext context,
guint state, guint button, gint x, gint y,
gboolean cancel, gboolean done)
{
a->data.inter.cancel = cancel;
a->data.inter.final = done;
if (!(cancel || done))
- keyboard_interactive_grab(state, c, context, a);
+ keyboard_interactive_grab(state, c, a);
}
a->func(&a->data);
/*! Executes an action.
@param c The client associated with the action. Can be NULL.
- @param context The context in which the user action occured.
@param state The keyboard modifiers state at the time the user action occured
@param button The mouse button used to execute the action.
@param x The x coord at which the user action occured.
affects interactive actions, but should generally always be FALSE.
*/
void action_run_full(ObAction *a, struct _ObClient *c,
- ObFrameContext context,
guint state, guint button, gint x, gint y,
gboolean cancel, gboolean done);
-#define action_run_mouse(a, c, t, s, b, x, y) \
- action_run_full(a, c, t, s, b, x, y, FALSE, FALSE)
+#define action_run_mouse(a, c, s, b, x, y) \
+ action_run_full(a, c, s, b, x, y, FALSE, FALSE)
#define action_run_interactive(a, c, s, n, d) \
- action_run_full(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, n, d)
+ action_run_full(a, c, s, 0, -1, -1, n, d)
#define action_run_key(a, c, s, x, y) \
- action_run_full(a, c, OB_FRAME_CONTEXT_NONE, s, 0, x, y, FALSE,FALSE)
+ action_run_full(a, c, s, 0, x, y, FALSE,FALSE)
#define action_run(a, c, s) \
- action_run_full(a, c, OB_FRAME_CONTEXT_NONE, s, 0, -1, -1, FALSE,FALSE)
+ action_run_full(a, c, s, 0, -1, -1, FALSE,FALSE)
/* Execute */
void action_execute(union ActionData *data);
{
if (menu_frame_visible)
event_handle_menu(e);
- else if (moveresize_in_progress)
- moveresize_event(e);
else {
- ObFrameContext context;
+ if (!keyboard_process_interactive_grab(e)) {
+ if (moveresize_in_progress)
+ moveresize_event(e);
- context = frame_context(client, e->xany.window);
-
- if (!keyboard_process_interactive_grab(e, &client, &context)) {
if (e->type == ButtonPress || e->type == ButtonRelease ||
e->type == MotionNotify)
- mouse_event(client, context, e);
+ mouse_event(client, e);
else if (e->type == KeyPress)
/* when in the middle of a focus cycling action, this
causes the window which appears to be focused to be
#include "keytree.h"
#include "keyboard.h"
#include "translate.h"
+#include "moveresize.h"
#include <glib.h>
}
void keyboard_interactive_grab(guint state, ObClient *client,
- ObFrameContext context, ObAction *action)
+ ObAction *action)
{
ObInteractiveState *s;
g_assert(action->data.any.interactive);
+ if (moveresize_in_progress)
+ moveresize_end(FALSE);
+
if (!interactive_states) {
if (!grab_keyboard(TRUE))
return;
s->state = state;
s->client = client;
s->action = action;
- s->context = context;
interactive_states = g_slist_append(interactive_states, s);
}
-gboolean keyboard_process_interactive_grab(const XEvent *e,
- ObClient **client,
- ObFrameContext *context)
+gboolean keyboard_process_interactive_grab(const XEvent *e)
{
GSList *it, *next;
gboolean handled = FALSE;
next = g_slist_next(it);
- *client = s->client;
- *context = s->context;
-
if ((e->type == KeyRelease &&
!(s->state & e->xkey.state)))
done = TRUE;
void keyboard_reset_chains();
void keyboard_interactive_grab(guint state, struct _ObClient *client,
- ObFrameContext context,
struct _ObAction *action);
-gboolean keyboard_process_interactive_grab(const XEvent *e,
- struct _ObClient **client,
- ObFrameContext *context);
+gboolean keyboard_process_interactive_grab(const XEvent *e);
void keyboard_grab_for_client(struct _ObClient *c, gboolean grab);
if (it == NULL) return FALSE;
for (it = b->actions[a]; it; it = it->next)
- action_run_mouse(it->data, c, context, state, button, x, y);
+ action_run_mouse(it->data, c, state, button, x, y);
return TRUE;
}
-void mouse_event(ObClient *client, ObFrameContext context, XEvent *e)
+void mouse_event(ObClient *client, XEvent *e)
{
static Time ltime;
static guint button = 0, state = 0, lbutton = 0;
-
static Window lwindow = None;
static int px, py;
+
+ ObFrameContext context;
gboolean click = FALSE;
gboolean dclick = FALSE;
+ context = frame_context(client, e->xany.window);
+
switch (e->type) {
case ButtonPress:
px = e->xbutton.x_root;
gboolean mouse_bind(char *buttonstr, char *contextstr, ObMouseAction mact,
ObAction *action);
-void mouse_event(struct _ObClient *client, ObFrameContext context, XEvent *e);
+void mouse_event(struct _ObClient *client, XEvent *e);
void mouse_grab_for_client(struct _ObClient *client, gboolean grab);
#include "prop.h"
#include "grab.h"
#include "startupnotify.h"
+#include "moveresize.h"
#include "config.h"
#include "screen.h"
#include "client.h"
ob_debug("Moving to desktop %d\n", num+1);
+ if (moveresize_client)
+ client_set_desktop(moveresize_client, num, TRUE);
+
/* show windows before hiding the rest to lessen the enter/leave events */
/* show windows from top to bottom */