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 758025 - cursor flickering
cursor flickering
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-11-12 18:59 UTC by Matthias Clasen
Modified: 2015-11-20 17:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Set a null cursor surface when cursor buffer is null (1.83 KB, patch)
2015-11-20 09:11 UTC, Jonas Ådahl
committed Details | Review

Description Matthias Clasen 2015-11-12 18:59:11 UTC
when I type in gnome-terminal or in gedit (or any other application using a gtktextview), the cursor starts flickering, as if it is drawn at various offsets, vertically.

This does not happen under weston.

The fact that it starts as soon as I type and stops as soon as I move the mouse makes me think it has something to do with vte/gtk+ trying to hide the mouse pointer during keyboard input.
Comment 1 Matthias Clasen 2015-11-13 02:03:46 UTC
https://mclasen.fedorapeople.org/20151112_195429.mp4
Comment 2 Matthias Clasen 2015-11-14 14:45:58 UTC
to reproduce this here, it is enough to click on the 'blank cursor' button in the cursors example in gtk3-demo.
Comment 3 Matthias Clasen 2015-11-17 00:24:01 UTC
I've put a WAYLAND_DEBUG=1 log of gedit when this flicker occured here:
https://mclasen.fedorapeople.org/gedit-wayland-debug.txt
Comment 4 Jonas Ådahl 2015-11-17 01:14:42 UTC
For the record, after investigating this with Matthias a bit, the flicker seems to be caused by gtk+ for some reason setting the blank cursor hotspot to a very high number, causing the cursor to move offscreen. This causes the cursor surface to leave the wl_output, causing gtk+ to set the cursor again, but now for some reason with the hotspot (0, 0). This new hotspot causes the cursor to jump back to within the wl_output region, and as a result, gtk+ again sets the hotspot to something odd. Then it repeats, again and again, causing glitches.
Comment 5 Jasper St. Pierre (not reading bugmail) 2015-11-17 02:46:23 UTC
Hm. Why would setting the cursor hotspot cause GTK+ to do anything? Leaving the wl_output shouldn't do anything -- do we send any events to GTK+ because of that?
Comment 6 Jonas Ådahl 2015-11-17 03:11:06 UTC
1. GTK+ sets a funky cursor hotspot causing the actual cursor surface to end up off screen
2. mutter sends "wl_surface.leave" to the cursor surface because thats what happened
3. GTK+ sets a non-funky hotspot (0, 0) causing the cursor surface to end up on screen
4. mutter sends "wl_surface.enter" to the cursor surface because thats what happened
5. goto 1.
Comment 7 Jonas Ådahl 2015-11-17 03:14:59 UTC
The reason why leaving the output causes set_cursor is because GTK+ is lazy and just calls wl_pointer_set_cursor no matter what (because if it didn't change its a no-op anyway). The real issue here is that setting a empty cursor has an incorrect hotspot.
Comment 8 Jonas Ådahl 2015-11-20 09:11:09 UTC
Created attachment 315942 [details] [review]
wayland: Set a null cursor surface when cursor buffer is null

If the buffer of a cursor is NULL, for example if its an empty cursor,
just set the cursor surface to NULL as well. Not doing this we'll use
uninitialized hotspot coordinates, dimensions and scales.

-----

As I've yet to reproduce this bug, I have not verified that this patch fixes
the issue. It does send more sane data to the compositor however.
Comment 9 Matthias Clasen 2015-11-20 17:03:29 UTC
Attachment 315942 [details] pushed as dc65abc - wayland: Set a null cursor surface when cursor buffer is null