Skip to content

Commit

Permalink
fix deprecated "St.ScrollView.[hv]scroll" property
Browse files Browse the repository at this point in the history
only used to access adjustments, which can be directly accessed now.

see: https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3020
  • Loading branch information
K1ngjulien committed Mar 29, 2024
1 parent 936b866 commit dd79585
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,8 +1140,15 @@ export const DockDash = GObject.registerClass({
* @param actor
*/
function ensureActorVisibleInScrollView(scrollView, actor) {
const {adjustment: vAdjustment} = scrollView.vscroll;
const {adjustment: hAdjustment} = scrollView.hscroll;
let vAdjustment = scrollView.vadjustment
let hAdjustment = scrollView.hadjustment
if (vAdjustment === undefined || hAdjustment === undefined) {
// access to scrollView.[hv]scroll was deprecated in gnome 46
// backwards compatibility for gnome <46
vAdjustment = scrollView.vscroll.adjustment
hAdjustment = scrollView.hscroll.adjustment
}

const {value: vValue0, pageSize: vPageSize, upper: vUpper} = vAdjustment;
const {value: hValue0, pageSize: hPageSize, upper: hUpper} = hAdjustment;
let [hValue, vValue] = [hValue0, vValue0];
Expand Down

0 comments on commit dd79585

Please sign in to comment.