Fix build failing when defining signals with Gdk.ScrollEvent - #329
Conversation
I suspect this is a bug of Vala. It tries to call gdk_value_get_event() which
does not exist and fails to build with the following error message:
../src/Widgets/DisplayWidget.vala: In function ‘g_cclosure_user_marshal_VOID__GDK_EVENT’:
../src/Widgets/DisplayWidget.vala:18:19: error: implicit declaration of function ‘gdk_value_get_event’; did you mean ‘g_value_get_uint’? [-Wimplicit-function-declaration]
18 | public class Sound.DisplayWidget : Gtk.Box {
| ^~~~~~~~~~~~~~~~~~~
| g_value_get_uint
../src/Widgets/DisplayWidget.vala:18:19: error: passing argument 2 of ‘callback’ makes pointer from integer without a cast [-Wint-conversion]
18 | public class Sound.DisplayWidget : Gtk.Box {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
This commit resolves the above build error by wrapping Gdk.ScrollEvent with
GLib.Value.
|
@danirabbit Would you test if this workaround actually works as expected? I'm not familiar with how to use GTK4 version of Wingpanel and its indicators. |
|
Hm I'm not getting scroll events with this branch. But that could be some issue elsewhere. Will keep investigating. Thanks for this fix though! |
Opened https://gitlab.gnome.org/GNOME/vala/-/work_items/1671 |
0abcf37 to
6dabd76
Compare
The scrolling now works as expected at least on my side. Would you check if it works for you too? Screencast.From.2026-07-28.22-08-16.mp4Leaving what I investigated for future reference. I saw the following warnings in the journal when things didn't work in 493b7b7: I susupect Then I found solution when I was looking at the code of GDK and GLib as a reference.
and I found a test class It uses Using these methods in 6dabd76 resolves our issue! |
danirabbit
left a comment
There was a problem hiding this comment.
Works as expected! Thanks for researching this ❤️
Followup of #295
I suspect this is a bug of Vala. It tries to call
gdk_value_get_event()which does not exist and fails to build with the following error message:This commit resolves the above build error by wrapping Gdk.ScrollEvent with GLib.Value.