{"id":40458,"date":"2022-06-01T17:26:05","date_gmt":"2022-06-01T17:26:05","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=40458"},"modified":"2024-05-06T06:33:51","modified_gmt":"2024-05-06T06:33:51","slug":"mpv-no-title-bar-border-ubuntu-2204","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/06\/mpv-no-title-bar-border-ubuntu-2204\/","title":{"rendered":"[Workaround] MPV has No title-bar &#038; window border in Ubuntu 24.04 | 22.04"},"content":{"rendered":"<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-logo.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-40459\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-logo-250x250.webp\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-logo-250x250.webp 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-logo-300x300.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-logo-600x600.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-logo-768x768.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-logo.webp 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/a><\/p>\n<p>Since Ubuntu 22.04, you&#8217;ll find that the MPV media player does NOT have window border and title-bar out-of-the-box.<\/p>\n<p>That&#8217;s quite annoying! You can no longer drag resizing the app window. And, title bar buttons (<i>minimize, maximize, and close<\/i>) only appear when you hover over the window during video playback.<\/p>\n<div id=\"attachment_40462\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-wayland-default.webp\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-40462\" class=\"size-large wp-image-40462\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-wayland-default-600x338.webp\" alt=\"\" width=\"600\" height=\"338\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-wayland-default-600x338.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-wayland-default-300x169.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-wayland-default-768x432.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-wayland-default.webp 1280w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-40462\" class=\"wp-caption-text\">MPV no window border and title bar<\/p><\/div>\n<h3>Why:<\/h3>\n<p><b>It&#8217;s NOT feature but a bug! Someone has reported the <a href=\"https:\/\/github.com\/mpv-player\/mpv\/issues\/139\" target=\"_blank\" rel=\"noopener\">issue<\/a> almost 9 years ago. Though, it&#8217;s still not been fixed due to GNOME Wayland protocol.<\/b><\/p>\n<p>You know, MPV is a command line media player. It does not use the GUI toolkit for window borders, but the server-side protocol. However, GNOME developers do deliberately do not support the xdg-decoration protocol for server-side decorations in Wayland (via <a href=\"https:\/\/github.com\/mpv-player\/mpv\/wiki\/FAQ#I_use_GNOME_Wayland_and_I_have_xyz_problem\" target=\"_blank\" rel=\"noopener\">this FAQ<\/a>).<\/p>\n<p>Ubuntu 22.04 finally switched Wayland as the default session. So, the problem occurs.<\/p>\n<h3>Workaround 1: Switch back Xorg Session<\/h3>\n<p>Besides MPV, still many applications have compatibility issues with GNOME Wayland. <del>Even the Night Light feature does not work in Ubuntu 22.04 with this session<\/del>.<\/p>\n<p>As a workaround, user may switch back to the classic Xorg session. To do so, <b>simply log out, click your username in login screen, then select &#8220;<i>Ubuntu on Xorg<\/i>&#8221; via the bottom right gear button menu, and finally type password to log in.<\/b><\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/select-xorg.webp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-38960\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/select-xorg-600x354.webp\" alt=\"\" width=\"600\" height=\"354\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/select-xorg-600x354.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/select-xorg-300x177.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/select-xorg.webp 716w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>To verify your current session either run <code>echo $XDG_SESSION_TYPE<\/code> command in terminal or check in &#8220;Settings -&gt; About -&gt; Windowing system&#8221;.<\/p>\n<h3>Workaround 2: Run MPV via X11 backend<\/h3>\n<p>For those prefer GNOME Wayland session, it&#8217;s possible to run MPV media player via X11 backend without switch session.<\/p>\n<p>1.) To start video playback from command line, use command:<\/p>\n<pre>mpv --gpu-context=x11egl --hwdec=vaapi-copy PATH\/TO\/VIDEO_FILE<\/pre>\n<p>Here <code>--gpu-context=x11egl<\/code> tells to use x11 backend for video playback. And, <code>--hwdec=vaapi-copy<\/code> is required to enable GPU hardware acceleration in this case.<\/p>\n<p><i>Thanks to S. Likhitrattanapisal, you may try <code>--hwdec=vaapi<\/code> flag to enable hwacc. Though it may not work, it depends on your hardware.<\/i><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-40464\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-x11backend-600x225.webp\" alt=\"\" width=\"600\" height=\"225\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-x11backend-600x225.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-x11backend-300x113.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-x11backend-768x288.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-x11backend.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>2.) To enable this for global use, you may add the flags into MPV configuration file.<\/p>\n<p>Press <b>Ctrl+Alt+T<\/b> on keyboard to open terminal. When terminal opens, make a copy of configuration file first via command:<\/p>\n<pre>sudo cp \/etc\/mpv\/mpv.conf \/etc\/mpv\/mpv.conf.bak<\/pre>\n<p>Then, edit the file via command:<\/p>\n<pre>sudo xdg-open \/etc\/mpv\/mpv.conf<\/pre>\n<p>When file opens, add the following new line:<\/p>\n<blockquote><p>gpu-context=x11egl<\/p><\/blockquote>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-40466\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-config-x11backend-600x289.webp\" alt=\"\" width=\"600\" height=\"289\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-config-x11backend-600x289.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-config-x11backend-300x144.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-config-x11backend-768x369.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/mpv-config-x11backend.webp 948w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>After saving the changes, start playing your movie via MPV. The window border as well as title-bar should be back!<\/p>\n<h3>Workaround 3: Use GUI front-end<\/h3>\n<p>There are a few media players that use MPV as backend. As far as I know, there are SMPlayer and Celluloid (formerly GNOME MPV), both of which are available to install via Ubuntu Software (or App Center).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-40467\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/celluloid-600x342.webp\" alt=\"\" width=\"600\" height=\"342\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/celluloid-600x342.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/celluloid-300x171.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/celluloid-768x438.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/06\/celluloid.webp 1053w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>","protected":false},"excerpt":{"rendered":"<p>Since Ubuntu 22.04, you&#8217;ll find that the MPV media player does NOT have window border and title-bar out-of-the-box. That&#8217;s quite annoying! You can no longer drag resizing the app window. And, title bar buttons (minimize, maximize, and close) only appear when you hover over the window during video playback. Why: It&#8217;s NOT feature but a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":40459,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[614],"class_list":["post-40458","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-media-player"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/40458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=40458"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/40458\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/40459"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=40458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=40458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=40458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}