Skip to content

Commit 8d8180f

Browse files
committed
cinnamonDbus: Have cinnamon-settings-daemon provide monitor
coordinates for the showOSD method, instead of a monitor index. This index could be incorrect due to differences between how Gdk figures monitor order and how muffin handles it now. Let cinnamon/muffin figure it out based on those coordinates instead. ref: linuxmint/mint21-beta#121 requires: linuxmint/cinnamon-settings-daemon@3d69c0e0a
1 parent 62c0205 commit 8d8180f

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

js/ui/cinnamonDBus.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,15 +244,17 @@ CinnamonDBus.prototype = {
244244
params[param] = params[param].deep_unpack();
245245

246246
let monitorIndex = -1;
247-
if (params.maybeGet('monitor') >= 0) {
248-
monitorIndex = params['monitor'];
247+
if (params.maybeGet('monitor_x') >= 0) {
248+
let x = params['monitor_x'];
249+
let y = params['monitor_y'];
250+
monitorIndex = Main.layoutManager.findMonitorIndexAt(++x, ++y);
249251
}
250252

251253
let icon = null;
252254
if (params['icon'])
253255
icon = Gio.Icon.new_for_string(params['icon']);
254256

255-
Main.osdWindowManager.show(monitorIndex, icon, params['level'], true);
257+
Main.osdWindowManager.show(monitorIndex, icon, params['level'], false);
256258
},
257259

258260
FlashArea: function(x, y, width, height) {

js/ui/layout.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@ LayoutManager.prototype = {
377377
return this._chrome.findMonitorIndexForActor(actor);
378378
},
379379

380+
findMonitorIndexAt: function(x, y) {
381+
let [index, monitor] = this._chrome._findMonitorForRect(x, y, 1, 1)
382+
return index;
383+
},
384+
380385
/**
381386
* isTrackingChrome:
382387
* @actor (Clutter.Actor): the actor to check

0 commit comments

Comments
 (0)