window-list: Add id property to buttons

A string ID that uniquely identifies a button will allow to
serialize/deserialize the positions in the next commit.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell-extensions/-/merge_requests/338>
This commit is contained in:
Florian Müllner
2024-06-26 00:58:18 +02:00
committed by Marge Bot
parent f87a25e913
commit 3f660ee973

View File

@@ -575,6 +575,10 @@ class WindowButton extends BaseButton {
this._updateStyle();
}
get id() {
return `window:${this.metaWindow.get_id()}`;
}
_createTitleActor() {
return new WindowTitle(this.metaWindow);
}
@@ -714,6 +718,10 @@ class AppButton extends BaseButton {
this._updateStyle();
}
get id() {
return `app:${this.app.get_id()}`;
}
_windowEnteredOrLeftMonitor(metaDisplay, monitorIndex, metaWindow) {
if (this._windowTracker.get_window_app(metaWindow) === this.app &&
monitorIndex === this._monitorIndex) {