Merge pull request #9140 from ageazrael/bug-fix
Fixed middle mouse button can't bounce in macOS
This commit is contained in:
commit
5077d2d28d
@ -409,14 +409,14 @@ static int button_mask = 0;
|
|||||||
if ((int)[event buttonNumber] != 2)
|
if ((int)[event buttonNumber] != 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
button_mask |= BUTTON_MASK_MIDDLE;
|
button_mask &= ~BUTTON_MASK_MIDDLE;
|
||||||
|
|
||||||
Ref<InputEventMouseButton> mb;
|
Ref<InputEventMouseButton> mb;
|
||||||
mb.instance();
|
mb.instance();
|
||||||
|
|
||||||
get_key_modifier_state([event modifierFlags], mb);
|
get_key_modifier_state([event modifierFlags], mb);
|
||||||
mb->set_button_index(BUTTON_MIDDLE);
|
mb->set_button_index(BUTTON_MIDDLE);
|
||||||
mb->set_pressed(true);
|
mb->set_pressed(false);
|
||||||
mb->set_position(Vector2(mouse_x, mouse_y));
|
mb->set_position(Vector2(mouse_x, mouse_y));
|
||||||
mb->set_global_position(Vector2(mouse_x, mouse_y));
|
mb->set_global_position(Vector2(mouse_x, mouse_y));
|
||||||
mb->set_button_mask(button_mask);
|
mb->set_button_mask(button_mask);
|
||||||
@ -816,7 +816,7 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
|
|||||||
unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | (p_desired.resizable ? NSResizableWindowMask : 0);
|
unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | (p_desired.resizable ? NSResizableWindowMask : 0);
|
||||||
|
|
||||||
window_object = [[GodotWindow alloc]
|
window_object = [[GodotWindow alloc]
|
||||||
initWithContentRect:NSMakeRect(0, 0, p_desired.width / display_scale, p_desired.height / display_scale)
|
initWithContentRect:NSMakeRect(0, 0, p_desired.width, p_desired.height)
|
||||||
styleMask:styleMask
|
styleMask:styleMask
|
||||||
backing:NSBackingStoreBuffered
|
backing:NSBackingStoreBuffered
|
||||||
defer:NO];
|
defer:NO];
|
||||||
@ -825,8 +825,8 @@ void OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_au
|
|||||||
|
|
||||||
window_view = [[GodotContentView alloc] init];
|
window_view = [[GodotContentView alloc] init];
|
||||||
|
|
||||||
window_size.width = p_desired.width;
|
window_size.width = p_desired.width * display_scale;
|
||||||
window_size.height = p_desired.height;
|
window_size.height = p_desired.height * display_scale;
|
||||||
|
|
||||||
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && display_scale > 1) {
|
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6 && display_scale > 1) {
|
||||||
[window_view setWantsBestResolutionOpenGLSurface:YES];
|
[window_view setWantsBestResolutionOpenGLSurface:YES];
|
||||||
|
Loading…
Reference in New Issue
Block a user