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

Our own backend for Wayland #1243

Open
kekekeks opened this issue Oct 22, 2017 · 14 comments · May be fixed by #11546
Open

Our own backend for Wayland #1243

kekekeks opened this issue Oct 22, 2017 · 14 comments · May be fixed by #11546
Assignees
Milestone

Comments

@kekekeks
Copy link
Member

kekekeks commented Oct 22, 2017

There are way too many limitations and tradeoffs that GTK/GDK have to support both of them, while not allowing us to do things that we want to do. Notable examples are separate-thread rendering (we have to use our own X11 connection to do that) and issues with absolute window positioning on Wayland (Wayland has xdg_surface_set_window_geometry which isn't used by GTK for some reason which leads to our popups being broken, we are forcing GTK to use X11 backend because of that).

There are some major caveats on that way:

  1. System dialogs (open/save file, folder selection, etc). We need to either still load GTK or have them out-of-proc somehow. The out-of-proc way will cause issues with making dialogs modal to the parent window on X11
  2. Input methods. Right now we are relying on GTK do support them
  3. Client-side window decorations. Some of the wayland shells are requiring applications to draw window frame, title and buttons, we need to support that somehow
@kekekeks kekekeks added this to the 1.0 milestone Oct 22, 2017
@martindecker
Copy link

Does "Our own backends for X11/Wayland " mean , you plan to write (more) code to interact with X11 ? I think, because Wayland is the future, it is not necessary to support X11 anymore. Keep it simple and only support Wayland. But I am not expert regarding this question, currently I am a WPF developer.

@kekekeks
Copy link
Member Author

Wayland haven't yet reached the feature parity with X11 and judging from their mailing list will never do so, because some features aren't implemented on purpose. X11 will also be more widespread for a half a decade, at least.

@kekekeks
Copy link
Member Author

kekekeks commented Mar 5, 2018

Shower thought: GTK is not, in fact, a "native" UI toolkit for Linux. Some popular distros are using KDE and Qt. So our dependency on GTK isn't free. Our file dialogs also don't look native everywhere.

So we should use libX11/libxcb for UI and separate backend system for file dialogs, that should support:

  • GTK2/3
  • Qt 3/4/5
  • our own managed implementation that doesn't depend on anything

@kekekeks kekekeks modified the milestones: 1.0, 0.7.0 (Beta 2) Mar 5, 2018
@kekekeks
Copy link
Member Author

kekekeks commented Mar 5, 2018

According to https://lists.freedesktop.org/archives/wayland-devel/2017-September/034967.html wayland doesn't support dpi awareness. Great.

@jkoritzinsky
Copy link
Collaborator

It looks like there's support on the Wayland side (and in Weston) as of 1.2, but there isn't support in the XWayland front end.

https://github.com/wayland-project/weston/blob/1a2adfedea74ae264eca7d4b8cbe6d1f04e552bf/man/weston.ini.man#L415

@kekekeks
Copy link
Member Author

kekekeks commented Mar 5, 2018

Yep, wl_surface::set_buffer_scale seems to be the way for per-window scaling factors

@grokys grokys modified the milestones: 0.7.0, 0.8.0 Jul 5, 2018
@grokys grokys modified the milestones: 0.8.0, 0.9 Apr 5, 2019
@iMonZ
Copy link

iMonZ commented Aug 25, 2021

Shower thought: GTK is not, in fact, a "native" UI toolkit for Linux. Some popular distros are using KDE and Qt. So our dependency on GTK isn't free. Our file dialogs also don't look native everywhere.

So we should use libX11/libxcb for UI and separate backend system for file dialogs, that should support:

* GTK2/3

* Qt 3/4/5

* our own managed implementation that doesn't depend on anything

So xcb doesn't work on modern systems.
Maybe dropping gtk2 support would help with the problems.
But full Wayland support without X11 or XWayland or xcb should be on the roadmap.
Ubuntu LTS will switch to Wayland in 22.04 and most other popular distros already switched to Wayland.
And most feature aren't implemented in Wayland for security reason, so yes it's on purpose.

It would be great if the support in AvaloniaUI would be there until Ubuntu will switch in the LTS

@jgcodes2020
Copy link
Contributor

Shower thought: GTK is not, in fact, a "native" UI toolkit for Linux. Some popular distros are using KDE and Qt. So our dependency on GTK isn't free. Our file dialogs also don't look native everywhere.

So we should use libX11/libxcb for UI and separate backend system for file dialogs, that should support:

* GTK2/3

* Qt 3/4/5

* our own managed implementation that doesn't depend on anything

File dialogs can be handled via desktop portals: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.FileChooser

@maxkatz6
Copy link
Member

maxkatz6 commented Jun 7, 2022

@jgcodes2020 yes, and it was #8217

@affederaffe affederaffe mentioned this issue Jun 16, 2022
36 tasks
@maxkatz6 maxkatz6 modified the milestones: 0.9, 11.0 Jun 19, 2022
@maxkatz6 maxkatz6 modified the milestones: 11.0, 11.x Mar 9, 2023
@microhobby
Copy link
Contributor

Hey, my dear Avalonia maintainers, let me say that this is important. Some users that are using Avalonia for embedded system does feel more comfortable having a desktop environment than using framebuffer or DRM. So, for embedded some machines does not support X11 anymore, only Wayland and Weston. "XWayland can still be used" may some argue. Yeah, but in some scenarios Xwayland is not supported and also is hard to set openGL ES for Xwayland, so, no HW acceleration for this users...

@timunie
Copy link
Contributor

timunie commented May 22, 2023

Wayland is planned afaik and the preparation work where we need breaking changes is already in progress. In the 11.x time frame we hope to be able to add wayland support. @affederaffe already did a great job on this backend.

@affederaffe affederaffe linked a pull request May 28, 2023 that will close this issue
3 tasks
@iMonZ
Copy link

iMonZ commented Nov 19, 2023

Wayland is planned afaik and the preparation work where we need breaking changes is already in progress. In the 11.x time frame we hope to be able to add wayland support. @affederaffe already did a great job on this backend.

Hey
any news on that?

@ratin3
Copy link

ratin3 commented Mar 31, 2024

Gentlemen, I am working with Zynq / embedded os like Petalinux, was wondering what components I will need to support Avalonia UI and .Net framework that Avalonia is based on. I would like to avoid Xorg if possible. Thanks

@maxkatz6 maxkatz6 changed the title Our own backends for X11/Wayland Our own backend for Wayland Apr 25, 2024
@LoongArum
Copy link

Gentlemen, I am working with Zynq / embedded os like Petalinux, was wondering what components I will need to support Avalonia UI and .Net framework that Avalonia is based on. I would like to avoid Xorg if possible. Thanks先生们,我正在使用 Zynq / 嵌入式操作系统,例如 Petalinux,我想知道我需要哪些组件来支持 Avalonia 所基于的 Avalonia UI 和 .Net 框架。如果可能的话,我想避免Xorg。谢谢

Just use LinuxFrameBuffer, ther are tutorial in avalonia document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.