Branch: refs/heads/master Home: https://github.com/qemu/qemu Commit: 2044dff87004b9b0faf1c8299491b258332c6887 https://github.com/qemu/qemu/commit/2044dff87004b9b0faf1c8299491b258332c6887 Author: Chen Zhang <tgfb...@me.com> 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 <tgfb...@me.com> Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> Message-id: fa3fbc4f-5379-4118-b997-58fe05cc5...@me.com Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> Commit: 8e23e34d989d5ce542fa26425f091fc61e1f23f4 https://github.com/qemu/qemu/commit/8e23e34d989d5ce542fa26425f091fc61e1f23f4 Author: Chen Zhang <tgfb...@me.com> 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 <tgfb...@me.com> Reviewed-by: Peter Maydell <peter.mayd...@linaro.org> Message-id: 2d2f1191-e82f-4b54-a6e7-73ffb953d...@me.com Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> Compare: https://github.com/qemu/qemu/compare/fe18911af739...8e23e34d989d