Skip to content

[Window State] implement fullscreen & minimized logic - #3398

Open
polarove wants to merge 7 commits into
tauri-apps:v2from
polarove:fullscreen
Open

polarove wants to merge 7 commits into
tauri-apps:v2from
polarove:fullscreen

Conversation

@polarove

Copy link
Copy Markdown
  1. Add new member StateFlags::MINIMIZED to record window.is_minimized() since we have StateFlag::MAXIMIZED

  2. Implement StatesFlags::FULLSCREEN, records & recover its state accordingly

@polarove
polarove requested a review from a team as a code owner April 18, 2026 12:15
@github-actions

github-actions Bot commented Apr 20, 2026 •

Copy link
Copy Markdown
Contributor

Package Changes Through 13cd21f

There are 9 changes which include deep-link with patch, deep-link-js with patch, shell with minor, shell-js with minor, single-instance with patch, updater with patch, updater-js with patch, window-state with minor, window-state-js with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.56 2.0.57
api-example-js 2.0.52 2.0.53
deep-link-example-js 2.2.17 2.2.18
deep-link 2.6.2 2.6.3
deep-link-js 2.6.2 2.6.3
shell 2.5.0 2.6.0
shell-js 2.5.0 2.6.0
single-instance 2.5.4 2.5.5
updater 2.14.0 2.14.1
updater-js 2.14.0 2.14.1
window-state 2.5.0 2.6.0
window-state-js 2.5.0 2.6.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@Legend-Master Legend-Master left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, some of your commits are not signed + your seem not to have the signing public key uploaded to GitHub yet.

Comment thread plugins/window-state/src/lib.rs Outdated
}

if flags.contains(StateFlags::MAXIMIZED) && state.maximized {
// fullscreen > maximized > minimized

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These 3 can co-exist.

}

if flags.contains(StateFlags::FULLSCREEN) {
metadata.fullscreen = self.is_fullscreen()?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Don't we already have fullscreen implemented?

Comment thread plugins/window-state/src/lib.rs Outdated
Comment on lines +297 to +309
let concern_flags = StateFlags::MAXIMIZED
| StateFlags::MINIMIZED
| StateFlags::POSITION
| StateFlags::SIZE
| StateFlags::FULLSCREEN;

let is_concern = flags.intersects(concern_flags);

let is_maximized = is_concern && self.is_maximized()?;

let is_minimized = is_concern && self.is_minimized()?;

let is_fullscreen = is_concern && self.is_fullscreen()?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think this change is correct

- restore maximized and fullscreen independently, set fullscreen from saved state
- minimize after show/focus so it is not undone
- don't save size/position while fullscreen, query state only for relevant flags
- keep the resize handler from overwriting maximized/minimized/fullscreen
- exclude MINIMIZED from StateFlags::default()
- add MINIMIZED to the JS StateFlags enum
- add change file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants