[Pkg-wmaker-commits] [wmix] 28/44: wmix: added an option to disable grabbing the volume control keys

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Sep 29 10:40:14 UTC 2017


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch upstream
in repository wmix.

commit e652d0f4501d10a19dccf3e2f5dc84a6f5faaecf
Author: Christophe CURIS <christophe.curis at free.fr>
Date:   Sat Jun 7 21:21:56 2014 +0200

    wmix: added an option to disable grabbing the volume control keys
    
    There may be some case where user would like to fall back to the original
    behaviour, for example if grabbing these keys could get in conflict with
    other applications.
    
    Signed-off-by: Christophe CURIS <christophe.curis at free.fr>
---
 config.c         |  8 +++++++-
 include/config.h |  1 +
 wmix.1x          | 11 +++++++++++
 wmix.c           |  4 +++-
 4 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/config.c b/config.c
index 6a3c822..0414ea4 100644
--- a/config.c
+++ b/config.c
@@ -41,6 +41,7 @@
 	"  -e <name> exclude channel, can be used many times\n" \
 	"  -f <file> parse this config [~/.wmixrc]\n" \
 	"  -h        print this help\n" \
+	"  -k        disable grabing volume control keys\n" \
 	"  -m <dev>  mixer device [/dev/mixer]\n" \
 	"  -v        verbose -> id, long name, name\n" \
 
@@ -64,6 +65,7 @@ void config_init(void)
 	config.mixer_device = (char *) default_mixer_device;
 	config.mousewheel = 1;
 	config.scrolltext = 1;
+	config.mmkeys = 1;
 	config.wheel_button_up = 4;
 	config.wheel_button_down = 5;
 	config.scrollstep = 0.03;
@@ -117,7 +119,7 @@ void parse_cli_options(int argc, char **argv)
 	config.verbose = false;
 	error_found = false;
 	for (;;) {
-		opt = getopt(argc, argv, ":d:e:f:hm:v");
+		opt = getopt(argc, argv, ":d:e:f:hkm:v");
 		if (opt == -1)
 			break;
 
@@ -158,6 +160,10 @@ void parse_cli_options(int argc, char **argv)
 			exit(0);
 			break;
 
+		case 'k':
+			config.mmkeys = false;
+			break;
+
 		case 'm':
 			if (config.mixer_device != default_mixer_device)
 				free(config.mixer_device);
diff --git a/include/config.h b/include/config.h
index 702a382..ee632f4 100644
--- a/include/config.h
+++ b/include/config.h
@@ -34,6 +34,7 @@ extern struct _Config {
 	unsigned int osd        : 1;	/* show OSD? */
 	unsigned int mousewheel : 1;	/* mousewheel enabled? */
 	unsigned int scrolltext : 1;	/* scroll channel names? */
+	unsigned int mmkeys     : 1;	/* grab multimedia keys for volume control */
 
 	unsigned int wheel_button_up;	/* up button */
 	unsigned int wheel_button_down;	/* down button */
diff --git a/wmix.1x b/wmix.1x
index 8e4cf68..9b6f650 100644
--- a/wmix.1x
+++ b/wmix.1x
@@ -40,6 +40,12 @@ Use config file instead of
 \fB\-h\fR
 Display list of command\-line options
 .TP
+\fB\-k\fR
+Disable grabbing the audio volume control keys on keyboard (see
+.SM
+.B BUGS
+below)
+.TP
 \fB\-m\fR <\fIdevice\fP>
 Use specified mixer device instead of
 .I /dev/mixer
@@ -137,6 +143,11 @@ that a channel has been muted.
 The X server allows only one application at a time to place a grab on a key,
 so if another application already claimed the volume control keys then \fBwmix\fP
 will warn you about it and continue without the functionality.
+If on the other hand you encounter problem with applications that do
+not work because they could not grab these keys (a typical symptom is
+an X Error of type \fIBadAccess\fP with major opcode 33 \fIX_GrabKey\fP),
+you can ask \fBwmix\fP to not grab them using the command line option
+\fB-k\fP.
 .LP
 If you modify the configuration file, do not expect \fBwmix\fP to reload
 it automatically, this is considered a too costly feature for such a
diff --git a/wmix.c b/wmix.c
index ae8bce5..a992987 100644
--- a/wmix.c
+++ b/wmix.c
@@ -93,7 +93,9 @@ int main(int argc, char **argv)
     dockapp_init(display);
     new_window("wmix", 64, 64);
     new_osd(DisplayWidth(display, DefaultScreen(display)) - 200, 60);
-    mmkey_install(display);
+
+    if (config.mmkeys)
+	    mmkey_install(display);
 
     config_release();
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmix.git



More information about the Pkg-wmaker-commits mailing list