shellDBus: Update ::accelerator-activated handler arguments

Mutter now passes a ClutterInputDevice. And use this to pass the
device ID (as we used to do) and the event node (so we can transition
to something that works on x11/wayland)

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/618
This commit is contained in:
Carlos Garnacho 2019-07-08 11:44:12 +02:00
parent be40de5a9b
commit 53be76c9e2

View File

@ -27,8 +27,8 @@ var GnomeShell = class {
this._grabbers = new Map(); this._grabbers = new Map();
global.display.connect('accelerator-activated', global.display.connect('accelerator-activated',
(display, action, deviceid, timestamp) => { (display, action, device, timestamp) => {
this._emitAcceleratorActivated(action, deviceid, timestamp); this._emitAcceleratorActivated(action, device, timestamp);
}); });
this._cachedOverviewVisible = false; this._cachedOverviewVisible = false;
@ -144,14 +144,15 @@ var GnomeShell = class {
return invocation.return_value(GLib.Variant.new('(b)', [ungrabSucceeded])); return invocation.return_value(GLib.Variant.new('(b)', [ungrabSucceeded]));
} }
_emitAcceleratorActivated(action, deviceid, timestamp) { _emitAcceleratorActivated(action, device, timestamp) {
let destination = this._grabbedAccelerators.get(action); let destination = this._grabbedAccelerators.get(action);
if (!destination) if (!destination)
return; return;
let connection = this._dbusImpl.get_connection(); let connection = this._dbusImpl.get_connection();
let info = this._dbusImpl.get_info(); let info = this._dbusImpl.get_info();
let params = { 'device-id': GLib.Variant.new('u', deviceid), let params = { 'device-id': GLib.Variant.new('u', device.get_device_id()),
'device-node': GLib.Variant.new('s', device.get_device_node()),
'timestamp': GLib.Variant.new('u', timestamp), 'timestamp': GLib.Variant.new('u', timestamp),
'action-mode': GLib.Variant.new('u', Main.actionMode) }; 'action-mode': GLib.Variant.new('u', Main.actionMode) };
connection.emit_signal(destination, connection.emit_signal(destination,