summaryrefslogtreecommitdiff
path: root/openbox/mouse.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-09 22:21:28 +0000
committerDana Jansens <danakj@orodu.net>2007-05-09 22:21:28 +0000
commit66afa1dcebaf8f1562311d1293baf4094f9ac011 (patch)
treefe68c70d127d6111a0662bd0ca3aba348b15bd24 /openbox/mouse.c
parent6042ba5e992739c5afdce742ee73ac1eed7fd499 (diff)
when a window is fully maxed, make clicking on the titlebar past the edge buttons count as clicking on the buttons
Diffstat (limited to 'openbox/mouse.c')
-rw-r--r--openbox/mouse.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/openbox/mouse.c b/openbox/mouse.c
index 522eba8c..9edda8eb 100644
--- a/openbox/mouse.c
+++ b/openbox/mouse.c
@@ -179,7 +179,7 @@ void mouse_event(ObClient *client, XEvent *e)
static Time ltime;
static guint button = 0, state = 0, lbutton = 0;
static Window lwindow = None;
- static gint px, py;
+ static gint px, py, pwx = -1, pwy = -1;
ObFrameContext context;
gboolean click = FALSE;
@@ -187,11 +187,14 @@ void mouse_event(ObClient *client, XEvent *e)
switch (e->type) {
case ButtonPress:
- context = frame_context(client, e->xany.window);
+ context = frame_context(client, e->xbutton.window,
+ e->xbutton.x, e->xbutton.y);
context = mouse_button_frame_context(context, e->xbutton.button);
px = e->xbutton.x_root;
py = e->xbutton.y_root;
+ if (pwx == -1) pwx = e->xbutton.x;
+ if (pwy == -1) pwy = e->xbutton.y;
button = e->xbutton.button;
state = e->xbutton.state;
@@ -209,9 +212,12 @@ void mouse_event(ObClient *client, XEvent *e)
break;
case ButtonRelease:
- context = frame_context(client, e->xany.window);
+ /* use where the press occured in the window */
+ context = frame_context(client, e->xbutton.window, pwx, pwy);
context = mouse_button_frame_context(context, e->xbutton.button);
+ pwx = pwy = -1;
+
if (e->xbutton.button == button) {
/* clicks are only valid if its released over the window */
gint junk1, junk2;
@@ -272,7 +278,7 @@ void mouse_event(ObClient *client, XEvent *e)
case MotionNotify:
if (button) {
- context = frame_context(client, e->xany.window);
+ context = frame_context(client, e->xmotion.window, pwx, pwy);
context = mouse_button_frame_context(context, button);
if (ABS(e->xmotion.x_root - px) >=