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 authored and vanvugt committed Apr 2, 2024
1 parent 6954508 commit 44a4726
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dash.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,13 +1140,17 @@ export const DockDash = GObject.registerClass({
* @param actor
*/
function ensureActorVisibleInScrollView(scrollView, actor) {
const {adjustment: vAdjustment} = scrollView.vscroll;
const {adjustment: hAdjustment} = scrollView.hscroll;
// access to scrollView.[hv]scroll was deprecated in gnome 46
// instead, adjustment can be accessed directly
// keep old way for backwards compatibility (gnome <= 45)
const vAdjustment = scrollView.vadjustment ?? scrollView.vscroll.adjustment;
const hAdjustment = scrollView.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];
let vOffset = 0;
let hOffset = 0;

const fade = scrollView.get_effect('fade');
if (fade) {
vOffset = fade.fade_margins.top;
Expand Down

0 comments on commit 44a4726

Please sign in to comment.