summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-04-13 08:36:38 +0000
committerDana Jansens <danakj@orodu.net>2003-04-13 08:36:38 +0000
commitbb8b9ddbc5c7932f184aeed744f4762b5c95fe28 (patch)
tree50144f1e27f1de3fe37a9412e384e3d0dc90a16e /openbox
parent14a842b34c2857385ee7c5a02c870f5aedef0e54 (diff)
pass the Client for frame_context cuz the client might be NULL
Diffstat (limited to 'openbox')
-rw-r--r--openbox/event.c2
-rw-r--r--openbox/frame.c9
-rw-r--r--openbox/frame.h2
3 files changed, 8 insertions, 5 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 4d449f78..b0ab0f35 100644
--- a/openbox/event.c
+++ b/openbox/event.c
@@ -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);
diff --git a/openbox/frame.c b/openbox/frame.c
index 765c4b59..a223aa5e 100644
--- a/openbox/frame.c
+++ b/openbox/frame.c
@@ -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;
diff --git a/openbox/frame.h b/openbox/frame.h
index c36e7833..bbe7d370 100644
--- a/openbox/frame.h
+++ b/openbox/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.