Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper interaction with Wayland #27

Closed
tobias47n9e opened this issue Oct 6, 2016 · 20 comments
Closed

Proper interaction with Wayland #27

tobias47n9e opened this issue Oct 6, 2016 · 20 comments
Labels
Milestone

Comments

@tobias47n9e
Copy link
Contributor

When launching Gromit on Fedora 24 in the Gnome Wayland session I get this error:

Supported backends: x11 wayland 
Using backend: wayland

(gromit-mpx:24312): GLib-GObject-WARNING
     **: g_object_get_valist: object class
    'GdkWaylandDevice' has no property named 'device-id'
Segmentation fault (core dumped)

Using the x11 session on the same machine works perfectly.

And thank you for making such a useful tool!

@bk138
Copy link
Owner

bk138 commented Oct 6, 2016

IIRC, wayland support is still preliminary. If you want to finish that, go ahead! :-)

@tobias47n9e
Copy link
Contributor Author

I would like to, but I wouldn't even know where to start. I never tried migrating anything to Wayland before.

@bk138
Copy link
Owner

bk138 commented Oct 7, 2016

First stab would be to remove device-id access, at GdkDevice does not have this anymore https://developer.gnome.org/gdk3/stable/GdkDevice.html

All the X11-specifix code is in input.c. You'd have to
a) use generic gdk functions (if available) instead of the X stuff
OR
b) (not so nice) leave the X11 stuff in there and add Wayland specific bits in ifdfes...

@bk138
Copy link
Owner

bk138 commented Oct 7, 2016

For a), there is https://developer.gnome.org/gdk3/stable/GdkDevice.html#gdk-device-grab and friends for the grabs, whicht at the time of writing were broken and required me to use the XINput functions...

@tobias47n9e
Copy link
Contributor Author

I had a chat with some of the Gnome developers on IRC. Because Wayland restricts programs from drawing over other programs for security reasons, the only way to have a program like Gromit under Wayland would be to (quote):

either it is in the compositor or it needs a protocol

At the moment that seems quite complicated. I might need to revisit this issue once I have a better understanding of all the parts involved. Thank you too, for explaining some of the first steps!

@russel
Copy link
Contributor

russel commented Oct 8, 2016

I have no technical input here, just to say that I use Gromit-MPX for all my presentations at conferences and during workshops. It has become a bit of a USP, and people are always asking what software I am using. Of course I tell them, hopefully this means more users – though many of them are Windows and macOS people…

Fedora is again trying to push Wayland as the default, and ditch X – I dual boot Debian Sid and Fedora Rawhide, Sid is still very much Xorg and no Wayland, Rawhide is Wayland by default but with Xorg as an option. I understand though that Xwayland is actually a hybrid; Wayland but with X-y bits. If Gromit-MPX cannot be made to work on Wayland, then I shall remain an Xorg holdout. I appreciate that Wayland is better than Xorg conceptually, but this is about what users want to do with their computers!

I had stopped recompiling Gromit-MPX each day as I needed a stable working version guaranteed for conferences and workshops. I will though set up to do daily builds and check on Sid and Rawhide if that will help.

@bk138
Copy link
Owner

bk138 commented Oct 8, 2016

Thank you @russel ! What's needed most is some more dev personnel as I am seriously lacking time. PRs are always welcome ;-)

@bk138 bk138 added the bug label Oct 8, 2016
@bk138
Copy link
Owner

bk138 commented Oct 8, 2016

@russel Ah and have you tried Wayland support of ardesia or spotlighter?

@bk138 bk138 added this to the Wayland Support (somehow) milestone Oct 8, 2016
@bk138
Copy link
Owner

bk138 commented Oct 8, 2016

@tobias47n9e I was curious and just tried it out in a wayland session and gromit-mpx worked surpisingly well under XWayland. When passing in GDK_BACKEND=wayland I got the same error as you. Did you try

GDK_BACKEND=x11 gromit-mpx -d

?

@bk138
Copy link
Owner

bk138 commented Oct 8, 2016

@tobias47n9e can you pls try 5e9aeb3 ?

@tobias47n9e
Copy link
Contributor Author

After applying the patch I could launch the program using GDK_BACKEND=x11 gromit-mpx -d. Pressing F9 launches the draw cursor, but only after clicking on another program, clicking on the desktop is not enough). Drawing itself does not seem to work. Pressing F9 again correctly ends the drawing mode. An interesting thing is that the terminal used to launch Gromit is not selectable by mouse anymore, but just by keyboard.

@bk138
Copy link
Owner

bk138 commented Oct 9, 2016

To clarify: 5e9aeb3 should make the manual GDK_BACKEND setting obsolete. Can you test this?

Did you launch gromit-mpx from the terminal? It seems doing make install and using the GNOME launcher makes a difference...

@tobias47n9e
Copy link
Contributor Author

Not sure why GDK_BACKEND is not chosen automatically, but it doesn't work. After a restart oddly enough I could get drawing to work. After exiting and launching again, drawing does not work anymore.

I am launching from the terminal. Using the icon segfaults like using only gromit-mpx to launch the program. Probably not enough information to debug the issue.

@bk138
Copy link
Owner

bk138 commented Oct 9, 2016

Few points here:

  • restart of gromit or your Wayland session?
  • you probably should not launch from the terminal but the launcher after sudo make install. pls also make sure you haven't installed the rpm/deb package as there might be concflicts.
  • can you give some info about your environment? OS, desktop, etc with versions. I could setup a virtual machine and try myself...

@tobias47n9e
Copy link
Contributor Author

  • A system restart
  • I didn't install an rpm package of gromit
  • I am using Fedora 24 with a standard installation and Gnome desktop.

I am thinking of updating to Fedora 25 alpha soon, to try it with the newer Wayland packages.

@russel
Copy link
Contributor

russel commented Oct 11, 2016

Sorry I haven't been able to chip in this for the last day or so. I should be able to try things out on Fedora Rawhide (F26 currently) over the weekend.

@bk138
Copy link
Owner

bk138 commented Nov 13, 2016

a3bd7ab should fix that particular issue here, but not the Wayland functionality as a whole...

@bk138 bk138 changed the title Wayland GdkWaylandDevice has no property named 'device-id' Proper interaction with Wayland Nov 13, 2016
@bk138 bk138 removed this from the Wayland Support (somehow) milestone Nov 13, 2016
@bk138 bk138 added enhancement and removed bug labels Mar 18, 2018
@bk138
Copy link
Owner

bk138 commented Jul 3, 2019

General update: issues with Gromit-MPX can now be funded at https://issuehunt.io/r/bk138/gromit-mpx

@bk138
Copy link
Owner

bk138 commented Jul 7, 2019

Getting back to this, here a some things that need fixing

bk138 added a commit that referenced this issue Nov 8, 2020
While this does not fix all issues when running on Wayland,
we at least get no hang when using GtkSelection and also can
get some basic drawing after the app was activated via the tray
icon. No keyboard shortcuts though.

re #27
bk138 added a commit that referenced this issue Nov 8, 2020
We only support 'x11' for the time being.

re #27
@bk138 bk138 added this to the Release 1.4 milestone Nov 13, 2020
bk138 added a commit that referenced this issue Nov 15, 2020
As Wayland has no other possibility to globally listen for hotkey
events than via the compositor, set the hotkeys there. This is not
device-specific anymore of course.

Currently supports GNOME, more hopefully to follow.

re #27
bk138 added a commit that referenced this issue Nov 15, 2020
This allows setting global hotkeys for a GNOME host.

re #27
@bk138
Copy link
Owner

bk138 commented Nov 17, 2020

Closing as as basic functionality works, #103 and #106 keep track of remaining Wayland-related issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants