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

[Windows] Remove app cut at the bottom and force refresh when back from fullscreen #359

Merged
merged 1 commit into from
Jul 1, 2023

Conversation

damywise
Copy link
Contributor

NOTE: I have not tested this on Windows 10

…om fullscreen

- Removes the line that `cuts the app at the bottom by the pixel to prevent jitter when resizing app`
- Remove the line that `cuts the app by 3 pixels at the bottom when full screen`
- Fixes leanflutter#311, leanflutter#266, leanflutter#228, leanflutter#355, leanflutter#237
@@ -116,8 +116,6 @@ std::optional<LRESULT> WindowManagerPlugin::HandleWindowProc(HWND hWnd,
// This must always be first or else the one of other two ifs will execute
// when window is in full screen and we don't want that
if (wParam && window_manager->IsFullScreen()) {
NCCALCSIZE_PARAMS* sz = reinterpret_cast<NCCALCSIZE_PARAMS*>(lParam);
sz->rgrc[0].bottom -= 3;
return 0;
}

Choose a reason for hiding this comment

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

While we're at it, can we add one more condition to ignore WM_NCCALCSIZE handling?

It won't break the plugin; we are implementing our in-house fullscreen mechanism in package:media_kit; and it will be great to have it compatible with package:window_manager.

Suggested change
if (!(GetWindowLongPtr(hWnd, GWL_STYLE) & WS_OVERLAPPEDWINDOW))
return 0;
}

Copy link

@alexmercerind alexmercerind left a comment

Choose a reason for hiding this comment

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

One more feedback:

In the current fullscreen implementation for Win32, you'll notice that window behaves oddly if you make the fullscreen while the window is maximized. It kind of flickers back to restored mode before going fullscreen.

Please use this fullscreen implementation. The most stable that can be achieved.

Forget the license; you have my permission.

@alexmercerind
Copy link

Thanks!

@damywise
Copy link
Contributor Author

Hi @alexmercerind, thank you so much for your review! Unfortunately, I am unable to implement nor test your changes and suggestions since I made this pull request during the only 3 days I had access to a Windows machine.
I currently don't have access to it until maybe 2 weeks, sorry about that!
Also I don't have a working Windows VM so, yeah, gonna take quite a while.

@lijy91
Copy link
Member

lijy91 commented Jul 1, 2023

LGTM

@lijy91 lijy91 merged commit 88f2842 into leanflutter:main Jul 1, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment