「Wayland」の版間の差分
(→ディスプレイマネージャ: 英語版から翻訳, 2019.5時点でのWayland対応状況追記) |
|||
(3人の利用者による、間の13版が非表示) | |||
1行目: | 1行目: | ||
− | [[Category: |
+ | [[Category:グラフィカルユーザーインターフェイス]] |
[[es:Wayland]] |
[[es:Wayland]] |
||
[[en:Wayland]] |
[[en:Wayland]] |
||
[[fr:Wayland]] |
[[fr:Wayland]] |
||
[[ru:Wayland]] |
[[ru:Wayland]] |
||
− | [[zh- |
+ | [[zh-hans:Wayland]] |
{{Related articles start}} |
{{Related articles start}} |
||
{{Related|Kernel Mode Setting}} |
{{Related|Kernel Mode Setting}} |
||
11行目: | 11行目: | ||
{{Related|カーソルテーマ}} |
{{Related|カーソルテーマ}} |
||
{{Related articles end}} |
{{Related articles end}} |
||
− | '''Wayland''' は Linux の新しいウィンドウプロトコルです。Wayland |
+ | '''Wayland''' は Linux の新しいウィンドウプロトコルです。[[GNOME]] や [[KDE]] などの主要な Linux デスクトップは Wayland に対応しており、"Weston" という名前のコンポジタのリファレンス実装も存在します。Wayland で昔の X11 アプリケーションを動作させるための互換レイヤーとして [https://wayland.freedesktop.org/xserver.html XWayland] があります。 |
− | |||
− | {{Warning|Wayland は開発途上です。まだ機能は完全ではありません。}} |
||
== 要件 == |
== 要件 == |
||
今のところ Wayland は [[KMS]] を利用しているシステムでしか動作できません。 |
今のところ Wayland は [[KMS]] を利用しているシステムでしか動作できません。 |
||
+ | また、Wayland はただのライブラリなので、それだけでは使い物になりません。X サーバーを置き換えるには、([[#Weston|Weston]] や [[Sway]] などの) コンポジタあるいは ([[GNOME]] や [[KDE]] など) デスクトップ環境が必要です。 |
||
− | == インストール == |
||
− | ほとんどの場合 {{pkg|gtk2}} や {{pkg|gtk3}} の依存パッケージとして既に間接的に Wayland がインストールされているはずです。インストールされていない場合、[[公式リポジトリ]]から {{pkg|wayland}} をインストールしてください。 |
||
+ | === バッファ API のサポート === |
||
− | == 使用方法 == |
||
+ | |||
− | Wayland はただのライブラリなので、それだけでは使い物になりません。X サーバーを置き換えるには、(Weston などの) コンポジタが必要です。 |
||
+ | GPU ドライバーと Wayland コンポジタは同一のバッファ API に対応している場合に互換性があります。主要な API は2つ存在します: [[Wikipedia:Generic Buffer Management|GBM]] と [https://www.phoronix.com/scan.php?page=news_item&px=XDC2016-Device-Memory-API EGLStreams] です。 |
||
+ | |||
+ | {| class="wikitable" |
||
+ | |- |
||
+ | ! バッファ API !! GPU ドライバーのサポート !! Wayland コンポジタのサポート |
||
+ | |- |
||
+ | | GBM || [[NVIDIA]] 以外の全てのドライバー || 全てのコンポジタ |
||
+ | |- |
||
+ | | EGLStreams || [[NVIDIA]] || [[GNOME]], [[KDE]] ([https://www.phoronix.com/scan.php?page=news_item&px=EGLStreams-Merged-KWin-5.16 Plasma 5.16+]) |
||
+ | |- |
||
+ | |} |
||
== Weston == |
== Weston == |
||
+ | Weston は Wayland コンポジタのリファレンス実装です。 |
||
+ | |||
=== インストール === |
=== インストール === |
||
− | + | {{pkg|weston}} パッケージをインストールしてください。 |
|
=== 使用方法 === |
=== 使用方法 === |
||
42行目: | 52行目: | ||
画面に花を散らすには: |
画面に花を散らすには: |
||
$ weston-flower |
$ weston-flower |
||
− | |||
− | フレームプロトコルをテストするには ({{ic|glxgears}} を実行): |
||
− | $ weston-gears |
||
画像を表示するには: |
画像を表示するには: |
||
$ weston-image image1.jpg image2.jpg... |
$ weston-image image1.jpg image2.jpg... |
||
− | |||
− | PDF ファイルを表示するには: |
||
− | $ weston-view doc1.pdf doc2.pdf... |
||
=== 設定 === |
=== 設定 === |
||
− | キーボードレイアウト・モジュール・UI の設定ファイルの例です。詳しくは {{ |
+ | キーボードレイアウト・モジュール・UI の設定ファイルの例です。詳しくは {{man|5|weston.ini}} を見て下さい。Weston の出力設定は {{ic|xorg.conf}} のモニターと多少異なります: |
+ | |||
− | {{hc|~/.config/weston.ini| |
||
+ | $ ls /sys/class/drm |
||
− | <nowiki>[core] |
||
+ | card0 |
||
− | ### uncomment this line for xwayland support ### |
||
+ | card0-VGA-1 |
||
− | #modules=xwayland.so |
||
+ | card1 |
||
+ | card1-DVI-I-1 |
||
+ | card1-HDMI-A-1 |
||
+ | card1-VGA-2 |
||
+ | |||
+ | {{ic|card0}} は使われていない内蔵ビデオアダプタです。追加アダプタ {{ic|card1}} は HDMI と DVI モニターに接続されており、出力名が {{ic|HDMI-A-1}} と {{ic|DVI-I-1}} です。 |
||
+ | |||
+ | {{hc|~/.config/weston.ini|<nowiki> |
||
+ | [core] |
||
+ | # xwayland support |
||
+ | xwayland=true |
||
+ | |||
+ | [libinput] |
||
+ | enable_tap=true |
||
[shell] |
[shell] |
||
66行目: | 84行目: | ||
locking=true |
locking=true |
||
animation=zoom |
animation=zoom |
||
+ | close-animation=fade |
||
+ | focus-animation=dim-layer |
||
#binding-modifier=ctrl |
#binding-modifier=ctrl |
||
#num-workspaces=6 |
#num-workspaces=6 |
||
77行目: | 97行目: | ||
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg |
#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg |
||
#animation=fade |
#animation=fade |
||
+ | |||
+ | ### for Laptop displays ### |
||
+ | #[output] |
||
+ | #name=LVDS1 |
||
+ | #mode=1680x1050 |
||
+ | #transform=90 |
||
+ | |||
+ | #[output] |
||
+ | #name=VGA1 |
||
+ | # The following sets the mode with a modeline, you can get modelines for your preffered resolutions using the cvt utility |
||
+ | #mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync |
||
+ | #transform=flipped |
||
+ | |||
+ | #[output] |
||
+ | #name=X1 |
||
+ | #mode=1024x768 |
||
+ | #transform=flipped-270 |
||
+ | |||
+ | [input-method] |
||
+ | #path=/usr/lib/weston/weston-keyboard |
||
[keyboard] |
[keyboard] |
||
keymap_rules=evdev |
keymap_rules=evdev |
||
− | #keymap_layout=gb |
+ | #keymap_layout=gb,de |
#keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel |
#keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel |
||
### keymap_options from /usr/share/X11/xkb/rules/base.lst ### |
### keymap_options from /usr/share/X11/xkb/rules/base.lst ### |
||
+ | numlock-on=true |
||
[terminal] |
[terminal] |
||
90行目: | 131行目: | ||
[launcher] |
[launcher] |
||
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png |
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png |
||
− | path=/usr/bin/ |
+ | path=/usr/bin/weston-terminal |
[launcher] |
[launcher] |
||
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png |
icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png |
||
− | path=/usr/bin/ |
+ | path=/usr/bin/gnome-terminal |
[launcher] |
[launcher] |
||
101行目: | 142行目: | ||
[launcher] |
[launcher] |
||
− | icon=/usr/share/ |
+ | icon=/usr/share/weston/icon_flower.png |
− | path= |
+ | path=/usr/bin/weston-flower |
[screensaver] |
[screensaver] |
||
108行目: | 149行目: | ||
path=/usr/libexec/weston-screensaver |
path=/usr/libexec/weston-screensaver |
||
duration=600 |
duration=600 |
||
+ | </nowiki>}} |
||
+ | 最小の {{ic|weston.ini}}: |
||
− | [input-method] |
||
− | + | {{hc|~/.config/weston.ini|<nowiki> |
|
+ | [core] |
||
− | |||
+ | xwayland=true |
||
− | ### for Laptop displays ### |
||
− | #[output] |
||
− | #name=LVDS1 |
||
− | #mode=1680x1050 |
||
− | #transform=90 |
||
− | |||
− | #[output] |
||
− | #name=VGA1 |
||
− | # The following sets the mode with a modeline, you can get modelines for your preffered resolutions using the cvt utility |
||
− | #mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync |
||
− | #transform=flipped |
||
− | |||
− | #[output] |
||
− | #name=X1 |
||
− | #mode=1024x768 |
||
− | #transform=flipped-270</nowiki> |
||
− | }} |
||
− | |||
− | 最小設定の {{ic|weston.ini}}: |
||
− | {{hc|~/.config/weston.ini| |
||
− | <nowiki>[core] |
||
− | modules=xwayland.so |
||
[keyboard] |
[keyboard] |
||
keymap_layout=gb |
keymap_layout=gb |
||
+ | |||
+ | [output] |
||
+ | name=LVDS1 |
||
+ | mode=1680x1050 |
||
+ | transform=90 |
||
[launcher] |
[launcher] |
||
145行目: | 171行目: | ||
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png |
icon=/usr/share/icons/hicolor/24x24/apps/firefox.png |
||
path=/usr/bin/firefox |
path=/usr/bin/firefox |
||
+ | </nowiki>}} |
||
− | |||
− | [output] |
||
− | name=LVDS1 |
||
− | mode=1680x1050 |
||
− | transform=90</nowiki> |
||
− | }} |
||
==== XWayland ==== |
==== XWayland ==== |
||
− | + | {{Pkg|xorg-server-xwayland}} パッケージをインストールしてください。 |
|
Weston の中で X アプリケーションを動かすには、Xwayland を使ってリクエストを処理させます。以下の設定ファイルを作成してください: |
Weston の中で X アプリケーションを動かすには、Xwayland を使ってリクエストを処理させます。以下の設定ファイルを作成してください: |
||
{{hc|~/.config/weston.ini| |
{{hc|~/.config/weston.ini| |
||
<nowiki>[core] |
<nowiki>[core] |
||
− | + | xwayland=true</nowiki> |
|
}} |
}} |
||
+ | |||
+ | {{Note|X を設定していない場合、キーマップの設定が必要です: [[Xorg でのキーボード設定]]。}} |
||
==== スクリーンキャスト録画 ==== |
==== スクリーンキャスト録画 ==== |
||
− | Weston にはスクリーンキャスト機能が備わっており、{{ic|Super |
+ | Weston にはスクリーンキャスト機能が備わっており、{{ic|Super+r}} キーを押すことで録画を開始・停止することができます。スクリーンキャストは Weston のカレントディレクトリ内の {{ic|capture.wcap}} ファイルに保存されます。 |
− | |||
− | WCAP ファイルは Weston 専用のロスレス動画フォーマットで、フレーム間の差異だけを記録しています。記録されたスクリーンキャストを再生するには、WCAP ファイルをメディアプレイヤーが再生できるフォーマットに変換する必要があります。 |
||
− | |||
− | ファイルを webm に変換するには、次を実行: |
||
+ | WCAP ファイルは Weston 専用のロスレス動画フォーマットで、フレーム間の差異だけを記録しています。記録されたスクリーンキャストを再生するには、WCAP ファイルをメディアプレイヤーが再生できるフォーマットに変換する必要があります。まず、録画した動画を YUV ピクセル形式に変換してください: |
||
− | $ wcap-decode capture.wcap --yuv4mpeg2 | vpxenc --target-bitrate=1024 --best -t 4 -o foo.webm - |
||
+ | $ wcap-decode capture.wcap --yuv4mpeg2 > capture.y4m |
||
− | ファイルを ogv に変換するには、次を実行: |
||
+ | 作成された YUV ファイルは [[FFmpeg]] を使うことで他のフォーマットに変換できます。 |
||
− | $ wcap-decode capture.wcap --yuv4mpeg2 | theora_encode - -o cap.ogv |
||
==== HiDPI ディスプレイ ==== |
==== HiDPI ディスプレイ ==== |
||
− | + | Retina または [[HiDPI]] のディスプレイでは以下を使用してください: |
|
{{hc|~/.config/weston.ini|<nowiki> |
{{hc|~/.config/weston.ini|<nowiki> |
||
[output] |
[output] |
||
182行目: | 201行目: | ||
scale=2 |
scale=2 |
||
</nowiki>}} |
</nowiki>}} |
||
+ | |||
+ | ==== シェルのフォント ==== |
||
+ | |||
+ | Weston はウィンドウのタイトルバーや時計などにデフォルトの sans-serif フォントを使用します。フォントを変更する方法は[[フォント設定#フォントの置き換え]]を見て下さい。 |
||
== GUI ライブラリ == |
== GUI ライブラリ == |
||
− | [ |
+ | [https://wayland.freedesktop.org/toolkits.html 公式ウェブサイト] も参照してください。 |
=== GTK+ 3 === |
=== GTK+ 3 === |
||
− | 公式リポジトリの {{pkg|gtk3}} は Wayland バックエンドが有効になっています。 |
+ | 公式リポジトリの {{pkg|gtk3}} パッケージは Wayland バックエンドが有効になっています。 |
− | + | Wayland と X 両方のバックエンドが有効になっているとき、GTK+ ではデフォルトで Wayland バックエンドを使いますが、{{ic|GDK_BACKEND=x11}} 環境変数を設定することで Xwayland を使うように上書きできます。 |
|
− | + | {{Note|GTK+ 3.0 から、GTK+ は実行時に複数のバックエンドをサポートできるようになり、Qt の lighthouse と同じ方法でバックエンドを切り替えることができるようになりました。}} |
|
=== Qt5 === |
=== Qt5 === |
||
+ | {{Grp|qt5}} パッケージは Wayland をサポートしています。{{Pkg|qt5-wayland}} をインストールしてください。 |
||
− | {{Pkg|qt5-wayland}} をインストールする必要があります。Wayland プラグインを使って Qt 5 アプリケーションを動作させるには環境変数 {{ic|1=QT_QPA_PLATFORM=wayland-egl}} をセットして下さい。 |
||
+ | |||
+ | Wayland プラグインを使って Qt 5 アプリケーションを動作させるには、[https://wiki.qt.io/QtWayland#How_do_I_use_QtWayland.3F] にあるように、{{ic|1=-platform wayland}} を使用するか、環境変数 {{ic|1=QT_QPA_PLATFORM=wayland-egl}} をセットして下さい。一方、Wayland セッション上で [[X11]] を使用させるには、{{ic|1=QT_QPA_PLATFORM=xcb}} とセットします。 |
||
===Clutter=== |
===Clutter=== |
||
− | Clutter ツールキットには Wayland バックエンドがあり、Clutter を Wayland のクライアントとして動作させることが可能です。このバックエンドは |
+ | Clutter ツールキットには Wayland バックエンドがあり、Clutter を Wayland のクライアントとして動作させることが可能です。このバックエンドは {{Pkg|clutter}} パッケージで有効になっています。 |
Clutter アプリを Wayland 上で動作させるには、環境変数 {{ic|CLUTTER_BACKEND=wayland}} を設定する必要があります。 |
Clutter アプリを Wayland 上で動作させるには、環境変数 {{ic|CLUTTER_BACKEND=wayland}} を設定する必要があります。 |
||
212行目: | 237行目: | ||
=== GLFW === |
=== GLFW === |
||
+ | GLFW で Wayland バックエンドを使用するには、({{Pkg|glfw-x11}} の代わりに) {{Pkg|glfw-wayland}} パッケージをインストールしてください。 |
||
− | バージョン 3.1 から wayland を試験的にサポートしています。コンパイルフラグで有効にします。AUR からパッケージ {{AUR|glfw3-git}} をインストールして cmake のフラグに {{ic|-DGLFW_USE_WAYLAND=ON}} を追加してください。 |
||
+ | |||
+ | === GLEW === |
||
+ | |||
+ | GLEW で Wayland バックエンドを使用するには、({{Pkg|glew}} の代わりに) {{Pkg|glew-wayland}} パッケージをインストールしてください。 |
||
===EFL=== |
===EFL=== |
||
− | EFL は Wayland を完全にサポートしています。Wayland で EFL アプリケーションを動かすには、Wayland の [ |
+ | EFL は Wayland を完全にサポートしています。Wayland で EFL アプリケーションを動かすには、Wayland の [https://wayland.freedesktop.org/efl.html プロジェクトページ] を見て下さい。 |
+ | |||
+ | == ディスプレイマネージャ == |
||
+ | |||
+ | Wayland コンポジタの実行をサポートした[[ディスプレイマネージャ]]は以下の表の通りです。種類の列にはディスプレイマネージャが Wayland 上での実行をサポートしているかどうかが示されています。 |
||
+ | |||
+ | {| class="wikitable sortable" |
||
+ | ! 名前 |
||
+ | ! 種類 |
||
+ | ! 説明 |
||
+ | |- |
||
+ | | GDM |
||
+ | | Wayland/X11 上で動作 |
||
+ | | [[GNOME]] ディスプレイマネージャ。 |
||
+ | |- |
||
+ | | LightDM |
||
+ | | Wayland/X11 上で動作 [https://github.com/CanonicalLtd/lightdm/commit/f4f681f7b4209a634b021ba731addec1e081e5c7] |
||
+ | | 様々なデスクトップに対応したディスプレイマネージャ。 |
||
+ | |- |
||
+ | | SDDM |
||
+ | | X11 上で動作 [https://github.com/sddm/sddm/pull/616] |
||
+ | | QML ベースのディスプレイマネージャ。 |
||
+ | |} |
||
+ | |||
==ウィンドウマネージャとデスクトップシェル== |
==ウィンドウマネージャとデスクトップシェル== |
||
228行目: | 280行目: | ||
Gnome Wayland セッションを起動するには、GDM ログインマネージャを使用する必要があります。ログインする前に "Gnome on Wayland" セッションを選択してください。 |
Gnome Wayland セッションを起動するには、GDM ログインマネージャを使用する必要があります。ログインする前に "Gnome on Wayland" セッションを選択してください。 |
||
− | === |
+ | ===Enlightenment=== |
+ | |||
− | [[Hawaii]] の記事を見て下さい。 |
||
+ | E19 から Wayland に対応していましたが、現在は削除されており、E20 以上が通常の利用に耐えうるほど Wayland で安定動作するとされています。詳しくは [https://www.enlightenment.org/about-wayland] を参照。 |
||
===KDE=== |
===KDE=== |
||
+ | [[KDE#Wayland]] を見てください。 |
||
− | KDE 4.11 から [http://blog.martin-graesslin.com/blog/2013/06/starting-a-full-kde-plasma-session-in-wayland/ Wayland システムコンポジタの下で KWin を動かせるように] なっています。今の所 KWin をセッションコンポジタとして使うためのサポートはありません。 |
||
=== Loliwm === |
=== Loliwm === |
||
241行目: | 294行目: | ||
=== sway === |
=== sway === |
||
− | [ |
+ | [[Sway]] は Wayland 用の i3 互換のウィンドウマネージャです。 |
=== Velox === |
=== Velox === |
||
− | [ |
+ | [[Velox]] は swc ベースのシンプルなウィンドウマネージャです。[[dwm]] と [[xmonad]] の影響を受けています。 |
=== Orbital === |
=== Orbital === |
||
251行目: | 304行目: | ||
[https://github.com/giucam/orbital Orbital] は Qt5 と Weston を使用する Wayland コンポジタ・シェルです。このプロジェクトではシンプルでありながら柔軟性のある見た目の良い Wayland デスクトップを作成することを目標としています。Orbital は完全装備の DE ではなく、どちらかと言えば [[Awesome]] や [[Fluxbox]] のような X11 におけるウィンドウマネージャに似ています。 |
[https://github.com/giucam/orbital Orbital] は Qt5 と Weston を使用する Wayland コンポジタ・シェルです。このプロジェクトではシンプルでありながら柔軟性のある見た目の良い Wayland デスクトップを作成することを目標としています。Orbital は完全装備の DE ではなく、どちらかと言えば [[Awesome]] や [[Fluxbox]] のような X11 におけるウィンドウマネージャに似ています。 |
||
− | === |
+ | === Liri Shell === |
− | [https://github.com/ |
+ | [https://github.com/lirios/shell Liri Shell] は [[Liri]] のデスクトップシェルであり、Wayland のコンポジタとして QtQuick と QtCompositor を使用して作られています。 |
=== Maynard === |
=== Maynard === |
||
262行目: | 315行目: | ||
[https://github.com/evil0sheep/motorcar Motorcar] は 3D ウィンドウを探検できる wayland コンポジタです。 |
[https://github.com/evil0sheep/motorcar Motorcar] は 3D ウィンドウを探検できる wayland コンポジタです。 |
||
+ | |||
+ | === Way Cooler === |
||
+ | {{AUR|way-cooler}} は Rust で書かれた (Lua の設定ファイルによる) 豊富な設定を持つ Wayland コンポジタです。i3 と awesome の影響を受けています。 |
||
+ | |||
+ | === Maze Compositor === |
||
+ | |||
+ | [https://github.com/capisce/mazecompositor Maze Compositor] は 3D の Qt ベースの Wayland コンポジタです。 |
||
+ | |||
+ | === Grefsen === |
||
+ | |||
+ | [https://github.com/ec1oud/grefsen Grefsen] はミニマルなデスクトップ環境を実現する Qt/Wayland コンポジタです。 |
||
==トラブルシューティング== |
==トラブルシューティング== |
||
+ | |||
+ | === root でグラフィカルアプリケーションを実行 === |
||
+ | |||
+ | [[Root で X アプリケーションを起動#Wayland]] を見てください。 |
||
=== LLVM assertion failure === |
=== LLVM assertion failure === |
||
272行目: | 340行目: | ||
$ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so |
$ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so |
||
+ | === 動作が遅い、表示がおかしい、クラッシュする === |
||
− | === 1.7 にアップデートしてから Weston が起動しない === |
||
+ | Gnome-shell で X から Wayland に切り替えるとグラフィック表示に問題が発生することがあります。原因として Xorg ベースの gnome-shell 用に {{ic|1=CLUTTER_PAINT=disable-clipped-redraws:disable-culling}} が設定されている可能性があります。{{ic|/etc/environment}} などの rc ファイルから該当箇所を削除してみてください。 |
||
− | おそらく {{ic|weston.ini}} によって {{ic|desktop-shell.so}} モジュールがロードされているのが原因です。以前はこのモジュールが必要でしたが、現在は要らなくなっています。 |
||
+ | === ゲームやリモートデスクトップ、仮想マシンウィンドウでの入力 === |
||
− | モジュールを削除するには、以下のようになっている行を探して: |
||
+ | |||
− | {{hc|~/.config/weston.ini| |
||
+ | Xorg と異なり、Wayland では入力デバイスを独占 (グラブ) することができません。キーボードショートカットやポインタデバイスをアプリケーションウィンドウに渡すのは Wayland コンポジタの役目となっています。 |
||
− | <nowiki>[core] |
||
+ | |||
− | modules=xwayland.so,desktop-shell.so</nowiki> |
||
+ | 入力グラブが変わったことで以下のように既存のアプリケーションで問題が発生します: |
||
− | }} |
||
+ | * ホットキーや修飾キーがコンポジタによって認識されてしまい、リモートデスクトップや仮想マシンのウィンドウに送信されなくなります。 |
||
− | 行から {{ic|desktop-shell.so}} を削除してください: |
||
+ | * マウスポインタがアプリケーションウィンドウに制限されなくなるため、仮想マシンやリモートデスクトップのウィンドウ内のマウスポインタの位置がホスト環境のマウスポインタとずれるようになります。 |
||
− | {{hc|~/.config/weston.ini| |
||
+ | |||
− | <nowiki>[core] |
||
+ | Wayland と XWayland にプロトコル拡張を追加することで解決を図っていますが、Wayland コンポジタが拡張をサポートしている必要があり、ネイティブの Wayland クライアントの場合、ウィジェットツールキット (例: GTK, Qt) やアプリケーション自身が拡張に対応していなければなりません。 |
||
− | modules=xwayland.so</nowiki> |
||
+ | |||
− | }} |
||
+ | 関連する拡張: |
||
+ | * [https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml XWayland keyboard grabbing protocol] (XWayland のサポートは xorg-server 1.20 開発ツリーに追加されています [https://lists.x.org/archives/xorg-devel/2017-August/054231.html]) |
||
+ | * [https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml Compositor shortcuts inhibit protocol] |
||
+ | * [https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/relative-pointer/relative-pointer-unstable-v1.xml Relative pointer protocol] |
||
+ | * [https://cgit.freedesktop.org/wayland/wayland-protocols/tree/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml Pointer constraints protocol] |
||
+ | |||
+ | サポートしている Wayland コンポジタ: |
||
+ | * Mutter, [[GNOME]] のコンポジタ ([https://bugzilla.gnome.org/show_bug.cgi?id=783342 リリース 3.28] 以上)。 |
||
+ | サポートしているウィジェットツールキット: |
||
− | === weston+xwayland の chrome/chromium でマウスのクリックが効かない === |
||
+ | * GTK (リリース 3.22.18 以上)。 |
||
− | Chrome/chromium は weston から起動することができますが、キーボードだけが動作し、マウスのクリックが動作しません。これは weston の [https://bugs.freedesktop.org/show_bug.cgi?id=89178 バグ] です。orbment など、他の wayland コンポジタなら Chrome は問題なく動作します。 |
||
==参照== |
==参照== |
||
+ | * [https://fedoraproject.org/wiki/How_to_debug_Wayland_problems Fedora Wiki の Wayland のデバッグに関する記事] |
||
* [https://bbs.archlinux.org/viewtopic.php?id=107499 Arch Linux forum discussion] |
* [https://bbs.archlinux.org/viewtopic.php?id=107499 Arch Linux forum discussion] |
||
− | * [ |
+ | * [https://wayland.freedesktop.org/docs/html/ Wayland オンラインドキュメント] |
2019年6月6日 (木) 22:37時点における版
Wayland は Linux の新しいウィンドウプロトコルです。GNOME や KDE などの主要な Linux デスクトップは Wayland に対応しており、"Weston" という名前のコンポジタのリファレンス実装も存在します。Wayland で昔の X11 アプリケーションを動作させるための互換レイヤーとして XWayland があります。
要件
今のところ Wayland は KMS を利用しているシステムでしか動作できません。
また、Wayland はただのライブラリなので、それだけでは使い物になりません。X サーバーを置き換えるには、(Weston や Sway などの) コンポジタあるいは (GNOME や KDE など) デスクトップ環境が必要です。
バッファ API のサポート
GPU ドライバーと Wayland コンポジタは同一のバッファ API に対応している場合に互換性があります。主要な API は2つ存在します: GBM と EGLStreams です。
バッファ API | GPU ドライバーのサポート | Wayland コンポジタのサポート |
---|---|---|
GBM | NVIDIA 以外の全てのドライバー | 全てのコンポジタ |
EGLStreams | NVIDIA | GNOME, KDE (Plasma 5.16+) |
Weston
Weston は Wayland コンポジタのリファレンス実装です。
インストール
weston パッケージをインストールしてください。
使用方法
Weston をインストールしたのなら Wayland をテストする環境が整っているはずです。
起動中の X セッションの中で Weston を実行することができます:
$ weston
もしくは、Weston をネイティブで起動するには、端末を切り替えて次を実行して見て下さい:
$ weston-launch
Weston の TTY からデモを実行できます。ターミナルエミュレータを起動するには:
$ weston-terminal
画面に花を散らすには:
$ weston-flower
画像を表示するには:
$ weston-image image1.jpg image2.jpg...
設定
キーボードレイアウト・モジュール・UI の設定ファイルの例です。詳しくは weston.ini(5) を見て下さい。Weston の出力設定は xorg.conf
のモニターと多少異なります:
$ ls /sys/class/drm card0 card0-VGA-1 card1 card1-DVI-I-1 card1-HDMI-A-1 card1-VGA-2
card0
は使われていない内蔵ビデオアダプタです。追加アダプタ card1
は HDMI と DVI モニターに接続されており、出力名が HDMI-A-1
と DVI-I-1
です。
~/.config/weston.ini
[core] # xwayland support xwayland=true [libinput] enable_tap=true [shell] background-image=/usr/share/backgrounds/gnome/Aqua.jpg background-color=0xff002244 panel-color=0x90ff0000 locking=true animation=zoom close-animation=fade focus-animation=dim-layer #binding-modifier=ctrl #num-workspaces=6 ### for cursor themes install xcursor-themes pkg from Extra. ### #cursor-theme=whiteglass #cursor-size=24 ### tablet options ### #lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png #lockscreen=/usr/share/backgrounds/gnome/Garden.jpg #homescreen=/usr/share/backgrounds/gnome/Blinds.jpg #animation=fade ### for Laptop displays ### #[output] #name=LVDS1 #mode=1680x1050 #transform=90 #[output] #name=VGA1 # The following sets the mode with a modeline, you can get modelines for your preffered resolutions using the cvt utility #mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync #transform=flipped #[output] #name=X1 #mode=1024x768 #transform=flipped-270 [input-method] #path=/usr/lib/weston/weston-keyboard [keyboard] keymap_rules=evdev #keymap_layout=gb,de #keymap_options=caps:ctrl_modifier,shift:both_capslock_cancel ### keymap_options from /usr/share/X11/xkb/rules/base.lst ### numlock-on=true [terminal] #font=DroidSansMono #font-size=14 [launcher] icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png path=/usr/bin/weston-terminal [launcher] icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png path=/usr/bin/gnome-terminal [launcher] icon=/usr/share/icons/hicolor/24x24/apps/firefox.png path=/usr/bin/firefox [launcher] icon=/usr/share/weston/icon_flower.png path=/usr/bin/weston-flower [screensaver] # Uncomment path to disable screensaver path=/usr/libexec/weston-screensaver duration=600
最小の weston.ini
:
~/.config/weston.ini
[core] xwayland=true [keyboard] keymap_layout=gb [output] name=LVDS1 mode=1680x1050 transform=90 [launcher] icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png path=/usr/bin/weston-terminal [launcher] icon=/usr/share/icons/hicolor/24x24/apps/firefox.png path=/usr/bin/firefox
XWayland
xorg-server-xwayland パッケージをインストールしてください。
Weston の中で X アプリケーションを動かすには、Xwayland を使ってリクエストを処理させます。以下の設定ファイルを作成してください:
~/.config/weston.ini
[core] xwayland=true
スクリーンキャスト録画
Weston にはスクリーンキャスト機能が備わっており、Super+r
キーを押すことで録画を開始・停止することができます。スクリーンキャストは Weston のカレントディレクトリ内の capture.wcap
ファイルに保存されます。
WCAP ファイルは Weston 専用のロスレス動画フォーマットで、フレーム間の差異だけを記録しています。記録されたスクリーンキャストを再生するには、WCAP ファイルをメディアプレイヤーが再生できるフォーマットに変換する必要があります。まず、録画した動画を YUV ピクセル形式に変換してください:
$ wcap-decode capture.wcap --yuv4mpeg2 > capture.y4m
作成された YUV ファイルは FFmpeg を使うことで他のフォーマットに変換できます。
HiDPI ディスプレイ
Retina または HiDPI のディスプレイでは以下を使用してください:
~/.config/weston.ini
[output] name=... scale=2
シェルのフォント
Weston はウィンドウのタイトルバーや時計などにデフォルトの sans-serif フォントを使用します。フォントを変更する方法はフォント設定#フォントの置き換えを見て下さい。
GUI ライブラリ
公式ウェブサイト も参照してください。
GTK+ 3
公式リポジトリの gtk3 パッケージは Wayland バックエンドが有効になっています。
Wayland と X 両方のバックエンドが有効になっているとき、GTK+ ではデフォルトで Wayland バックエンドを使いますが、GDK_BACKEND=x11
環境変数を設定することで Xwayland を使うように上書きできます。
Qt5
qt5 パッケージは Wayland をサポートしています。qt5-wayland をインストールしてください。
Wayland プラグインを使って Qt 5 アプリケーションを動作させるには、[1] にあるように、-platform wayland
を使用するか、環境変数 QT_QPA_PLATFORM=wayland-egl
をセットして下さい。一方、Wayland セッション上で X11 を使用させるには、QT_QPA_PLATFORM=xcb
とセットします。
Clutter
Clutter ツールキットには Wayland バックエンドがあり、Clutter を Wayland のクライアントとして動作させることが可能です。このバックエンドは clutter パッケージで有効になっています。
Clutter アプリを Wayland 上で動作させるには、環境変数 CLUTTER_BACKEND=wayland
を設定する必要があります。
SDL
SDL 2.0.2 から実験的に wayland がサポートされており、Arch Linux ではデフォルトで有効になっています。
SDL アプリケーションを Wayland 上で動作させるには、環境変数 SDL_VIDEODRIVER=wayland
を設定する必要があります。
GLFW
GLFW で Wayland バックエンドを使用するには、(glfw-x11 の代わりに) glfw-wayland パッケージをインストールしてください。
GLEW
GLEW で Wayland バックエンドを使用するには、(glew の代わりに) glew-wayland パッケージをインストールしてください。
EFL
EFL は Wayland を完全にサポートしています。Wayland で EFL アプリケーションを動かすには、Wayland の プロジェクトページ を見て下さい。
ディスプレイマネージャ
Wayland コンポジタの実行をサポートしたディスプレイマネージャは以下の表の通りです。種類の列にはディスプレイマネージャが Wayland 上での実行をサポートしているかどうかが示されています。
名前 | 種類 | 説明 |
---|---|---|
GDM | Wayland/X11 上で動作 | GNOME ディスプレイマネージャ。 |
LightDM | Wayland/X11 上で動作 [2] | 様々なデスクトップに対応したディスプレイマネージャ。 |
SDDM | X11 上で動作 [3] | QML ベースのディスプレイマネージャ。 |
ウィンドウマネージャとデスクトップシェル
GNOME
バージョン 3.14 から、GNOME は Wayland を使ってデスクトップを動作させることができるようになりました。Gnome コンポジタは X を使用しなくても動かすことができ、Wayland のシステムコンポジタとして動作します。本番環境で使えるほど安定しているとされていますが、まだサポートされていない機能もいくつか存在します (Gnome のドキュメントを参照)。Gnome デスクトップでは、X を使用するアプリケーションは XWayland で動作します。
Gnome Wayland セッションを起動するには、GDM ログインマネージャを使用する必要があります。ログインする前に "Gnome on Wayland" セッションを選択してください。
Enlightenment
E19 から Wayland に対応していましたが、現在は削除されており、E20 以上が通常の利用に耐えうるほど Wayland で安定動作するとされています。詳しくは [4] を参照。
KDE
KDE#Wayland を見てください。
Loliwm
loliwm は Wayland 用のタイル型ウィンドウマネージャです。
sway
Sway は Wayland 用の i3 互換のウィンドウマネージャです。
Velox
Velox は swc ベースのシンプルなウィンドウマネージャです。dwm と xmonad の影響を受けています。
Orbital
Orbital は Qt5 と Weston を使用する Wayland コンポジタ・シェルです。このプロジェクトではシンプルでありながら柔軟性のある見た目の良い Wayland デスクトップを作成することを目標としています。Orbital は完全装備の DE ではなく、どちらかと言えば Awesome や Fluxbox のような X11 におけるウィンドウマネージャに似ています。
Liri Shell
Liri Shell は Liri のデスクトップシェルであり、Wayland のコンポジタとして QtQuick と QtCompositor を使用して作られています。
Maynard
Maynard は GTK ベースの Weston 用デスクトップシェルクライアントです。Tiago Vignatti によるプロジェクト、weston-gtk-shell に基づいています。
Motorcar
Motorcar は 3D ウィンドウを探検できる wayland コンポジタです。
Way Cooler
way-coolerAUR は Rust で書かれた (Lua の設定ファイルによる) 豊富な設定を持つ Wayland コンポジタです。i3 と awesome の影響を受けています。
Maze Compositor
Maze Compositor は 3D の Qt ベースの Wayland コンポジタです。
Grefsen
Grefsen はミニマルなデスクトップ環境を実現する Qt/Wayland コンポジタです。
トラブルシューティング
root でグラフィカルアプリケーションを実行
Root で X アプリケーションを起動#Wayland を見てください。
LLVM assertion failure
LLVM assertion failure になるときは、この問題が修正されるまで Gallium LLVM なしで mesa をリビルドする必要があります。
これは LLVM を必要とするドライバを無効にしてしまう可能性があります。ハードウェアドライバに問題が発生するときは、以下の export を試して下さい:
$ export EGL_DRIVER=/usr/lib/egl/egl_gallium.so
動作が遅い、表示がおかしい、クラッシュする
Gnome-shell で X から Wayland に切り替えるとグラフィック表示に問題が発生することがあります。原因として Xorg ベースの gnome-shell 用に CLUTTER_PAINT=disable-clipped-redraws:disable-culling
が設定されている可能性があります。/etc/environment
などの rc ファイルから該当箇所を削除してみてください。
ゲームやリモートデスクトップ、仮想マシンウィンドウでの入力
Xorg と異なり、Wayland では入力デバイスを独占 (グラブ) することができません。キーボードショートカットやポインタデバイスをアプリケーションウィンドウに渡すのは Wayland コンポジタの役目となっています。
入力グラブが変わったことで以下のように既存のアプリケーションで問題が発生します:
- ホットキーや修飾キーがコンポジタによって認識されてしまい、リモートデスクトップや仮想マシンのウィンドウに送信されなくなります。
- マウスポインタがアプリケーションウィンドウに制限されなくなるため、仮想マシンやリモートデスクトップのウィンドウ内のマウスポインタの位置がホスト環境のマウスポインタとずれるようになります。
Wayland と XWayland にプロトコル拡張を追加することで解決を図っていますが、Wayland コンポジタが拡張をサポートしている必要があり、ネイティブの Wayland クライアントの場合、ウィジェットツールキット (例: GTK, Qt) やアプリケーション自身が拡張に対応していなければなりません。
関連する拡張:
- XWayland keyboard grabbing protocol (XWayland のサポートは xorg-server 1.20 開発ツリーに追加されています [5])
- Compositor shortcuts inhibit protocol
- Relative pointer protocol
- Pointer constraints protocol
サポートしている Wayland コンポジタ:
サポートしているウィジェットツールキット:
- GTK (リリース 3.22.18 以上)。