From 3369481138750f57645fff2bc4d65b39d7ebfbc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Mon, 7 Jun 2021 00:26:29 +0200 Subject: Add 'put#' action I wanted to call it layer#, but it (rather silently, apart from the crashing...) conflicted with something else. --- src/event.c | 3 +++ src/hint.h | 4 ++-- src/key.c | 1 + src/key.h | 9 +++++---- src/parse.c | 1 + 5 files changed, 12 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/event.c b/src/event.c index 3919c94..e8a0049 100644 --- a/src/event.c +++ b/src/event.c @@ -354,6 +354,9 @@ void HandleKeyPress(const XKeyEvent *event) { NextDesktop(); } break; + case KEY_PUT: + SetClientLayer(np, key >> 8); + break; case KEY_SENDTO: SetClientDesktop(np, (key >> 8) - 1); break; diff --git a/src/hint.h b/src/hint.h index 7eae815..86eb7a1 100644 --- a/src/hint.h +++ b/src/hint.h @@ -123,8 +123,8 @@ typedef enum { LAYER_BOTTOM = 0, LAYER_NORMAL = 4, DEFAULT_TRAY_LAYER = 8, - LAYER_TOP = 12, - LAYER_COUNT = 13 + LAYER_TOP = 10, + LAYER_COUNT = 11 } WinLayerType; typedef struct ClientState { diff --git a/src/key.c b/src/key.c index 1bf443b..d5c6b4f 100644 --- a/src/key.c +++ b/src/key.c @@ -254,6 +254,7 @@ int ShouldGrab(KeyType key) { case KEY_ROOT: case KEY_WIN: case KEY_DESKTOP: + case KEY_PUT: case KEY_SENDTO: case KEY_EXEC: case KEY_RESTART: diff --git a/src/key.h b/src/key.h index cd89fd5..05e8083 100644 --- a/src/key.h +++ b/src/key.h @@ -34,10 +34,11 @@ typedef enum { KEY_ROOT = 18, KEY_WIN = 19, KEY_DESKTOP = 20, - KEY_SENDTO = 21, - KEY_EXEC = 22, - KEY_RESTART = 23, - KEY_EXIT = 24 + KEY_PUT = 21, + KEY_SENDTO = 22, + KEY_EXEC = 23, + KEY_RESTART = 24, + KEY_EXIT = 25 } KeyType; void InitializeKeys(); diff --git a/src/parse.c b/src/parse.c index 5c6cece..65e3197 100644 --- a/src/parse.c +++ b/src/parse.c @@ -63,6 +63,7 @@ static const KeyMapType KEY_MAP[] = { { "exit", KEY_EXIT }, { "desktop", KEY_DESKTOP }, { "desktop#", KEY_DESKTOP }, + { "put#", KEY_PUT }, { "sendto#", KEY_SENDTO }, { NULL, KEY_NONE } }; -- cgit v1.2.3