gnome-shell-extension-another-window-session-manager icon indicating copy to clipboard operation
gnome-shell-extension-another-window-session-manager copied to clipboard

Updated for GNOME 49

Open mendres82 opened this issue 2 months ago • 3 comments

Updated to reflect GNOME 49 API changes:

Meta.Window Meta.Window removes the Meta.MaximizeFlags from the parameters for maximize() and unmaximize(). Also get_maximized() is removed and you can use is_maximized() instead. To maximize or unmaximize the window horizontally or vertically, you can call new methods set_maximize_flags() and set_unmaximize_flags().

mendres82 avatar Sep 27 '25 17:09 mendres82

I wonder if we could still support older versions with something like:

-            const currentMetaMaximized = metaWindow.get_maximized();
+            const currentMetaMaximized = (metaWindow.get_maximized || metaWindow.is_maximized)();

gadicc avatar Oct 10 '25 14:10 gadicc

If we had to maintain compatibility to older GNOME versions, I'd probably write separate blocks, because

  1. it handles both changed methods metaWindow.is_maximized() and metaWindow.maximize() correctly and
  2. makes the code easy to maintain, once you decide to remove the support for a specific version.
  3. The code is clear in what it's doing.
const Config = imports.misc.config;
const shellVersion = parseFloat(Config.PACKAGE_VERSION);

if (shellVersion < 49) {
    const currentMetaMaximized = metaWindow.get_maximized();
    if (currentMetaMaximized !== Meta.MaximizeFlags.BOTH) {
        this._log.debug(`Maximizing ${metaWindow.get_title()}`);
        metaWindow.maximize(savedMetaMaximized);
    }
} else {
    const currentMetaMaximized = metaWindow.is_maximized();
    if (currentMetaMaximized !== Meta.MaximizeFlags.BOTH) {
        this._log.debug(`Maximizing ${metaWindow.get_title()}`);
        metaWindow.maximize();
    }                
}

Please note: I didn't test any of this yet, it's just a suggestion.

mendres82 avatar Oct 10 '25 15:10 mendres82

Yeah good point. What's your preference, @nlpsuge? Should we drop old versions or still support them for a while?

gadicc avatar Oct 10 '25 16:10 gadicc

When can we expect this to hit the GNOME repo?

By the way, appreciate the work you all do. Love this extension!

BashBandito avatar Nov 05 '25 12:11 BashBandito

As long as this PR doesn't get merged or the extension gets updated by the author, you shouldn't expect it to hit GNOME extension website anytime soon. I don't want to put a forked version anywhere officially, because the author deserves all credit for this extension.

mendres82 avatar Nov 05 '25 21:11 mendres82

@mendres82

Oh, I see, it sounds like the author is absent. I see their last activity on their profile was in August, so perhaps they are busy with schooling?

That's understandable, but also rather unfortunate because this extension is one that brings a ton of value to daily workflow. Pretty rough without it when you have dual monitors, and you have to constantly fix your window positioning.

Do you happen to know if it works when changing the metadata.json version number? I've never gone that route before, but this one has me curious, as I am rather impatient for it.

BashBandito avatar Nov 06 '25 12:11 BashBandito

There is a zip-file attached to my PR, which you can use to install the updated version while waiting for an official update.

mendres82 avatar Nov 06 '25 12:11 mendres82

@mendres82

Thank you for sharing this. I installed it, logged out and back in and there she is again.

You made my day.

BashBandito avatar Nov 06 '25 19:11 BashBandito