diff options
Diffstat (limited to 'src')
63 files changed, 203 insertions, 131 deletions
diff --git a/src/actionGroups/actionGroup.vala b/src/actionGroups/actionGroup.vala index 85488ad..3bc7086 100644 --- a/src/actionGroups/actionGroup.vala +++ b/src/actionGroups/actionGroup.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actionGroups/bookmarkGroup.vala b/src/actionGroups/bookmarkGroup.vala index 791d609..3a36be6 100644 --- a/src/actionGroups/bookmarkGroup.vala +++ b/src/actionGroups/bookmarkGroup.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actionGroups/clipboardGroup.vala b/src/actionGroups/clipboardGroup.vala index 58409de..51c3d1a 100644 --- a/src/actionGroups/clipboardGroup.vala +++ b/src/actionGroups/clipboardGroup.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actionGroups/devicesGroup.vala b/src/actionGroups/devicesGroup.vala index e18f4c0..1ea8607 100644 --- a/src/actionGroups/devicesGroup.vala +++ b/src/actionGroups/devicesGroup.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actionGroups/groupRegistry.vala b/src/actionGroups/groupRegistry.vala index c97cf95..89cde6a 100644 --- a/src/actionGroups/groupRegistry.vala +++ b/src/actionGroups/groupRegistry.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actionGroups/menuGroup.vala b/src/actionGroups/menuGroup.vala index ccb5407..353128f 100644 --- a/src/actionGroups/menuGroup.vala +++ b/src/actionGroups/menuGroup.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actionGroups/sessionGroup.vala b/src/actionGroups/sessionGroup.vala index 42afafc..5d47674 100644 --- a/src/actionGroups/sessionGroup.vala +++ b/src/actionGroups/sessionGroup.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actionGroups/windowListGroup.vala b/src/actionGroups/windowListGroup.vala index 69029a7..363b8b8 100644 --- a/src/actionGroups/windowListGroup.vala +++ b/src/actionGroups/windowListGroup.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -103,8 +103,6 @@ public class WindowListGroup : ActionGroup {      private void update() {          unowned GLib.List<Wnck.Window?> windows = this.screen.get_windows(); -        var matcher = Bamf.Matcher.get_default(); -          foreach (var window in windows) {              if (window.get_window_type() == Wnck.WindowType.NORMAL                  && !window.is_skip_pager() && !window.is_skip_tasklist() @@ -112,18 +110,22 @@ public class WindowListGroup : ActionGroup {                  && window.get_workspace() == this.screen.get_active_workspace()))) {                  var application = window.get_application(); -                var bamf_app = matcher.get_application_for_xid((uint32)window.get_xid()); +                var icon = application.get_icon_name().down(); + +                #if HAVE_BAMF +                    var matcher = Bamf.Matcher.get_default(); +                    var bamf_app = matcher.get_application_for_xid((uint32)window.get_xid()); +                    icon = bamf_app.get_icon(); +                #endif                  string name = window.get_name(); -                if (name.length > 30) +                if (name.length > 30) {                      name = name.substring(0, 30) + "..."; +                } + +                var action = new SigAction(name, icon, "%lu".printf(window.get_xid())); -                var action = new SigAction( -                    name, -                    (bamf_app == null) ? application.get_icon_name().down() : bamf_app.get_icon(), -                    "%lu".printf(window.get_xid()) -                );                  action.activated.connect((time_stamp) => {                      Wnck.Screen.get_default().force_update(); diff --git a/src/actions/action.vala b/src/actions/action.vala index 1e6437e..555dc3c 100644 --- a/src/actions/action.vala +++ b/src/actions/action.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actions/actionRegistry.vala b/src/actions/actionRegistry.vala index 9a22cc7..579fc93 100644 --- a/src/actions/actionRegistry.vala +++ b/src/actions/actionRegistry.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actions/appAction.vala b/src/actions/appAction.vala index e1ca3a2..cc98c1e 100644 --- a/src/actions/appAction.vala +++ b/src/actions/appAction.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actions/keyAction.vala b/src/actions/keyAction.vala index cbe8b6e..41dab61 100644 --- a/src/actions/keyAction.vala +++ b/src/actions/keyAction.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actions/pieAction.vala b/src/actions/pieAction.vala index 931c9d3..806d63b 100644 --- a/src/actions/pieAction.vala +++ b/src/actions/pieAction.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actions/sigAction.vala b/src/actions/sigAction.vala index bf9374d..fdde40a 100644 --- a/src/actions/sigAction.vala +++ b/src/actions/sigAction.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/actions/uriAction.vala b/src/actions/uriAction.vala index d0a41b8..2dde62d 100644 --- a/src/actions/uriAction.vala +++ b/src/actions/uriAction.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/daemon.vala b/src/daemon.vala index c5912b3..640ba0d 100644 --- a/src/daemon.vala +++ b/src/daemon.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -49,7 +49,7 @@ public class Daemon : GLib.Application {      /////////////////////////////////////////////////////////////////////      public static int main(string[] args) { -        version = "0.6.8"; +        version = "0.6.9";          // disable overlay scrollbar --- hacky workaround for black /          // transparent background diff --git a/src/gui/aboutWindow.vala b/src/gui/aboutWindow.vala index 73fb1be..cddca63 100644 --- a/src/gui/aboutWindow.vala +++ b/src/gui/aboutWindow.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/iconSelectWindow.vala b/src/gui/iconSelectWindow.vala index ce610ea..d7e5062 100644 --- a/src/gui/iconSelectWindow.vala +++ b/src/gui/iconSelectWindow.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/indicator.vala b/src/gui/indicator.vala index ddb85e6..55baaf1 100644 --- a/src/gui/indicator.vala +++ b/src/gui/indicator.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/newSliceWindow.vala b/src/gui/newSliceWindow.vala index 89294b5..d719213 100644 --- a/src/gui/newSliceWindow.vala +++ b/src/gui/newSliceWindow.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/newsWindow.vala b/src/gui/newsWindow.vala index cc1a77d..2ab13c0 100644 --- a/src/gui/newsWindow.vala +++ b/src/gui/newsWindow.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/pieComboList.vala b/src/gui/pieComboList.vala index f0fd22f..6a5c172 100644 --- a/src/gui/pieComboList.vala +++ b/src/gui/pieComboList.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/pieList.vala b/src/gui/pieList.vala index 77f833b..ed93098 100644 --- a/src/gui/pieList.vala +++ b/src/gui/pieList.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/pieOptionsWindow.vala b/src/gui/pieOptionsWindow.vala index 2f9cadf..5440305 100644 --- a/src/gui/pieOptionsWindow.vala +++ b/src/gui/pieOptionsWindow.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/piePreview.vala b/src/gui/piePreview.vala index ce1ba96..eadaa8e 100644 --- a/src/gui/piePreview.vala +++ b/src/gui/piePreview.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/piePreviewAddSign.vala b/src/gui/piePreviewAddSign.vala index b3f6f7b..b5bbe53 100644 --- a/src/gui/piePreviewAddSign.vala +++ b/src/gui/piePreviewAddSign.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/piePreviewCenter.vala b/src/gui/piePreviewCenter.vala index 2a163b6..2da47e6 100644 --- a/src/gui/piePreviewCenter.vala +++ b/src/gui/piePreviewCenter.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/piePreviewDeleteSign.vala b/src/gui/piePreviewDeleteSign.vala index a830002..05afd5b 100644 --- a/src/gui/piePreviewDeleteSign.vala +++ b/src/gui/piePreviewDeleteSign.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/piePreviewRenderer.vala b/src/gui/piePreviewRenderer.vala index 53dd2fb..dbd929a 100644 --- a/src/gui/piePreviewRenderer.vala +++ b/src/gui/piePreviewRenderer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/piePreviewSliceRenderer.vala b/src/gui/piePreviewSliceRenderer.vala index 5b4d939..35cb0a2 100644 --- a/src/gui/piePreviewSliceRenderer.vala +++ b/src/gui/piePreviewSliceRenderer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/preferencesWindow.vala b/src/gui/preferencesWindow.vala index fff8168..1fedfb2 100644 --- a/src/gui/preferencesWindow.vala +++ b/src/gui/preferencesWindow.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -67,6 +67,7 @@ public class PreferencesWindow : GLib.Object {          var builder = new Gtk.Builder.from_file(Paths.ui_files + "/preferences.ui");          this.window = builder.get_object("window") as Gtk.Window; +        this.window.icon_name = "gnome-pie";          this.window.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK |                      Gdk.EventMask.KEY_RELEASE_MASK |                      Gdk.EventMask.KEY_PRESS_MASK | diff --git a/src/gui/sliceTypeList.vala b/src/gui/sliceTypeList.vala index 1a9ecc4..2dcf16b 100644 --- a/src/gui/sliceTypeList.vala +++ b/src/gui/sliceTypeList.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/themeList.vala b/src/gui/themeList.vala index 786c305..8e7b190 100644 --- a/src/gui/themeList.vala +++ b/src/gui/themeList.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/tipViewer.vala b/src/gui/tipViewer.vala index e2158bd..e484315 100644 --- a/src/gui/tipViewer.vala +++ b/src/gui/tipViewer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/gui/triggerSelectButton.vala b/src/gui/triggerSelectButton.vala index eb34066..c870f84 100644 --- a/src/gui/triggerSelectButton.vala +++ b/src/gui/triggerSelectButton.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -53,7 +53,7 @@ public class TriggerSelectButton : Gtk.ToggleButton {                                               |Gdk.ModifierType.LOCK_MASK;      ///////////////////////////////////////////////////////////////////// -    /// C'tor, constructs a new TriggerSelectWindow. +    /// C'tor, constructs a new TriggerSelectButton.      /////////////////////////////////////////////////////////////////////      public TriggerSelectButton(bool enable_mouse) { @@ -132,31 +132,31 @@ public class TriggerSelectButton : Gtk.ToggleButton {      private bool on_button_press(Gdk.EventButton event) {          if (this.active) { -                Gtk.Allocation rect; -                this.get_allocation(out rect); -                if (event.x < 0 || event.x > rect.width -                 || event.y < 0 || event.y > rect.height) { - -                    this.cancel(); -                    return true; -                } -            } - -            if (this.active && this.enable_mouse) { -                Gdk.ModifierType state = event.state & ~ this.lock_modifiers; -                var new_trigger = new Trigger.from_values((int)event.button, state, true, -                                                          false, false, false, false, 5); - -                if (new_trigger.key_code != 1) this.update_trigger(new_trigger); -                else                           this.cancel(); +            Gtk.Allocation rect; +            this.get_allocation(out rect); +            if (event.x < 0 || event.x > rect.width +             || event.y < 0 || event.y > rect.height) { -                return true; -            } else if (this.active) {                  this.cancel();                  return true;              } +        } + +        if (this.active && this.enable_mouse) { +            Gdk.ModifierType state = event.state & ~ this.lock_modifiers; +            var new_trigger = new Trigger.from_values((int)event.button, state, true, +                                                      false, false, false, false, 5); -            return false; +            if (new_trigger.key_code != 1) this.update_trigger(new_trigger); +            else                           this.cancel(); + +            return true; +        } else if (this.active) { +            this.cancel(); +            return true; +        } + +        return false;      }  } diff --git a/src/images/icon.vala b/src/images/icon.vala index 9cfccf8..176e187 100644 --- a/src/images/icon.vala +++ b/src/images/icon.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/images/image.vala b/src/images/image.vala index a903493..840a8ad 100644 --- a/src/images/image.vala +++ b/src/images/image.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/images/renderedText.vala b/src/images/renderedText.vala index 2f4b82f..f00c8b5 100644 --- a/src/images/renderedText.vala +++ b/src/images/renderedText.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/images/themedIcon.vala b/src/images/themedIcon.vala index 9f4ca8a..9dd9609 100644 --- a/src/images/themedIcon.vala +++ b/src/images/themedIcon.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/pies/defaultConfig.vala b/src/pies/defaultConfig.vala index 8763a1d..4041111 100644 --- a/src/pies/defaultConfig.vala +++ b/src/pies/defaultConfig.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/pies/load.vala b/src/pies/load.vala index 0dfb423..20e18d8 100644 --- a/src/pies/load.vala +++ b/src/pies/load.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/pies/pie.vala b/src/pies/pie.vala index 1699ada..be17238 100644 --- a/src/pies/pie.vala +++ b/src/pies/pie.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/pies/pieManager.vala b/src/pies/pieManager.vala index d2cc837..d9bf5b7 100644 --- a/src/pies/pieManager.vala +++ b/src/pies/pieManager.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -42,7 +42,7 @@ public class PieManager : GLib.Object {      /// Stores all global hotkeys.      ///////////////////////////////////////////////////////////////////// -    private static BindingManager bindings; +    public static BindingManager bindings;      /////////////////////////////////////////////////////////////////////      /// True, if any pie has the current focus. If it is closing this diff --git a/src/pies/save.vala b/src/pies/save.vala index efb3fb6..0a2d401 100644 --- a/src/pies/save.vala +++ b/src/pies/save.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/renderers/centerRenderer.vala b/src/renderers/centerRenderer.vala index c146216..88b569c 100644 --- a/src/renderers/centerRenderer.vala +++ b/src/renderers/centerRenderer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/renderers/pieRenderer.vala b/src/renderers/pieRenderer.vala index 1ff2b3e..32f3a5f 100644 --- a/src/renderers/pieRenderer.vala +++ b/src/renderers/pieRenderer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/renderers/pieWindow.vala b/src/renderers/pieWindow.vala index 5accb15..d2bf61f 100755..100644 --- a/src/renderers/pieWindow.vala +++ b/src/renderers/pieWindow.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -129,7 +129,7 @@ public class PieWindow : Gtk.Window {          //and infinte loop while processing some mouse-motion events.          //(this was seen in Ubuntu 14.04.2 64/32-bits -Glib 2.19- and in MATE 14.04.2)          // set up event filter -        //this.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK | +        // this.add_events(Gdk.EventMask.BUTTON_RELEASE_MASK |          //                Gdk.EventMask.KEY_RELEASE_MASK |          //                Gdk.EventMask.KEY_PRESS_MASK |          //                Gdk.EventMask.POINTER_MOTION_MASK | @@ -169,6 +169,16 @@ public class PieWindow : Gtk.Window {              return true;          }); +        ulong connection_id = PieManager.bindings.on_release.connect((time_stamp) => { +            if (PieManager.get_is_turbo(this.renderer.id)) { +                this.activate_slice(time_stamp); +            } +        }); + +        this.on_closing.connect(() => { +            PieManager.bindings.disconnect(connection_id); +        }); +          // notify the renderer of mouse move events          this.motion_notify_event.connect((e) => {              this.renderer.on_mouse_move(); diff --git a/src/renderers/sliceRenderer.vala b/src/renderers/sliceRenderer.vala index 591fbdd..b465bd7 100644 --- a/src/renderers/sliceRenderer.vala +++ b/src/renderers/sliceRenderer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/themes/centerLayer.vala b/src/themes/centerLayer.vala index 34d473e..c4adbb8 100644 --- a/src/themes/centerLayer.vala +++ b/src/themes/centerLayer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/themes/sliceLayer.vala b/src/themes/sliceLayer.vala index bd9e98b..1a2c7cd 100644 --- a/src/themes/sliceLayer.vala +++ b/src/themes/sliceLayer.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/themes/theme.vala b/src/themes/theme.vala index ccf38c2..9c1ac5c 100644 --- a/src/themes/theme.vala +++ b/src/themes/theme.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/themes/themeImporter.vala b/src/themes/themeImporter.vala index f110696..24db741 100644 --- a/src/themes/themeImporter.vala +++ b/src/themes/themeImporter.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/animatedValue.vala b/src/utilities/animatedValue.vala index 79be155..5bb46f5 100644 --- a/src/utilities/animatedValue.vala +++ b/src/utilities/animatedValue.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/archiveReader.vala b/src/utilities/archiveReader.vala index 16e4541..14183ac 100644 --- a/src/utilities/archiveReader.vala +++ b/src/utilities/archiveReader.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/archiveWriter.vala b/src/utilities/archiveWriter.vala index 92bd31b..b74b5d0 100644 --- a/src/utilities/archiveWriter.vala +++ b/src/utilities/archiveWriter.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/bindingManager.vala b/src/utilities/bindingManager.vala index ac5a8fb..38ae1e0 100644 --- a/src/utilities/bindingManager.vala +++ b/src/utilities/bindingManager.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -32,6 +32,12 @@ public class BindingManager : GLib.Object {      public signal void on_press(string id);      ///////////////////////////////////////////////////////////////////// +    /// Called when a previously pressed binding is released again. +    ///////////////////////////////////////////////////////////////////// + +    public signal void on_release(uint32 time_stamp); + +    /////////////////////////////////////////////////////////////////////      /// A list storing bindings, which are invoked even if Gnome-Pie      /// doesn't have the current focus      ///////////////////////////////////////////////////////////////////// @@ -303,6 +309,12 @@ public class BindingManager : GLib.Object {              mods = mods & ~ Gdk.ModifierType.SUPER_MASK;          } +        mods &= ~(Gdk.ModifierType.BUTTON1_MASK +                | Gdk.ModifierType.BUTTON2_MASK +                | Gdk.ModifierType.BUTTON3_MASK +                | Gdk.ModifierType.BUTTON4_MASK +                | Gdk.ModifierType.BUTTON5_MASK); +          return mods & ~lock_modifiers[7];      } @@ -319,13 +331,16 @@ public class BindingManager : GLib.Object {              X.Event* xevent = (X.Event*) pointer;          #endif -        if(xevent->type == X.EventType.KeyPress) { -            foreach(var binding in bindings) { -                // remove NumLock, CapsLock and ScrollLock from key state -                var event_mods = prepare_modifiers((Gdk.ModifierType)xevent.xkey.state); -                var bound_mods = prepare_modifiers(binding.trigger.modifiers); +        if (xevent->type == X.EventType.KeyRelease) { +            on_release((uint32)xevent.xkey.time); +        } else if (xevent->type == X.EventType.KeyPress) { +            // remove NumLock, CapsLock and ScrollLock from key state +            var event_mods = prepare_modifiers((Gdk.ModifierType)xevent.xkey.state); + +            foreach(var binding in bindings) { +                var bound_mods = prepare_modifiers(binding.trigger.modifiers);                  if(xevent->xkey.keycode == binding.trigger.key_code &&                     event_mods == bound_mods) { @@ -336,14 +351,14 @@ public class BindingManager : GLib.Object {                      }                  }              } -         } -         else if(xevent->type == X.EventType.ButtonPress) { -            foreach(var binding in bindings) { +         } else if(xevent->type == X.EventType.ButtonRelease) { +            on_release((uint32)xevent.xkey.time); +         } else if(xevent->type == X.EventType.ButtonPress) { +            // remove NumLock, CapsLock and ScrollLock from key state +            var event_mods = prepare_modifiers((Gdk.ModifierType)xevent.xbutton.state); -                // remove NumLock, CapsLock and ScrollLock from key state -                var event_mods = prepare_modifiers((Gdk.ModifierType)xevent.xbutton.state); +            foreach(var binding in bindings) {                  var bound_mods = prepare_modifiers(binding.trigger.modifiers); -                  if(xevent->xbutton.button == binding.trigger.key_code &&                     event_mods == bound_mods) { diff --git a/src/utilities/color.vala b/src/utilities/color.vala index a681e02..1e2baf3 100644 --- a/src/utilities/color.vala +++ b/src/utilities/color.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/config.vala b/src/utilities/config.vala index 74bbcbb..3fc8d3f 100644 --- a/src/utilities/config.vala +++ b/src/utilities/config.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/focusGrabber.vala b/src/utilities/focusGrabber.vala index baa5fed..4a3212f 100644 --- a/src/utilities/focusGrabber.vala +++ b/src/utilities/focusGrabber.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/key.vala b/src/utilities/key.vala index 486744d..432c40e 100644 --- a/src/utilities/key.vala +++ b/src/utilities/key.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -30,10 +30,14 @@ public class Key : GLib.Object {      private static X.Display display; -    private static int shift_code; -    private static int ctrl_code; -    private static int alt_code; -    private static int super_code; +    private static int shift_l_code; +    private static int shift_r_code; +    private static int ctrl_l_code; +    private static int ctrl_r_code; +    private static int alt_l_code; +    private static int alt_r_code; +    private static int super_l_code; +    private static int super_r_code;      /////////////////////////////////////////////////////////////////////      /// A human readable form of the Key's accelerator. @@ -96,10 +100,14 @@ public class Key : GLib.Object {      static construct {          display = new X.Display(); -        shift_code = display.keysym_to_keycode(Gdk.keyval_from_name("Shift_L")); -        ctrl_code =  display.keysym_to_keycode(Gdk.keyval_from_name("Control_L")); -        alt_code =   display.keysym_to_keycode(Gdk.keyval_from_name("Alt_L")); -        super_code = display.keysym_to_keycode(Gdk.keyval_from_name("Super_L")); +        shift_l_code = display.keysym_to_keycode(Gdk.keyval_from_name("Shift_L")); +        shift_r_code = display.keysym_to_keycode(Gdk.keyval_from_name("Shift_R")); +        ctrl_l_code =  display.keysym_to_keycode(Gdk.keyval_from_name("Control_L")); +        ctrl_r_code =  display.keysym_to_keycode(Gdk.keyval_from_name("Control_R")); +        alt_l_code =   display.keysym_to_keycode(Gdk.keyval_from_name("Alt_L")); +        alt_r_code =   display.keysym_to_keycode(Gdk.keyval_from_name("Alt_R")); +        super_l_code = display.keysym_to_keycode(Gdk.keyval_from_name("Super_L")); +        super_r_code = display.keysym_to_keycode(Gdk.keyval_from_name("Super_R"));      }      ///////////////////////////////////////////////////////////////////// @@ -111,8 +119,8 @@ public class Key : GLib.Object {          Gdk.ModifierType current_modifiers = get_modifiers();          // release them and press the desired ones -        press_modifiers(current_modifiers, false); -        press_modifiers(this.modifiers, true); +        release_modifiers(current_modifiers); +        press_modifiers(this.modifiers);          // send events to X          display.flush(); @@ -122,8 +130,8 @@ public class Key : GLib.Object {          XTest.fake_key_event(display, this.key_code, false, 0);          // release the pressed modifiers and re-press the keys hold down by the user -        press_modifiers(this.modifiers, false); -        press_modifiers(current_modifiers, true); +        release_modifiers(this.modifiers); +        // press_modifiers(current_modifiers);          // send events to X          display.flush(); @@ -134,27 +142,57 @@ public class Key : GLib.Object {      /////////////////////////////////////////////////////////////////////      private Gdk.ModifierType get_modifiers() { -        Gdk.ModifierType modifiers; -        Gtk.get_current_event_state(out modifiers); -        return modifiers; +        return (Gdk.ModifierType)Gdk.Keymap.get_default().get_modifier_state(); +    } + +    ///////////////////////////////////////////////////////////////////// +    /// Helper method which 'releases' the desired modifier keys. +    ///////////////////////////////////////////////////////////////////// + +    private void release_modifiers(Gdk.ModifierType modifiers) { +        // since we do not know whether left or right version of each key +        // is pressed, we release both... +        if ((modifiers & Gdk.ModifierType.CONTROL_MASK) > 0) { +            XTest.fake_key_event(display, ctrl_l_code, false, 0); +            XTest.fake_key_event(display, ctrl_r_code, false, 0); +        } + +        if ((modifiers & Gdk.ModifierType.SHIFT_MASK) > 0) { +            XTest.fake_key_event(display, shift_l_code, false, 0); +            XTest.fake_key_event(display, shift_r_code, false, 0); +        } + +        if ((modifiers & Gdk.ModifierType.MOD1_MASK) > 0) { +            XTest.fake_key_event(display, alt_l_code, false, 0); +            XTest.fake_key_event(display, alt_r_code, false, 0); +        } + +        if ((modifiers & Gdk.ModifierType.SUPER_MASK) > 0) { +            XTest.fake_key_event(display, super_l_code, false, 0); +            XTest.fake_key_event(display, super_r_code, false, 0); +        }      }      /////////////////////////////////////////////////////////////////////      /// Helper method which 'presses' the desired modifier keys.      ///////////////////////////////////////////////////////////////////// -    private void press_modifiers(Gdk.ModifierType modifiers, bool down) { -        if ((modifiers & Gdk.ModifierType.CONTROL_MASK) > 0) -            XTest.fake_key_event(display, ctrl_code, down, 0); +    private void press_modifiers(Gdk.ModifierType modifiers) { +        if ((modifiers & Gdk.ModifierType.CONTROL_MASK) > 0) { +            XTest.fake_key_event(display, ctrl_l_code, true, 0); +        } -        if ((modifiers & Gdk.ModifierType.SHIFT_MASK) > 0) -            XTest.fake_key_event(display, shift_code, down, 0); +        if ((modifiers & Gdk.ModifierType.SHIFT_MASK) > 0) { +            XTest.fake_key_event(display, shift_l_code, true, 0); +        } -        if ((modifiers & Gdk.ModifierType.MOD1_MASK) > 0) -            XTest.fake_key_event(display, alt_code, down, 0); +        if ((modifiers & Gdk.ModifierType.MOD1_MASK) > 0) { +            XTest.fake_key_event(display, alt_l_code, true, 0); +        } -        if ((modifiers & Gdk.ModifierType.SUPER_MASK) > 0) -            XTest.fake_key_event(display, super_code, down, 0); +        if ((modifiers & Gdk.ModifierType.SUPER_MASK) > 0) { +            XTest.fake_key_event(display, super_l_code, true, 0); +        }      }  } diff --git a/src/utilities/logger.vala b/src/utilities/logger.vala index 7c66615..ecc551e 100644 --- a/src/utilities/logger.vala +++ b/src/utilities/logger.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/paths.vala b/src/utilities/paths.vala index 7bdd642..68c5384 100644 --- a/src/utilities/paths.vala +++ b/src/utilities/paths.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 diff --git a/src/utilities/trigger.vala b/src/utilities/trigger.vala index 5373b41..aeed3fb 100644 --- a/src/utilities/trigger.vala +++ b/src/utilities/trigger.vala @@ -1,5 +1,5 @@  ///////////////////////////////////////////////////////////////////////// -// Copyright (c) 2011-2015 by Simon Schneegans +// Copyright (c) 2011-2016 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 @@ -172,6 +172,8 @@ public class Trigger : GLib.Object {              int button = this.get_mouse_button(check_string);              if (button > 0) { +                check_string = check_string.substring(0, check_string.index_of("button")); +                  this.with_mouse = true;                  this.key_code = button;                  this.key_sym = button; @@ -179,6 +181,10 @@ public class Trigger : GLib.Object {                  Gtk.accelerator_parse(check_string, null, out this._modifiers);                  this.label = Gtk.accelerator_get_label(0, this.modifiers); +                if (this.label != "") { +                    label += "+"; +                } +                  string button_text = _("Button %i").printf(this.key_code);                  if (this.key_code == 1)  | 
