Skip to content

Match the declarations to GNOME Shell 51 - #147

Open
JumpLink wants to merge 3 commits into
mainfrom
fix/gnome-51-api-drift
Open

JumpLink wants to merge 3 commits into
mainfrom
fix/gnome-51-api-drift

Conversation

@JumpLink

@JumpLink JumpLink commented Aug 29, 2026 •

Copy link
Copy Markdown
Collaborator

GNOME 51 moved event handling off actor vfuncs and onto Clutter actions, gestures and key binding pools. The shell classes stopped overriding vfunc_*_event and grew signal handlers instead. Those vfuncs still exist on Clutter.Actor, so nothing fails to compile. The declarations just stopped describing the shell, quietly.

#144 and #145 are merged, so this diff is only the three commits below.

First commit, sync with 51

Checked module by module against gnome-shell at tag 51.beta, for every declared name that changed between 50.4 and 51.beta.

module what changed
appDisplay BaseAppView / AppDisplay._onScroll now takes the ScrollController::scroll arguments, and _onKeyPressEvent became a binding pool closure
boxpointer _muteKeys is a Clutter.KeyController and _muteInput a Clutter.ClickGesture, both were boolean
calendar vfunc_scroll_event became _onScroll
dialog vfunc_event became a KeyController
layout HotCorner.vfunc_leave_event is gone
messageList URLHighlighter motion and leave became a MotionController, Message.vfunc_key_press_event became _closeIfAllowed
messageTray _onNotificationKeyRelease became a binding pool closure
modalDialog vfunc_captured_event is gone
search new exported SearchEntry, with its activate-new-instance signal
slider scroll and key vfuncs became _onScroll, _moveLeft, _moveRight
status/backlight SliderItem forwards vfunc_navigate_focus to the slider
status/volume _handleScrollEvent became _onScroll plus _handleScroll
switcherPopup key and scroll vfuncs became _onKeyPress, _onModifierChange, _onScroll
userWidget new showAvatar and hideAvatar

Everything added carries @version 51, per the convention (#156 renames the tag to @since). I applied it to the handlers whose arguments 51 reshaped as well, appDisplay._onScroll for one, since the declared contract is the 51 one. Trim those if you read the tag more strictly.

Two additions I left out, because those classes declare no members at all and one more private helper would not help anyone. ActivitiesButton._toggleAction in panel, declared as class ActivitiesButton extends Button {}, and WindowPreview._onEnter / _onLeave in windowPreview, which declares exactly two members.

Second commit, names 51 did not remove but an earlier release did

Checking those modules turned up a second group, absent at 50.4 as well. They describe an API no supported shell has. Same files, so the same PR, but a separate commit, because it is a different claim and you may want to judge it separately.

slider is the worst of them. startDragging, _endDragging, _motionEvent, scroll and three vfuncs all went away when the pan gesture landed, and step(nSteps), the method status/volume actually calls, was never declared. That one I added. It predates 51, so it carries no @version tag here. It came in with 49, and #157 tags it @since 49.

Third commit, two members spelled wrong

Both are wrong at 50.4 as well, so neither is a 51 change. Both modules are ones this PR touches anyway.

  • layout: Monitor.geometryScale is geometry_scale.
  • switcherPopup: itemEnteredHandler and itemRemovedHandler carry the underscore, _itemEnteredHandler and _itemRemovedHandler.

What is still wrong after this PR

check-shell-api (#154) reports 53 stale declarations in 17 modules, 18 of them public. All of them are in modules GNOME 51 did not touch, so they are outside this PR's scope, but they are the same defect. #155 removes all of them. The list I put here earlier was written by hand from the first script and was short by 16, and it still named four messageList members that the second commit removes.

There is a stale export too. search.d.ts exports MaxWidthBox, which upstream has kept module-private since at least 50.4, and so do many other classes in the package. Removing an export breaks consumers, so I left it alone. check-shell-api --exports lists them.

The part worth automating

The throwaway script I found this with is now a proper one in #154, as @Totto16 suggested below. It parses both sides with the TypeScript compiler API, keeps a baseline that can only shrink, and splits findings into public and private. Its README lists what it cannot see: it matches names, not shapes, so a method whose signature changed stays invisible. Every removal in this PR I verified by reading the upstream source, not by trusting the script.

Validation

build:types, prettier:check, validate:types, build:example and validate:example all pass locally.

@JumpLink
JumpLink force-pushed the fix/gnome-51-api-drift branch from 3777bff to 755b6ff Compare August 29, 2026 06:55
@JumpLink
JumpLink force-pushed the fix/gnome-51-api-drift branch from 755b6ff to 42c3493 Compare August 29, 2026 07:02
@JumpLink JumpLink changed the title Sync declared API with GNOME Shell 51 Match the declarations to GNOME Shell 51 Aug 29, 2026
@JumpLink
JumpLink force-pushed the fix/gnome-51-api-drift branch from 42c3493 to 9cf89c9 Compare August 29, 2026 07:05
@Totto16

Totto16 commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

Sorry for noticing so late.

I would say, having this script in the rpo would be a good idea, and so we can improve it step by step, to the point where it can be added to the lint step, so that such changes are detected in the future and we don't add regressions.

I already noticed a small chnage in the vfunc functions in the migration from 49 to 50, but it was only one function (at least the extension I noticed it on had only one occurence) so I never really thought about it. This seems to be a bigger change and maybe it's woth checking for earlier cases of this as well, at least back to v49 🤔

I'll take a look at this specific PR, but as it's more complicated I'll look closer, which takes a little. 😄

Base automatically changed from v51.x.x to main October 6, 2026 06:24
@JumpLink
JumpLink force-pushed the fix/gnome-51-api-drift branch from 9cf89c9 to 9043954 Compare October 6, 2026 06:24
@JumpLink

JumpLink commented Oct 6, 2026

Copy link
Copy Markdown
Collaborator Author

@Totto16 Thanks for the feedback, that's a good idea. I'll revise the script and check it in as a separate pull request 👍

@JumpLink

JumpLink commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

@Totto16 the script is up as #154, stacked on this PR, and #155 on top of it removes the 53 declarations it finds, so the baseline ends up empty.

GNOME 51 moves event handling off actor vfuncs and onto Clutter actions,
gestures and key binding pools. The shell classes stopped overriding
`vfunc_*_event` and grew signal handlers instead. Those vfuncs still
exist on `Clutter.Actor`, so nothing fails to compile. The declarations
just stopped describing the shell.

Checked against gnome-shell at tag 51.beta, module by module, for every
declared name that changed between 50.4 and 51.beta:

  appDisplay    BaseAppView/AppDisplay._onScroll now takes the
                ScrollController signal arguments; _onKeyPressEvent is a
                binding pool closure
  boxpointer    _muteKeys is a KeyController, _muteInput a ClickGesture
  calendar      vfunc_scroll_event -> _onScroll
  dialog        vfunc_event -> KeyController
  layout        HotCorner.vfunc_leave_event is gone
  messageList   URLHighlighter motion/leave -> MotionController;
                Message.vfunc_key_press_event -> _closeIfAllowed
  messageTray   _onNotificationKeyRelease -> binding pool
  modalDialog   vfunc_captured_event is gone
  search        new exported SearchEntry with activate-new-instance
  slider        scroll/key vfuncs -> _onScroll, _moveLeft, _moveRight
  backlight     SliderItem forwards vfunc_navigate_focus
  volume        _handleScrollEvent -> _onScroll + _handleScroll
  switcherPopup key/scroll vfuncs -> _onKeyPress, _onModifierChange,
                _onScroll
  userWidget    new showAvatar/hideAvatar

Everything added here carries `@version 51`, including the handlers
whose arguments 51 reshaped.
Checking these modules against 51.beta turned up a second group. These
names are absent at 50.4 as well, so gnome-shell dropped them in an
earlier cycle and they describe an API no supported shell has.

  appFavorites  _onFavsChanged
  calendar      _dndSwitch, _dndButton and the DoNotDisturbSwitch class
                behind them (the switch moved to quick settings)
  layout        HotCorner._entered, _onCornerEntered, _onCornerLeft,
                _setupFallbackCornerIfNeeded, _pendingLoadBackground
  messageList   URLHighlighter button press/release vfuncs,
                NotificationMessage._getIcon/_onUpdated,
                MediaMessage._secondaryBin/_closeButton
  messageTray   _onNotificationShow
  popupMenu     _motionEvent, _touchDragging
  search        _onPan
  slider        button press/release and touch vfuncs, startDragging,
                _endDragging, _motionEvent, scroll
  switcherPopup vfunc_button_press_event

Slider gains `step(nSteps)` in the same pass. It replaced
`scroll(event)`, `status/volume` calls it, and it was never declared. It
predates 51, so it carries no `@version` tag.

Only modules that GNOME 51 touched are in scope here. The rest of the
package has more of this; the PR description lists it.
Both are wrong at 50.4 as well, so neither is a 51 change. The new
check-shell-api script reported them.

  layout         Monitor.geometryScale is geometry_scale
  switcherPopup  itemEnteredHandler and itemRemovedHandler carry the
                 underscore: _itemEnteredHandler, _itemRemovedHandler
@JumpLink
JumpLink force-pushed the fix/gnome-51-api-drift branch from 3ed8e00 to d73143b Compare October 6, 2026 13:18

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants