screenshot: Use meta_window_has_pointer () for pointer check

909616b208 seems to have wrapped window actors in a container, so the actor.has_pointer check started failing. Instead, switch to meta_window_has_pointer () which doesn't rely on window actor implementation details.

We check for existence of has_pointer first just in case someone attempts to run gnome-shell 44.1 with mutter 44.0 which does not have the function exported publicly yet.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2710>
This commit is contained in:
Ivan Molodetskikh 2023-03-20 11:49:24 -07:00 committed by Marge Bot
parent 21ef781234
commit 4daea0ccae

View File

@ -787,7 +787,7 @@ class UIWindowSelectorWindow extends St.Button {
this._cursor = null; this._cursor = null;
this._cursorPoint = { x: 0, y: 0 }; this._cursorPoint = { x: 0, y: 0 };
this._shouldShowCursor = actor.get_children().some(c => c.has_pointer); this._shouldShowCursor = window.has_pointer && window.has_pointer();
this.connect('destroy', this._onDestroy.bind(this)); this.connect('destroy', this._onDestroy.bind(this));
} }