mirror of
https://github.com/mpv-player/mpv
synced 2025-02-24 00:46:58 +00:00
cocoa: refactor init window positioning code
This commit is contained in:
parent
635424c8f0
commit
812f149585
@ -262,7 +262,7 @@ static void create_window(struct vo *vo, uint32_t d_width, uint32_t d_height,
|
|||||||
struct vo_cocoa_state *s = vo->cocoa;
|
struct vo_cocoa_state *s = vo->cocoa;
|
||||||
struct mp_vo_opts *opts = vo->opts;
|
struct mp_vo_opts *opts = vo->opts;
|
||||||
|
|
||||||
const NSRect contentRect = NSMakeRect(0, 0, d_width, d_height);
|
const NSRect contentRect = NSMakeRect(vo->dx, vo->dy, d_width, d_height);
|
||||||
|
|
||||||
int window_mask = 0;
|
int window_mask = 0;
|
||||||
if (opts->border) {
|
if (opts->border) {
|
||||||
@ -299,7 +299,6 @@ static void create_window(struct vo *vo, uint32_t d_width, uint32_t d_height,
|
|||||||
[s->window setDelegate:s->window];
|
[s->window setDelegate:s->window];
|
||||||
[s->window makeMainWindow];
|
[s->window makeMainWindow];
|
||||||
|
|
||||||
[s->window setFrameOrigin:NSMakePoint(vo->dx, vo->dy)];
|
|
||||||
[s->window makeKeyAndOrderFront:nil];
|
[s->window makeKeyAndOrderFront:nil];
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user