Skip to content

Add unmaximize() to WindowManager#123

Merged
gwleuverink merged 2 commits into
NativePHP:mainfrom
Eoin-k:add-window-unmaximize
Jun 9, 2026
Merged

Add unmaximize() to WindowManager#123
gwleuverink merged 2 commits into
NativePHP:mainfrom
Eoin-k:add-window-unmaximize

Conversation

@Eoin-k

@Eoin-k Eoin-k commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

If a window is maximized and you try to resize it, this was being ignored by the window.
The only workaround I was able to find was by calling Window::minimize() then Window::open() before resizing, which worked but looked strange having the window close and reopen in a different place and size.

Example - original resize and position as a sidebar:
Window::minimize();
Window::open();
Window::resize($width, $screenHeight, 'main');
Window::position(0, 0, true, 'main');

Now with the Window::unmaximize() the window just drops out of maximized state to whatever the previous dimensions were and the resize or any window function can be called directly after.

Once the electron plugin is rebuilt with these changes it works as expected and also emits the WindowUnmaximized event.

unmaximized event firing

@gwleuverink gwleuverink left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for your contribution! 🙏🏻

@gwleuverink

Copy link
Copy Markdown
Collaborator

The checks fail because they run outside the org. Both Pint & plugin build run fine locally. Ok to merge!

@gwleuverink gwleuverink merged commit 81f48bc into NativePHP:main Jun 9, 2026
51 of 53 checks passed
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.

3 participants