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 745752 - wayland: cursor is out of screen after logging
wayland: cursor is out of screen after logging
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: wayland
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on: 745121
Blocks:
 
 
Reported: 2015-03-06 15:54 UTC by Marek Chalupa
Modified: 2015-03-09 13:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Set cursor initial position to the center of primary monitor (2.12 KB, patch)
2015-03-06 15:54 UTC, Marek Chalupa
none Details | Review
Make sure the pointer is in the visible area after native backend init (1.24 KB, patch)
2015-03-09 11:52 UTC, Marek Chalupa
committed Details | Review

Description Marek Chalupa 2015-03-06 15:54:54 UTC
Created attachment 298727 [details] [review]
Set cursor initial position to the center of primary monitor

It happens me all the time - when I start gnome-shell, the cursor is not visible. Did some debugging and found out that it is displayed, just on some coordinates like: -4538 x 123 or similar. When I'm lucky, I just get it somehow to the screen... Don't know if it does the same under X11.

Attached patch moves cursor to the center of primary monitor after backend init.
Comment 1 Rui Matos 2015-03-06 16:46:13 UTC
(In reply to Marek Chalupa from comment #0)
> It happens me all the time - when I start gnome-shell, the cursor is not
> visible. Did some debugging and found out that it is displayed, just on some
> coordinates like: -4538 x 123 or similar. When I'm lucky, I just get it

This should definitely no happen and doesn't for me. Clutter initializes the pointer coordinates on https://git.gnome.org/browse/clutter/tree/clutter/evdev/clutter-device-manager-evdev.c#n727

> somehow to the screen... Don't know if it does the same under X11.

The X server takes care of this for us.

> Attached patch moves cursor to the center of primary monitor after backend
> init.

If we really need this then it should be in the native backend. See also bug 745121 .
Comment 2 Marek Chalupa 2015-03-09 11:45:59 UTC
(In reply to Rui Matos from comment #1)
> (In reply to Marek Chalupa from comment #0)
> > It happens me all the time - when I start gnome-shell, the cursor is not
> > visible. Did some debugging and found out that it is displayed, just on some
> > coordinates like: -4538 x 123 or similar. When I'm lucky, I just get it
> 
> This should definitely no happen and doesn't for me. Clutter initializes the
> pointer coordinates on
> https://git.gnome.org/browse/clutter/tree/clutter/evdev/clutter-device-
> manager-evdev.c#n727

Yes, I don't know why I was getting the weird values - I can't reproduce it anymore. However, even after having clutter to initialize the device properly, the cursor can appear off the screen. When the displays are arranged so that the clutter's initial position is not in visible area (atm the initial position is 16x16):

            |------------------|
   x        |                  |
|-----------|                  |
|           |                  |
|           |                  |
|-----------|------------------|

And I can confirm it is true.

> > somehow to the screen... Don't know if it does the same under X11.
> 
> The X server takes care of this for us.
> 
> > Attached patch moves cursor to the center of primary monitor after backend
> > init.
> 
> If we really need this then it should be in the native backend. See also bug
> 745121 .

Yes, that's definitely true.
Comment 3 Marek Chalupa 2015-03-09 11:52:23 UTC
Created attachment 298870 [details] [review]
Make sure the pointer is in the visible area after native backend init

This patch depends on 745121
Comment 4 Rui Matos 2015-03-09 13:29:53 UTC
Review of attachment 298870 [details] [review]:

Ah, right, we could still be outside the visible area if there's no monitor at (0,0) .

So, you were probably seeing those values because you moved your pointer and in this case since the pointer wasn't inside the visible area, the constraining callback wasn't working.