all the old ob2 mouse bindings are workin
This commit is contained in:
parent
9ca9bcc11c
commit
a7705024c6
2 changed files with 75 additions and 23 deletions
|
@ -21,9 +21,13 @@ static void focus_fallback(guint desk, gboolean warp)
|
||||||
doesn't skip briefly to what was under the pointer */
|
doesn't skip briefly to what was under the pointer */
|
||||||
if (XCheckTypedEvent(ob_display, EnterNotify, &e)) {
|
if (XCheckTypedEvent(ob_display, EnterNotify, &e)) {
|
||||||
XPutBackEvent(ob_display, &e);
|
XPutBackEvent(ob_display, &e);
|
||||||
|
/* XXX WERE NOT SKIPPING THEM ALL@&*)! */
|
||||||
|
g_message("Skip");
|
||||||
++skip_enter;
|
++skip_enter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* I have to do this warp twice! Otherwise windows dont get
|
||||||
|
Enter/Leave events when i warp on a desktop switch! */
|
||||||
XWarpPointer(ob_display, None, c->window, 0, 0, 0, 0,
|
XWarpPointer(ob_display, None, c->window, 0, 0, 0, 0,
|
||||||
c->area.width / 2, c->area.height / 2);
|
c->area.width / 2, c->area.height / 2);
|
||||||
XWarpPointer(ob_display, None, c->window, 0, 0, 0, 0,
|
XWarpPointer(ob_display, None, c->window, 0, 0, 0, 0,
|
||||||
|
|
|
@ -197,9 +197,7 @@ static void event(ObEvent *e, void *foo)
|
||||||
|
|
||||||
case Event_X_ButtonPress:
|
case Event_X_ButtonPress:
|
||||||
if (!button) {
|
if (!button) {
|
||||||
if (e->data.x.client == NULL)
|
if (e->data.x.client != NULL) {
|
||||||
corner = Corner_TopLeft;
|
|
||||||
else {
|
|
||||||
cx = e->data.x.client->frame->area.x;
|
cx = e->data.x.client->frame->area.x;
|
||||||
cy = e->data.x.client->frame->area.y;
|
cy = e->data.x.client->frame->area.y;
|
||||||
cw = e->data.x.client->frame->area.width;
|
cw = e->data.x.client->frame->area.width;
|
||||||
|
@ -207,8 +205,8 @@ static void event(ObEvent *e, void *foo)
|
||||||
px = e->data.x.e->xbutton.x_root;
|
px = e->data.x.e->xbutton.x_root;
|
||||||
py = e->data.x.e->xbutton.y_root;
|
py = e->data.x.e->xbutton.y_root;
|
||||||
corner = pick_corner(px, py, cx, cy, cw, ch);
|
corner = pick_corner(px, py, cx, cy, cw, ch);
|
||||||
button = e->data.x.e->xbutton.button;
|
|
||||||
}
|
}
|
||||||
|
button = e->data.x.e->xbutton.button;
|
||||||
}
|
}
|
||||||
fire_button(MouseAction_Press,
|
fire_button(MouseAction_Press,
|
||||||
engine_get_context(e->data.x.client,
|
engine_get_context(e->data.x.client,
|
||||||
|
@ -228,10 +226,12 @@ static void event(ObEvent *e, void *foo)
|
||||||
e->data.x.e->xbutton.button,
|
e->data.x.e->xbutton.button,
|
||||||
cx, cy, cw, ch, dx, dy, TRUE, corner);
|
cx, cy, cw, ch, dx, dy, TRUE, corner);
|
||||||
drag = FALSE;
|
drag = FALSE;
|
||||||
}
|
|
||||||
|
|
||||||
|
lbutton = 0;
|
||||||
|
} else {
|
||||||
/* clicks are only valid if its released over the window */
|
/* clicks are only valid if its released over the window */
|
||||||
if (e->data.x.e->xbutton.x >= 0 && e->data.x.e->xbutton.y >= 0) {
|
if (e->data.x.e->xbutton.x >= 0 &&
|
||||||
|
e->data.x.e->xbutton.y >= 0) {
|
||||||
int junk;
|
int junk;
|
||||||
Window wjunk;
|
Window wjunk;
|
||||||
guint ujunk, w, h;
|
guint ujunk, w, h;
|
||||||
|
@ -248,6 +248,7 @@ static void event(ObEvent *e, void *foo)
|
||||||
lbutton = button;
|
lbutton = button;
|
||||||
} else
|
} else
|
||||||
lbutton = 0;
|
lbutton = 0;
|
||||||
|
}
|
||||||
|
|
||||||
button = 0;
|
button = 0;
|
||||||
ltime = e->data.x.e->xbutton.time;
|
ltime = e->data.x.e->xbutton.time;
|
||||||
|
@ -366,12 +367,59 @@ static void binddef()
|
||||||
a = action_new(action_resize);
|
a = action_new(action_resize);
|
||||||
mbind("A-3", "frame", MouseAction_Motion, a);
|
mbind("A-3", "frame", MouseAction_Motion, a);
|
||||||
|
|
||||||
|
a = action_new(action_raise);
|
||||||
|
mbind("1", "titlebar", MouseAction_Press, a);
|
||||||
|
a = action_new(action_raise);
|
||||||
|
mbind("1", "handle", MouseAction_Press, a);
|
||||||
|
a = action_new(action_lower);
|
||||||
|
mbind("2", "titlebar", MouseAction_Press, a);
|
||||||
|
a = action_new(action_lower);
|
||||||
|
mbind("2", "handle", MouseAction_Press, a);
|
||||||
|
a = action_new(action_raise);
|
||||||
|
mbind("A-1", "frame", MouseAction_Click, a);
|
||||||
|
a = action_new(action_lower);
|
||||||
|
mbind("A-3", "frame", MouseAction_Click, a);
|
||||||
|
|
||||||
a = action_new(action_toggle_shade);
|
a = action_new(action_toggle_shade);
|
||||||
mbind("1", "titlebar", MouseAction_DClick, a);
|
mbind("1", "titlebar", MouseAction_DClick, a);
|
||||||
a = action_new(action_shade);
|
a = action_new(action_shade);
|
||||||
mbind("4", "titlebar", MouseAction_Press, a);
|
mbind("4", "titlebar", MouseAction_Press, a);
|
||||||
a = action_new(action_unshade);
|
a = action_new(action_unshade);
|
||||||
mbind("5", "titlebar", MouseAction_Click, a);
|
mbind("5", "titlebar", MouseAction_Click, a);
|
||||||
|
|
||||||
|
a = action_new(action_toggle_maximize_full);
|
||||||
|
mbind("1", "maximize", MouseAction_Click, a);
|
||||||
|
a = action_new(action_toggle_maximize_vert);
|
||||||
|
mbind("2", "maximize", MouseAction_Click, a);
|
||||||
|
a = action_new(action_toggle_maximize_horz);
|
||||||
|
mbind("3", "maximize", MouseAction_Click, a);
|
||||||
|
a = action_new(action_iconify);
|
||||||
|
mbind("1", "iconify", MouseAction_Click, a);
|
||||||
|
a = action_new(action_close);
|
||||||
|
mbind("1", "icon", MouseAction_DClick, a);
|
||||||
|
a = action_new(action_close);
|
||||||
|
mbind("1", "close", MouseAction_Click, a);
|
||||||
|
a = action_new(action_toggle_omnipresent);
|
||||||
|
mbind("1", "alldesktops", MouseAction_Click, a);
|
||||||
|
|
||||||
|
a = action_new(action_next_desktop);
|
||||||
|
a->data.nextprevdesktop.wrap = TRUE;
|
||||||
|
mbind("4", "root", MouseAction_Click, a);
|
||||||
|
a = action_new(action_previous_desktop);
|
||||||
|
a->data.nextprevdesktop.wrap = TRUE;
|
||||||
|
mbind("5", "root", MouseAction_Click, a);
|
||||||
|
a = action_new(action_next_desktop);
|
||||||
|
a->data.nextprevdesktop.wrap = TRUE;
|
||||||
|
mbind("A-4", "root", MouseAction_Click, a);
|
||||||
|
a = action_new(action_previous_desktop);
|
||||||
|
a->data.nextprevdesktop.wrap = TRUE;
|
||||||
|
mbind("A-5", "root", MouseAction_Click, a);
|
||||||
|
a = action_new(action_next_desktop);
|
||||||
|
a->data.nextprevdesktop.wrap = TRUE;
|
||||||
|
mbind("A-4", "frame", MouseAction_Click, a);
|
||||||
|
a = action_new(action_previous_desktop);
|
||||||
|
a->data.nextprevdesktop.wrap = TRUE;
|
||||||
|
mbind("A-5", "frame", MouseAction_Click, a);
|
||||||
}
|
}
|
||||||
|
|
||||||
void plugin_startup()
|
void plugin_startup()
|
||||||
|
|
Loading…
Reference in a new issue