[vlc-commits] [Git][videolan/vlc][master] macosx: replace deprecated NSEvent mask and subtype constants for mouse events
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Apr 3 07:18:24 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
f6721576 by Serhii Bykov at 2026-04-03T07:00:02+00:00
macosx: replace deprecated NSEvent mask and subtype constants for mouse events
- - - - -
3 changed files:
- modules/gui/macosx/preferences/prefs_widgets.m
- modules/gui/macosx/windows/video/VLCVoutView.m
- modules/video_output/window_macosx.m
Changes:
=====================================
modules/gui/macosx/preferences/prefs_widgets.m
=====================================
@@ -167,8 +167,8 @@ my_width, tooltip, init_value) \
[o_stepper setMinValue: lower]; \
[o_stepper setTarget: self]; \
[o_stepper setAction: @selector(stepperChanged:)]; \
- [o_stepper sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask | \
- NSLeftMouseDraggedMask]; \
+ [o_stepper sendActionOn:NSEventMaskLeftMouseUp \
+ | NSEventMaskLeftMouseDown | NSEventMaskLeftMouseDragged]; \
[o_stepper sizeToFit]; \
}
@@ -1387,8 +1387,8 @@ my_width, tooltip, init_value) \
[o_slider setAutoresizingMask:NSViewWidthSizable ];
[o_slider setTarget: self];
[o_slider setAction: @selector(sliderChanged:)];
- [o_slider sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask |
- NSLeftMouseDraggedMask];
+ [o_slider sendActionOn:NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDown |
+ NSEventMaskLeftMouseDragged];
[self addSubview: o_slider];
}
@@ -1594,8 +1594,8 @@ my_width, tooltip, init_value) \
[o_slider setAutoresizingMask:NSViewWidthSizable ];
[o_slider setTarget: self];
[o_slider setAction: @selector(sliderChanged:)];
- [o_slider sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask |
- NSLeftMouseDraggedMask];
+ [o_slider sendActionOn:NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDown |
+ NSEventMaskLeftMouseDragged];
[self addSubview: o_slider];
}
@@ -1835,8 +1835,8 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
[o_tableview setDataSource:self];
[o_tableview setTarget: self];
[o_tableview setAction: @selector(tableChanged:)];
- [o_tableview sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask |
- NSLeftMouseDraggedMask];
+ [o_tableview sendActionOn:NSEventMaskLeftMouseUp | NSEventMaskLeftMouseDown |
+ NSEventMaskLeftMouseDragged];
[o_tableview reloadData];
[o_tableview setAutoresizingMask: NSViewWidthSizable];
=====================================
modules/gui/macosx/windows/video/VLCVoutView.m
=====================================
@@ -162,7 +162,7 @@
- (void)mouseDown:(NSEvent *)o_event
{
- if (([o_event type] == NSLeftMouseDown) && (! ([o_event modifierFlags] & NSControlKeyMask))) {
+ if (([o_event type] == NSEventTypeLeftMouseDown) && (! ([o_event modifierFlags] & NSControlKeyMask))) {
if (o_event.clickCount == 1) {
vlc_mutex_lock(&_mutex);
if (_wnd) {
@@ -173,7 +173,7 @@
[_playerController toggleFullscreen];
}
} else if (([o_event type] == NSEventTypeRightMouseDown) ||
- (([o_event type] == NSLeftMouseDown) &&
+ (([o_event type] == NSEventTypeLeftMouseDown) &&
([o_event modifierFlags] & NSControlKeyMask))) {
[NSMenu popUpContextMenu: VLCMain.sharedInstance.mainMenu.voutMenu withEvent: o_event forView: self];
}
@@ -183,7 +183,7 @@
- (void)mouseUp:(NSEvent *)event
{
- if (event.type == NSLeftMouseUp) {
+ if (event.type == NSEventTypeLeftMouseUp) {
vlc_mutex_lock(&_mutex);
if (_wnd) {
vlc_window_ReportMouseReleased(_wnd, MOUSE_BUTTON_LEFT);
@@ -256,7 +256,7 @@
// A mouse scroll wheel has lower sensitivity. We want to scroll at least
// with every event here.
- BOOL isMouseScrollWheel = ([theEvent subtype] == NSMouseEventSubtype);
+ BOOL isMouseScrollWheel = ([theEvent subtype] == NSEventSubtypeMouseEvent);
if (isMouseScrollWheel && f_deltaYAbs < f_yThreshold)
f_deltaY = f_deltaY > 0. ? f_yThreshold : -f_yThreshold;
=====================================
modules/video_output/window_macosx.m
=====================================
@@ -491,7 +491,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)mouseDown:(NSEvent *)event
{
@synchronized(self) {
- if (event.type == NSLeftMouseDown &&
+ if (event.type == NSEventTypeLeftMouseDown &&
!(event.modifierFlags & NSControlKeyMask) &&
event.clickCount == 1) {
[_moduleDelegate reportMousePressed:MOUSE_BUTTON_LEFT];
@@ -505,7 +505,7 @@ NS_ASSUME_NONNULL_BEGIN
- (void)mouseUp:(NSEvent *)event
{
@synchronized(self) {
- if (event.type == NSLeftMouseUp) {
+ if (event.type == NSEventTypeLeftMouseUp) {
[_moduleDelegate reportMouseReleased:MOUSE_BUTTON_LEFT];
}
}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f672157626c353cb1a99ef68c163b3073c3f0029
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/f672157626c353cb1a99ef68c163b3073c3f0029
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list