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

The goal and scope of the GTK backend in druid-shell #860

Open
xStrom opened this issue Apr 19, 2020 · 3 comments
Open

The goal and scope of the GTK backend in druid-shell #860

xStrom opened this issue Apr 19, 2020 · 3 comments
Labels
architecture changes the architecture, usually breaking discussion needs feedback and ideas shell/gtk concerns the GTK backend

Comments

@xStrom
Copy link
Member

xStrom commented Apr 19, 2020

What exactly is the goal of the GTK backend in druid-shell?

Is it a temporary solution or a more permanent one?

  • If temporary, what is the real goal? Some sort of barebones X11 and Wayland support?
  • If it's a permanent target, then what is the scope?
    • Ubuntu
    • All Linux flavors (distros/X11/Wayland)
    • All GTK platforms (including Windows/macOS)

The problem with GTK is that it's not consistent. It has platform specific behavior. For example for mouse events the ModifierType docs state the GDK X backend interprets button press events for button 4-7 as scroll events, so gdk_button4_mask and gdk_button5_mask will never be set. There are also similar issues with keyboard events.

This means that it's not possible to just target one GTK. The GTK druid-shell layer has to basically have an internal gtk-shell abstraction which deals with delivering a consistent GTK API across the different platforms that GTK might run on.

@xStrom xStrom added architecture changes the architecture, usually breaking discussion needs feedback and ideas shell/gtk concerns the GTK backend labels Apr 19, 2020
@luleyleo
Copy link
Collaborator

luleyleo commented Apr 19, 2020

Considering the fact that GTK is way more than we would actually need in combination with the compile times it causes (I was really impressed how much faster druid could compile when I tried it on Windows) I would prefer to replace it with more fitting solutions such as barebones X11 and Wayland support.

It is currently not really possible to see if the X11 back end has better compile times as it depends on GTK due to how the druid-shell build is organized, but I would imagine it to be much faster.

Also a problem we will have with X11 + Wayland is that druid-shell would have to chose the correct back end at runtime but I think that can be solved by having some kind of middle layer that merges the X11 and the Wayland back ends.

@xStrom
Copy link
Member Author

xStrom commented Apr 20, 2020

With dropping GTK I guess some of the issues are menus, titlebars, file dialogs. There would need to be druid implementations of these, right?

@luleyleo
Copy link
Collaborator

For bare bones X11 and Wayland context menus will always need a druid implementation while menubars, titlebars and file dialogs in some / most cases will need a druid implementation.

For example on KDE there is an optional MacOS like menu bar (If the user wants it) and always titlebars. And when bundling as Flatpak there will be file dialogs.

So yes, in the end all of those need a druid implementation at least as a fallback option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
architecture changes the architecture, usually breaking discussion needs feedback and ideas shell/gtk concerns the GTK backend
Projects
None yet
Development

No branches or pull requests

2 participants