Commit 9c3dd03b authored by Felix Paul Kühne's avatar Felix Paul Kühne

vout_macosx: re-write VOUT_DISPLAY_CHANGE_FULLSCREEN the way it was intended...

vout_macosx: re-write VOUT_DISPLAY_CHANGE_FULLSCREEN the way it was intended and update the display size correctly, so we get sharp OSD rendering
(cherry picked from commit 4a10b45f3147f524ce09bff7b939d09a3f59f108)
parent ba72805f
...@@ -313,16 +313,33 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -313,16 +313,33 @@ static int Control (vout_display_t *vd, int query, va_list ap)
{ {
case VOUT_DISPLAY_CHANGE_FULLSCREEN: case VOUT_DISPLAY_CHANGE_FULLSCREEN:
{ {
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init]; const vout_display_cfg_t *cfg = va_arg (ap, const vout_display_cfg_t *);
id window = [sys->glView window]; if (vout_window_SetFullScreen (sys->embed, cfg->is_fullscreen))
if ([window respondsToSelector:@selector(updateFullscreen)]) return VLC_EGENERIC;
{
[[sys->glView window] performSelectorOnMainThread:@selector(updateFullscreen) withObject: nil waitUntilDone:NO]; NSRect frame;
[o_pool release];
return VLC_SUCCESS; /* when entering fullscreen, set the OSD / display size to the visible screen size.
} * this way, the text rendering will be as sharp as possible.
[o_pool release]; * when returning from fullscreen, pick the dimensions from cfg, which can be different
return VLC_EGENERIC; * from the native video size because of crop and zoom */
if (cfg->is_fullscreen)
frame = [[[sys->glView window] screen] visibleFrame];
else
frame = NSMakeRect( 0., 0., cfg->display.width, cfg->display.height );
vout_display_SendEventDisplaySize( vd, frame.size.width, frame.size.height, cfg->is_fullscreen );
const video_format_t * source;
source = &vd->source;
vout_display_cfg_t place_cfg = *cfg;
place_cfg.display.width = frame.size.width;
place_cfg.display.height = frame.size.height;
vout_display_place_t place;
vout_display_PlacePicture(&place, source, &place_cfg, false);
return VLC_SUCCESS;
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE: case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{ {
...@@ -405,6 +422,7 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -405,6 +422,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
} }
else else
{ {
// VOUT_DISPLAY_CHANGE_ZOOM, VOUT_DISPLAY_CHANGE_DISPLAY_FILLED, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
const vout_display_cfg_t *cfg; const vout_display_cfg_t *cfg;
const video_format_t *source; const video_format_t *source;
bool is_forced = false; bool is_forced = false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment