Skip to content

Fix gnome 49 compatibility#1804

Open
sasilanz wants to merge 2 commits intopop-os:master_noblefrom
sasilanz:fix-gnome-49-compatibility
Open

Fix gnome 49 compatibility#1804
sasilanz wants to merge 2 commits intopop-os:master_noblefrom
sasilanz:fix-gnome-49-compatibility

Conversation

@sasilanz
Copy link

Pop Shell incompatible with GNOME Shell 49

Environment

  • OS: Fedora 43
  • GNOME Shell: 49.2
  • Pop Shell Version: 2

Problem

Pop Shell fails to work correctly on GNOME Shell 49 with the following error repeated in the journal:

JS WARNING: file:///home/USER/.local/share/gnome-shell/extensions/pop-shell@system76.com/window.js:264:22:
Too many arguments to method Meta.Window.unmaximize: expected 0, got 1

Root Cause

The GNOME 49 API changed the Meta.Window.unmaximize() method signature. It no longer accepts any parameters (previously accepted Meta.MaximizeFlags).

Solution

Replace all instances of:

  • unmaximize(Meta.MaximizeFlags.BOTH)
  • unmaximize(Meta.MaximizeFlags.HORIZONTAL)
  • unmaximize(Meta.MaximizeFlags.VERTICAL)

with just: unmaximize()

Affected Files and Lines

window.js

  • Line 264: meta.unmaximize(Meta.MaximizeFlags.BOTH)meta.unmaximize()

extension.js

  • Line 636: prev.meta.unmaximize(Meta.MaximizeFlags.BOTH)prev.meta.unmaximize()
  • Line 640: prev.meta.unmaximize(Meta.MaximizeFlags.BOTH)prev.meta.unmaximize()
  • Line 742: compare.meta.unmaximize(Meta.MaximizeFlags.BOTH)compare.meta.unmaximize()
  • Lines 949-951: Three separate calls → single win.meta.unmaximize()

tiling.js

  • Line 562: win.meta.unmaximize(Meta.MaximizeFlags.BOTH)win.meta.unmaximize()

Testing

After applying these changes, Pop Shell works correctly on GNOME 49 with all tiling functionality restored.

Additional Notes

The metadata.json already lists shell version 49 as supported, but the code wasn't updated for the API changes.

The GNOME 49 API changed unmaximize() to accept no parameters.
This fixes JS warnings and restores Pop Shell functionality on
GNOME 49 (Fedora 43).

Fixes: unmaximize() calls in window.ts, extension.ts, tiling.ts
@jacobgkau jacobgkau requested a review from a team December 31, 2025 16:24
Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. As mentioned in the README, GNOME 46+ support is on the master_noble branch. master_jammy is only for GNOME 42-44. Can you change the target branch to master_noble?

This will need to continue working on GNOME 46-48. If it doesn't, then a new branch might be needed. I'll try to test once the target is changed.

@sasilanz sasilanz changed the base branch from master_jammy to master_noble January 1, 2026 08:52
@sasilanz
Copy link
Author

sasilanz commented Jan 1, 2026

@jacobgkau : sorry for not reading properly ! i changed the pr to master_noble branch. fix is more or less a nobrainer, works perfect for fedora 43 gnome. happy new year as well :-)

Copy link
Member

@jacobgkau jacobgkau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @sasilanz, I'm trying to take a look at this again (thanks for your patience, as COSMIC is taking priority right now).

First of all, on EndeavourOS with GNOME 49.3, I'm not actually seeing any functional problems without this change. I see the Too many arguments to method Meta.Window.unmaximize: expected 0, got 1 message logged once per session, when I first open a second window after enabling tiling, but tiling does still seem to work. I'm also seeing it work fine without this fix on Fedora 43. Can you clarify what you mean when you say it "fails to work correctly"?

Secondly, this branch is failing to build on Pop!_OS (including our build servers), EndeavourOS, and Fedora 43. This is the sort of output I'm getting when attempting to build:

Build error:
+ tsc
src/extension.ts:912:35 - error TS2554: Expected 1 arguments, but got 0.

912                         prev.meta.unmaximize();
                                      ~~~~~~~~~~~~

  src/mod.d.ts:314:20
    314         unmaximize(flags: any): void;
                           ~~~~~~~~~~
    An argument for 'flags' was not provided.

src/extension.ts:915:31 - error TS2554: Expected 1 arguments, but got 0.

915                     prev.meta.unmaximize();
                                  ~~~~~~~~~~~~

  src/mod.d.ts:314:20
    314         unmaximize(flags: any): void;
                           ~~~~~~~~~~
    An argument for 'flags' was not provided.

src/extension.ts:1037:34 - error TS2554: Expected 1 arguments, but got 0.

1037                     compare.meta.unmaximize();
                                      ~~~~~~~~~~~~

  src/mod.d.ts:314:20
    314         unmaximize(flags: any): void;
                           ~~~~~~~~~~
    An argument for 'flags' was not provided.

src/extension.ts:1261:30 - error TS2554: Expected 1 arguments, but got 0.

1261                     win.meta.unmaximize();
                                  ~~~~~~~~~~~~

  src/mod.d.ts:314:20
    314         unmaximize(flags: any): void;
                           ~~~~~~~~~~
    An argument for 'flags' was not provided.

src/tiling.ts:752:26 - error TS2554: Expected 1 arguments, but got 0.

752                 win.meta.unmaximize();
                             ~~~~~~~~~~~~

  src/mod.d.ts:314:20
    314         unmaximize(flags: any): void;
                           ~~~~~~~~~~
    An argument for 'flags' was not provided.

src/window.ts:376:22 - error TS2554: Expected 1 arguments, but got 0.

376                 meta.unmaximize();
                         ~~~~~~~~~~~~

  src/mod.d.ts:314:20
    314         unmaximize(flags: any): void;
                           ~~~~~~~~~~
    An argument for 'flags' was not provided.


Found 6 errors in 3 files.

Errors  Files
     4  src/extension.ts:912
     1  src/tiling.ts:752
     1  src/window.ts:376
make[1]: *** [Makefile:38: compile] Error 2
make[1]: Leaving directory '/home/jacob/Work/shell'
dh_auto_build: error: make -j24 returned exit code 2
make: *** [debian/rules:10: build] Error 2
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

Are you not seeing this build error when building the project?

…NOME 49

- Make unmaximize() flags parameter optional in type definition to fix
  TypeScript compilation errors while maintaining backward compatibility
- Use local Gio.Settings instance in WindowSwitcherPopup._getWindowList()
  instead of this._settings which is null in GNOME 49+
@sasilanz
Copy link
Author

Hi @jacobgkau,

Thanks for the detailed review! I've pushed a new commit that addresses the build failures and adds an additional fix.

Build fix:
I made the flags parameter optional in src/mod.d.ts (unmaximize(flags?: any): void). This maintains backward compatibility with older GNOME versions while allowing the parameter-free calls required by GNOME 49+. The build now passes successfully.

Additional fix:
While testing on Fedora 43 with Wayland, I discovered another GNOME 49 compatibility issue: WindowSwitcherPopup.prototype._getWindowList was crashing with TypeError: can't access property "get_boolean", this._settings is null. In GNOME 49, the _settings property is no longer available on the popup instance. I fixed this by creating a local Gio.Settings instance instead of relying on this._settings.

Regarding "fails to work correctly":
You're right that the unmaximize() warnings alone don't break tiling functionality. The _settings crash occurs specifically when using Alt+Tab window switching. This issue may be specific to Fedora + Wayland + stock GNOME configuration, which could explain why you weren't seeing functional problems on EndeavourOS (different display server or GNOME configuration). The combination of both fixes ensures Pop Shell works without errors or warnings across different GNOME 49 setups.

Let me know if you have any further questions!

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