From 309d161f6d464fcea2de200bb3cb5a7cb784b6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Mon, 24 Jul 2017 19:58:27 +0200 Subject: New upstream version 0.7.1 --- src/utilities/bindingManager.vala | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/utilities/bindingManager.vala') 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 @@ -72,6 +72,12 @@ public class BindingManager : GLib.Object { private X.Event? delayed_event = null; 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; } -- cgit v1.2.3