Wacom と Wayland

ふと Wacom のタブレットを使っていて、ペンが押されたままの状態になってしまった。

暫く原因が分からずに色々調べていると、Wayland に原因があることがわかった。

今回は、原因究明と対処法などについて解説する。


Wacom ドライバじゃあなかった

取りあえず設定の「ワコムタブレット」で「タブレット」を表示。

うん、問題なく認識されている。

次は原因を探るため「xsetwacom」コマンドを使用すると、次のようなメッセージが出た。

$ xsetwacom --list devices
Wayland devices found but this tool is incompatible with Wayland. See
https://github.com/linuxwacom/xf86-input-wacom/wiki/Wayland
$ 

へ? Wayland だと Wacom ドライバじゃない?

仕方がないので「xinput」で調査。

$ xinput list
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
⎡ Virtual core pointer                    	id=2	[master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer              	id=4	[slave  pointer  (2)]
⎜   ↳ xwayland-pointer:17                     	id=6	[slave  pointer  (2)]
⎜   ↳ xwayland-relative-pointer:17            	id=7	[slave  pointer  (2)]
⎜   ↳ xwayland-tablet stylus:17               	id=9	[slave  pointer  (2)]
⎜   ↳ xwayland-tablet eraser:17               	id=10	[slave  pointer  (2)]
⎜   ↳ xwayland-tablet cursor:17               	id=11	[slave  pointer  (2)]
⎣ Virtual core keyboard                   	id=3	[master keyboard (2)]
    ↳ Virtual core XTEST keyboard             	id=5	[slave  keyboard (3)]
    ↳ xwayland-keyboard:17                    	id=8	[slave  keyboard (3)]
$

ペンタブレットは「stylus」なので、これで間違いない様だ。

ID が「9」なので、それで状態を確認。

$ xinput query-state 9
WARNING: running xinput against an Xwayland server. See the xinput man page for details.
2 classes :
ButtonClass
	button[1]=down
	button[2]=up
	button[3]=up
	button[4]=up
	button[5]=up
	button[6]=up
	button[7]=up
	button[8]=up
	button[9]=up
ValuatorClass Mode=Absolute Proximity=In
	valuator[0]=142701
	valuator[1]=146090
	valuator[2]=0
	valuator[3]=0
	valuator[4]=0
	valuator[5]=0
$ 

お前かぁ~!!

ドライバは「libinput」を使っている様だ。


Wayland の設定ってどうやるの?

いろいろ調べてみた結果、どうやら Wayland は「/etc/X11/xorg.conf.d/」の影響を受ける様だ。

参考:「Wayland : How do I configure my device on X?

そしてドライバばやっぱり「libinput」っぽい。

参考:「Wayland:Where is the configuration stored?

と言う訳で、「/usr/share/X11/xorg.conf.d/72-Intuos2-wacom.conf」を作って再起動した。

# Wacom Co., Ltd XD-0608-U [Intuos2 (6x8)] on Wacom tablets
Section "InputClass"
        Identifier "Wacom tablet class"
        MatchProduct "Intuos2"
        MatchDevicePath "/dev/input/event*"
        MatchIsTablet "true"
        Driver "libinput"

        Option "Threshold" "27"
EndSection

問題はスレッシュホールドだと思われるので、取り敢えずその項目を追加した。

参考のページでもドライバは「libinput」を使用していたので、問題ないハズ。


描き心地を確認

うん、問題ない様だ。


Wayland の設定は Xorg の設定ファイルで行うべし

今回、調べてみて判明したのだが、libinput ドライバには Wacom ドライバを内包していた。これは Wacom ドライバに関してだけでなく、幾つかのペンタブやタブレット、タッチパネルなどにも言える事なので、Wayland の設定は Xorg の設定ファイルで行うのはアリだと思う。(そう言えば cintiq も見た気がする)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です