#729402 oneko: Resets cursor image to default X-shape on exit

Package:
oneko
Source:
oneko
Description:
cat chases the cursor (now a mouse) around the screen
Submitter:
Guillem Jover
Date:
2023-02-23 00:39:13 UTC
Severity:
normal
Tags:
#729402#5
Date:
2013-11-12 16:33:09 UTC
From:
To:
Hi!

After quitting the program, the cursor image gets reset to the default
X.Org ‘X’ pointer shape. On awesome, just resetting the window manager
restores the cursor image.

Thanks,
Guillem

#729402#12
Date:
2013-11-13 00:19:09 UTC
From:
To:
tags 729402 confirmed patch
thanks

  Hey Guillem! :)

  Just tried and yes, on awesome it leaves the x-shaped pointer upon exit.
  Strangely on KDE this doesn't happen, for example. I've found also there's
  no need to restart awesome, starting some other application fixes the
  pointer automagically :-? (tried with gedit and also with xedit just to
  be sure it wasn't a GTK+ side effect).

  Anyway this seems to be a feature: you can try “oneko -cursor 132”
  as manpage suggests, and the default root cursor will be restored, instead
  of the x-shaped one. The untested attached patch should also fix it.

  best regards,

#729402#17
Date:
2013-11-13 20:40:00 UTC
From:
To:
Hey Ricardo!

Hmm, starting xedit for example from the same konsole from where I
started oneko, does not fix it for me. Ah, ok, it restores it only
if I start it from awesome's prompt (or I guess from the menu). So
maybe it's awesome's doings.

As long as the purpose of the program is to only switch the cursor
image temporarily while it is running, I'm not sold on it having
side-effects after it has finished as a feature. :)

Oh wow, I did check in the man page, I don't know now what I searched
for though. In any case having tested the -cursor option now, it sets
up a similar but not identical cursor to the previous one (the new one
is a bit more tilted to the left), I can attach images if you want. :)

I investigated a bit about this, and I've not found a clear way to
save the currently running cursor to restore it afterwards. The
Xfixes X extension has some stuff but does not seem enough, neither
the Xcursor library, nor Xlib's XGetWindowAttributes() which does
not seem to expose the cursor attribute that you can change with
XChangeWindowAttributes(). But this all seems rather confusing.

Although maybe this is an awesome bug (heh), and it should be changing
the default cursor as pointed by the None Cursor value to be the root
window cursor.

Thanks,
Guillem

#729402#22
Date:
2014-02-05 02:35:53 UTC
From:
To:
Good day!

I found the least invasive way to restore the actual default left_ptr cursor from the Terminal. Issue the command:
xsetroot -xcf /usr/share/icons/Adwaita/cursors/left_ptr 24

Three other methods work (in my Debian Wheezy):

Alt+F2
r
[Enter]


Launch Applications => System Tools => System Settings and it automatically resets.


Refresh the shell with the Terminal command:
nohup gnome-shell --replace >/dev/null 2>&1 &
(survives closing the Terminal window)

Until there's a stable fix, I'm hoping this helps.

#729402#27
Date:
2023-02-23 00:07:42 UTC
From:
To:
Hi,
was digging a bit into this because we've put oneka as a rare easter egg event into our distro ( c.f. https://github.com/fsfw-dresden/usb-live-linux/tree/main/features/config_desktop_cats ) and the cursor was not restored properly. Turns out the 132 in cursor 132 (aka "top_left_arrow") suggested by the oneko man page to be the default root cursor is not what works on modern DEs. There, we want 68 ("left_ptr") .. as in the xsetroot command Charles has given 9 years ago.

See https://tronche.com/gui/x/xlib/appendix/b/ for a complete visual list of X cursors...

The two attached patches should help, one documents the number 68 to be a more adequate choice for modern DEs, the other expands on Ricardo's 2013 patch and makes oneko restore left_ptr (68) by default.

Best Regards
Marcel