Apply the same fix on the main branch (gtk4) as for gtk3: !4524 (merged)
@lb90 @fanc999 Thank you once again. This is for GTK4