disallow drag events on title buttons.

dont redraw title button when the wheel buttons are used on them.
This commit is contained in:
Dana Jansens 2003-05-17 15:16:45 +00:00
parent 0b5f6589ba
commit f6b61bb60e
2 changed files with 40 additions and 26 deletions

View file

@ -538,6 +538,9 @@ static void event_handle_client(Client *client, XEvent *e)
switch (e->type) { switch (e->type) {
case ButtonPress: case ButtonPress:
case ButtonRelease: case ButtonRelease:
/* Wheel buttons don't draw because they are an instant click, so it
is a waste of resources to go drawing it. */
if (!(e->xbutton.button == 4 || e->xbutton.button == 5)) {
switch (frame_context(client, e->xbutton.window)) { switch (frame_context(client, e->xbutton.window)) {
case Context_Maximize: case Context_Maximize:
client->frame->max_press = (e->type == ButtonPress); client->frame->max_press = (e->type == ButtonPress);
@ -563,6 +566,7 @@ static void event_handle_client(Client *client, XEvent *e)
/* nothing changes with clicks for any other contexts */ /* nothing changes with clicks for any other contexts */
break; break;
} }
}
break; break;
case FocusIn: case FocusIn:
#ifdef DEBUG_FOCUS #ifdef DEBUG_FOCUS

View file

@ -288,6 +288,18 @@ static void event(ObEvent *e, void *foo)
ABS(e->data.x.e->xmotion.y_root - py) >= threshold) { ABS(e->data.x.e->xmotion.y_root - py) >= threshold) {
guint32 corner; guint32 corner;
context = frame_context(e->data.x.client,
e->data.x.e->xmotion.window);
/* You can't drag on buttons */
if (context == Context_Maximize ||
context == Context_AllDesktops ||
context == Context_Shade ||
context == Context_Iconify ||
context == Context_Icon ||
context == Context_Close)
break;
if (!e->data.x.client) if (!e->data.x.client)
corner = prop_atoms.net_wm_moveresize_size_bottomright; corner = prop_atoms.net_wm_moveresize_size_bottomright;
else else
@ -306,8 +318,6 @@ static void event(ObEvent *e, void *foo)
e->data.x.client->area.height + e->data.x.client->area.height +
e->data.x.client->frame->size.top + e->data.x.client->frame->size.top +
e->data.x.client->frame->size.bottom); e->data.x.client->frame->size.bottom);
context = frame_context(e->data.x.client,
e->data.x.e->xmotion.window);
fire_motion(MouseAction_Motion, context, fire_motion(MouseAction_Motion, context,
e->data.x.client, state, button, e->data.x.client, state, button,
e->data.x.e->xmotion.x_root, e->data.x.e->xmotion.x_root,