From 51343f5a1fad4ade0060f454056195da6108b5d8 Mon Sep 17 00:00:00 2001 From: Marius Gripsgard Date: Wed, 31 May 2023 05:48:35 +0200 Subject: [PATCH] cursor: Always follow cursor position from mir It makes no sense to not, if we dont we can quickly get out of sync with mir. This was done for multiscreen, but this has to be fixed another way then tracking pointer ourself. The plan is to follow mir's screen position anyway so we don't need this. (the current multiscreen impl is horrable) update 2025-05-15 (Mike Gabriel localPos(); + QPointF oldPos; // Adjust the position - QPointF oldPos = pointer->window()->geometry().topLeft() + pointer->position(); + if (qEnvironmentVariableIsSet("LOMIRI_RUNNING_IN_VM")) { + // Get the position directly from Mir + oldPos = me->screenPos(); + } + else { + oldPos = pointer->window()->geometry().topLeft() + pointer->position(); + } QPointF newPos = adjustedPositionForMovement(oldPos, movement); QScreen* currentScreen = screenAt(newPos); --- a/data/lomiri-greeter-wrapper +++ b/data/lomiri-greeter-wrapper @@ -51,6 +51,7 @@ if ([ -x "$(command -v hostnamectl)" ] && [ "$(hostnamectl status | grep 'Chassis: vm')" ]) \ || grep -wq hypervisor /proc/cpuinfo; then set_greeter_var MIR_MESA_KMS_DISABLE_MODESET_PROBE 1 + set_greeter_var LOMIRI_RUNNING_IN_VM 1 fi set_greeter_var QT_IM_MODULE maliit