mirror of
https://github.com/mpv-player/mpv
synced 2025-02-17 21:27:08 +00:00
win32: update maximized state when leaving fullscreen
If the window-maximized is set while in fullscreen, it needs to be applied when leaving fullscreen, as noted in the comment.
This commit is contained in:
parent
2be8976d59
commit
ee586c526d
@ -1023,14 +1023,13 @@ static void update_minimized_state(struct vo_w32_state *w32)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void update_maximized_state(struct vo_w32_state *w32)
|
static void update_maximized_state(struct vo_w32_state *w32, bool leaving_fullscreen)
|
||||||
{
|
{
|
||||||
if (w32->parent)
|
if (w32->parent)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Don't change the maximized state in fullscreen for now. In future, this
|
// Apply the maximized state on leaving fullscreen.
|
||||||
// should be made to apply the maximized state on leaving fullscreen.
|
if (w32->current_fs && !leaving_fullscreen)
|
||||||
if (w32->current_fs)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
WINDOWPLACEMENT wp = { .length = sizeof wp };
|
WINDOWPLACEMENT wp = { .length = sizeof wp };
|
||||||
@ -1099,7 +1098,7 @@ static void update_window_state(struct vo_w32_state *w32)
|
|||||||
if (!is_visible(w32->window)) {
|
if (!is_visible(w32->window)) {
|
||||||
if (w32->opts->window_minimized) {
|
if (w32->opts->window_minimized) {
|
||||||
ShowWindow(w32->window, SW_SHOWMINNOACTIVE);
|
ShowWindow(w32->window, SW_SHOWMINNOACTIVE);
|
||||||
update_maximized_state(w32); // Set the WPF_RESTORETOMAXIMIZED flag
|
update_maximized_state(w32, false); // Set the WPF_RESTORETOMAXIMIZED flag
|
||||||
} else if (w32->opts->window_maximized) {
|
} else if (w32->opts->window_maximized) {
|
||||||
ShowWindow(w32->window, SW_SHOWMAXIMIZED);
|
ShowWindow(w32->window, SW_SHOWMAXIMIZED);
|
||||||
} else {
|
} else {
|
||||||
@ -2075,6 +2074,8 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg)
|
|||||||
struct mp_vo_opts *vo_opts = w32->opts_cache->opts;
|
struct mp_vo_opts *vo_opts = w32->opts_cache->opts;
|
||||||
|
|
||||||
if (changed_option == &vo_opts->fullscreen) {
|
if (changed_option == &vo_opts->fullscreen) {
|
||||||
|
if (!vo_opts->fullscreen)
|
||||||
|
update_maximized_state(w32, true);
|
||||||
reinit_window_state(w32);
|
reinit_window_state(w32);
|
||||||
} else if (changed_option == &vo_opts->window_affinity) {
|
} else if (changed_option == &vo_opts->window_affinity) {
|
||||||
update_affinity(w32);
|
update_affinity(w32);
|
||||||
@ -2092,7 +2093,7 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg)
|
|||||||
} else if (changed_option == &vo_opts->window_minimized) {
|
} else if (changed_option == &vo_opts->window_minimized) {
|
||||||
update_minimized_state(w32);
|
update_minimized_state(w32);
|
||||||
} else if (changed_option == &vo_opts->window_maximized) {
|
} else if (changed_option == &vo_opts->window_maximized) {
|
||||||
update_maximized_state(w32);
|
update_maximized_state(w32, false);
|
||||||
} else if (changed_option == &vo_opts->window_corners) {
|
} else if (changed_option == &vo_opts->window_corners) {
|
||||||
update_corners_pref(w32);
|
update_corners_pref(w32);
|
||||||
} else if (changed_option == &vo_opts->geometry || changed_option == &vo_opts->autofit ||
|
} else if (changed_option == &vo_opts->geometry || changed_option == &vo_opts->autofit ||
|
||||||
|
Loading…
Reference in New Issue
Block a user