From 6b7a7a7f036ef3b2420da3fc5bf5ec732001450a Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Sat, 26 Oct 2024 09:38:19 -0400 Subject: [PATCH 1/3] allow Colors 0.13 --- Project.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index dd1f213..48de4d4 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "GtkObservables" uuid = "8710efd8-4ad6-11eb-33ea-2d5ceb25a41c" -version = "2.1.3" +version = "2.1.4" [deps] Cairo = "159f3aea-2a34-519c-b102-8c37f9878175" @@ -18,7 +18,7 @@ RoundingIntegers = "d5f540fe-1c90-5db3-b776-2e2f362d9394" [compat] Cairo = "1" -Colors = "0.12" +Colors = "0.12, 0.13" Dates = "1.6" FixedPointNumbers = "0.8" Graphics = "1" From dd47e57f9970bbd536a9c76ad36f870cc3ac1550 Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Sat, 26 Oct 2024 10:08:37 -0400 Subject: [PATCH 2/3] check if click controller is found before testing --- test/runtests.jl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index af36119..d5689b3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -414,13 +414,17 @@ end lastevent[] = "nothing" @test lastevent[] == "nothing" ec = find_gesture_click(widget(c)) - signal_emit(ec, "pressed", Nothing, Int32(1), 0.0, 0.0) - sleep(0.1) - @test lastevent[] == "press" - signal_emit(ec, "released", Nothing, Int32(1), 0.0, 0.0) - sleep(0.1) - sleep(0.1) - @test lastevent[] == "release" + if ec !== nothing + signal_emit(ec, "pressed", Nothing, Int32(1), 0.0, 0.0) + sleep(0.1) + @test lastevent[] == "press" + signal_emit(ec, "released", Nothing, Int32(1), 0.0, 0.0) + sleep(0.1) + sleep(0.1) + @test lastevent[] == "release" + else + @warn("Didn't find click controller, some tests skipped!") + end ec = Gtk4.find_controller(widget(c), GtkEventControllerScroll) signal_emit(ec, "scroll", Bool, 1.0, 0.0) sleep(0.1) From 0cf4d361824e0197c357714dacaeb114dbbf2f90 Mon Sep 17 00:00:00 2001 From: Jared Wahlstrand Date: Sat, 26 Oct 2024 12:26:40 -0400 Subject: [PATCH 3/3] same workaround in another test --- test/runtests.jl | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index d5689b3..a2a1b54 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -423,7 +423,7 @@ end sleep(0.1) @test lastevent[] == "release" else - @warn("Didn't find click controller, some tests skipped!") + @warn("Didn't find click controller, some tests skipped.") end ec = Gtk4.find_controller(widget(c), GtkEventControllerScroll) signal_emit(ec, "scroll", Bool, 1.0, 0.0) @@ -460,12 +460,16 @@ end yield() @test !popuptriggered[] ec = find_gesture_click(widget(c)) - signal_emit(ec, "pressed", Nothing, Int32(1), 0.0, 0.0) - yield() - @test !popuptriggered[] - modifier[] = Gtk4.ModifierType_BUTTON3_MASK - signal_emit(ec, "pressed", Nothing, Int32(1), 0.0, 0.0) - @test popuptriggered[] # this requires simulating a right click, which might require constructing a GdkEvent structure + if ec !== nothing + signal_emit(ec, "pressed", Nothing, Int32(1), 0.0, 0.0) + yield() + @test !popuptriggered[] + modifier[] = Gtk4.ModifierType_BUTTON3_MASK + signal_emit(ec, "pressed", Nothing, Int32(1), 0.0, 0.0) + @test popuptriggered[] # this requires simulating a right click, which might require constructing a GdkEvent structure + else + @warn("Didn't find click controller, some tests skipped.") + end Gtk4.destroy(win) end