]> Dogcows Code - chaz/openbox/commitdiff
disallow drag events on title buttons.
authorDana Jansens <danakj@orodu.net>
Sat, 17 May 2003 15:16:45 +0000 (15:16 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 17 May 2003 15:16:45 +0000 (15:16 +0000)
dont redraw title button when the wheel buttons are used on them.

openbox/event.c
plugins/mouse/mouse.c

index 732857e0886486a6b29b60267b88443f773effe7..900567c0f255aecbd5417531599eafa9466b0615 100644 (file)
@@ -538,30 +538,34 @@ static void event_handle_client(Client *client, XEvent *e)
     switch (e->type) {
     case ButtonPress:
     case ButtonRelease:
-        switch (frame_context(client, e->xbutton.window)) {
-        case Context_Maximize:
-            client->frame->max_press = (e->type == ButtonPress);
-            framerender_frame(client->frame);
-            break;
-        case Context_Close:
-            client->frame->close_press = (e->type == ButtonPress);
-            framerender_frame(client->frame);
-            break;
-        case Context_Iconify:
-            client->frame->iconify_press = (e->type == ButtonPress);
-            framerender_frame(client->frame);
-            break;
-        case Context_AllDesktops:
-            client->frame->desk_press = (e->type == ButtonPress);
-            framerender_frame(client->frame);
-            break; 
-        case Context_Shade:
-            client->frame->shade_press = (e->type == ButtonPress);
-            framerender_frame(client->frame);
-            break;
-        default:
-            /* nothing changes with clicks for any other contexts */
-            break;
+        /* 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)) {
+            case Context_Maximize:
+                client->frame->max_press = (e->type == ButtonPress);
+                framerender_frame(client->frame);
+                break;
+            case Context_Close:
+                client->frame->close_press = (e->type == ButtonPress);
+                framerender_frame(client->frame);
+                break;
+            case Context_Iconify:
+                client->frame->iconify_press = (e->type == ButtonPress);
+                framerender_frame(client->frame);
+                break;
+            case Context_AllDesktops:
+                client->frame->desk_press = (e->type == ButtonPress);
+                framerender_frame(client->frame);
+                break; 
+            case Context_Shade:
+                client->frame->shade_press = (e->type == ButtonPress);
+                framerender_frame(client->frame);
+                break;
+            default:
+                /* nothing changes with clicks for any other contexts */
+                break;
+            }
         }
         break;
     case FocusIn:
index 0d0b8fd9a9e59a0c0758ebb6897a0fbdccec7755..e39720cbb022961b448d0bbf8e74ce4b00ec1c18 100644 (file)
@@ -288,6 +288,18 @@ static void event(ObEvent *e, void *foo)
                 ABS(e->data.x.e->xmotion.y_root - py) >= threshold) {
                 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)
                     corner = prop_atoms.net_wm_moveresize_size_bottomright;
                 else
@@ -306,8 +318,6 @@ static void event(ObEvent *e, void *foo)
                                     e->data.x.client->area.height +
                                     e->data.x.client->frame->size.top +
                                     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,
                             e->data.x.client, state, button,
                             e->data.x.e->xmotion.x_root, 
This page took 0.024565 seconds and 4 git commands to generate.