summaryrefslogtreecommitdiff
path: root/app/cwm/client.c
diff options
context:
space:
mode:
authorOkan Demirmen <okan@cvs.openbsd.org>2014-08-25 12:49:20 +0000
committerOkan Demirmen <okan@cvs.openbsd.org>2014-08-25 12:49:20 +0000
commit74d02b4b0830e12c80b303b4bc615617c24577ed (patch)
treec9398d11b28d789080f8e7e929903ced091f7603 /app/cwm/client.c
parent771c1604293674a050b800a31229045fbd3ba6c4 (diff)
Implement _NET_WM_STATE_STICKY, bound to CM-s by default; allows any
client to 'stick' to all desktops (ewmh speak) or groups - this currently has the same affect as setting a client's group to 'nogroup', with the exception that the client can also be in a group, so when un-sticking, the client will go back to its original group/desktop.
Diffstat (limited to 'app/cwm/client.c')
-rw-r--r--app/cwm/client.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/app/cwm/client.c b/app/cwm/client.c
index d613375ba..5e2d2c4d1 100644
--- a/app/cwm/client.c
+++ b/app/cwm/client.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: client.c,v 1.173 2014/08/20 15:15:29 okan Exp $
+ * $OpenBSD: client.c,v 1.174 2014/08/25 12:49:19 okan Exp $
*/
#include <sys/param.h>
@@ -239,6 +239,17 @@ client_freeze(struct client_ctx *cc)
}
void
+client_sticky(struct client_ctx *cc)
+{
+ if (cc->flags & CLIENT_STICKY)
+ cc->flags &= ~CLIENT_STICKY;
+ else
+ cc->flags |= CLIENT_STICKY;
+
+ xu_ewmh_set_net_wm_state(cc);
+}
+
+void
client_fullscreen(struct client_ctx *cc)
{
struct screen_ctx *sc = cc->sc;
@@ -468,6 +479,9 @@ client_ptrsave(struct client_ctx *cc)
void
client_hide(struct client_ctx *cc)
{
+ if (cc->flags & CLIENT_STICKY)
+ return;
+
XUnmapWindow(X_Dpy, cc->win);
cc->active = 0;
@@ -481,6 +495,9 @@ client_hide(struct client_ctx *cc)
void
client_unhide(struct client_ctx *cc)
{
+ if (cc->flags & CLIENT_STICKY)
+ return;
+
XMapRaised(X_Dpy, cc->win);
cc->flags &= ~CLIENT_HIDDEN;