Skip to content

Commit

Permalink
Monitor names from muffin (#12525)
Browse files Browse the repository at this point in the history
This stores monitor names in LayoutManager, together with their geometry and index.
  • Loading branch information
Cobinja authored Nov 28, 2024
1 parent d14b2f2 commit 0c1e98c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions js/ui/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,18 @@ var MonitorConstraint = GObject.registerClass({
}
});

function Monitor(index, geometry) {
this._init(index, geometry);
function Monitor(index, geometry, name) {
this._init(index, geometry, name);
}

Monitor.prototype = {
_init: function(index, geometry) {
_init: function(index, geometry, name) {
this.index = index;
this.x = geometry.x;
this.y = geometry.y;
this.width = geometry.width;
this.height = geometry.height;
this.name = name;
},

get inFullscreen() {
Expand Down Expand Up @@ -340,8 +341,9 @@ LayoutManager.prototype = {
for (let i = 0; i < nMonitors; i++) {
let rect = global.display.get_monitor_geometry(i);
let lmon = global.display.get_monitor_index_for_rect(rect);
let name = global.display.get_monitor_name(i);

this.monitors.push(new Monitor(lmon, rect));
this.monitors.push(new Monitor(lmon, rect, name));
}

this.primaryIndex = global.display.get_primary_monitor();
Expand Down

0 comments on commit 0c1e98c

Please sign in to comment.