Supreeeme / xwayland-satellite

Xwayland outside your Wayland
Mozilla Public License 2.0
210 stars 10 forks source link

feature request: Handle tablet/stylus input #47

Closed vgskye closed 1 month ago

Supreeeme commented 3 months ago

As far as I'm aware this should already work, as of e70cb817516834450cb424d31dcbf70ad13b9718. I'm not too familiar with Xwayland's touch input though. What's not working?

vgskye commented 3 months ago

I don't think wayland considers tablet input touch inputs; thus tablet input doesn't register at all. I... think the correct protocol is the zwp_tablet_v2 family?

Supreeeme commented 3 months ago

Oh I see, you meant stylus input specifically. It looks like xwayland supports the protocol so it shouldn't be hard to support, but I won't get to it this week, and I have no way to test it, so I'll ask that you test it 🙂

vgskye commented 3 months ago

alright, thanks!

Gavin-Niederman commented 1 month ago

I also need support for this. Also I can test if needed!

Supreeeme commented 1 month ago

Ah yeah sorry, I started to do this then realize it would be a little more involved than I expected, and then forgot about it lol. I'll see if I can get back on this within the next 2-3 weeks.

jamesonBradfield commented 1 month ago

this would be super handy for krita on my laptop! let me know if there's any way my inexperienced brain can help!

sommerper commented 1 month ago

Just running into this with a Huion Kamvas. Would be awesome if I could get Krita and Aseprite up and running!

lanastara commented 1 month ago

This would be awesome

Supreeeme commented 1 month ago

Added an entirely untested implementation of tablet support on the stylus branch (PR: https://github.com/Supreeeme/xwayland-satellite/pull/61). Would appreciate any testing before I merge.

sommerper commented 1 month ago

@Supreeeme thanks for working on this.

When I try Krita it crashes as soon as the stylus is causing pointer movement. So I don't even need to touch the screen before Krita disappears.

Output from satellite:

xwayland-satellite on  stylus is 📦 v0.4.0 via 🦀 v1.77.0 took 31s
❯ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `target/debug/xwayland-satellite`
 2024-10-17T10:43:20.151Z INFO  xwayland_satellite > Connected to Xwayland on :0
 2024-10-17T10:43:20.151Z INFO  xwayland_process   > [dix] couldn't enable device 11
 2024-10-17T10:43:20.152Z INFO  xwayland_process   > [dix] couldn't enable device 12
 2024-10-17T10:43:20.152Z INFO  xwayland_process   > [dix] couldn't enable device 13
 2024-10-17T10:43:20.157Z INFO  xwayland_process   > The XKEYBOARD keymap compiler (xkbcomp) reports:
 2024-10-17T10:43:20.157Z INFO  xwayland_process   > > Warning:          Unsupported maximum keycode 708, clipping.
 2024-10-17T10:43:20.157Z INFO  xwayland_process   > >                   X11 cannot support keycodes above 255.
 2024-10-17T10:43:20.159Z INFO  xwayland_process   > Errors from xkbcomp are not fatal to the X server
 2024-10-17T10:43:23.682Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 3408, height: 1374 }
 2024-10-17T10:43:23.682Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-10-17T10:43:25.875Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 3408, height: 1374 }
 2024-10-17T10:43:25.875Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-10-17T10:43:28.874Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 3408, height: 1374 }
 2024-10-17T10:43:28.874Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: WmCapabilities { capabilities: [3, 0, 0, 0] }
 2024-10-17T10:43:28.881Z WARN  xwayland_satellite::xstate        > unrecognized message: Atom { res_id: 252 }
 2024-10-17T10:43:32.856Z WARN  xwayland_satellite::server::event > unhandled xdgtoplevel event: ConfigureBounds { width: 2528, height: 1408 }
 2024-10-17T10:43:32.859Z WARN  xwayland_satellite::server        > Non popup (Some(Toplevel(Some(ToplevelData { toplevel: XdgToplevel { id: ObjectId(xdg_toplevel@41, 61), version: 6, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, xdg: XdgSurfaceData { surface: XdgSurface { id: ObjectId(xdg_surface@40, 60), version: 6, data: Some(ObjectData { .. }), backend: WeakBackend { inner: WeakInnerBackend { state: (Weak) } } }, configured: true, pending: None }, fullscreen: false })))) being reconfigured, behavior may be off.
thread 'main' panicked at src/server/event.rs:954:69:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

From Krita:

xwayland-satellite on  stylus is 📦 v0.4.0 via 🦀 v1.77.0 took 22s
❯ env DISPLAY=:0 flatpak run org.kde.krita
krita.lib.pigment: Replacing color space factory "LABA" "L*a*b* (16-bit integer/channel, unmanaged)" with "LABA" "L*a*b*/Alpha (16-bit integer/channel)"
krita.lib.pigment: Replacing color space factory "RGBA" "RGB (8-bit integer/channel, unmanaged)" with "RGBA" "RGB/Alpha (8-bit integer/channel)"
krita.lib.pigment: Replacing color space factory "RGBA16" "RGB (16-bit integer/channel, unmanaged)" with "RGBA16" "RGB/Alpha (16-bit integer/channel)"
QObject::startTimer: Timers cannot have negative intervals
/app/lib64/krita-python-libs/krita added to PYTHONPATH
/app/share/krita/pykrita/comics_project_management_tools/comics_exporter.py:429: SyntaxWarning: invalid escape sequence '\d'
  svgRegExp = re.compile('[MLCSQHVATmlzcqshva]\d+\.?\d* \d+\.?\d*')
/app/share/krita/pykrita/comics_project_management_tools/comics_exporter.py:539: SyntaxWarning: invalid escape sequence '\<'
  string = re.sub("\<.*?\>", " ", string)
/app/share/krita/pykrita/comics_project_management_tools/exporters/CPMT_ACBF_XML_Exporter.py:510: SyntaxWarning: invalid escape sequence '\<'
  string = re.sub("\<\/*?text.*?\>",'', str(v["text"]))
/app/share/krita/pykrita/comics_project_management_tools/exporters/CPMT_ACBF_XML_Exporter.py:511: SyntaxWarning: invalid escape sequence '\s'
  string = re.sub("\s+?", " ", string)
/app/share/krita/pykrita/comics_project_management_tools/exporters/CPMT_po_parser.py:49: SyntaxWarning: invalid escape sequence '\<'
  text = re.sub("\<.*?\>", " ", text)
/app/share/krita/pykrita/comics_project_management_tools/exporters/CPMT_po_parser.py:50: SyntaxWarning: invalid escape sequence '\s'
  key += str(re.sub("\s+", " ", text)).strip()
/app/share/krita/pykrita/comics_project_management_tools/exporters/CPMT_po_parser.py:114: SyntaxWarning: invalid escape sequence '\<'
  key = re.sub("\<.*?\>", " ", key)
/app/share/krita/pykrita/comics_project_management_tools/exporters/CPMT_po_parser.py:115: SyntaxWarning: invalid escape sequence '\s'
  key = re.sub("\s+", " ", key)
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:33: SyntaxWarning: invalid escape sequence '\+'
  '\+', '-', '\*', '/', '//', '\%', '\*\*',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:33: SyntaxWarning: invalid escape sequence '\*'
  '\+', '-', '\*', '/', '//', '\%', '\*\*',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:33: SyntaxWarning: invalid escape sequence '\%'
  '\+', '-', '\*', '/', '//', '\%', '\*\*',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:33: SyntaxWarning: invalid escape sequence '\*'
  '\+', '-', '\*', '/', '//', '\%', '\*\*',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:35: SyntaxWarning: invalid escape sequence '\+'
  '\+=', '-=', '\*=', '/=', '\%=',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:35: SyntaxWarning: invalid escape sequence '\*'
  '\+=', '-=', '\*=', '/=', '\%=',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:35: SyntaxWarning: invalid escape sequence '\%'
  '\+=', '-=', '\*=', '/=', '\%=',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:37: SyntaxWarning: invalid escape sequence '\^'
  '\^', '\|', '\&', '\~', '>>', '<<',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:37: SyntaxWarning: invalid escape sequence '\|'
  '\^', '\|', '\&', '\~', '>>', '<<',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:37: SyntaxWarning: invalid escape sequence '\&'
  '\^', '\|', '\&', '\~', '>>', '<<',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:37: SyntaxWarning: invalid escape sequence '\~'
  '\^', '\|', '\&', '\~', '>>', '<<',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:42: SyntaxWarning: invalid escape sequence '\{'
  '\{', '\}', '\(', '\)', '\[', '\]',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:42: SyntaxWarning: invalid escape sequence '\}'
  '\{', '\}', '\(', '\)', '\[', '\]',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:42: SyntaxWarning: invalid escape sequence '\('
  '\{', '\}', '\(', '\)', '\[', '\]',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:42: SyntaxWarning: invalid escape sequence '\)'
  '\{', '\}', '\(', '\)', '\[', '\]',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:42: SyntaxWarning: invalid escape sequence '\['
  '\{', '\}', '\(', '\)', '\[', '\]',
/app/share/krita/pykrita/scripter/ui_scripter/syntax/syntax.py:42: SyntaxWarning: invalid escape sequence '\]'
  '\{', '\}', '\(', '\)', '\[', '\]',
/app/share/krita/pykrita/scripter/ui_scripter/editor/pythoneditor.py:274: SyntaxWarning: invalid escape sequence '\)'
  """The return key has just been pressed (and processed by the editor)
The X11 connection broke: I/O error (code 1)
X connection to :0 broken (explicit kill or server shutdown).
krita.general: Warning: some tiles have leaked:
krita.general:  Tiles in memory: 4412
        Total tiles: 4412

And when trying with Aseprite:

xwayland-satellite on  stylus is 📦 v0.4.0 via 🦀 v1.77.0 took 17s
❯ env DISPLAY=:0 ~/apps/Aseprite/aseprite
[S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam.
[S_API] SteamAPI_Init(): Loaded '/home/ps/.local/share/Steam/linux64/steamclient.so' OK.
X connection to :0 broken (explicit kill or server shutdown).
terminate called without an active exception
[1]    38570 IOT instruction (core dumped)  env DISPLAY=:0 ~/apps/Aseprite/aseprite
alicealysia commented 1 month ago

I literally just came home from work, and was about to comment on this before I saw that you made that commit, So excited to test this!!!