Skip to content

gtk4-prep: version-guard GdkVisual APIs for GTK4#21543

Open
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:gtk4/no-non-rgba-visuals
Open

gtk4-prep: version-guard GdkVisual APIs for GTK4#21543
Arecsu wants to merge 1 commit into
darktable-org:masterfrom
Arecsu:gtk4/no-non-rgba-visuals

Conversation

@Arecsu

@Arecsu Arecsu commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Related: "Stop using non-RGBA visuals" #15920 #20433

There is no other place across darktable's current source code other than this one at bauhaus.c when it comes to non-RGBA visuals, AFAIK. According to https://docs.gtk.org/gtk4/migrating-3to4.html:

Stop using non-RGBA visuals

GTK 4 always uses RGBA visuals for its windows; you should make sure that your code works with such visuals. At the same time, you should stop using GdkVisual APIs, since this object no longer exists in GTK 4. Most of its APIs are deprecated already and not useful when dealing with RGBA visuals.

In preparation for GTK4, guard the Wayland-specific GdkVisual setup (gdk_screen_get_rgba_visual, gtk_widget_set_visual, GdkVisual type, gtk_widget_set_app_paintable, GdkScreen) with #if !GTK_CHECK_VERSION(4, 0, 0).

Move the pop->offcut / height updates outside the guard since they are not GTK API calls.

Something should be done here when the actual transition to GTK4 happens. Hopefully this serves as a reminder!

In GTK4, all visuals are RGBA and GdkVisual does not exist. Guard the Wayland-specific GdkVisual setup (gdk_screen_get_rgba_visual, gtk_widget_set_visual, GdkVisual type, gtk_widget_set_app_paintable, GdkScreen) with #if !GTK_CHECK_VERSION(4, 0, 0). Move the pop->offcut / height updates outside the guard since they are not GTK API calls.
@ralfbrown ralfbrown added the gtk4 label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants