Skip to content

Wallpaper: replace deprecated Gtk.ColorButton - #503

Merged
ryonakano merged 2 commits into
mainfrom
danirabbit/wallpaper-colordialogbutton
Nov 3, 2026
Merged

ryonakano merged 2 commits into
mainfrom
danirabbit/wallpaper-colordialogbutton

Conversation

@danirabbit

Copy link
Copy Markdown
Member

No description provided.

Comment thread src/Views/Wallpaper.vala
if (finished) {
set_combo_disabled_if_necessary ();
create_solid_color_container (color_button.rgba.to_string ());
create_solid_color_container (color_button.get_rgba ().to_string ());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason for this change? Gtk.ColorDialogButton seems to have the rgba property: https://valadoc.org/gtk4/Gtk.ColorDialogButton.rgba.html

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a compiler error for some reason when using the property here

@ryonakano ryonakano Nov 3, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah this seems to be another bug in Vala 😞

The RGBA can be retrieve via the return value of gtk_color_dialog_button_get_rgba() but Vala generates a C code to retrieve via the second argument:

                GtkColorDialogButton* _tmp0_;
                GdkRGBA _tmp1_ = {0};

		(...snip...)

#line 232 "../src/Views/Wallpaper.vala"
                _tmp0_ = self->priv->color_button;
#line 232 "../src/Views/Wallpaper.vala"
                gtk_color_dialog_button_get_rgba (_tmp0_, &_tmp1_);

resulting the compiler error.

FAILED: [code=1] src/libdesktop.so.p/meson-generated_Views_Wallpaper.c.o 
cc -Isrc/libdesktop.so.p -Isrc -I../src -I. -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/granite-7 -I/usr/include/gee-0.8 -I/usr/include/gio-unix-2.0 -I/usr/include/gtk-4.0 -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/harfbuzz -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glycin-2 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/graphene-1.0 -I/usr/lib/x86_64-linux-gnu/graphene-1.0/include -I/usr/include/libadwaita-1 -I/usr/include/appstream -I/usr/include/switchboard-3 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O0 -g '-DGETTEXT_PACKAGE="io.elementary.settings.desktop"' '-DG_LOG_DOMAIN="io.elementary.settings.desktop"' -w -fPIC -mfpmath=sse -msse -msse2 -pthread -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -mfpmath=sse -msse -msse2 -MD -MQ src/libdesktop.so.p/meson-generated_Views_Wallpaper.c.o -MF src/libdesktop.so.p/meson-generated_Views_Wallpaper.c.o.d -o src/libdesktop.so.p/meson-generated_Views_Wallpaper.c.o -c src/libdesktop.so.p/Views/Wallpaper.c
../src/Views/Wallpaper.vala: In function ‘pantheon_shell_wallpaper_update_color’:
../src/Views/Wallpaper.vala:232:3: error: too many arguments to function ‘gtk_color_dialog_button_get_rgba’; expected 1, have 2
  232 |             create_solid_color_container (color_button.rgba.to_string ());
      |   ^         ~~~~~~~~~~~~~~~~~~~~~~          ~~~~~~~
In file included from /usr/include/gtk-4.0/gtk/gtk.h:88,
                 from /usr/include/switchboard-3/switchboard.h:6,
                 from src/desktop.h:9,
                 from src/libdesktop.so.p/Views/Wallpaper.c:9:
/usr/include/gtk-4.0/gtk/gtkcolordialogbutton.h:47:17: note: declared here
   47 | const GdkRGBA * gtk_color_dialog_button_get_rgba        (GtkColorDialogButton *self);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/Views/Wallpaper.vala: In function ‘pantheon_shell_wallpaper_load_wallpapers_co’:
../src/Views/Wallpaper.vala:333:4: error: too many arguments to function ‘gtk_color_dialog_button_get_rgba’; expected 1, have 2
  333 |                 create_solid_color_container (color_button.rgba.to_string ());
      |    ^            ~~~~~~~~~~~~~~~~~~~                   ~~~~~~~~~~~~~~~~
/usr/include/gtk-4.0/gtk/gtkcolordialogbutton.h:47:17: note: declared here
   47 | const GdkRGBA * gtk_color_dialog_button_get_rgba        (GtkColorDialogButton *self);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[5/7] Compiling C object src/libdesktop.so.p/meson-generated_Widgets_WallpaperContainer.c.o
ninja: build stopped: subcommand failed.

@danirabbit
danirabbit requested a review from ryonakano November 2, 2026 17:13
@ryonakano
ryonakano merged commit cbeee5a into main Nov 3, 2026
2 of 4 checks passed
@ryonakano
ryonakano deleted the danirabbit/wallpaper-colordialogbutton branch November 3, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants