|
|
Home » Developing U++ » U++ Developers corner » U++ GTK Wayland Port (WiP)
U++ GTK Wayland Port [message #60816] |
Sun, 15 September 2024 23:33  |
 |
Klugier
Messages: 1100 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello,
I would like to announce that I am currently working on porting U++ to Wayland using our GTK backend. I did some progress in this area:
- SSD (Server Side Decoration) variant works just fine with minor issues. Please, keep in mind that SSD is not supported on many distros, currently KDE support it properly
- CSD (Client Side Decoration) variant works, but there are more problems there in comparison with SSD variant
- In general the responsiveness of the app is much higher in comparison to X11
However, there are some problems as well:
- When backing to previous window after closing dialog window, focus is not being properly restored with CSD
- Menubar positioning is not optimal for example when you spawn menu near the right ennd of the sceen it will be rendered outside of the screen instead of inside
- Second menubar on Gnome doesn't work for some reasons - CSD variant
- Drag and drop needs to be properly implemented on both CSD and SSD
- OpenGL doesn't work (This is out of scope for initial release)
- Window positioning is not optimal. However, it depends on the compositor since it is very powerful in this area for example in comparison with X11
- Probably more...
I attached screenshot from Ubuntu 24.04, where U++ is running in Wayland session and windowing is done using Wayland, not X11:

If you want play with it you can try my branch klugier/gtk-wayland-initial-version in main u++ repo. Also, once running, please make sure that CtrlCore/GtkApp.cpp file has following backend initialization order:
#if GTK_CHECK_VERSION(3, 10, 0)
gdk_set_allowed_backends("wayland,x11"); // this fixes some wayland issues
#endif
Alternatively, you can add WAYLAND compilation flag and it should force prioritizing Wayland backend over X11.
Klugier
U++ - one framework to rule them all.
[Updated on: Sun, 22 September 2024 15:00] Report message to a moderator
|
|
|
|
Re: U++ GTK Wayland Port [message #60827 is a reply to message #60816] |
Tue, 17 September 2024 22:05   |
Oblivion
Messages: 1214 Registered: August 2007
|
Senior Contributor |
|
|
Hello Klugier,
Great and much needed work. Thank you for your efforts!
I am willing to test it and help, but unfortunately I cant get it compiled. The compiler gives the following errors:
/home/maldoror/Geliştirme/upp/upp-wayland/uppsrc/CtrlCore/GtkX11Util.cpp (29): error: unknown type name 'XDisplay'
/home/maldoror/Geliştirme/upp/upp-wayland/uppsrc/CtrlCore/GtkX11Util.cpp (31): error: cannot initialize return object of type 'int *' with an rvalue of type 'Display *' (aka '_XDisplay *')
(): 31 | return GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
/usr/include/gtk-3.0/gdk/x11/gdkx11display.h (59): note: expanded from macro 'GDK_DISPLAY_XDISPLAY'
(): 59 | #define GDK_DISPLAY_XDISPLAY(display) (gdk_x11_display_get_xdisplay (display))
Any ideas why I'm getting X errors? (I am on wayland, on up-to-date archlinux with the latest gtk/gnome)
Do I have to manually set any flags?
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Tue, 17 September 2024 22:06] Report message to a moderator
|
|
|
Re: U++ GTK Wayland Port [message #60828 is a reply to message #60827] |
Tue, 17 September 2024 22:17   |
 |
Klugier
Messages: 1100 Registered: September 2012 Location: Poland, Kraków
|
Senior Contributor |
|
|
Hello Oblivion,
I have this compilation error from time to. I think it is somehow related to BLITZ. Just change (CtrlCore/GtkX11Util.cpp - line 29):
XDisplay *Xdisplay()
{
return GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
}
to
XDisplay *Xdisplay()
{
return NULL;
}
If you will have again this error, just back to the previous version, so I usually comment and recomment
return NULL;//GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
I know that it sound stupid, but I didn't have time to investigate BLITZ problem. I hope it will help. In case of any error or success, please let me know.
Please keep in mind that even if you are on Wayland, X11 modules for GTK are still there. So, you can call both X11 and Wayland functions.
Klugier
U++ - one framework to rule them all.
[Updated on: Tue, 17 September 2024 22:18] Report message to a moderator
|
|
|
|
Re: U++ GTK Wayland Port [message #60853 is a reply to message #60816] |
Thu, 19 September 2024 22:37   |
Oblivion
Messages: 1214 Registered: August 2007
|
Senior Contributor |
|
|
Hello Klugier,
The below approach you've recommended didn't work:
return NULL;//GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
However, undefining the preprocessor flag at the top level (at the application level, before including U++ headers) did:
This way, I've even successfully compiled and run Bobcat on Wayland backend with no apparent issues.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
|
|
|
|
|
Goto Forum:
Current Time: Sat Jul 05 19:50:48 CEST 2025
Total time taken to generate the page: 0.04623 seconds
|
|
|