]> Dogcows Code - chaz/openbox/commitdiff
pass the Client for frame_context cuz the client might be NULL
authorDana Jansens <danakj@orodu.net>
Sun, 13 Apr 2003 08:36:38 +0000 (08:36 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 13 Apr 2003 08:36:38 +0000 (08:36 +0000)
openbox/event.c
openbox/frame.c
openbox/frame.h
plugins/mouse/mouse.c

index 4d449f78856bd929c5e60bae05c580b07de894ae..b0ab0f35cc4b6c4cb5a64a380e5650c3c1b80b02 100644 (file)
@@ -369,7 +369,7 @@ static void event_handle_client(Client *client, XEvent *e)
     switch (e->type) {
     case ButtonPress:
     case ButtonRelease:
-        switch (frame_context(client->frame, e->xbutton.window)) {
+        switch (frame_context(client, e->xbutton.window)) {
         case Context_Maximize:
             client->frame->max_press = (e->type == ButtonPress);
             framerender_frame(client->frame);
index 765c4b59bca0e1473ad993872ebb7d897af117f7..a223aa5eead7686894bb0e1690e5174becb10552 100644 (file)
@@ -646,12 +646,15 @@ Context frame_context_from_string(char *name)
     return Context_None;
 }
 
-Context frame_context(Frame *self, Window win)
+Context frame_context(Client *client, Window win)
 {
+    Frame *self;
+
     if (win == ob_root) return Context_Root;
-    if (self == NULL) return Context_None;
-    if (win == self->client->window) return Context_Client;
+    if (client == NULL) return Context_None;
+    if (win == client->window) return Context_Client;
 
+    self = client->frame;
     if (win == self->window) return Context_Frame;
     if (win == self->plate)  return Context_Client;
     if (win == self->title)  return Context_Titlebar;
index c36e783312b865d71293d1b3859f68cab5271b5b..bbe7d370f034e7f4ee05c9244c9554137abfc57b 100644 (file)
@@ -98,7 +98,7 @@ void frame_release_client(Frame *self, Client *client);
 
 Context frame_context_from_string(char *name);
 
-Context frame_context(Frame *self, Window win);
+Context frame_context(Client *self, Window win);
 
 /*! Applies gravity to the client's position to find where the frame should
   be positioned.
index b2173c25156a9a2a3c870a7a59a3cb4cf4b71e67..45559e5c6faae19910507a0919782437b427a9af 100644 (file)
@@ -240,7 +240,7 @@ static void event(ObEvent *e, void *foo)
             button = e->data.x.e->xbutton.button;
             state = e->data.x.e->xbutton.state;
         }
-        context = frame_context(e->data.x.client->frame,
+        context = frame_context(e->data.x.client,
                                 e->data.x.e->xbutton.window);
 
         fire_button(MouseAction_Press, context,
@@ -255,7 +255,7 @@ static void event(ObEvent *e, void *foo)
             break;
 
     case Event_X_ButtonRelease:
-        context = frame_context(e->data.x.client->frame,
+        context = frame_context(e->data.x.client,
                                 e->data.x.e->xbutton.window);
         if (e->data.x.e->xbutton.button == button) {
             /* end drags */
@@ -314,7 +314,7 @@ static void event(ObEvent *e, void *foo)
                 (ABS(dx) >= threshold || ABS(dy) >= threshold))
                 drag = TRUE;
             if (drag) {
-                context = frame_context(e->data.x.client->frame,
+                context = frame_context(e->data.x.client,
                                         e->data.x.e->xbutton.window);
                 drag_used = fire_motion(MouseAction_Motion, context,
                                         e->data.x.client,
This page took 0.030452 seconds and 4 git commands to generate.