all repos — openbox @ bb8b9ddbc5c7932f184aeed744f4762b5c95fe28

openbox fork - make it a bit more like ryudo

pass the Client for frame_context cuz the client might be NULL
Dana Jansens danakj@orodu.net
commit

bb8b9ddbc5c7932f184aeed744f4762b5c95fe28

parent

14a842b34c2857385ee7c5a02c870f5aedef0e54

4 files changed, 11 insertions(+), 8 deletions(-)

jump to
M openbox/event.copenbox/event.c

@@ -369,7 +369,7 @@

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);
M openbox/frame.copenbox/frame.c

@@ -646,12 +646,15 @@ return Context_Close;

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;
M openbox/frame.hopenbox/frame.h

@@ -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.
M plugins/mouse/mouse.cplugins/mouse/mouse.c

@@ -240,7 +240,7 @@ }

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 @@ } else

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 @@ if (!drag &&

(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,