+ client_set_focused(self, FALSE);
+}
+
+gboolean client_focused(Client *self)
+{
+ return self == focus_client;
+}
+
+void client_set_focused(Client *self, gboolean focused)
+{
+ if (focused) {
+ if (focus_client != self)
+ focus_set_client(self);
+ } else {
+ if (focus_client == self)
+ focus_set_client(NULL);
+ }
+
+ /* focus state can affect the stacking layer */
+ client_calc_layer(self);
+
+ engine_frame_adjust_focus(self->frame);