I am pleased to announce a new development release of Casilda, a simple Wayland compositor widget for Gtk 4 which can be used to embed other processes windows in your Gtk 4 application.
The main feature of this release is dmabuf support which allow clients to use hardware accelerated libraries for their rendering brought to you by Val Packet!
This allowed me to stop relaying on wlroots scene compositor and render client windows directly in the widget snapshot method which not only is faster but also integrates better with Gtk since now the background is not handled by wlroots anymore and can be set with CSS like with any other widget. This is why I decided to deprecate bg-color property.
Other improvements include transient window support and better initial window placement.
Hello, I am pleased to announce a new Cambalache stable release.
2025-05-16: Version 0.96.1
Fix/improve GResource list model update
Fix removing custom class data like styles
Version 0.96.0 – GResource Release!
Add GResource support
Add internal children support
New project format
Save directly to .ui files
Show directory structure in navigation
Add Notification system (version, messages and polls)
Unified import dialog for all file types
Update widget catalogs to SDK 48
New project format
So far Cambalache project file contained all the data in one file which meant you had to export UI files to xml in order to use them in your build system.
This constraint was added to discourage XML editing by hand which would have introduced incompatibilities since Cambalache’s GtkBuilder feature support was limited.
Now that GtkBuilder support has improved I decided it was the right time to simplify things for developers and save UI data directly in XML format. Not more manual exporting or integrating with the build system.
The project file will store a relative path to the GtkBuilder file and a hash of its contents, currently all it does is print a warning if you edit the file by hand.
With the project format change it makes sense to show all UI files in the navigation pane as they are in the filesystem.
Unsaved/unnamed files will be stored inline in the project file which comes in handy for WIP UI or as a quick way to define a custom type that does not have a template.
GResource support
Basic GResource support was added to be able to create or edit gresource.xml files. This opens the possibility for Cambalache to support loading assets from a resource path in the workspace, but unfortunately is not yet implemented.
Internal children support
Even tough this is not commonly used anymore, internal children are still used in some classes like GtkDialog. Cambalache will show any internal children in the hierarchy and only export it in the XML file if you change one of its properties or add any children inside.
Notification System
Last but not least I added a simple notification system to inform about new versions and send messages or polls directly to users.
Notifications are polled once a day and only one notification is shown per day. This is how a message notification looks like and it will be used sporadically to inform users about talks or workshops.
New version notifications will show the release notes and include a link to the blogpost and to flathub.
Polls will let you vote and change your vote until the poll close date results are shown after you vote and a final notification will be sent after the poll closes.
This function will create the custom interface with all the properties and make sure all values in the GtkEnumeration are covered.
One fundamental difference with properties is that some a11y relations can be used more than once to specify multiple values.
To cover this I created a new value type called CmbAccessibleList which is simply a coma separated list of values.
This way the import and export code can handle loading and exporting a11y data into Cambalache data model.
Editing a11y data in the UI
Now since these interfaces are not real, no actual widget implements them, they wont show up automatically in the UI.
This can be easily solved by adding a new tab “a11y” to the object editor which only shows a11y interface properties.Now at this point it is possible to create and edit accessibility metadata for any UI but as Emmanuelle pointed out not every a11y property and relation is valid for every role.
To know what is valid or not you need to read WAI-ARIA specs or write a script that pulls all the metadata from it.
With this metadata handy is it easy to filter properties and relations depending on the a11y role.BTW keep in mind that accessible-role property should not be changed under normal circumstances.
I am pleased to announce a new Cambalache stable release, version 0.92.0!
This comes with two major dependencies changes, the first one is a very basic port to Adwaita and webkit/broadway replacement with a custom Wayland compositor widget based on wlroots.
What’s new:
Basic port to Adwaita
Use Casilda compositor widget for workspace
Update widget catalogs to SDK 47
Improved Drag&Drop support
Improve workspace performance
Enable workspace animations
Fix window ordering
Support new desktop dark style
Support 3rd party libraries
Streamline headerbar
Lots of bug fixes and minor improvements
Adwaita
The port to Adwaita gives Cambalache the new modern look and enables dark mode support. The headerbar is simplified only keeping most common used actions, everything else was moved to the main menu.
Cambalache editing Cambalache UICambalache editing Cambalache UI in dark mode
Casilda Compositor
Up until this release, Cambalache showed windows from a different process in its workspace running broadwayd or gtk4-broadwayd backend depending on the gtk version of your project and using a WebView to connect to it and show the windows in an HTML canvas.All of this was replaced with a simple Wayland compositor widget which reduces hard dependencies a lot.
On top of that we get all the optimizations from using Wayland instead of a protocol meant to go over the internet.
With Broadway, the client would render the window in memory, the broadway backend would compress the image and sent it over TCP to the webview which has to uncompress it and render it on an HTML5 canvas.
Now, the client just renders in shared memory which is directly available to the compositor widget to use. This also leave the option to further improve performance by adding support for dmabuf which would allow to offload the composition to the host compositor reducing the number of memory copies to show the windows on the screen.
This allowed me to re enable Gtk animations since they no longer impact the workspace performance.
Special thanks to emersion, kennylevinsen, vyivel and the wlroots community for their support and awesome project, I would not have been able to do this without wlroots and their help.
Cambalache now loads 3rd party catalogs from GLib.get_system_data_dirs()/cambalache/catalogs and ~/.cambalache/catalogs
These catalog files are generated from Gir data with a new tool bundled in Cambalache calledcmb-catalog-gen. This used to be an internal and still lacks proper documentation but you can see an example of how its used internally here
So what is a catalog anyway?
A catalog is a XML file with all the necessary data for Cambalache to produce UI files with widgets from a particular library, this includes the different GTypes, with their properties, signals and everything else except the actual object implementations.
Runtime objects are created in the workspace by loading the GI namespace specified in the catalog.
Feel free to contact me on matrix if you are interested in adding support for a 3rd party library.
Improved Drag&Drop
After the extensive rework done porting the main widget hierarchy from GtkTreeView to GtkColumnView and implementing several GListModel interfaces to avoid maintaining multiple lists I was able to reimplement and extend Drag&Drop code so now its possible to drop widgets in different parents.
Data Model
History handling for Undo/Redo was simplified from multiple history tables (one per table tracked) into one history table by adding a few extra columns to store data change in JSON format.
This is a regular meson package and can be installed the usual way.
# Configure project in _build directory
meson setup --wipe --prefix=~/.local _build .
# Build and install in ~/.local
ninja -C _build install
How to use it
To add a Wayland compositor to your application all you have to do is create a CasildaCompositor widget. You can specify which UNIX socket the compositor will listen for clients connections or let it will choose one automatically.
compositor = casilda_compositor_new ("/tmp/casilda-example.sock");
gtk_window_set_child (GTK_WINDOW (window), GTK_WIDGET (compositor));
Once the compositor is running you can connect to it by specifying the socket in WAYLAND_DISPLAY environment variable.
I am pleased to announce a new development release of Cambalache, version 0.91.3, getting us one step closer to the stable release for GNOME 47.
What’s new:
Support 3rd party libraries
Improved Drag&Drop support
Streamline headerbar
Ported treeview to column view
Several bug fixes
3rd party libraries
Cambalache now loads 3rd party catalogs from Load catalogs from GLib.get_system_data_dirs()/cambalache/catalogs and ~/.cambalache/catalogs
These catalog files are generated from Gir data with tools/cambalache-db.py script. Currently this is an internal tool which means it needs some work and documentation to make it easier to use but you can see an example of how its used internally here
So what is a catalog anyway?
A catalog is a XML file with all the necessary data for cambalache to produce UI files with widgets from a particular library, this includes the different GTypes, with their properties, signals and everything else except the actual object implementations.
Runtime objects are created in the workspace by loading the GI namespace specified in the catalog.
So please, feel free to contact me on matrix if you are interested in adding support for a 3rd party library.
Improved Drag&Drop support
After the extensive rework done porting the main widget hierarchy from GtkTreeView to GtkColumnView and implementing several GListModel interfaces to avoid maintaining multiple lists I was able to reimplement and extend Drag&Drop code so now its possible to drop widgets in different parents.
I am please to announce a new development version of Cambalache
This comes with two major dependencies changes, the first one is a very basic port to Adwaita which fixes dark mode support with Gtk4The biggest one is that I have replaced the WebKit WebView used to show widgets in the workspace for a custom Wayland compositor widget based on wlroots.
So far, this is how Cambalache showed windows from a different process in its workspace.
It would run broadwayd or gtk4-broadwayd backend depending on the gtk version of your project and use a WebView to show all the windows.
With the new approach we do not need the extra broadway backend and also we do not need to run a whole web browser just to show a window.On top of that we get all the obvious optimizations from using Wayland instead of a protocol meant to go over the internet.
For example, with broadway, the client would render the window in memory, the broadway backend would compress the image and sent it over TCP to the webview which has to uncompress it and render it on an HTML5 canvas using JS api.
But now, the client just renders it in shared memory which the compositor use it to create a cairo surface from it and renders it directly in a GtkDrawingArea.
And this is how the new Cambalache looks like when editing its own UI.This also leaves room for improvement by leveraging all the new Gtk infrastructure for graphics offloading (see this blog post from Matthias about it)
As usual with so many changes I expect new bugs so please if you find any, file them here.
Special thanks goes to emersion, kennylevinsen, vyivel and the wlroots community for their support and awesome project, I would not have been able to do this without wlroots and their help.
I specially like the new GtkDialog API and the removal of gtk_dialog_run()
With so many changes I expect some new bugs so please if you find any file them here.
I created a Mastodon account @xjuan where you will be able to get news related to Cambalache, which means the Twitter account @XjuanAr will be phased out soon.