ui: a press anywhere in the window closes the time-window popover
The window control is a GtkMenuButton whose popover autohides -- which works for as long as
GTK holds the popover's grab, and the grab is what can go missing: a window manager moving
it, the nested popover the unit dropdown opens taking it, and every headless run, where
there is no manager to hand one out at all. After that a click anywhere else in the window
leaves the bubble up, which is the "sometimes it is awkward to close" report.
`on_window_popover_press()` states the rule outright instead of relying on the grab: any
press that reaches the window's own surface closes it. That needs no hit test beyond the
button -- a popover is its own surface, so a click *inside* it never arrives here -- and the
button is left alone, because its own click is the toggle that closes it. The press gesture
is on the window in the capture phase, so a widget under the press (the plot's own gestures
among them) cannot hide it.
[windowpop] reads both halves, with autohide turned off for the probe -- the state a user
meets when the grab goes missing:
[windowpop] opened=1 visible=1 click_gestures=2
[windowpop] after a press elsewhere: active=0 (want 0)
[windowpop] after a press on the button: active=1 (want 1)
`click_gestures` is read as well as the handler, so "the rule works" and "the rule is
connected" are two facts rather than one.
This commit is contained in:
1 parent
47d49e75ff
commit
d34b97158e
5 files changed
+126
No files matched your search
@@ -1349,6 +1349,11 @@ gboolean zoomkeys_probe(gpointer user);
|
||||
void menus_probe_next(App& a, int step, guint delay_ms);
|
||||
void menu_row_labels(GtkWidget* box, GtkWidget** label, GtkWidget** accel);
|
||||
gboolean menus_probe_step(gpointer user);
|
||||
gboolean windowpop_probe_step(gpointer user);
|
||||
|
||||
/// Closes the time-window popover when a press lands elsewhere in the window (see ui.cpp). Declared for
|
||||
/// the probe, which drives it and presses the button to check the one case that must *not* close it.
|
||||
void on_window_popover_press(GtkGestureClick* gesture, int n_press, double x, double y, gpointer user);
|
||||
gboolean color_probe(gpointer user);
|
||||
gboolean reseq_probe(gpointer user);
|
||||
void capture_probe_next(App& a, int step, guint delay_ms);
|
||||
|
||||
Reference in new issue
Block a user