]> git.sur5r.net Git - i3/i3/blobdiff - src/ewmh.c
Merge pull request #3375 from orestisf1993/ipc_client_timeout
[i3/i3] / src / ewmh.c
index 5459c7e922ea9c93437d6de94886d902cdc32e9a..e5dcafcb012a6572e336e23594fae26301bd3a95 100644 (file)
@@ -1,5 +1,3 @@
-#undef I3__FILE__
-#define I3__FILE__ "ewmh.c"
 /*
  * vim:ts=4:sw=4:expandtab
  *
@@ -224,9 +222,9 @@ void ewmh_update_visible_name(xcb_window_t window, const char *name) {
 /*
  * i3 currently does not support _NET_WORKAREA, because it does not correspond
  * to i3’s concept of workspaces. See also:
- * http://bugs.i3wm.org/539
- * http://bugs.i3wm.org/301
- * http://bugs.i3wm.org/1038
+ * https://bugs.i3wm.org/539
+ * https://bugs.i3wm.org/301
+ * https://bugs.i3wm.org/1038
  *
  * We need to actively delete this property because some display managers (e.g.
  * LightDM) set it.
@@ -286,6 +284,20 @@ void ewmh_update_sticky(xcb_window_t window, bool sticky) {
     }
 }
 
+/*
+ * Set or remove _NEW_WM_STATE_FOCUSED on the window.
+ *
+ */
+void ewmh_update_focused(xcb_window_t window, bool is_focused) {
+    if (is_focused) {
+        DLOG("Setting _NET_WM_STATE_FOCUSED for window = %d.\n", window);
+        xcb_add_property_atom(conn, window, A__NET_WM_STATE, A__NET_WM_STATE_FOCUSED);
+    } else {
+        DLOG("Removing _NET_WM_STATE_FOCUSED for window = %d.\n", window);
+        xcb_remove_property_atom(conn, window, A__NET_WM_STATE, A__NET_WM_STATE_FOCUSED);
+    }
+}
+
 /*
  * Set up the EWMH hints on the root window.
  *