[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] ui/cocoa.m: fix absolute mode
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] ui/cocoa.m: fix absolute mode |
Date: |
Sun, 1 Jul 2018 20:26:28 +0100 |
On 8 June 2018 at 21:01, John Arbuckle <address@hidden> wrote:
> Fix the cocoa front-end to correctly be able to use absolute mode.
>
> Signed-off-by: John Arbuckle <address@hidden>
> case NSEventTypeMouseMoved:
> if (isAbsoluteEnabled) {
> - if (![self screenContainsPoint:p] || ![[self window]
> isKeyWindow]) {
> + if ([self mouseInWindow]) {
> + mouse_event = true;
> + }
> +
> + if (![self mouseInWindow] || ![[self window] isKeyWindow]) {
> if (isMouseGrabbed) {
> [self ungrabMouse];
> }
> } else {
> - if (!isMouseGrabbed) {
> + if (!isMouseGrabbed && [self mouseInWindow]) {
> [self grabMouse];
> }
We may well not need this part of the patch, but:
this change of condition from "!isMouseGrabbed" to
"!isMouseGrabbed && [self mouseInWindow]" is unnecessary.
This code is inside the "else" block for the preceding
"if (![self mouseInWindow] || ![[self window] isKeyWindow])",
so it is not possible to reach it if "[self mouseInWindow]"
returns false.
thanks
-- PMM