GNOME Bugzilla – Bug 650604
Hide mouse pointer if no mice
Last modified: 2011-11-11 09:14:49 UTC
If we don't have a mouse, touchpad, or similar, connected, and only have a touchscreen device, we should hide the cursor itself. Peter, is there X API to do that?
It might be interesting to use the spinner next to the App name when a busy cursor would be used too.
XFixesHideCursor(display, window) and XFixesShowCursor(display, window), provided XFIXES version 4 or greater. We don't have a useful way to find out which devices are "real" and which ones are devices like "Video Bus" though. You can test for the virtual XTest devices by testing for the "XTEST Device" property on the device.
(In reply to comment #2) > XFixesHideCursor(display, window) and XFixesShowCursor(display, window), > provided XFIXES version 4 or greater. I'm guessing that means that the toolkit needs to know about it as well, so that the apps don't show the cursor either. I'm starting to think that we might as well use a different cursor theme. > We don't have a useful way to find out which devices are "real" and which ones > are devices like "Video Bus" though. You can test for the virtual XTest devices > by testing for the "XTEST Device" property on the device. We can test for having a touchscreen first, so we never end up hiding the cursor in the wrong case. (In reply to comment #1) > It might be interesting to use the spinner next to the App name when a busy > cursor would be used too. I have no idea how we would get that information from the X server though.
(In reply to comment #3) > (In reply to comment #2) > > XFixesHideCursor(display, window) and XFixesShowCursor(display, window), > > provided XFIXES version 4 or greater. > > I'm guessing that means that the toolkit needs to know about it as well, so > that the apps don't show the cursor either. I'm starting to think that we might > as well use a different cursor theme. bit out of my depth here but I _think_ that hide cursor overrides app cursor updates. so even if the application changes cursors they will be invisible until a ShowCursor is called. Plus, HideCursor/ShowCursor are a stack, if you call it on the root window the cursors should be invisible until you pop the stack. but yes, gtk would have to expose this call first too. > (In reply to comment #1) > > It might be interesting to use the spinner next to the App name when a busy > > cursor would be used too. > > I have no idea how we would get that information from the X server though. how is the current spinning cursor decided on? wouldn't it be the same thing?
commit 3d2f33aa46f2c524fbd0c00def12fa1c7178a71c Author: Bastien Nocera <hadess@hadess.net> Date: Tue Jun 7 18:09:02 2011 +0100 cursor: Hide cursor on tablets with only a touchscreen When a tablet is available and no external pointer devices are available, hide the cursor. https://bugzilla.gnome.org/show_bug.cgi?id=650604 Filed the gnome-shell part of the bug in bug 652066.