Skip to content
Snippets Groups Projects

xwayland: Use `double` for `xwl_tablet_tool`

Merged Olivier Fourdan requested to merge ofourdan/xserver:libinput-issue-138 into master

So we do not lose subpixel precision in Xwayland.

Suggested-by: Peter Hutterer peter.hutterer@who-t.net Signed-off-by: Olivier Fourdan ofourdan@redhat.com Closes: libinput/libinput#138 (closed)

Edited by Olivier Fourdan

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • I just realized that while jhbuild build wayland works out-of-the-box, naively replacing wayland with xorg or xserver does not (that would be too easy :-) ). Do you know what is the most straightforward way to compile Xorg?

    Thanks in advance!

  • Author Maintainer

    You don't need all of Xserver and you should install it in a separate location from your distro packages (i.e. not in /usr/bin/Xwayland).

    So you could use that procedure here: https://wayland.freedesktop.org/xserver.html

    Now, if you use GNOME (mutter/gnome-shell) as I suspect, be aware that the path to Xwayland is hardcoded in mutter, so it won't use your separate install of Xwayland unless you rebuild mutter and specify where it should find Xwayland (with --with-xwayland-path option to the configure script of mutter)...

  • Thanks for the info! I will give it a try.

  • Author Maintainer

    Well, FWIW, a quick test with xinput --test-xi2 using an old Wacom Bamboo shows that the RawMotion events have subpixel precision with commit 4db3ef87 so there is some hope in my patch.

  • I am getting a bunch of DRI3-related errors. I suspect that I need to rebuild a dependency, but since I am not familiar with the Xorg build procedure I may be missing something else.

    xwayland-glamor-gbm.c: In function ‘sync_callback’:
    xwayland-glamor-gbm.c:368:5: error: implicit declaration of function ‘dri3_send_open_reply’ [-Werror=implicit-function-declaration]
         dri3_send_open_reply(client, state->fd);
         ^~~~~~~~~~~~~~~~~~~~
    xwayland-glamor-gbm.c:368:5: warning: nested extern declaration of ‘dri3_send_open_reply’ [-Wnested-externs]
    xwayland-glamor-gbm.c: At top level:
    xwayland-glamor-gbm.c:597:14: error: unknown type name ‘dri3_screen_info_rec’
     static const dri3_screen_info_rec xwl_dri3_info = {
                  ^~~~~~~~~~~~~~~~~~~~
    xwayland-glamor-gbm.c:598:5: error: field name not in record or union initializer
         .version = 2,
         ^
    xwayland-glamor-gbm.c:598:5: note: (near initialization for ‘xwl_dri3_info’)
    ...

    If you did not notice any obvious regression in your tests, then we might as well tentatively proceed with this change. As soon as it reaches Rawhide or some other rolling release I will test it more extensively.

  • Author Maintainer

    If you did not notice any obvious regression in your tests, then we might as well tentatively proceed with this change. As soon as it reaches Rawhide or some other rolling release I will test it more extensively.

    If you're using Fedora, I can build a test package for you so you can tell if it fixes the problem with the hardware/software you use.

  • Wow, that would be amazing! I hope it isn't too much of a burden.

    Currently, I am using a fully updated Fedora 28 (x86_64) + some select packages from Rawhide (Mesa), but I am considering installing the full Rawhide as a dual boot.

    Let me know if you need any specific system information (dependencies versions...) to build the package.

  • Author Maintainer

    Wow, that would be amazing! I hope it isn't too much of a burden.

    No worries :)

    Currently, I am using a fully updated Fedora 28 (x86_64) [...]

    I've ran a scratch build of the current F28 xorg-x11-server package with 4db3ef87 applied:

    https://koji.fedoraproject.org/koji/taskinfo?taskID=29790856

    More specifically, the x86_64 packages are found in:

    https://kojipkgs.fedoraproject.org//work/tasks/857/29790857/

    Please note that scratch builds are automatically removed after a few days.

  • Thanks! I will try this now.

  • It is partially working.

    Looking at the MyPaint input device test log (I could not copy it so I have attached a screenshot below) with GDK_BACKEND=x11, I have subpixel resolution for some events (proximity and button press) but not for MOTION_NOTIFY events. The aliasing issue is still present (not visible with MyPaint but obvious with Xournal).

    So I guess there is still at least one place where coordinates are coerced to int.

    Input device test

    Screenshot_from_2018-09-21_11-30-41

    Notes

    • The half-pixels are probably due to the 2x scaling.

    • The test was performed using the patched X server along with Gnome 3.28.3. I installed the following test packages:

      sudo dnf install --nogpgcheck xorg-x11-server-{common,Xorg,Xdmx,Xephyr,Xnest,Xvfb,Xwayland}-1.19.6-9.1test.fc28.x86_64.rpm

  • added 1 commit

    • e1bae8be - xwayland: Use `double` for `xwl_tablet_tool`

    Compare with previous version

  • Author Maintainer

    Thanks for testing!

    I've updated the patch, and re-ran a new scratch build here:

    https://koji.fedoraproject.org/koji/taskinfo?taskID=29795326

    Build is still on-going at this time of writing, but the x86_64 build is complete already:

    https://kojipkgs.fedoraproject.org//work/tasks/5327/29795327/

    Would you mind giving that one another try?

  • Sure, I'll give it a spin!

  • LGTM!

    I can now see the subpixel resolution for all events on the MyPaint log, and using the pen in Xournal is finally as precise as on Xorg!

    Many thanks for your work Olivier!

  • Author Maintainer

    Brilliant, thanks for testing!

  • Olivier Fourdan unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Olivier Fourdan changed the description

    changed the description

  • FTR, Looks good to me.

  • Adam Jackson added 3 commits

    added 3 commits

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading