Skip to content

GtkScale gets no "released" signal using a GtkGestureClick #77

@jonathanBieler

Description

@jonathanBieler

I'm not totally sure that's a bug or by design but I write this here for reference.

if you try to get a signal for releasing a click on a scale, it doesn't work :

using Gtk4

c = GtkScale(:h, 0, 1, 0.01)
win = GtkWindow(c, "Scale")

g = GtkGestureClick(c, 0)
signal_connect(g, "released") do controller, n_press, x, y
    @info "released"
end
signal_connect(g, "pressed") do controller, n_press, x, y
    @info "pressed"
end

Apparently there was a bug related to this but it should be fixed already in the JLL we use.

https://gitlab.gnome.org/GNOME/gtk/-/issues/4939

Searching a bit I came across this workaround (wrap the scale in a box), that works just fine :

using Gtk4
c = GtkScale(:h,0,1, 0.01)
box = GtkBox(:v)
push!(box,c)

win = GtkWindow(box, "Scale")

g = GtkGestureClick(box, 0)
Gtk4.G_.set_propagation_phase(g, Gtk4.PropagationPhase_CAPTURE)

signal_connect(g, "released") do controller, n_press, x, y
    @info "released"
end
signal_connect(g, "pressed") do controller, n_press, x, y
    @info "pressed"
end

gircore/gir.core#1015 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    upstreamProbably caused by a bug in one of the C libraries wrapped by a package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions