win32: remove SC_RESTORE handling#16127
Conversation
|
@na-na-hi do you know where this would be needed? I couldn't reproduce on my end. Maybe it was FSE mode that is no longer with us. |
|
Download the artifacts for this pull request: |
After a maximized window is put in fullscreen, when you press win+down, it exits fullscreen in a maximized state. |
I see, but what is expected behavior in this case? Shouldn't it exit fullscreen? Same as win+down goes from maximized to windowed first. |
It does. As I already said, currently win+down in fullscreen exits fullscreen if |
But if it is not maximized it minimize instead. Is this expected to you? I found dozen other bugs when testing this again, so we can postpone this discussion. I only wanted to know if this is expected that |
win+down on a non-maximized window normally minimizes it. Technically I don't think there is any expected behavior in this case. As long as it does not leave the window in a buggy state it should be fine. |
|
@na-na-hi: Could you help testing this one? I had it long in the backlog. Let me know of any undesirable behavior, maybe we will manage to get this in. |
d857d7a to
32dae59
Compare
|
The latest version still has this issue: #16127 (comment) |
Should be fine now, could you try again? |
That issue is fixed but there is a new one: maximize, fullscreen, then print the value of |
Updated. One thing I really wanted to have is to keep Hopefully, this doesn't cause domino effect in some other parts. But when it really matters, I tried to use |
|
Will merge if there are no more comments. |
|
Setting Setting |
Fixed.
Would you prefer to contain whole window in working area? Or only top-left corner? What if user moves 90% of window outside of screen? Should we on resize bring it fully in view? |
ac6d090 to
86c0744
Compare
I've added explicit size constrain also for geometry. Let me know what do you think. Previously it was constrained by Windows in this case. |
|
@na-na-hi: have you had a chance to retest this? |
Options may be at different state when caller is using it's own cached copy. This makes opts consistent in usage.
Will be useful to limit the size directly based on platform requirement.
We don't support other ways of fullscreening. Fixes: mpv-player#16119
It doesn't seem to be neeeded anymore.
Fixes lots of issues with current window resizing and window style modifications.
|
The behavior of the On Windows 11, Display Resolution: 2560x1440
It seems that the border has an impact on the calculation result. If the |
Yes, it does. And there is good reason for this.
Now if you do 50% of usable available space it will be smaller than 50% of display resolution and this is what happens. You may say now, why not calculate it from display resolution. Because in this case there are all sort of other issues, first The easiest to think about this is when you think what happens when I know that intuitively 50% should give 50% of screen size, but you need to account for borders, taskbars and so on. This makes positioning and sizing consistent across all the decorations option. If you need exact size, use tl;dr You are setting window size, not video size. |
I personally never set the exact size because it doesn't work well on multi-display. e.g. If the primary display is 4k and and the non-primary display is 1080p, the calculation result of percentage size now differs between bordered and borderless window, making it almost impossible to set the desired target video size in bordered window, as there may always be a few pixel difference, for example, 50% is a few pixels smaller, while 51% is a few pixels larger. |
|
This make it impossible to go back to windowed maximized state :/ for years since borderless windowed with taskbar hasn't really been possible any other way for years (an official way would be nice). |
That's fair. But you have to pick your poison. % is a %, you may not get the exact same numeric values, but it will be exactly the amount you requested. @Jules-A: I don't understand what you are trying to achieve. Is this what you want? @na-na-hi: Do you have opinion of autofit and decorations? This could be fixed, by autofitting to monitor dimensions, instead of working area, but still size constrain to screen. I feel like the current approach is correct, from the math point of view. Because it's consistent scaling across whole 0-100%. diff --git a/video/out/win_state.c b/video/out/win_state.c
index 3ca22fecf3..fc409cf29f 100644
--- a/video/out/win_state.c
+++ b/video/out/win_state.c
@@ -121,9 +121,9 @@ void vo_calc_window_geometry(struct vo *vo, struct mp_vo_opts *opts,
calc_monitor_aspect(opts, mon_w, mon_h, &out_geo->monitor_par, &d_w, &d_h);
- apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit, true, true);
- apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit_smaller, true, false);
- apply_autofit(&d_w, &d_h, scr_w, scr_h, &opts->autofit_larger, false, true);
+ apply_autofit(&d_w, &d_h, mon_w, mon_h, &opts->autofit, true, true);
+ apply_autofit(&d_w, &d_h, mon_w, mon_h, &opts->autofit_smaller, true, false);
+ apply_autofit(&d_w, &d_h, mon_w, mon_h, &opts->autofit_larger, false, true);
if (size_constraint)
apply_autofit(&d_w, &d_h, scr_w, scr_h, size_constraint, false, true); |
It is but it's always been and still is buggy. Most notably I wasn't able to double click twice to re-enter windowed-maximized state (which doesn't matter now that it doesn't work with geometry) and when I go to resize, it's no longer able to be resized to fit the windowed-maximized size because it removes the black bars on the side and keeps assuming fullscreen resolution. Also I can still reproduce #8728 with windows-maximized. |
Sorry, I don't know what steps you are doing. Could you report issue, with clear 1 2 3 steps to reproduce the unexpected behavior? Once I will be able to reproduce, I can fix that. |
Hmm... I could have sworn there was an old bug open with it already but I can't find it now, possibly been closed with a partial fix. There's tonne of related issues, I'll have to look better next time when I get more time then create an issue if I can't find it I guess. Some of these related issues you'd likely end up running into what I'm describing while trying to fix them though... |
|
This PR also causes MPV opening to now play the Windows 10 opening animation instead of opening instantly which is extremely annoying, was that intentional??? Do you know if there's any way to disable it without having to disable it system-wide? If you're wondering why I don't it's because it causes bugs in many programs like Explorer that causes white flashes. |
|
There also seems to be an issue with geometry positioning now. Setting Works as expected when set at runtime. |
Weirdly enough this works fine for me on Windows 11 at least. Your description is pretty clear, however. Before we show window, DWM will not give us correct invisible border sizes, so when we move window to 0:0 it is actually not taking into account. I wonder what's the diff that it works differently for you, I can try on Windows 10 later to see. |
DWMWA_EXTENDED_FRAME_BOUNDS is not available before window is shown, so show it off-screen to get correct values. Fixes: mpv-player#16127 (comment)
DWMWA_EXTENDED_FRAME_BOUNDS is not available before window is shown, so show it off-screen to get correct values. Fixes: mpv-player#16127 (comment)
DWMWA_EXTENDED_FRAME_BOUNDS is not available before window is shown, so show it off-screen to get correct values. Fixes: mpv-player#16127 (comment)
DWMWA_EXTENDED_FRAME_BOUNDS is not available before window is shown, so show it off-screen to get correct values. Fixes: #16127 (comment)




No description provided.