Hello!

This is a small patch against latest next branch to allow WindowMaker
toggle omnipresent status from keyboard.

Regards,
Gaspar

-- 
Gaspar Chilingarov
w http://gasparchilingarov.com/
From 8c0af332dead21137d90bab084d8fcd0bd90b4cb Mon Sep 17 00:00:00 2001
From: Gaspar Chilingarov <gaspa...@gmail.com>
Date: Mon, 10 Nov 2014 15:28:51 +0400
Subject: [PATCH] nm	support omnipresent setting toggle from keyboard

---
 WPrefs.app/KeyboardShortcuts.c |    1 +
 src/defaults.c                 |    2 ++
 src/event.c                    |    7 +++++++
 src/keybind.h                  |    1 +
 4 files changed, 11 insertions(+)

diff --git a/WPrefs.app/KeyboardShortcuts.c b/WPrefs.app/KeyboardShortcuts.c
index 5830f79..418b239 100644
--- a/WPrefs.app/KeyboardShortcuts.c
+++ b/WPrefs.app/KeyboardShortcuts.c
@@ -89,6 +89,7 @@ static const struct {
 	{ "LBCMaximizeKey", N_("Maximize active window left bottom corner") },
 	{ "RBCMaximizeKey", N_("Maximize active window right bottom corner") },
 	{ "MaximusKey",     N_("Maximus: Tiled maximization ") },
+	{ "OmnipresentKey", N_("Toggle window omnipresent status") },
 	{ "RaiseKey",       N_("Raise active window") },
 	{ "LowerKey",       N_("Lower active window") },
 	{ "RaiseLowerKey",  N_("Raise/Lower window under mouse pointer") },
diff --git a/src/defaults.c b/src/defaults.c
index 6ea935e..cf34424 100644
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -649,6 +649,8 @@ WDefaultEntry optionList[] = {
 		NULL, getKeybind, setKeyGrab, NULL, NULL},
 	{"MaximusKey", "None", (void*)WKBD_MAXIMUS,
 		NULL, getKeybind, setKeyGrab, NULL, NULL},
+	{"OmnipresentKey", "None", (void *)WKBD_OMNIPRESENT,
+	    NULL, getKeybind, setKeyGrab, NULL, NULL},
 	{"RaiseKey", "\"Meta+Up\"", (void *)WKBD_RAISE,
 	    NULL, getKeybind, setKeyGrab, NULL, NULL},
 	{"LowerKey", "\"Meta+Down\"", (void *)WKBD_LOWER,
diff --git a/src/event.c b/src/event.c
index 0d9b9c2..bc590fe 100644
--- a/src/event.c
+++ b/src/event.c
@@ -1543,6 +1543,13 @@ static void handleKeyPress(XEvent * event)
 			handleMaximize(wwin, MAX_MAXIMUS | MAX_KEYBOARD);
 		}
 		break;
+	case WKBD_OMNIPRESENT:
+		if (ISMAPPED(wwin) && ISFOCUSED(wwin)) {
+			CloseWindowMenu(scr);
+
+			wWindowSetOmnipresent(wwin, !wwin->flags.omnipresent);
+		}
+		break;
 	case WKBD_RAISE:
 		if (ISMAPPED(wwin) && ISFOCUSED(wwin)) {
 			CloseWindowMenu(scr);
diff --git a/src/keybind.h b/src/keybind.h
index 11f0211..4aaadd4 100644
--- a/src/keybind.h
+++ b/src/keybind.h
@@ -63,6 +63,7 @@ enum {
 	WKBD_RBCMAXIMIZE,
 	WKBD_MAXIMUS,
 	WKBD_SELECT,
+	WKBD_OMNIPRESENT,
 	WKBD_RAISE,
 	WKBD_LOWER,
 	WKBD_RAISELOWER,
-- 
1.7.9.5

Reply via email to