summaryrefslogtreecommitdiff
path: root/src/utilities/bindingManager.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-25 06:51:21 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-25 06:51:21 +0200
commit3b49907c8b012b0a62d6e264f62bf03b13e68a51 (patch)
treee9acc532002ca7a52810325eee1f16d6d17f9d27 /src/utilities/bindingManager.vala
parent394ad3b32f9f79775bcac4c6cc2a4dfa74586800 (diff)
parent334f925d5866faaf6ed36a4269d14bcc7aa86a76 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/utilities/bindingManager.vala')
-rw-r--r--src/utilities/bindingManager.vala16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/utilities/bindingManager.vala b/src/utilities/bindingManager.vala
index a21c0a1..82b6334 100644
--- a/src/utilities/bindingManager.vala
+++ b/src/utilities/bindingManager.vala
@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
-// Copyright (c) 2011-2016 by Simon Schneegans
+// Copyright (c) 2011-2017 by Simon Schneegans
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -73,6 +73,12 @@ public class BindingManager : GLib.Object {
private Keybinding? delayed_binding = null;
/////////////////////////////////////////////////////////////////////
+ /// Used to identify wayland sessions.
+ /////////////////////////////////////////////////////////////////////
+
+ private bool wayland = GLib.Environment.get_variable("XDG_SESSION_TYPE") == "wayland";
+
+ /////////////////////////////////////////////////////////////////////
/// Helper class to store keybinding
/////////////////////////////////////////////////////////////////////
@@ -104,7 +110,9 @@ public class BindingManager : GLib.Object {
/////////////////////////////////////////////////////////////////////
public void bind(Trigger trigger, string id) {
- if (trigger.key_code != 0) {
+
+ // global key grabbing is impossible on wayland
+ if (!wayland && trigger.key_code != 0) {
unowned X.Display display = Gdk.X11.get_default_xdisplay();
X.ID xid = Gdk.X11.get_default_root_xwindow();
@@ -143,8 +151,8 @@ public class BindingManager : GLib.Object {
public void unbind(string id) {
foreach (var binding in bindings) {
if (id == binding.id) {
- if (binding.trigger.key_code == 0) {
- //no key_code: just remove the bindind from the list
+ if (binding.trigger.key_code == 0 || wayland) {
+ //no key_code or wayland: just remove the bindind from the list
bindings.remove(binding);
return;
}