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 761676 - Touch text selection handles don't move on scroll
Touch text selection handles don't move on scroll
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-02-07 17:40 UTC by Ben
Modified: 2016-02-24 17:37 UTC
See Also:
GNOME target: 3.20
GNOME version: ---


Attachments
picture of the bug (317.79 KB, image/jpeg)
2016-02-07 17:40 UTC, Ben
  Details
testcase (729 bytes, text/plain)
2016-02-21 20:06 UTC, Ben
  Details
GtkTextHandle: Look up for the first child of a scrolled window found (2.21 KB, patch)
2016-02-24 16:26 UTC, Carlos Garnacho
committed Details | Review

Description Ben 2016-02-07 17:40:48 UTC
Created attachment 320578 [details]
picture of the bug

If you have, say, a listbox, select some text and then scroll it (all via the touchscreen). In the app I used I had ListBox > ScrolledWindow > TextView.
Comment 1 Matthias Clasen 2016-02-21 06:11:56 UTC
A small testcase would be helpful
Comment 2 Ben 2016-02-21 20:06:52 UTC
Created attachment 321791 [details]
testcase
Comment 3 Carlos Garnacho 2016-02-22 20:43:29 UTC
Hmm, text handles currently hook up to the first GtkScrollable found. In this case that's the per-row GtkTextView itself, not the GtkViewport containing the GtkListBox.

I guess we could connect to scrollables up the hierarchy, but maintaining the scrollable and adjustment signals will be kind of a pain...

FWIW, if multiline is not needed, GtkEntry won't have this problem.
Comment 4 Carlos Garnacho 2016-02-22 20:44:38 UTC
Which I see it is in the photo attached in comment #0... nevermind
Comment 5 Matthias Clasen 2016-02-24 02:47:11 UTC
could we skip the scrollable if it isn't actually used for scrolling ?
Comment 6 Carlos Garnacho 2016-02-24 15:27:06 UTC
(In reply to Matthias Clasen from comment #5)
> could we skip the scrollable if it isn't actually used for scrolling ?

Right, I guess we want the scrollable that's actually a child of a GtkScrolledWindow, we can look up for this indeed.
Comment 7 Carlos Garnacho 2016-02-24 16:26:13 UTC
Created attachment 322256 [details] [review]
GtkTextHandle: Look up for the first child of a scrolled window found

Text handles use to connect to the first GtkScrollable up the hierarchy
so they can be repositioned when scrolling. It makes more sense to look
up the first child of a GtkScrolledWindow, it must be an scrollable too,
and will be the scrollable that can actually change the position of the
text handles.
Comment 8 Matthias Clasen 2016-02-24 16:49:51 UTC
Review of attachment 322256 [details] [review]:

::: gtk/gtktexthandle.c
@@ +558,3 @@
+
+  return gtk_bin_get_child (GTK_BIN (scrolled_window));
+}

I guess you could construct contrived examples where more than one scrolledwindow in the ancestry could make the handles move, but lets just ignore that for the time being.
Comment 9 Carlos Garnacho 2016-02-24 17:37:16 UTC
Attachment 322256 [details] pushed as 60d7f43 - GtkTextHandle: Look up for the first child of a scrolled window found