Should I port my custom UI toolkit to Wayland or GTK/QT?
Igor Korot
ikorot01 at gmail.com
Mon Nov 1 05:18:31 UTC 2021
Hi,
On Sun, Oct 31, 2021, 20:16 Brad Robinson <brobinson at toptensoftware.com>
wrote:
> Hi Igor,
>
> Thanks for taking the time to answer.
>
> It sounds like you're suggesting porting the application to a new toolkit
> rather than updating the toolkit?
>
IIUC, you application does not use any cross-platform toolkit - i.e. it
uses Win32/MFC on Windows and Carbon/Cocoa on OSX.
Unfortunately both are not available on *nix.
It would, of course be nice to use something cross-platform in the
beginning, but...
And yes - my suggestion is to use the cross-platform library and port your
application to it.
Using low level API for a high level tasl - it is not really feasible.
Especially, since wayland API is still changing. And there too many systems
on the market, which use X11 protocol.
As mentioned, that's not really feasible as I have literally hundreds of
> screens that would need to be ported. Porting my existing toolkit - either
> directly to X11, Wayland or by leveraging an existing toolkit seems an
> easier option.
>
This is the solution I'm talking about - use GTK, QT or wxWidgets and
forget about wayland, x11 or any other low-level things.
> Would you say the same about AvaloniaUI... that instead of porting
> Avalonia, every app that uses it should move to a new toolkit?
>
I don't know anything about that.
Thank you
> Brad
>
> On Sat, Oct 30, 2021 at 3:07 PM Igor Korot <ikorot01 at gmail.com> wrote:
>
>> Hi,
>>
>> On Fri, Oct 29, 2021 at 6:59 PM Brad Robinson
>> <brobinson at toptensoftware.com> wrote:
>> >
>> > Hey All,
>> >
>> > I have a custom UI toolkit that I initially developed for my music
>> application over 15 years ago. Currently it runs on Windows and OSX, and
>> I'd like to port it to Linux.
>> >
>> > The main thing I'm trying to decide is whether to port directly to
>> Wayland or to a higher level UI toolkit like GTK or QT. Here's what I'm
>> thinking about.
>>
>> There is no doubt that the UI should be ported to GTK/Qt/wxWidgets.
>>
>> Why do you even ask?
>>
>> Especially since those libraries are capable of being used under both
>> X11 and Wayland.
>>
>> But that not even the main reason.
>>
>> Wayland/X11 is a low-level API where UI doesn't have any business
>> accessing.
>>
>> There is a reason Qt/GTK/wxWidgets libraries exist - to make the
>> cross-platform development
>> nice and smooth. Remember the paradigm: design once - build/run
>> everywhere.
>>
>> Everything else should be irrelevant.
>>
>> Thank you.
>>
>> P.S.: If you do port to wxWidgets you could disregard the Windows/Mac
>> ports. You will have one
>> codebase which will run on all platforms.
>>
>> P.S.S.: Same can be sad for Qt.
>>
>> >
>> > Pros:
>> >
>> > * I really like the elegance of Wayland and think I'd enjoy coding
>> against it. It seems lightweight and the way of the future for Linux
>> desktop apps.
>> > * I've written a partial, proof of concept C# wrapper for Wayland which
>> seems to work fine. (my toolkit is written in C#)
>> > * My toolkit already includes implementations of every control/widget I
>> need (including menus) so I don't need much of what GTK/QT provides.
>> Wayland seems like a nice fit in this regard.
>> > * Regarding GTK/QT I'm not keen to learn yet another UI API unless I
>> really have to. I've dabbled with GTK and didn't really like it. I've
>> never used QT but it seems over the top for my needs and possibly difficult
>> to call from C#. Wayland seems simple in comparison.
>> > * I use Skia for graphics rendering. So long as I can blit to the
>> screen and get user input it should port reasonably well.
>> >
>> > Cons:
>> >
>> > * Seems like I might need to implement window decorations myself as I
>> understand not all Wayland compositors provide this.
>> > * System dialogs - in particular file and folder selection dialogs.
>> I'd need to either implement these myself or figure out how to invoke
>> GTK/QT versions?
>> > * IME support - I believe this is outside the scope of Wayland.
>> > * Automation/Accessibility - again outside the scope of Wayland.
>> > * OS theme consistency.
>> >
>> > I think all the cons are workable - either I'm happy to put in the work
>> to get it done (cons 1 and 2) or I can live without if I have to (cons 3
>> and 4), or I'm not that fussed about (con 5)
>> >
>> > Other notes:
>> >
>> > * Porting my apps from my toolkit to GTK or QT is out of the question
>> as that would entail porting literally hundreds of screens, dialogs and
>> widgets.
>> > * I'm a long time Windows developer but I've never done Linux desktop
>> development.
>> > * I'm not the only one in this boat. The AvaloniaUI project is very
>> similar to my toolkit and while I can't speak for them, they currently use
>> X11 and I believe will have similar issues when it comes to Wayland,
>> Accessibility and IME.
>> > * I'd also really like support for OpenGL. Not a deal breaker but I
>> presume it's available through Wayland.
>> > * My toolkit is closed source and only used by apps I develop - it's
>> not likely that it will suddenly have lots of additional requirements
>> placed on it besides what I'm currently considering.
>> > * I don't have any particular distros that I need to support. If my
>> app only works on particular distros then so be it.
>> > * It's not urgent and I'm willing to put in the time.
>> >
>> > So, with all that in mind, here's my questions:
>> >
>> > 1. Wayland, GTK or QT?
>> > 2. Are there options for IME and Accessibility for pure Wayland apps?
>> > 3. Assuming I go with Wayland, is there a Linux distro you would
>> recommend that includes a good, regularly updated, feature rich Wayland
>> compositor. (Unless there's a compelling reason to, I'd prefer not to have
>> to compile a compositor myself).
>> > 4. Any other advice - am I neglecting to consider anything obvious?
>> >
>> > Sorry for the long post... much to think about and any advice greatly
>> appreciated.
>> >
>> > Brad
>> >
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20211101/936de3ad/attachment-0001.htm>
More information about the wayland-devel
mailing list