Deciding which toolkit to use
Niels De Graef
ndegraef at redhat.com
Mon Sep 25 12:13:04 UTC 2023
Hey Maxim,
the GTK code might serve as inspiration:
https://gitlab.gnome.org/GNOME/gtk/-/blob/main/gdk/gdkdisplaymanager.c#L379
Basically, in the default setup, that function is called with a `NULL`
string; which (IIUC) just means it will try to open a connection to
the Wayland display first, and if that fails, tries to open a X11
connection. The default behavior can be overridden with the
GDK_BACKEND envvar
-- Niels
On Mon, Sep 25, 2023 at 12:54 PM Maxim Kartashev
<maxim.kartashev at jetbrains.com> wrote:
>
> I'd like to propose a topic for the upcoming Wakefield project meeting, namely, how to best decide which toolkit to use at the start? The question is relatively easily answered at the toolkit load time, but we must decide much earlier because of the splash screen support. That thing starts working when there's no Java yet, so the decision must be made then and not change afterwards.
> Options for the decision making include (but not limited to):
> - look at $XDG_SESSION_TYPE,
> - check $DISPLAY, then $WAYLAND_DISPLAY (or the other way around),
> - try connecting to $DISPLAY, then $WAYLAND_DISPLAY.
>
> There is also a question on how to pass this decision down to the toolkit initialization time, which must choose the same and (preferably) regardless of whether or not the splash screen was shown.
> Options here include
> - pass a command line option,
> - implement the same logic in Java as in the early C startup code.
>
> Opinions and suggestions are welcomed!
More information about the wakefield-dev
mailing list