@@ -75,22 +75,23 @@ namespace Gala {
7575 private static DBusAccelerator ? instance;
7676
7777 [DBus (visible = false )]
78- public static unowned DBusAccelerator init (WindowManager wm) {
79- if (instance == null )
80- instance = new DBusAccelerator (wm);
78+ public static unowned DBusAccelerator init (Meta . Display display) {
79+ if (instance == null ) {
80+ instance = new DBusAccelerator (display);
81+ }
8182
8283 return instance;
8384 }
8485
8586 public signal void accelerator_activated (uint action, GLib . HashTable<string, Variant > parameters);
8687
87- private WindowManager wm ;
88+ private Meta . Display display ;
8889 private GLib . HashTable<unowned string, GrabbedAccelerator > grabbed_accelerators;
8990
90- private DBusAccelerator (WindowManager _wm ) {
91- wm = _wm ;
91+ private DBusAccelerator (Meta . Display _display ) {
92+ display = _display ;
9293 grabbed_accelerators = new HashTable<unowned string, GrabbedAccelerator > (str_hash, str_equal);
93- wm . get_display () . accelerator_activated. connect (on_accelerator_activated);
94+ display . accelerator_activated. connect (on_accelerator_activated);
9495 }
9596
9697 private void on_accelerator_activated (uint action, Clutter . InputDevice device, uint timestamp) {
@@ -115,7 +116,7 @@ namespace Gala {
115116 return found_accel. action;
116117 }
117118
118- uint action = wm . get_display () . grab_accelerator (accelerator, grab_flags);
119+ uint action = display . grab_accelerator (accelerator, grab_flags);
119120 if (action != Meta . KeyBindingFlags . NONE ) {
120121 var accel = new GrabbedAccelerator ();
121122 accel. action = action;
@@ -141,7 +142,7 @@ namespace Gala {
141142 public bool ungrab_accelerator (uint action) throws GLib . DBusError , GLib . IOError {
142143 foreach (unowned GrabbedAccelerator accel in grabbed_accelerators. get_values ()) {
143144 if (accel. action == action) {
144- bool ret = wm . get_display () . ungrab_accelerator (action);
145+ bool ret = display . ungrab_accelerator (action);
145146 grabbed_accelerators. remove (accel. name);
146147 return ret;
147148 }
0 commit comments