Adapt to the new Mtk library
As we plan to slowly phase out Cairo where possible in libmutter https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3128 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2873>
This commit is contained in:

committed by
Marge Bot

parent
533f3fe69d
commit
80237b1082
@ -2,7 +2,7 @@
|
||||
|
||||
import Clutter from 'gi://Clutter';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Mtk from 'gi://Mtk';
|
||||
import St from 'gi://St';
|
||||
|
||||
import * as Main from './main.js';
|
||||
@ -25,7 +25,7 @@ export const EdgeDragAction = GObject.registerClass({
|
||||
}
|
||||
|
||||
_getMonitorRect(x, y) {
|
||||
let rect = new Meta.Rectangle({x: x - 1, y: y - 1, width: 1, height: 1});
|
||||
const rect = new Mtk.Rectangle({x: x - 1, y: y - 1, width: 1, height: 1});
|
||||
let monitorIndex = global.display.get_monitor_index_for_rect(rect);
|
||||
|
||||
return global.display.get_monitor_geometry(monitorIndex);
|
||||
|
@ -5,6 +5,7 @@ import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Mtk from 'gi://Mtk';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
import * as Signals from '../misc/signals.js';
|
||||
@ -985,7 +986,7 @@ export const LayoutManager = GObject.registerClass({
|
||||
findIndexForActor(actor) {
|
||||
let [x, y] = actor.get_transformed_position();
|
||||
let [w, h] = actor.get_transformed_size();
|
||||
let rect = new Meta.Rectangle({x, y, width: w, height: h});
|
||||
const rect = new Mtk.Rectangle({x, y, width: w, height: h});
|
||||
return global.display.get_monitor_index_for_rect(rect);
|
||||
}
|
||||
|
||||
@ -1049,7 +1050,7 @@ export const LayoutManager = GObject.registerClass({
|
||||
h = Math.round(h);
|
||||
|
||||
if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility())
|
||||
rects.push(new Meta.Rectangle({x, y, width: w, height: h}));
|
||||
rects.push(new Mtk.Rectangle({x, y, width: w, height: h}));
|
||||
|
||||
let monitor = null;
|
||||
if (actorData.affectsStruts)
|
||||
@ -1099,7 +1100,7 @@ export const LayoutManager = GObject.registerClass({
|
||||
continue;
|
||||
}
|
||||
|
||||
let strutRect = new Meta.Rectangle({x: x1, y: y1, width: x2 - x1, height: y2 - y1});
|
||||
const strutRect = new Mtk.Rectangle({x: x1, y: y1, width: x2 - x1, height: y2 - y1});
|
||||
let strut = new Meta.Strut({rect: strutRect, side});
|
||||
struts.push(strut);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import GObject from 'gi://GObject';
|
||||
import GLib from 'gi://GLib';
|
||||
import Graphene from 'gi://Graphene';
|
||||
import Meta from 'gi://Meta';
|
||||
import Mtk from 'gi://Mtk';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
@ -2655,7 +2656,7 @@ class SelectArea extends St.Widget {
|
||||
}
|
||||
|
||||
_getGeometry() {
|
||||
return new Meta.Rectangle({
|
||||
return new Mtk.Rectangle({
|
||||
x: Math.min(this._startX, this._lastX),
|
||||
y: Math.min(this._startY, this._lastY),
|
||||
width: Math.abs(this._startX - this._lastX) + 1,
|
||||
|
@ -3,7 +3,7 @@
|
||||
import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Mtk from 'gi://Mtk';
|
||||
|
||||
import * as Main from './main.js';
|
||||
import * as Params from '../misc/params.js';
|
||||
@ -595,7 +595,7 @@ export const SwipeTracker = GObject.registerClass({
|
||||
|
||||
this._history.append(time, 0);
|
||||
|
||||
let rect = new Meta.Rectangle({x, y, width: 1, height: 1});
|
||||
const rect = new Mtk.Rectangle({x, y, width: 1, height: 1});
|
||||
let monitor = global.display.get_monitor_index_for_rect(rect);
|
||||
|
||||
this.emit('begin', monitor);
|
||||
|
@ -5,6 +5,7 @@ import Gio from 'gi://Gio';
|
||||
import GLib from 'gi://GLib';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Mtk from 'gi://Mtk';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
@ -417,7 +418,7 @@ class TilePreview extends St.Widget {
|
||||
this._updateStyle(monitor);
|
||||
|
||||
if (!this._showing || changeMonitor) {
|
||||
const monitorRect = new Meta.Rectangle({
|
||||
const monitorRect = new Mtk.Rectangle({
|
||||
x: monitor.x,
|
||||
y: monitor.y,
|
||||
width: monitor.width,
|
||||
|
@ -4,6 +4,7 @@ import Clutter from 'gi://Clutter';
|
||||
import Gio from 'gi://Gio';
|
||||
import GObject from 'gi://GObject';
|
||||
import Meta from 'gi://Meta';
|
||||
import Mtk from 'gi://Mtk';
|
||||
import Shell from 'gi://Shell';
|
||||
import St from 'gi://St';
|
||||
|
||||
@ -1052,7 +1053,7 @@ class WorkspacesDisplay extends St.Widget {
|
||||
|
||||
_getMonitorIndexForEvent(event) {
|
||||
let [x, y] = event.get_coords();
|
||||
let rect = new Meta.Rectangle({x, y, width: 1, height: 1});
|
||||
const rect = new Mtk.Rectangle({x, y, width: 1, height: 1});
|
||||
return global.display.get_monitor_index_for_rect(rect);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user