After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 334446 - automatic range scrolling and dialog popups
automatic range scrolling and dialog popups
Status: RESOLVED WONTFIX
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal normal
: Medium feature
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-03-13 15:25 UTC by Tim Janik
Modified: 2006-04-20 15:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
maemo-gtk pseudo patch, stripped of irrelevant stuff (1.44 KB, patch)
2006-03-13 15:31 UTC, Tim Janik
rejected Details | Review
testcase that pops up a dialog for adjustment values >75% (999 bytes, text/x-csrc)
2006-03-13 15:37 UTC, Tim Janik
  Details

Description Tim Janik 2006-03-13 15:25:08 UTC
maemo-gtk contains a patch that stops automatic scrolling in gtkrange.c upon focus-out events. it is not entirely sure that this is a good idea, however i'll attach the original patch as reference and a test case that i created.
Comment 1 Tim Janik 2006-03-13 15:31:13 UTC
Created attachment 61181 [details] [review]
maemo-gtk pseudo patch, stripped of irrelevant stuff

this patch adds a focus-out handler that calls stop_scrolling() which is provided by gtkrange.c and stops the timer and removes the grab.
Comment 2 Tim Janik 2006-03-13 15:37:18 UTC
Created attachment 61183 [details]
testcase that pops up a dialog for adjustment values >75%

this test case will pop up a window with a scrollbar. when the slider moves to >75%, a new dialog is popped up that gets the focus. the right arrow of the scrollbar can be used in conjunction with auto-repeat scrolling to create the described scenrio (auto-repeat continues across the new dialog popping up).
Comment 3 Matthias Clasen 2006-03-14 17:11:41 UTC
If we decide to do this, we should do it unconditionally (looking at the
"hildonlike" bits)
Comment 4 Matthias Clasen 2006-03-14 17:15:01 UTC
And if we do it, we probably want to treat other places in the same way,
like the button-repeat in the spinbutton, calendar, pathbar
Comment 5 Tim Janik 2006-03-14 21:35:23 UTC
yeah, forget the hildonlike stuff, that is just uncleaned patch cruft. the question is more if this is really something worth fixing in head...
Comment 6 Matthias Clasen 2006-03-21 16:02:46 UTC
well, you proposed to fix it in the first place, so you probably have some interest in fixing it... its fine with me. As I said, I think the same principle should apply to spinbutton, calendar and pathbar, but we can treat them separately.
Comment 7 Tim Janik 2006-03-28 14:35:17 UTC
well, initially i said "it is not entirely sure that this is a good idea", and it turns out it's in fact not. ;)
at least not with the patch in its current form.

mitch points out that a focus_out handler only gets triggered for CAN_FOCUS() widgets, and scrollbars/ranges are by default !CAN_FOCUS(). so the logic added by the patch isn't actually triggered.
running the test with --gdk-debug=events and described as above, you can observe that the toplevel window does indeed get a focus_out event (toplevels get this unconditionally) when the new dialog pops up.

i think if we really want to fix this kind of behaviour, we probably should do this:
- once toplevels get !NotifyInferior focus_out events during grabs, cancel the currently active X grab and emit ::grab_broken_event appropriately.
- add cleanup logic like stop_scrolling() in the above patch to the grab_broken_event() event handler of ranges, spinbuttons, etc.
Comment 8 Matthias Clasen 2006-03-29 18:42:12 UTC
You intend to leave this open for further musings, Tim ?
Comment 9 Tim Janik 2006-04-20 15:02:09 UTC
re comment #8, no, i'm not leaving this open, because:
a) scrollbars/ranges which are CAN_FOCUS are exceptionally rare, so the original patch won't have much effect anyway;
b) if we want abort logic to be triggered when new dialogs pop up, something like the ::grab-borken-event logic is needed as outlined in comment #7;
c) i am not even convinced that gtk really needs the ::grab-borken-event logic outlined, i'm inclined to wait for a reasonable usecase description or accessibility reason before actually working on this.

so i'll close the bug as WONTFIX for now, we can reopen it at any point later anyway.