Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » U++ Developers corner » U++ GTK Wayland Port (WiP)
U++ GTK Wayland Port [message #60816] Sun, 15 September 2024 23:33 Go to next message
Klugier is currently offline  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:
index.php?t=getfile&id=6966&private=0

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 #60818 is a reply to message #60816] Mon, 16 September 2024 10:31 Go to previous messageGo to next message
Tom1
Messages: 1305
Registered: March 2007
Ultimate Contributor
Hi Klugier,

I'm pleased to see that you're working on this subject! Keep up the good work!

Best regards,

Tom
Re: U++ GTK Wayland Port [message #60827 is a reply to message #60816] Tue, 17 September 2024 22:05 Go to previous messageGo to next message
Oblivion is currently offline  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


[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 Go to previous messageGo to next message
Klugier is currently offline  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 #60829 is a reply to message #60828] Tue, 17 September 2024 22:41 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1214
Registered: August 2007
Senior Contributor
Yep, that worked, thanks!

Now I can start testing.

First issue I've noticed:

I've noticed that some elements (in this case a SplitterFrame) do not paint its background and the whole background becomes transparent (actually, if this can be utilized in the final form, it would be very cool to have transparent or blurred background on some apps Smile )


Screenshot:

index.php?t=getfile&id=6967&private=0


Best regards,
Oblivion


[Updated on: Tue, 17 September 2024 22:43]

Report message to a moderator

Re: U++ GTK Wayland Port [message #60853 is a reply to message #60816] Thu, 19 September 2024 22:37 Go to previous messageGo to next message
Oblivion is currently offline  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:

#undef GDK_WINDOWING_X11



This way, I've even successfully compiled and run Bobcat on Wayland backend with no apparent issues.

Best regards,
Oblivion


Re: U++ GTK Wayland Port [message #60864 is a reply to message #60853] Sun, 22 September 2024 15:05 Go to previous messageGo to next message
Klugier is currently offline  Klugier
Messages: 1100
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello Oblivion,

Thanks for letting me know that Wayland backend cooperates with Bobcat. For the random compilation issue, I managed to fix it by replacing XDisplay with _XDisplay. So, you shouldn't observe the issue anymore on the test branch. Undefing GDK_WINDOWING_X11 is bad idea in this case. We would like to have X11 backed alongiste Wayland one in single application. Thanks to that the application will be able to work in both X11 and Wayland and the compilation for concrete display won't be needed.

BTW, The branch name was changed to klugier/gtk-wayland-initial-version. So, if you encourage any pull issues, just switch to this particular branch.

Klugier


U++ - one framework to rule them all.
Re: U++ GTK Wayland Port [message #60865 is a reply to message #60864] Sun, 22 September 2024 20:05 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1214
Registered: August 2007
Senior Contributor
Hello Klugier,

I've checked the latest version and it works fine. There are some small issues, which I'll report back (or come up with pull requests) to you in the following days.

Thank you for your efforts.

Best regards,
Oblivion


Previous Topic: styling of widgets ( animation / look and feel)
Next Topic: ChromiumBrowser
Goto Forum:
  


Current Time: Sat Jul 05 19:50:48 CEST 2025

Total time taken to generate the page: 0.04623 seconds