[PATCH xf86-video-nested 07/10] Don't load nested input driver if Xorg is started with option "-seat (...)"

Laércio de Sousa laerciosousa at sme-mogidascruzes.sp.gov.br
Thu Nov 5 01:15:03 PST 2015


When used for single-GPU multi-seat purposes, there's no need to
load nestedinput driver, since nested Xorg will grab input devices
assigned to the seat in question.

Signed-off-by: Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>
---
 src/driver.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/driver.c b/src/driver.c
index 7939ce7..6615a46 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -183,6 +183,7 @@ typedef struct NestedPrivate {
     ShadowUpdateProc update;
 } NestedPrivate, *NestedPrivatePtr;
 
+Bool enableNestedInput;
 OsTimerPtr timer;
 
 #define PNESTED(p) ((NestedPrivatePtr)((p)->driverPrivate))
@@ -194,12 +195,16 @@ static pointer
 NestedSetup(pointer module, pointer opts, int *errmaj, int *errmin) {
     static Bool setupDone = FALSE;
 
+    enableNestedInput = !SeatId;
+
     if (!setupDone) {
         setupDone = TRUE;
-        
+
         xf86AddDriver(&NESTED, module, HaveDriverFuncs);
-        xf86AddInputDriver(&NESTEDINPUT, module, 0);
-        
+
+        if (enableNestedInput)
+            xf86AddInputDriver(&NESTEDINPUT, module, 0);
+
         return (pointer)1;
     } else {
         if (errmaj)
@@ -632,7 +637,8 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL)
     
     // Schedule the NestedInputLoadDriver function to load once the
     // input core is initialized.
-    timer = TimerSet(NULL, 0, 1, NestedMouseTimer, pNested->clientData);
+    if (enableNestedInput)
+        timer = TimerSet(NULL, 0, 1, NestedMouseTimer, pNested->clientData);
 
     miClearVisualTypes();
     if (!miSetVisualTypesAndMasks(pScrn->depth,
-- 
2.1.4



More information about the xorg-devel mailing list