qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] 2044df: ui/cocoa: Fix absolute input device g


From: Zhang Ch. N.
Subject: [Qemu-commits] [qemu/qemu] 2044df: ui/cocoa: Fix absolute input device grabbing issue...
Date: Thu, 13 Jun 2019 03:57:38 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 2044dff87004b9b0faf1c8299491b258332c6887
      
https://github.com/qemu/qemu/commit/2044dff87004b9b0faf1c8299491b258332c6887
  Author: Chen Zhang <address@hidden>
  Date:   2019-06-13 (Thu, 13 Jun 2019)

  Changed paths:
    M ui/cocoa.m

  Log Message:
  -----------
  ui/cocoa: Fix absolute input device grabbing issue on Mojave

On Mojave, absolute input device, i.e. tablet, had trouble re-grabbing
the cursor in re-entry into the virtual screen area. In some cases,
the `window` property of NSEvent object was nil after cursor exiting from
window, hinting that the `-locationInWindow` method would return value in
screen coordinates. The current implementation used raw locations from
NSEvent without considering whether the value was for the window coordinates
or the macOS screen coordinates, nor the zooming factor for Zoom-to-Fit in
fullscreen mode.

In fullscreen mode, the fullscreen cocoa window might not be the key
window, therefore the location of event in virtual coordinates should
suffice.

This patches fixed boundary check methods for cursor in normal
and fullscreen with/without Zoom-to-Fit in Mojave.

Note: CGRect, -convertRectToScreen: and -convertRectFromScreen: were
used in coordinates conversion for compatibility reason.

Signed-off-by: Chen Zhang <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>


  Commit: 8e23e34d989d5ce542fa26425f091fc61e1f23f4
      
https://github.com/qemu/qemu/commit/8e23e34d989d5ce542fa26425f091fc61e1f23f4
  Author: Chen Zhang <address@hidden>
  Date:   2019-06-13 (Thu, 13 Jun 2019)

  Changed paths:
    M ui/cocoa.m

  Log Message:
  -----------
  ui/cocoa: Fix mouse grabbing in fullscreen mode for relative input device

In fullscreen mode, the window property of cocoaView may not be the key
window, and the current implementation would not re-grab cursor by left click
in fullscreen mode after ungrabbed in fullscreen mode with hot-key ctrl-opt-g.

This patch used value of isFullscreen as a short-cirtuit condition for
relative input device grabbing.

Signed-off-by: Chen Zhang <address@hidden>
Reviewed-by: Peter Maydell <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/fe18911af739...8e23e34d989d



reply via email to

[Prev in Thread] Current Thread [Next in Thread]