If Gtk+ is built with support for both X11 and Wayland, you can detect it
because an environment variable will be set.

A quick search (gtk3 wayland env variable) got me this:
"When both Wayland and X backends are enabled, GTK+ will default to the X11
backend, but this can be overridden by modifying an environment variable:
GDK_BACKEND=wayland." (https://wiki.archlinux.org/index.php/wayland)

I suspect if Gtk+ is built without support for X11, that this may not work.

A better option may be to look at
https://developer.gnome.org/gdk3/stable/gdk3-Wayland-Interaction.html and
make vapi bindings for gdkwayland.h.

     Jonathan Moerman

2016-12-12 21:21 GMT+01:00 rastersoft <ras...@rastersoft.com>:

> Hi all:
>
> I want my program Terminus to be able to run under Wayland.
> Unfortunately, by default tries to bind to a key, which Wayland doesn't
> support and produces a core dump.
>
> It is possible to detect if my code is running under Wayland to disable
> the key binding?
>
> Thanks.
>
> --
> Nos leemos
>                          RASTER    (Linux user #228804)
> ras...@rastersoft.com              http://www.rastersoft.com
>
> _______________________________________________
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>


     Jonathan Moerman

2016-12-12 21:21 GMT+01:00 rastersoft <ras...@rastersoft.com>:

> Hi all:
>
> I want my program Terminus to be able to run under Wayland.
> Unfortunately, by default tries to bind to a key, which Wayland doesn't
> support and produces a core dump.
>
> It is possible to detect if my code is running under Wayland to disable
> the key binding?
>
> Thanks.
>
> --
> Nos leemos
>                          RASTER    (Linux user #228804)
> ras...@rastersoft.com              http://www.rastersoft.com
>
> _______________________________________________
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>


     Jonathan Moerman

2016-12-12 21:21 GMT+01:00 rastersoft <ras...@rastersoft.com>:

> Hi all:
>
> I want my program Terminus to be able to run under Wayland.
> Unfortunately, by default tries to bind to a key, which Wayland doesn't
> support and produces a core dump.
>
> It is possible to detect if my code is running under Wayland to disable
> the key binding?
>
> Thanks.
>
> --
> Nos leemos
>                          RASTER    (Linux user #228804)
> ras...@rastersoft.com              http://www.rastersoft.com
>
> _______________________________________________
> vala-list mailing list
> vala-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/vala-list
>
_______________________________________________
vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list

Reply via email to