summaryrefslogtreecommitdiffstats
path: root/osdep
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-02-16 13:07:15 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-02-28 00:48:44 -0800
commit938ad6ebc037ebb32b41619a31b15f8ade712867 (patch)
treefc8c27e6c73f79a75de42032dabdd3650ef54601 /osdep
parenta4c436bac26cc9a6f257764bbb268adde8ef8496 (diff)
downloadmpv-938ad6ebc037ebb32b41619a31b15f8ade712867.tar.bz2
mpv-938ad6ebc037ebb32b41619a31b15f8ade712867.tar.xz
cocoa-cb: change border and borderless window styling
the title bar is now within the window bounds instead of outside. same as QuickTime Player. it supports several standard styles, two dark and two light ones. additionally we have properly rounded corners now and the borderless window also has the proper window shadow. Also make the earliest supported macOS version 10.10. Fixes #4789, #3944
Diffstat (limited to 'osdep')
-rw-r--r--osdep/macOS_mpv_helper.swift1
-rw-r--r--osdep/macosx_application.m16
2 files changed, 17 insertions, 0 deletions
diff --git a/osdep/macOS_mpv_helper.swift b/osdep/macOS_mpv_helper.swift
index 15081d0133..c8b9771ba6 100644
--- a/osdep/macOS_mpv_helper.swift
+++ b/osdep/macOS_mpv_helper.swift
@@ -39,6 +39,7 @@ class MPVHelper: NSObject {
mpv_observe_property(mpvHandle, 0, "ontop", MPV_FORMAT_FLAG)
mpv_observe_property(mpvHandle, 0, "border", MPV_FORMAT_FLAG)
mpv_observe_property(mpvHandle, 0, "keepaspect-window", MPV_FORMAT_FLAG)
+ mpv_observe_property(mpvHandle, 0, "macos-title-bar-style", MPV_FORMAT_STRING)
}
func setGLCB() {
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m
index a65910ec9e..fe117f7a1c 100644
--- a/osdep/macosx_application.m
+++ b/osdep/macosx_application.m
@@ -23,6 +23,7 @@
#include "common/msg.h"
#include "input/input.h"
#include "player/client.h"
+#include "options/m_config.h"
#import "osdep/macosx_application_objc.h"
#include "osdep/macosx_compat.h"
@@ -39,6 +40,21 @@
#define MPV_PROTOCOL @"mpv://"
+struct macos_opts {
+ int macos_title_bar_style;
+};
+
+#define OPT_BASE_STRUCT struct macos_opts
+const struct m_sub_options macos_conf = {
+ .opts = (const struct m_option[]) {
+ OPT_CHOICE("macos-title-bar-style", macos_title_bar_style, 0,
+ ({"dark", 0}, {"ultradark", 1}, {"light", 2},
+ {"mediumlight", 3}, {"auto", 4})),
+ {0}
+ },
+ .size = sizeof(struct macos_opts),
+};
+
// Whether the NSApplication singleton was created. If this is false, we are
// running in libmpv mode, and cocoa_main() was never called.
static bool application_instantiated;