Incorrect Xcursor being set.

Bug #1543075 reported by Michael Heyns on 2016-02-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LightDM Webkit Greeter
High
Scott Balneaves

Bug Description

Xcursor theme set by Xresources.

Starting session via xinit and lightdm-gtk-greeter sets the correct cursor for root window.

Starting session via llightdm-webkit-greeter sets the wrong (default) cursor for root window. (panels/apps correct, as expected)

Scott Balneaves (sbalneav) wrote :

Which version of lightdm-webkit-greeter are you using, Michael?

Michael Heyns (mike-bean-heyns) wrote :

Hi, Scott. I should have mentioned that I'm using the mainline branch, revision 24. (current trunk)

Scott Balneaves (sbalneav) wrote :

Could you try release 2.0, see if there's any difference?

Here's all I'm seeing:

In lightdm-gtk-greeter, the line to set the cursor is:

gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new (GDK_LEFT_PTR));

Whereas we're using

gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new_for_display (gdk_display_get_default (), GDK_LEFT_PTR));

I'm wondering if we'll have to put in an #if GTK_CHECK_VERSION (3, 0, 0) in there to select between the two.

Are you using GTK 2?

Michael Heyns (mike-bean-heyns) wrote :

Release 2.0 shows the same behaviour. I believe I am using gtk3, lightdm-webkit-greeter pulls
webkitgtk3-2.4.9 and I can use it without gtk2 installed.

I have tried the following to no effect, I'm not certain if it is even correct:

    #if GTK_CHECK_VERSION(3,0,0)
        gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new (GDK_LEFT_PTR));
    #else
        gdk_window_set_cursor (gdk_get_default_root_window (), gdk_cursor_new_for_display (gdk_display_get_default (), GDK_LEFT_PTR));
    #endif

I also tried simply replacing the line. No change.

I have also set the cursor in gtk3 settings.ini and gtk2 rc for good measure.

Michael Heyns (mike-bean-heyns) wrote :

Huzzah.

https://bugs.launchpad.net/lightdm-gtk-greeter/+bug/1024482 gives plenty insight into the behaviour. Especially Daniel Gnoutcheff's comment https://bugs.launchpad.net/lightdm-gtk-greeter/+bug/1024482/comments/15.

The following env variable solves the problem. At least with the #if condition from above applied. I haven't reverted it yet.

    g_setenv ("GDK_CORE_DEVICE_EVENTS", "1", TRUE);

Scott Balneaves (sbalneav) wrote :

Rather than implement the g_setenv solution, which I was concerned might have other unintended consequences, instead I implemented Daniel Gnoutcheff's code in his bug. It's in commit #60. Can you try the trunk, and see if that works for you now? If so, I'll stage a 2.1 release.

Changed in lightdm-webkit-greeter:
status: New → In Progress
importance: Undecided → High
assignee: nobody → Scott Balneaves (sbalneav)
Michael Heyns (mike-bean-heyns) wrote :

Hi Scott,

Unfortunately, the latest commit has no effect.

I have tested i3wm, AwesomeWM and Openbox sessions.

Scott Balneaves (sbalneav) wrote :

Is the cursor correct in the lightdm-webkit-greeter? Are you saying the cursor is set correctly (i.e. a left pointer) in the webkit greeter, but it's not subsequently a left pointer in your session that gets spawned?

Michael Heyns (mike-bean-heyns) wrote :

The cursor for the greeter is the expected default, I haven't made any modification outside of the user apart from webkit theme.

The cursor is set for the user via Xresources by the session-wrapper (lightdm-session on Debian and Xsession on Arch) executed as user upon login.

At the moment, using lightdm-webkit-greeter, left pointer for the user's root window is locked to that same default. Not even xsetroot can modify it anymore. Cursor is fine for panels and applications but not root window.

I discovered the above bug report via this Gentoo wiki entry https://wiki.gentoo.org/wiki/LightDM#Cursor_themes_not_working

I don't know if this is even worth mentioning, but apart from my preference of the Breeze cursor set, my folks need a larger size cursor for accessibility reasons. So moving between windows, the cursor switches sizes too.

Scott Balneaves (sbalneav) wrote :

OK, I've now committed commit #61. This commit doesn't set a root pointer at all, it only sets the pointer for the lightdm window. Please give that a try and see if it has the desired behaviour.

Apologies for taking so long to reply.

I tested the new commit, and unfortunately still no change. xsetroot also still has no effect.

Scott Balneaves (sbalneav) wrote :

Ok, well, at this point, I'm going to say your problem lies elsewhere, since we are now not setting a root pointer at all; only a pointer for the lightdm-webkit-greeter window. If your root pointer isn't correct at this point, then the problem has to lie with your session manager, or something else.

I'm not really sure what the session manager is. From the xsm and XSMP docs I kind of understand the idea but I'm not sure which package/files/processes are responsible in my case.

I have run the following tests over the weekend, all default configurations apart from:

__ ~/.Xresources __

    Xcursor.theme: Breeze-Default
    Xcursor.size: 48
__

| | Fedora23 | Ubuntu15.10 | openSuseTW | ArchLinux |
| | w.k. | gtk | w.k. | uni | gtk | w.k. | gtk | w.k. | gtk |
|-----------|------|-----|------|-----|-----|------|-----|------|-----|
| openbox | N | Y | Y | Y | Y | Y | Y | N | Y |
| i3wm | N | Y | Y | N | Y | Y | Y | N | Y |
| icewm | N | Y | Y | N | Y | Y | Y | N | Y |
| awesome | N | Y | Y | N | Y | Y | Y | N | Y |
| dwm | N | Y | Y | N | Y | Y | Y | N | Y |
| ratpoison | N | x | x | N | x | x | x | N | x |
| xmonad | N | Y | x | N | x | x | x | N | x |
| unity | - | - | Y | Y | Y | - | - | - | |

Y = correct cursor set
x = wrong cursor set on login, can be with xsetroot
N = wrong cursor set on login, xsetroot powerless

Note: openSUSE uses the XCURSOR_THEME method. I disabled it first.

If it indeed is not anything to do with the webkit greeter, I'd really appreciate if you could point me in the right direction. Thank you, Scott.

Ugh. Launchpad's comment submission removed the whitespaces.

I have drawn up the table again here: http://i.imgur.com/4M0BFV6.png

Scott Balneaves (sbalneav) wrote :

Questions:

1) How are you getting lightdm-webkit-greeter on these distros?
2) OpenBox, i3wm, etc, are all *window* managers, they're not *desktop* managers. You'll have to have some kind of .xinitrc or something that's doing an xrdb -merge or whatever. What is it?
3) When xsetroot fails, does it give an error? What's it's exit code?

1) Arch has a lightdm-webkit-greeter-bzr package, the rest I have to manually build.
2) I used window managers as they have minimal or no impact on the root window. lightdm's 'session-wrapper' is run as the user upon login. Below are the lightdm package defaults for Debian [1]; Arch Linux [2]; Fedora [3] and openSUSE [4]. The setting is confirmed with `xrdb -query`.
3) xsetroot exits successfully. I asked around on #Xorg and apparently there is no method for querying currently defined cursor for a window.

[1] http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/lightdm/wily/view/head:/debian/lightdm-session#L44
[2] https://projects.archlinux.org/svntogit/packages.git/tree/trunk/Xsession?h=packages/lightdm#n15
[3] http://pkgs.fedoraproject.org/cgit/rpms/xorg-x11-xinit.git/tree/xinitrc-common#n30
[4] http://www.termbin.com/yag2

Scott Balneaves (sbalneav) wrote :

OK, I'm running on debian jessie. Here's what I did.

Installed xcursor-themes package, installed openbox package
running on commit 71 of lightdm-webkit-greeter using simple theme.
Added your exact lines to my .Xresources

Log in with lightdm-webkit-greeter. As expected, get the small mouse left mouse pointer for the background.

Soon as I log in, I get a large root pointer of a left pointer.

That what I'm supposed to see?

That is correct, yes.

Oh, gosh. I was in the process of making a screencast when I discovered the webkit-greeter-bzr package used by Arch Linux links to lp:~lightdm-team/lightdm-webkit-greeter/trunk, which is still on commit 24. Double checking the Fedora23 VM, it is clear I used that repository in that build too. Launchpad is very unfamiliar to me, and I should have been more vigilant.

Using the correct repository, I can confirm that the issue has since been resolved on all distributions.

I am sincerely sorry for dragging this out. Thank you for the time spent on this, Scott.

Scott Balneaves (sbalneav) wrote :

Hey hey fantastic. Glad we got it fixed. I'll close the bug.

Changed in lightdm-webkit-greeter:
status: In Progress → Fix Committed
Yann (chezyann) wrote :

Thank you for this bugfix !

I fixed it on my computer but a newer problem occurs (am I alone ?) :

On each boot, when I log-in I have my brand new cursor but If I log-out and re log-in, I do not have my new cursor back :(

Am I alone ?

Thank you

(Is there a way to change the lightdm-webkit-greeter cursor, to see when the problem occurs ?)

Infos : I'm on Gentoo 32bits + XFCE4

Yann (chezyann) wrote :

My bug seems to be the same as :
https://bugzilla.xfce.org/show_bug.cgi?id=7415

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.