all repos — openbox @ 8fe0cb8989c1fe12b30b9030b446345f25340d35

openbox fork - make it a bit more like ryudo

no more interactive mouse actions, they are evil etc. actions now "feel" much more solid. if move/resizing a window while changing workspaces, it will follow.
Dana Jansens danakj@orodu.net
commit

8fe0cb8989c1fe12b30b9030b446345f25340d35

parent

0f544808b8372a6c8a2cbfae214f2803dd3c6170

M openbox/action.copenbox/action.c

@@ -767,7 +767,6 @@ return act;

} void action_run_full(ObAction *a, struct _ObClient *c, - ObFrameContext context, guint state, guint button, gint x, gint y, gboolean cancel, gboolean done) {

@@ -784,7 +783,7 @@ if (a->data.any.interactive) {

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);
M openbox/action.hopenbox/action.h

@@ -153,7 +153,6 @@ void action_free(ObAction *a);

/*! 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.

@@ -164,21 +163,20 @@ @param done If the action is completing an interactive action. This only

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);
M openbox/event.copenbox/event.c

@@ -487,17 +487,14 @@ e->type == KeyRelease)

{ 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
M openbox/keyboard.copenbox/keyboard.c

@@ -12,6 +12,7 @@ #include "config.h"

#include "keytree.h" #include "keyboard.h" #include "translate.h" +#include "moveresize.h" #include <glib.h>

@@ -129,11 +130,14 @@ return TRUE;

} 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))

@@ -149,14 +153,11 @@

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;

@@ -168,9 +169,6 @@ ObInteractiveState *s = it->data;

next = g_slist_next(it); - *client = s->client; - *context = s->context; - if ((e->type == KeyRelease && !(s->state & e->xkey.state))) done = TRUE;
M openbox/keyboard.hopenbox/keyboard.h

@@ -21,11 +21,8 @@ void keyboard_event(struct _ObClient *client, const XEvent *e);

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);
M openbox/mouse.copenbox/mouse.c

@@ -107,19 +107,22 @@ /* if not bound, then nothing to do! */

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:
M openbox/mouse.hopenbox/mouse.h

@@ -13,7 +13,7 @@

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);
M openbox/screen.copenbox/screen.c

@@ -5,6 +5,7 @@ #include "xerror.h"

#include "prop.h" #include "grab.h" #include "startupnotify.h" +#include "moveresize.h" #include "config.h" #include "screen.h" #include "client.h"

@@ -409,6 +410,9 @@

screen_last_desktop = old; 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 */