summaryrefslogtreecommitdiff
path: root/src/utilities/bindingManager.vala
diff options
context:
space:
mode:
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;
}