summaryrefslogtreecommitdiff
path: root/openbox
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-03-21 08:18:39 +0000
committerDana Jansens <danakj@orodu.net>2003-03-21 08:18:39 +0000
commitdb75d406ce6194dd85c142616071e55f9b831f60 (patch)
tree6adc0ce1981de73b358b76cb26bb6c9821907dd4 /openbox
parentca45916f77822dcd48a4d4f459c719e5e000a4b7 (diff)
rm the focused member from the client struct, it was redundant with the focus_client variable around
Diffstat (limited to 'openbox')
-rw-r--r--openbox/client.c18
-rw-r--r--openbox/client.h5
2 files changed, 17 insertions, 6 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 6f4dd16a..7dbb4d0b 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -276,7 +276,7 @@ void client_unmanage(Client *client)
/* unfocus the client (dispatchs the focus event) (we're out of the
transient lists already, so being modal doesn't matter) */
- if (client->focused)
+ if (client_focused(client))
client_unfocus(client);
if (ob_state != State_Exiting) {
@@ -385,7 +385,6 @@ static void client_get_all(Client *self)
self->title = self->icon_title = NULL;
self->res_name = self->res_class = self->role = NULL;
self->wmstate = NormalState;
- self->focused = FALSE;
self->transient = FALSE;
self->transients = NULL;
self->transient_for = NULL;
@@ -1171,7 +1170,7 @@ static Client *search_focus_tree(Client *node, Client *skip)
Client *c = it->data;
if (c == skip) continue; /* circular? */
if ((ret = search_focus_tree(c, skip))) return ret;
- if (c->focused) return c;
+ if (client_focused(c)) return c;
}
return NULL;
}
@@ -1898,6 +1897,11 @@ gboolean client_focus(Client *self)
return FALSE;
}
}
+
+ if (client_focused(self))
+ return TRUE;
+
+ g_print("Focusing: %lx\n", self->window);
if (self->can_focus)
XSetInputFocus(ob_display, self->window, RevertToNone, CurrentTime);
@@ -1917,12 +1921,18 @@ gboolean client_focus(Client *self)
XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);
}
- /*XSync(ob_display, FALSE); XXX Why sync? */
+ /* XSync(ob_display, FALSE); XXX Why sync? */
return TRUE;
}
void client_unfocus(Client *self)
{
g_assert(focus_client == self);
+ g_print("UNFocusing: %lx\n", self->window);
focus_set_client(NULL);
}
+
+gboolean client_focused(Client *self)
+{
+ return self == focus_client;
+}
diff --git a/openbox/client.h b/openbox/client.h
index c757332d..6f303fff 100644
--- a/openbox/client.h
+++ b/openbox/client.h
@@ -217,8 +217,6 @@ typedef struct Client {
gboolean urgent;
/*! Notify the window when it receives focus? */
gboolean focus_notify;
- /*! Does the client window have the input focus? */
- gboolean focused;
/*! The window uses shape extension to be non-rectangular? */
gboolean shaped;
@@ -319,6 +317,9 @@ gboolean client_should_show(Client *self);
to them in a number of places regarding focus or user interaction. */
gboolean client_normal(Client *self);
+/* Returns if the window is focused */
+gboolean client_focused(Client *self);
+
/*! Move and/or resize the window.
This also maintains things like the client's minsize, and size increments.
@param anchor The corner to keep in the same position when resizing.