diff options
author | wm4 <wm4@mplayer2.org> | 2011-12-07 01:36:19 +0100 |
---|---|---|
committer | wm4 <wm4@mplayer2.org> | 2012-03-17 21:06:30 +0100 |
commit | 1bb08fc1e6b02d8a043005bd498b4d5a7e5a57bd (patch) | |
tree | 9d09e1878a007c30ef6e8995a4b899dbac7f9330 /libvo/w32_common.c | |
parent | 7c6a4e1e98c29ea853c6f7fdf9a3e5a3668006b5 (diff) | |
download | mpv-1bb08fc1e6b02d8a043005bd498b4d5a7e5a57bd.tar.bz2 mpv-1bb08fc1e6b02d8a043005bd498b4d5a7e5a57bd.tar.xz |
win32: properly set window title
Set the window title on win32 based VOs using the same logic as on X11
and Cocoa.
Until now, the window title when using vo_direct3d and vo_gl was hardcoded
to "MPlayer - The Movie Player", and vo_directx showed "MPlayer". Now it
will show "mplayer2", unless the --title or --use-filename-title options
are used.
Change the internal window class name to the string "mplayer2" too.
Diffstat (limited to 'libvo/w32_common.c')
-rw-r--r-- | libvo/w32_common.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libvo/w32_common.c b/libvo/w32_common.c index 8dcd8a1708..bbcf110686 100644 --- a/libvo/w32_common.c +++ b/libvo/w32_common.c @@ -31,6 +31,8 @@ #include "aspect.h" #include "w32_common.h" #include "mp_fifo.h" +#include "osdep/io.h" +#include "talloc.h" #ifndef WM_XBUTTONDOWN # define WM_XBUTTONDOWN 0x020B @@ -44,7 +46,7 @@ #define WIN_ID_TO_HWND(x) ((HWND)(uint32_t)(x)) -static const char classname[] = "MPlayer - The Movie Player"; +static const char classname[] = "mplayer2"; int vo_vm = 0; static int depthonscreen; @@ -402,7 +404,7 @@ static void resetMode(void) { ChangeDisplaySettings(0, 0); } -// Update the window position, size, and border style from vo_* values. +// Update the window title, position, size, and border style from vo_* values. static int reinit_window_state(void) { const LONG NO_FRAME = WS_POPUP; const LONG FRAME = WS_OVERLAPPEDWINDOW | WS_SIZEBOX; @@ -412,6 +414,10 @@ static int reinit_window_state(void) { if (WinID >= 0) return 1; + wchar_t *title = mp_from_utf8(NULL, vo_get_window_title(global_vo)); + SetWindowTextW(vo_window, title); + talloc_free(title); + bool toggle_fs = current_fs != vo_fs; current_fs = vo_fs; |