summaryrefslogtreecommitdiff
path: root/src/utilities/bindingManager.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-24 19:58:27 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-07-24 19:58:27 +0200
commit309d161f6d464fcea2de200bb3cb5a7cb784b6d3 (patch)
treea0d5ea02bfb3765191f2596aa8a7404f6b3a819c /src/utilities/bindingManager.vala
parent45a3d7f0e2783d9898f017772583d31c1c9e0f03 (diff)
New upstream version 0.7.1upstream/0.7.1
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;
}