Porting extensions: Meta.Window does not have set_maximized_flags

According to the upgrade instructions at Port Extensions to GNOME Shell 49 | GNOME JavaScript :

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().

I’m not seeing that the method actually exists: (gsl is a helper that evals stdin inside of gnome-shell)

➜  ~ echo "global.display.get_focus_window()['maximized-horizontally']" | gsl 
(true, 'false')
➜  ~ echo "global.display.get_focus_window().is_maximized.toString()" | gsl  
(true, '"method Meta.Window.is_maximized() {\\n\\t/* wrapper for native symbol meta_window_is_maximized() */\\n}"')
➜  ~ echo "global.display.get_focus_window().is_maximized()" | gsl           
(true, 'false')
➜  ~ echo "global.display.get_focus_window().get_maximized_flags()" | gsl
(false, 'TypeError: global.display.get_focus_window().get_maximized_flags is not a function')
➜  ~ echo "global.display.get_focus_window().set_maximized_flags()" | gsl
(false, 'TypeError: global.display.get_focus_window().set_maximized_flags is not a function')
➜  ~ echo "global.display.get_focus_window()['maximized-horizontally'] = true"  | gsl
(false, 'Error: Property MetaWindowWayland.maximized-horizontally is not writable')

It’s not set_maximized_flags(), but set_maximize_flags().

1 Like

Also note that window: Make `meta_window_{get,set}_maximize_flags()` public again (!4573) · Merge requests · GNOME / mutter · GitLab reintroduced them, so make sure you have a build that contains that change.

1 Like

It’s not set_maximized_flags(), but set_maximize_flags().

Oof, yeah. I did try both variants :slight_smile: But did not show that in my example. Thank you for correcting the record.

Also note that window: Make meta_window_{get,set}_maximize_flags() public again (!4573) · Merge requests · GNOME / mutter · GitLab reintroduced them, so make sure you have a build that contains that change.

Thank you so much for the commit reference! I’ll boot up the Gnome nightly and try it.

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.