diff options
-rw-r--r-- | etc/mpv.desktop | 2 | ||||
-rw-r--r-- | player/main.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/etc/mpv.desktop b/etc/mpv.desktop index 7bdeee3be7..07564205fd 100644 --- a/etc/mpv.desktop +++ b/etc/mpv.desktop @@ -24,7 +24,7 @@ Comment[zh-CN]=播放电影和歌曲 Comment[zh-TW]=播放電影和歌曲 Icon=mpv TryExec=mpv -Exec=mpv --no-terminal --force-window -- %U +Exec=mpv --profile=pseudo-gui -- %U Terminal=false NoDisplay=true Categories=AudioVideo;Audio;Video;Player;TV; diff --git a/player/main.c b/player/main.c index b3fb14ef10..7f0e61f9e4 100644 --- a/player/main.c +++ b/player/main.c @@ -313,6 +313,13 @@ static int cfg_include(void *ctx, char *filename, int flags) return r; } +static void add_default_profiles(struct m_config *cfg) +{ + struct m_profile *ui = m_config_add_profile(cfg, "pseudo-gui"); + m_config_set_profile_option(cfg, ui, bstr0("terminal"), bstr0("no")); + m_config_set_profile_option(cfg, ui, bstr0("force-window"), bstr0("yes")); +} + struct MPContext *mp_create(void) { mp_time_init(); @@ -346,6 +353,7 @@ struct MPContext *mp_create(void) mpctx->mconfig->includefunc_ctx = mpctx; mpctx->mconfig->use_profiles = true; mpctx->mconfig->is_toplevel = true; + add_default_profiles(mpctx->mconfig); mpctx->global->opts = mpctx->opts; |