Skip to contentSkip to conversation

xserver-nodm-init: option to remove cursor

PATCH In review Trevor Woerner 2 participants 5 messages Mar 25, 2017 – Mar 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xserver-nodm-init: option to remove cursor

Add a PACKAGECONFIG option to allow the user to disable the mouse cursor/pointer in the X server. This might be useful where a touchscreen is used.

---
 .../recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in | 2 +-
 meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb              | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
meta/recipes-graphics/x11-common/xserver-nodm-init/xserver-nodm.conf.in +1 -1
index 757c23d95a..4a9670d8d2 100644
@@ -2,6 +2,6 @@
 
 XSERVER=/usr/bin/Xorg
 DISPLAY=:0
-ARGS=" -br -pn @BLANK_ARGS@ "
+ARGS=" -br -pn @BLANK_ARGS@ @NO_CURSOR_ARG@ "
 HOME=@HOME@
 USER=@USER@
meta/recipes-graphics/x11-common/xserver-nodm-init_3.0.bb +3 -0
index 62da11800c..345b589696 100644
@@ -24,6 +24,7 @@ REQUIRED_DISTRO_FEATURES = "x11"
 PACKAGECONFIG ??= "blank"
 # dpms and screen saver will be on only if 'blank' is in PACKAGECONFIG
 PACKAGECONFIG[blank] = ""
+PACKAGECONFIG[nocursor] = ""
 
 do_install() {
     install -d ${D}${sysconfdir}/default
@@ -35,6 +36,7 @@ do_install() {
     install X11/Xsession ${D}${sysconfdir}/X11/
 
     BLANK_ARGS="${@bb.utils.contains('PACKAGECONFIG', 'blank', '', '-s 0 -dpms', d)}"
+    NO_CURSOR_ARG="${@bb.utils.contains('PACKAGECONFIG', 'nocursor', '-nocursor', '', d)}"
     if [ "${ROOTLESS_X}" = "1" ] ; then
         XUSER_HOME="/home/xuser"
         XUSER="xuser"
@@ -44,6 +46,7 @@ do_install() {
     fi
     sed -i "s:@HOME@:${XUSER_HOME}:; s:@USER@:${XUSER}:; s:@BLANK_ARGS@:${BLANK_ARGS}:" \
         ${D}${sysconfdir}/default/xserver-nodm
+    sed -i "s:@NO_CURSOR_ARG@:${NO_CURSOR_ARG}:" ${D}${sysconfdir}/default/xserver-nodm
 
     if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
         install -d ${D}${systemd_unitdir}/system
Signature · 1 line
2.12.0.rc1.48.g076c053
#1 lore raw
Quoted 4 lines · Trevor Woerner

Add a PACKAGECONFIG option to allow the user to disable the mouse cursor/pointer in the X server. This might be useful where a touchscreen is used.

This is what the touchscreen variable in the formfactor recipe is for. Is this not sufficient?

Ross

#2 lore raw
Quoted 9 lines · Ross
Quoted 4 lines · Trevor Woerner

Add a PACKAGECONFIG option to allow the user to disable the mouse cursor/pointer in the X server. This might be useful where a touchscreen is used.

This is what the touchscreen variable in the formfactor recipe is for. Is this not sufficient?

To be honest I hadn't noticed formfactor before I created my patch. But looking at it now, no, I don't think it would be sufficient. I'll take a couple stabs at it, but I don't think it'll do what I want.

What I want is to get rid of the mouse pointer completely. Formfactor has variables that would appear to affect things like rotation and whether or not the calibration routine gets called when X starts up. I don't see anything in there that can disable the showing of the pointer.

#3 lore raw
Quoted 7 lines · Trevor Woerner

What I want is to get rid of the mouse pointer completely. Formfactor has variables that would appear to affect things like rotation and whether or not
the calibration routine gets called when X starts up. I don't see anything in
there that can disable the showing of the pointer.

The touchscreen variable results in the X startup scripts hiding the cursor.

Ross

#4 lore raw
Quoted 11 lines · Ross
Quoted 7 lines · Trevor Woerner

What I want is to get rid of the mouse pointer completely. Formfactor has variables that would appear to affect things like rotation and whether or not
the calibration routine gets called when X starts up. I don't see anything in
there that can disable the showing of the pointer.

Quoted 1 line

The touchscreen variable results in the X startup scripts hiding the cursor.

Oh, I see what you're saying... on *SATO*. Agreed. On _sato_ setting HAVE_TOUCHSCREEN set to 1 hides the cursor:
meta/recipes-sato/machbox-session-sato/session

But what about on plain ol' core-image-x11? Although I wasn't aware of formfactor before, using it now it still doesn't solve the issue for me. The existing mechanism tweaks the pointer at the window manager level, my proposed patch tweaks the pointer at the X server level which (I'm arguing) is a better place to adjust it. This way it's independent of everything (except which display server you're using).