فهرست منبع

vm(qemu): do not set mouse if index is invalid

osy 1 هفته پیش
والد
کامیت
bb26fe2264
1فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 3 0
      Services/UTMQemuVirtualMachine.swift

+ 3 - 0
Services/UTMQemuVirtualMachine.swift

@@ -726,6 +726,9 @@ extension UTMQemuVirtualMachine {
         }
         }
         do {
         do {
             let index = try await monitor.mouseIndex(forAbsolute: tablet)
             let index = try await monitor.mouseIndex(forAbsolute: tablet)
+            guard index > -1 else {
+                return
+            }
             try await monitor.mouseSelect(index)
             try await monitor.mouseSelect(index)
             ioService?.primaryInput?.requestMouseMode(!tablet)
             ioService?.primaryInput?.requestMouseMode(!tablet)
         } catch {
         } catch {