Similar to other platforms. Also make sure that the x/y positions are set on geometry update.
Unified · Split
| @@ -1739,9 +1739,8 @@ static void run_message_loop(struct vo_w32_state *w32) · 1738 unmodified lines | ||
| 1739 | 1739 | mp_dispatch_queue_process(w32->dispatch, 1000); |
| 1740 | 1740 | } |
| 1741 | 1741 | |
| 1742 | −static void gui_thread_reconfig(void *ptr) | |
| 1742 | +static void window_reconfig(struct vo_w32_state *w32, bool force) | |
| 1743 | 1743 | { |
| 1744 | − struct vo_w32_state *w32 = ptr; | |
| 1745 | 1744 | struct vo *vo = w32->vo; |
| 1746 | 1745 | |
| 1747 | 1746 | RECT r = get_working_area(w32); |
| @@ -1764,14 +1763,14 @@ static void gui_thread_reconfig(void *ptr) · 16 unmodified lines | ||
| 1764 | 1763 | vo_calc_window_geometry3(vo, &screen, &mon, w32->dpi_scale, &geo); |
| 1765 | 1764 | vo_apply_window_geometry(vo, &geo); |
| 1766 | 1765 | |
| 1767 | − bool reset_size = (w32->o_dwidth != vo->dwidth || | |
| 1766 | + bool reset_size = ((w32->o_dwidth != vo->dwidth || | |
| 1768 | 1767 | w32->o_dheight != vo->dheight) && |
| 1769 | − w32->opts->auto_window_resize; | |
| 1768 | + w32->opts->auto_window_resize) || force; | |
| 1770 | 1769 | |
| 1771 | 1770 | w32->o_dwidth = vo->dwidth; |
| 1772 | 1771 | w32->o_dheight = vo->dheight; |
| 1773 | 1772 | |
| 1774 | − if (!w32->parent && !w32->window_bounds_initialized) { | |
| 1773 | + if (!w32->parent && (!w32->window_bounds_initialized || force)) { | |
| 1775 | 1774 | SetRect(&w32->windowrc, geo.win.x0, geo.win.y0, |
| 1776 | 1775 | geo.win.x0 + vo->dwidth, geo.win.y0 + vo->dheight); |
| 1777 | 1776 | w32->prev_windowrc = w32->windowrc; |
| @@ -1802,6 +1801,11 @@ finish: · 24 unmodified lines | ||
| 1802 | 1801 | reinit_window_state(w32); |
| 1803 | 1802 | } |
| 1804 | 1803 | |
| 1804 | +static void gui_thread_reconfig(void *ptr) | |
| 1805 | +{ | |
| 1806 | + window_reconfig(ptr, false); | |
| 1807 | +} | |
| 1808 | + | |
| 1805 | 1809 | // Resize the window. On the first call, it's also made visible. |
| 1806 | 1810 | void vo_w32_config(struct vo *vo) |
| 1807 | 1811 | { |
| @@ -2077,6 +2081,10 @@ static int gui_thread_control(struct vo_w32_state *w32, int request, void *arg) · 269 unmodified lines | ||
| 2077 | 2081 | update_maximized_state(w32); |
| 2078 | 2082 | } else if (changed_option == &vo_opts->window_corners) { |
| 2079 | 2083 | update_corners_pref(w32); |
| 2084 | + } else if (changed_option == &vo_opts->geometry || changed_option == &vo_opts->autofit || | |
| 2085 | + changed_option == &vo_opts->autofit_smaller || changed_option == &vo_opts->autofit_larger) | |
| 2086 | + { | |
| 2087 | + window_reconfig(w32, true); | |
| 2080 | 2088 | } |
| 2081 | 2089 | } |
| 2082 | 2090 | |