GtkScale in GtkPopover lags in visually updating slider under Wayland
Minimum test case scale-popover-issue.cpp:
#include <gtkmm.h>
int main(int argc, char *argv[])
{
auto app = Gtk::Application::create(argc, argv, "org.gtkmm.examples.base");
auto adjustment = Gtk::Adjustment::create(0, 0, 2, 1, 1);
Gtk::Scale scale;
scale.set_adjustment(adjustment);
scale.set_has_origin(false);
scale.set_round_digits(0);
scale.add_mark(0, Gtk::POS_BOTTOM, "");
scale.add_mark(1, Gtk::POS_BOTTOM, "");
scale.add_mark(2, Gtk::POS_BOTTOM, "");
scale.set_size_request(150, -1);
scale.show();
Gtk::Popover popover;
popover.add(scale);
Gtk::MenuButton menuButton;
menuButton.set_popover(popover);
menuButton.set_image_from_icon_name("open-menu-symbolic");
menuButton.set_size_request(36, 36);
Gtk::Box contentBox;
contentBox.set_size_request(36, 36);
contentBox.pack_start(menuButton, Gtk::PACK_SHRINK);
Gtk::Box topBox{Gtk::ORIENTATION_VERTICAL};
topBox.pack_start(contentBox, Gtk::PACK_SHRINK);
topBox.show_all();
Gtk::Window window;
window.set_default_size(300, 300);
window.add(topBox);
return app->run(window);
}
Compile using:
g++ scale-popover-issue.cpp -o scale-popover-issue `pkg-config gtkmm-3.0 --cflags --libs`
How to trigger the bug:
- Open the popover.
- Place the mouse pointer over the slider, between the first and second notches.
- Trigger an increase of the slider value, either using the mouse wheel or with the keyboard (right arrow key). At this point the displayed value over the scale will increase, but the slider won't move.
- Move the mouse pointer out of the popover. At this point, the slider position will update.
Video showing the bug (mouse pointer doesn't appear): scale-popover-bug
I stumbled upon this bug in my application.
This bug doesn't happen on Xorg.
Using:
Fedora 30
Gtk 3.24.8
Mutter 3.32.2