Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: offset lost after invoking gtk hide on linux #241

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

Kingtous
Copy link
Contributor

@Kingtous Kingtous commented Nov 9, 2022

I've found there's an issue when using gtk_widget_hide method, causing offset lost after hide the window (always center).

Reproduce repo(pure empty flutter project + window_manager): https://github.com/Kingtous/hide_and_show_issue_reproduce_demo

flutter

Note that this is NOT a issue in window_manager, but gtk is.

gtk hide will reset offset of the window.

btw, i can reproduce this behavior of gtk also in rust code.
Peek 2022-11-09 19-08

But if I saved the size and offset before hide, and set them once after invoking hide, it behaves normally.
after

So I add a workaround to make linux able to remember offset and size after hide, which uniforms behaviors of all platforms supported by window_manager. (the position and offset of the window after hiding it can be saved automatically by system, but linux gtk can't). With this PR, window manager can remember the position and offset after hiding windows on all platforms.

@Kingtous Kingtous closed this Nov 9, 2022
@Kingtous Kingtous reopened this Nov 9, 2022
@lijy91
Copy link
Member

lijy91 commented Nov 28, 2022

LGTM

@lijy91 lijy91 merged commit 7e12f9d into leanflutter:main Nov 28, 2022
obiwanzenobi pushed a commit to obiwanzenobi/window_manager that referenced this pull request May 25, 2023
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