Skip to content

Commit

Permalink
fix(InitInput.c): fixing stylus creating after X server reset.
Browse files Browse the repository at this point in the history
  • Loading branch information
twaik committed Jan 7, 2025
1 parent 79064cd commit 65b7213
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions app/src/main/cpp/lorie/InitInput.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,22 @@ InitInput(__unused int argc, __unused char *argv[]) {
AssignTypeAndName(lorieMouse, MakeAtom(XI_MOUSE, sizeof(XI_MOUSE) - 1, TRUE), "Lorie mouse");
AssignTypeAndName(lorieTouch, MakeAtom(XI_TOUCHSCREEN, sizeof(XI_TOUCHSCREEN) - 1, TRUE), "Lorie touch");
AssignTypeAndName(lorieKeyboard, MakeAtom(XI_KEYBOARD, sizeof(XI_KEYBOARD) - 1, TRUE), "Lorie keyboard");
ActivateDevice(lorieMouse, FALSE);
ActivateDevice(lorieTouch, FALSE);
ActivateDevice(lorieKeyboard, FALSE);
EnableDevice(lorieMouse, TRUE);
EnableDevice(lorieTouch, TRUE);
EnableDevice(lorieKeyboard, TRUE);
AttachDevice(NULL, lorieMouse, inputInfo.pointer);
AttachDevice(NULL, lorieTouch, inputInfo.pointer);
AttachDevice(NULL, lorieKeyboard, inputInfo.keyboard);

// We should explicitly create stylus pen and eraser devices here for the case of X server reset.
if (loriePen && lorieEraser) {
loriePen = lorieEraser = NULL;
lorieSetStylusEnabled(true);
}

(void) mieqInit();
}

Expand Down

0 comments on commit 65b7213

Please sign in to comment.