diff options
author | Enrico Weigelt, metux IT consult <info@metux.net> | 2024-05-14 14:25:20 +0200 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2024-05-19 17:58:21 +0000 |
commit | 86b6dc3bb6d78f40905ecc63df3635b284214836 (patch) | |
tree | 19d32507a5944b469a3c93d2d385302f2d076ef3 /src | |
parent | a2b108a8bd2c97be229be0027f19c2b7e9731ebe (diff) |
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/driver/xf86-video-nested/-/merge_requests/5>
Diffstat (limited to 'src')
-rw-r--r-- | src/driver.c | 34 | ||||
-rw-r--r-- | src/nested_input.c | 12 |
2 files changed, 17 insertions, 29 deletions
diff --git a/src/driver.c b/src/driver.c index a7a4c1a..f30d76d 100644 --- a/src/driver.c +++ b/src/driver.c @@ -179,15 +179,15 @@ NestedSetup(pointer module, pointer opts, int *errmaj, int *errmin) { if (!setupDone) { setupDone = TRUE; - + xf86AddDriver(&NESTED, module, HaveDriverFuncs); xf86AddInputDriver(&NESTEDINPUT, module, 0); - + return (pointer)1; } else { if (errmaj) *errmaj = LDR_ONCEONLY; - + return NULL; } } @@ -316,7 +316,7 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb)) return FALSE; - + xf86PrintDepthBpp(pScrn); if (pScrn->depth > 8) { @@ -372,12 +372,6 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { return FALSE; } - /*if (pScrn->depth > 1) { - Gamma zeros = {0.0, 0.0, 0.0}; - if (!xf86SetGamma(pScrn, zeros)) - return FALSE; - }*/ - if (NestedValidateModes(pScrn) < 1) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes\n"); return FALSE; @@ -401,7 +395,7 @@ static Bool NestedPreInit(ScrnInfoPtr pScrn, int flags) { pScrn->memPhysBase = 0; pScrn->fbOffset = 0; - + return TRUE; } @@ -456,10 +450,10 @@ NestedValidateModes(ScrnInfoPtr pScrn) { while (mode != NULL) { if (mode->HDisplay > maxX) maxX = mode->HDisplay; - + if (mode->VDisplay > maxY) maxY = mode->VDisplay; - + mode = mode->next; } pScrn->virtualX = maxX; @@ -559,15 +553,9 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "NestedScreenInit\n"); pNested = PNESTED(pScrn); - /*NESTEDScrn = pScrn;*/ NestedPrintPscreen(pScrn); - /* Save state: - * NestedSave(pScrn); */ - - //Load_Nested_Mouse(); - pNested->clientData = NestedClientCreateScreen(pScrn->scrnIndex, pNested->displayName, pScrn->virtualX, @@ -577,12 +565,12 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL) pScrn->depth, pScrn->bitsPerPixel, &redMask, &greenMask, &blueMask); - + if (!pNested->clientData) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to create client screen\n"); return FALSE; } - + // Schedule the NestedInputLoadDriver function to load once the // input core is initialized. TimerSet(NULL, 0, 1, NestedMouseTimer, pNested->clientData); @@ -593,7 +581,7 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL) pScrn->rgbBits, pScrn->defaultVisual, redMask, greenMask, blueMask)) return FALSE; - + if (!miSetPixmapDepths()) return FALSE; @@ -607,7 +595,7 @@ static Bool NestedScreenInit(SCREEN_INIT_ARGS_DECL) xf86SetBlackWhitePixels(pScreen); xf86SetBackingStore(pScreen); miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); - + if (!miCreateDefColormap(pScreen)) return FALSE; diff --git a/src/nested_input.c b/src/nested_input.c index 78323aa..7d84cbd 100644 --- a/src/nested_input.c +++ b/src/nested_input.c @@ -199,7 +199,7 @@ _nested_input_init_buttons(DeviceIntPtr device) { if (!InitButtonClassDeviceStruct(device, NUM_MOUSE_BUTTONS, buttonLabels, map)) { xf86Msg(X_ERROR, "%s: Failed to register buttons.\n", pInfo->name); - + free(map); return BadAlloc; } @@ -271,12 +271,12 @@ NestedInputControl(DeviceIntPtr device, int what) { break; case DEVICE_OFF: xf86Msg(X_INFO, "%s: Off.\n", pInfo->name); - + if (!device->public.on) break; - + xf86RemoveEnabledDevice(pInfo); - + pInfo->fd = -1; device->public.on = FALSE; break; @@ -311,7 +311,7 @@ NestedInputLoadDriver(NestedClientPrivatePtr clientData) { InputOption* options = NULL; options = input_option_new(options, strdup("identifier"), strdup("nestedinput")); options = input_option_new(options, strdup("driver"), strdup("nestedinput")); - + // Invoke NewInputDeviceRequest to call the PreInit function of // the driver. int ret = NewInputDeviceRequest(options, NULL, &dev); @@ -333,7 +333,7 @@ NestedInputLoadDriver(NestedClientPrivatePtr clientData) { // device back to the input driver when events are being posted. NestedClientSetDevicePtr(clientData, dev); } - + void NestedInputPostMouseMotionEvent(DeviceIntPtr dev, int x, int y) { xf86PostMotionEvent(dev, TRUE, 0, 2, x, y); |