Skip to content

Commit

Permalink
partially revert f6f7181 to fix #165
Browse files Browse the repository at this point in the history
  • Loading branch information
blueboxd committed Jul 22, 2023
1 parent fa9669b commit 1d9b465
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include "base/containers/contains.h"
#include "base/debug/crash_logging.h"
#include "base/mac/mac_util.h"
#import "base/mac/foundation_util.h"
#include "base/strings/sys_string_conversions.h"
#include "components/remote_cocoa/app_shim/ns_view_ids.h"
Expand Down Expand Up @@ -1404,6 +1405,27 @@ - (void)scrollWheel:(NSEvent*)event {

// Called repeatedly during a pinch gesture, with incremental change values.
- (void)magnifyWithEvent:(NSEvent*)event {
if (base::mac::IsAtLeastOS10_11()) {
if (event.phase == NSEventPhaseBegan) {
[self handleBeginGestureWithEvent:event isSyntheticallyInjected:NO];
return;
}

if (event.phase == NSEventPhaseEnded ||
event.phase == NSEventPhaseCancelled) {
[self handleEndGestureWithEvent:event];
return;
}
}

// If this conditional evalutes to true, and the function has not
// short-circuited from the previous block, then this event is a duplicate of
// a gesture event, and should be ignored.
if (event.phase == NSEventPhaseBegan || event.phase == NSEventPhaseEnded ||
event.phase == NSEventPhaseCancelled) {
return;
}

WebGestureEvent updateEvent = WebGestureEventBuilder::Build(event, self);
_hostHelper->GestureUpdate(updateEvent);
}
Expand Down

0 comments on commit 1d9b465

Please sign in to comment.