question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

A native application for X11

See original GitHub issue

Is your feature request related to a problem? Please describe. The toga philosophy provide us with a native user interface apps, this is good, but what about if I don’t have a backend native interface, i.e. what if I use a Unix-like OS without any backend GUI like Gtk3+ or Qt backends and just simply using X11. The current implementation does not provide us a backend for this need, i.e. backend that help me to build an app has a minimum requirements backend but provide me with an GUI app.

Describe the solution you’d like I suggest adopting a backend for this purpose like Tkinter or something else that compatible with toga project.

Additional context This will be helpful if I want an app and I want my machine as simple as possible.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
freakboy3742commented, Mar 24, 2021

It’s true that web apps won’t share the look and feel of your desktop apps - but then, if you’re writing a web app, the desktop isn’t the platform that is being targeted. Web apps are targetting the web - that means they need to expose a UI that is native for the web. This means we need to support web-native features like deep linking, URL-based navigation, and high-level theming through CSS. It doesn’t mean we need to make a web app look and feel like an macOS or Windows desktop app.

The analogy between X11 and Web is also fair enough - they’re both very low level drawing protocols. However, the Web does have the concept of native widgets. To be sure, there aren’t many - but they do exist. There is a native concept of a “Button” in HTML. There is a basic concept of a windows, and panes within that window. And, of course, there’s a native WebView widget… the web is a WebView widget 😃

X11 doesn’t have those primitives. It’s a canvas on which you can issue drawing instructions over a network layer. There’s no such thing as an “X11 Button”. There’s a Motif button, or a Tk button, or a GTK button - but no X11 button.

So - if you wanted to propose adding ‘toga-motif’ or ‘toga-tk’, that would make sense; but ‘toga-x11’ doesn’t make any sense.

I like your optimism that toga-tk would be “relatively little effort”. My experience with Tkinter has been that it has a good, but not great spread of widgets; and when a widget is missing, you’re pretty much out of luck, I wasn’t aware of cefpython - that definitely looks promising on the webview front - but there are other widgets that Toga requires that I don’t think you’ll find analogs in Tk. I’m happy to be proven wrong, though.

Ultimately, if you’re particularly motivated to write a toga-tk backend, I won’t stand in your way, and I’m open to any API suggestions that make alternate widget toolkits more viable. However, I would ask… why? What is your use case here? What audience for an app are you anticipating that has access to a Linux X11 graphical desktop… and doesn’t have a desktop environment that is based either in GTK ( Gnome, LXDE etc) or Qt (KDE)? You say you want an app that is “as simple as possible” - I’m not sure how introducing a widget toolkit that isn’t the platform’s native widget toolkit makes things simpler.

1reaction
paulproteuscommented, Mar 15, 2021

Hi @MuhammadMouradG !

I’m hoping to get more info and keep this conversation moving. I’m just a contributor, not a core maintainer, so my opinion isn’t authoritative.

I wanted to share two questions I have about a non-Gtk non-Qt X11 backend for Toga.

Would it implement a substantial number of the Toga widgets? If it doesn’t, then I think it would frustrating rather than helpful to people who write Toga apps.

Would this backend create an app that looks, feels, and works like other apps on your system? The Why Toga? page of the docs says, “You need to feel like a native app.” In X11 without Qt or Gtk, in my experience, there is no consistent look and feel. If there is no consistent look and feel that the Toga app blends in smoothly with, then I think Toga can’t really accomplish its goal.

I would love to know what you think. I’m hoping that we can figure out if the idea of a non-Gtk non-Qt Toga backend for X11 makes sense, and if so, figure out what the next step should be. If it’s not a good fit for Toga, maybe it makes sense to develop outside Toga.

Read more comments on GitHub >

github_iconTop Results From Across the Web

A Brief intro to X11 Programming
This is meant to be a simple overview of X11 programming. It will contain the basics necessary to create a single window X...
Read more >
X11 app in Kotlin/Native - Victor Kropp
X Server is an application that manages graphics displays and input devices (keyboards, mice, etc.) on Linux. It is also known as X11...
Read more >
An initial Approach to deliver an X11 Application as a Web ...
As a technology for porting the application, webassembly and the associated emscripten toolchain seemed like a promising fit at first, as native ......
Read more >
X Window System
The X Window System (X11, or simply X) is a windowing system for bitmap displays, common on Unix-like operating systems.
Read more >
Chapter 5. X11 Application Support
Being able to run existing X11 applications is crucial for the adoption of Wayland, ... You have a native window, inside which all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found