micheleg/dash-to-dock

Gjs-WARNING: The GObject property St.ScrollView.[hv]scroll is deprecated (in GNOME 46)

Closed this issue · 8 comments

In GNOME 46:

(gnome-shell:18994): Gjs-WARNING **: 13:53:18.466: The GObject property St.ScrollView.vscroll is deprecated.
0 ensureActorVisibleInScrollView() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js":1143:38]
1 _createAppItem/<() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js":569:46]
2 _generateAccessors/propdesc.set() ["resource:///org/gnome/gjs/modules/core/_common.js":38:25]
3 _updateFocusState() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js":328:8]
4 _init/<() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js":921:74]
5 popModal() ["resource:///org/gnome/shell/ui/main.js":739:16]
6 _syncGrab() ["resource:///org/gnome/shell/ui/overview.js":526:21]
7 _hideDone() ["resource:///org/gnome/shell/ui/overview.js":647:13]
8 _animateNotVisible/<() ["resource:///org/gnome/shell/ui/overview.js":627:54]
9 onStopped() ["resource:///org/gnome/shell/ui/overviewControls.js":757:20]
10 _makeEaseCallback/<() ["resource:///org/gnome/shell/ui/environment.js":65:21]
11 _easeActorProperty/<() ["resource:///org/gnome/shell/ui/environment.js":232:59]
12 anonymous() ["resource:///org/gnome/shell/ui/init.js":21:19]


(gnome-shell:18994): Gjs-WARNING **: 13:53:18.466: The GObject property St.ScrollView.hscroll is deprecated.
0 ensureActorVisibleInScrollView() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js":1144:38]
1 _createAppItem/<() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/dash.js":569:46]
2 _generateAccessors/propdesc.set() ["resource:///org/gnome/gjs/modules/core/_common.js":38:25]
3 _updateFocusState() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js":328:8]
4 _init/<() ["file:///home/dan/.local/share/gnome-shell/extensions/dash-to-dock@micxgx.gmail.com/appIcons.js":921:74]
5 popModal() ["resource:///org/gnome/shell/ui/main.js":739:16]
6 _syncGrab() ["resource:///org/gnome/shell/ui/overview.js":526:21]
7 _hideDone() ["resource:///org/gnome/shell/ui/overview.js":647:13]
8 _animateNotVisible/<() ["resource:///org/gnome/shell/ui/overview.js":627:54]
9 onStopped() ["resource:///org/gnome/shell/ui/overviewControls.js":757:20]
10 _makeEaseCallback/<() ["resource:///org/gnome/shell/ui/environment.js":65:21]
11 _easeActorProperty/<() ["resource:///org/gnome/shell/ui/environment.js":232:59]
12 anonymous() ["resource:///org/gnome/shell/ui/init.js":21:19]

This is odd... neither the documentation nor the Gnome Shell source code do mark those properties as deprecated...

imagen

imagen

$ grep -B4 DEPRECATED *
...
--
st-scroll-view.c-    g_param_spec_object ("hscroll",
st-scroll-view.c-                         "StScrollBar",
st-scroll-view.c-                         "Horizontal scroll indicator",
st-scroll-view.c-                         ST_TYPE_SCROLL_BAR,
st-scroll-view.c:                         ST_PARAM_READABLE | G_PARAM_DEPRECATED);
--
st-scroll-view.c-    g_param_spec_object ("vscroll",
st-scroll-view.c-                         "StScrollBar",
st-scroll-view.c-                         "Vertical scroll indicator",
st-scroll-view.c-                         ST_TYPE_SCROLL_BAR,
st-scroll-view.c:                         ST_PARAM_READABLE | G_PARAM_DEPRECATED);
--
...

Oh! I was searching for something in the comments... Now it makes sense.

(also, I searched in lowercase 🤦🏾‍♂️)

Am I correct in seeing that this is the only place this occurs?:

dash-to-dock/dash.js

Lines 1142 to 1146 in 936b866

function ensureActorVisibleInScrollView(scrollView, actor) {
const {adjustment: vAdjustment} = scrollView.vscroll;
const {adjustment: hAdjustment} = scrollView.hscroll;
const {value: vValue0, pageSize: vPageSize, upper: vUpper} = vAdjustment;
const {value: hValue0, pageSize: hPageSize, upper: hUpper} = hAdjustment;

From what I can tell, it should be possible to just access scrollView.vAdjustment and scrollView.hAdjustment directly instead of going through vscroll and hscroll.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020/diffs?commit_id=d243a9ba9320971d5ce8524ff8355b24606d9420

That seems to be why they got deprecated it in the first place:

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020

@vanvugt can you check the PR? that should be the last issue for the gnome 46 release :)

@K1ngjulien You are right. I left a comment in your PR, but in overall, it looks good.

Closed in #2185.