Bug 327118 - Cursor is sometimes invisible or incorrectly themed
Summary: Cursor is sometimes invisible or incorrectly themed
Status: RESOLVED DUPLICATE of bug 327273
Alias: None
Product: kwin
Classification: Plasma
Component: general (show other bugs)
Version: 4.11.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-04 06:55 UTC by Jethro Beekman
Modified: 2013-11-09 22:25 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
C program that dumps cursor pixel data on cursor change (1.52 KB, text/plain)
2013-11-07 03:27 UTC, Jethro Beekman
Details
Error case: black arrow (458 bytes, image/png)
2013-11-07 03:28 UTC, Jethro Beekman
Details
Error case: invisible (96 bytes, image/png)
2013-11-07 03:28 UTC, Jethro Beekman
Details
Error case: X (153 bytes, image/png)
2013-11-07 03:28 UTC, Jethro Beekman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jethro Beekman 2013-11-04 06:55:46 UTC
I have this weird problem where the pointer sometimes becomes 
invisible/unthemed. I run "classic" GNOME with the KWin window manager. In 
KWin 4.10, the cursor would only become invisible/unthemed when showing a 
context menu in a GNOME/GTK application. However, starting in KWin 4.11, it 
also happens when:

* Using the Desktop Grid and Present Windows KWin effects
* Dragging a Window by it's title bar
* (And stilll when showing a context menu in a GNOME/GTK application)

In KWin 4.10 the first two actions would show a hand pointer and 
drag-and-drop hand, respectively.

The cursor that is (not) shown is different for different situations:

* Immediately after login trough gdm, it shows a black pointer. I saved this 
    pointer to a file and it looks like the left_ptr from the DMZ-Black theme.
    I use the DMZ-White theme.
* Immediately after manual start of Xorg, window manager and one program, it 
    shows the standard Xorg 'X' pointer.
* Immediately after starting intel-virtual-output and having the screens
    reconfigured automatically (I assume gnome-settings-daemon does this) the
    pointer is invisible. I saved this pointer to a file and it is an 8×8 
    completely transparent image.

When this happens, if I start the metacity window manager, the pointer is no 
longer invisible/unthemed for the above described actions, just the regular 
(DMZ-White) left_ptr. When I then start KWin again, the pointer is still normal.

I don't think this is a driver or a mesa issue, because it happens on an Intel
card as well as an NVIDIA card with both the binary driver and noueveau.

Versions of software I run:
Ubuntu 13.10
Linux 3.11.4-generic (built locally)
kde-window-manager 4.10.2-0ubuntu2 or 4.11.2-0ubuntu1
metacity 2.34.13-0ubuntu2
nvidia-331 331.17-0ubuntu1~xedgers~saucy1
xserver-xorg 7.7+1ubuntu6
xserver-xorg-core 1.14.3-3ubuntu2
xserver-xorg-video-intel 2.99.904-0ubuntu2
xserver-xorg-video-nouveau 1.0.9-2ubuntu1

This bugs sounds similar to #289336, but I *don't'* have any problems with 
the zoom effect.


Reproducible: Always
Comment 1 Thomas Lübking 2013-11-04 22:42:56 UTC
(In reply to comment #1)
> KWin 4.10, the cursor would only become invisible/unthemed when showing a 
> context menu in a GNOME/GTK application.
This would be rather an issue with GNOME/GTK

> * Using the Desktop Grid and Present Windows KWin effects
> * Dragging a Window by it's title bar
Sounds like bug #325763
There's patch https://git.reviewboard.kde.org/r/113177/
Is it an unthemed or an invisible pointer?

> The cursor that is (not) shown is different for different situations:
> 
> * Immediately after login trough gdm, it shows a black pointer. I saved this 
>     pointer to a file and it looks like the left_ptr from the DMZ-Black
> theme.

This is very likely the core (unthemed) pointer.

The important question here and for the rest is "on what" - if it's the pointer of the desktop window, it's a problem of the desktop window - if it's on a window decoration or during desktop grid etc. it's a problem of the WM and if it's on gtk popups, it's a problem of gtk.

a) is "env | grep XCURSOR" set (properly)? (XCURSOR_SIZE, XCURSOR_THEME)
b) is it set (properly) in "cat /proc/`pidof kwin`/environ"?
Comment 2 Jethro Beekman 2013-11-05 05:45:56 UTC
Sorry, don't have a lot of time today, I'll try the patch and reply more in depth tomorrow.

> > * Immediately after login trough gdm, it shows a black pointer. I saved this 
> >     pointer to a file and it looks like the left_ptr from the DMZ-Black
> > theme.
> 
> This is very likely the core (unthemed) pointer.

I'm not sure about that... the pointer has some shading to it, I would expect the core pointer to be pure black and white.
Comment 3 Jethro Beekman 2013-11-06 05:29:14 UTC
> > * Using the Desktop Grid and Present Windows KWin effects
> > * Dragging a Window by it's title bar
> Sounds like bug #325763
> There's patch https://git.reviewboard.kde.org/r/113177/

Tried this patch, unfortunately it doesn't fix any of the issues I described.

> Is it an unthemed or an invisible pointer?

I'm not sure I can provide you with a better answer than what I described in my original report.

> a) is "env | grep XCURSOR" set (properly)? (XCURSOR_SIZE, XCURSOR_THEME)
> b) is it set (properly) in "cat /proc/`pidof kwin`/environ"?

These are not set. I tried finding information on these variables online but they don't seem to be used a lot? My cursor theme is specified according to the XDG Icon specification, through /usr/share/icons/default/index.theme
Comment 4 Jethro Beekman 2013-11-06 06:00:46 UTC
Did some more debugging, steps to reproduce:

1. Download Kubuntu 13.10 ISO, boot it (e.g. in a VM)
2. Click 'Try Kubuntu'
3. Open Konsole
4. Type sudo chvt 1
5. Type sudo stop lightdm
6. Type sudo apt-get install xterm dmz-cursor-theme geany
7. Type startx bash
8. Type kwin & geany  &
9. Reproduce the issues by doing any the following:
* Drag a window by it's titlebar
* Press Ctrl-F10
* Right-click in geany
Comment 5 Thomas Lübking 2013-11-06 20:49:34 UTC
(In reply to comment #3)

> > Is it an unthemed or an invisible pointer?
> 
> I'm not sure I can provide you with a better answer than what I described in
> my original report.

An "unthemed" cursor is *not* invisible, but the aliased default cursor (eventually serverside shadowed) of the server.
 
> > a) is "env | grep XCURSOR" set (properly)? (XCURSOR_SIZE, XCURSOR_THEME)
> > b) is it set (properly) in "cat /proc/`pidof kwin`/environ"?
> 
> These are not set. I tried finding information on these variables online but
> they don't seem to be used a lot?

export XCURSOR_THEME=DMZ-White
kwin --replace &

Last chance: ensure your theme has a "size_all" cursor.
If no, smlink it to "fleur" or use this script:
http://kde-look.org/content/show.php/Cursor+theme+"fixing"+script?content=161037
Comment 6 Jethro Beekman 2013-11-07 03:27:47 UTC
Created attachment 83389 [details]
C program that dumps cursor pixel data on cursor change
Comment 7 Jethro Beekman 2013-11-07 03:28:17 UTC
Created attachment 83390 [details]
Error case: black arrow
Comment 8 Jethro Beekman 2013-11-07 03:28:34 UTC
Created attachment 83391 [details]
Error case: invisible
Comment 9 Jethro Beekman 2013-11-07 03:28:49 UTC
Created attachment 83392 [details]
Error case: X
Comment 10 Jethro Beekman 2013-11-07 03:31:28 UTC
> An "unthemed" cursor is *not* invisible, but the aliased default cursor
> (eventually serverside shadowed) of the server.

I've attached the cursors in question to this bug. They were captured using a program the source of which is also attached, and then converted to PNG with pnmtopng. Hope this helps.

> export XCURSOR_THEME=DMZ-White
> kwin --replace &

Doesn't help.

> Last chance: ensure your theme has a "size_all" cursor.
> If no, smlink it to "fleur" or use this script:
> http://kde-look.org/content/show.php/
> Cursor+theme+"fixing"+script?content=161037

It doesn't. I'll try this next.
Comment 11 Jethro Beekman 2013-11-07 03:40:23 UTC
> Last chance: ensure your theme has a "size_all" cursor.
> If no, smlink it to "fleur" or use this script:
> http://kde-look.org/content/show.php/
> Cursor+theme+"fixing"+script?content=161037

Thanks, this resolved the 4.11 regression.

I do get: *** WARNING *** No usable cursor for O_HAND. I checked, and none of the themes installed have any of the valid alternatives for that cursor?
Comment 12 Thomas Lübking 2013-11-07 12:36:59 UTC
would be one of:
 openhand
 all_scroll
 all-scroll
 9141b49c8149039304290b508d208c40

*** This bug has been marked as a duplicate of bug 327273 ***
Comment 13 Jethro Beekman 2013-11-09 17:13:52 UTC
For the remaining issue, the GNOME/GTK people are not convinced it's their problem: https://bugzilla.gnome.org/show_bug.cgi?id=711582
Comment 14 Thomas Lübking 2013-11-09 18:21:21 UTC
try running "kapplymousetheme" for that matter.
the idea that the WM would be the item to set the session theme seems odd to me.
Comment 15 Jethro Beekman 2013-11-09 18:40:28 UTC
Ok, after I figured out you're supposed to run that with two empty arguments, that works.
Comment 16 Jethro Beekman 2013-11-09 18:51:59 UTC
Actually, how is this supposed to work for real? kapplymousetheme just configures it once, but it can get broken mid-session (e.g. after intel-virtual-output as described above).
Comment 17 Jethro Beekman 2013-11-09 19:05:38 UTC
> but it can get broken mid-session (e.g. after
> intel-virtual-output as described above).

Actually, this is probably not a KWin bug as metacity has the same problem (unless they're both buggy).
Comment 18 Thomas Lübking 2013-11-09 20:56:42 UTC
The command is invoked by "startkde" - i guess that "intel-virtual-output" resets the root window property (for whatever reason)

-> just re-run kapplymousetheme

(somehow seems to stress that 1. the WM is not the right tool to do this and 2. inheriting the property from the parenting window is not very robust ;-)
Comment 19 Jethro Beekman 2013-11-09 22:25:40 UTC
> -> just re-run kapplymousetheme

That's not a real solution, this should be automatic.

Filed another bug here: https://bugs.freedesktop.org/show_bug.cgi?id=71439