win32: window styles improvements

Allow minimizing the borderless/fullscreen window by clicking on the
taskbar button or pressing Win+Down hotkey.

Also fixes #2229 and probably fixes #2451
This commit is contained in:
pavelxdd 2016-12-11 00:01:39 +03:00 committed by James Ross-Gowan
parent 765a7228d1
commit bf5727a60f
1 changed files with 9 additions and 4 deletions

View File

@ -1112,10 +1112,15 @@ static void update_screen_rect(struct vo_w32_state *w32)
static DWORD update_style(struct vo_w32_state *w32, DWORD style)
{
const DWORD NO_FRAME = WS_OVERLAPPED;
const DWORD FRAME = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
style &= ~(NO_FRAME | FRAME);
style |= (w32->opts->border && !w32->current_fs) ? FRAME : NO_FRAME;
const DWORD NO_FRAME = WS_OVERLAPPED | WS_MINIMIZEBOX;
const DWORD FRAME = WS_OVERLAPPEDWINDOW;
const DWORD FULLSCREEN = NO_FRAME | WS_SYSMENU;
style &= ~(NO_FRAME | FRAME | FULLSCREEN);
if (w32->current_fs) {
style |= FULLSCREEN;
} else {
style |= w32->opts->border ? FRAME : NO_FRAME;
}
return style;
}