diff options
author | der richter <der.richter@gmx.de> | 2020-12-13 17:13:18 +0100 |
---|---|---|
committer | Jan Ekström <jeebjp@gmail.com> | 2020-12-19 21:37:55 +0200 |
commit | af264029483656e04458a678849165f0340433ab (patch) | |
tree | d09a264ac37f67089b7baeb6003efeaed985119a /osdep | |
parent | 93d071dbd8fb8b9561e1830754c40f3de87cf3ca (diff) | |
download | mpv-af264029483656e04458a678849165f0340433ab.tar.bz2 mpv-af264029483656e04458a678849165f0340433ab.tar.xz |
mac: use visible frame rectangle for window geometry calculation
currently we use the whole screen rectangle to calculate the window
geometry. this doesn't take the menu bar or the Dock into account.
by default use the visible screen rectangle instead. this is also a
change in behaviour, since the window can't be placed outside of this
rectangle anymore. also add an option to change to the old behaviour,
because it can still be useful in certain cases, like placing the window
directly underneath the menu bar when used a desktop background.
Fixes #8272
Diffstat (limited to 'osdep')
-rw-r--r-- | osdep/macosx_application.h | 6 | ||||
-rw-r--r-- | osdep/macosx_application.m | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/osdep/macosx_application.h b/osdep/macosx_application.h index 9a366d81fb..05d0b07c07 100644 --- a/osdep/macosx_application.h +++ b/osdep/macosx_application.h @@ -21,6 +21,11 @@ #include "osdep/macosx_menubar.h" #include "options/m_option.h" +enum { + FRAME_VISIBLE = 0, + FRAME_WHOLE, +}; + struct macos_opts { int macos_title_bar_style; int macos_title_bar_appearance; @@ -29,6 +34,7 @@ struct macos_opts { int macos_fs_animation_duration; int macos_force_dedicated_gpu; int macos_app_activation_policy; + int macos_geometry_calculation; int cocoa_cb_sw_renderer; int cocoa_cb_10bit_context; }; diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index 95c6a3f953..bb8b67b575 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -65,6 +65,8 @@ const struct m_sub_options macos_conf = { {"macos-force-dedicated-gpu", OPT_FLAG(macos_force_dedicated_gpu)}, {"macos-app-activation-policy", OPT_CHOICE(macos_app_activation_policy, {"regular", 0}, {"accessory", 1}, {"prohibited", 2})}, + {"macos-geometry-calculation", OPT_CHOICE(macos_geometry_calculation, + {"visible", FRAME_VISIBLE}, {"whole", FRAME_WHOLE})}, {"cocoa-cb-sw-renderer", OPT_CHOICE(cocoa_cb_sw_renderer, {"auto", -1}, {"no", 0}, {"yes", 1})}, {"cocoa-cb-10bit-context", OPT_FLAG(cocoa_cb_10bit_context)}, |