[vlc-commits] [Git][videolan/vlc][master] 6 commits: macosx: Acquire segment index after expanding node parent
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Fri Aug 7 12:39:00 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
3b9bf249 by Claudio Cambra at 2026-08-07T14:15:40+02:00
macosx: Acquire segment index after expanding node parent
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4c002ba9 by Claudio Cambra at 2026-08-07T14:15:40+02:00
macosx: Apply expected segment for library item presentation via nav controller
Fixes incorrect segment selection
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
30f9f821 by Claudio Cambra at 2026-08-07T14:15:40+02:00
macosx: Request artists even if they have no albums (only tracks)
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
4a65a497 by Claudio Cambra at 2026-08-07T14:15:40+02:00
macosx: Preserve master selection across reloads in audio data source
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
82b825f3 by Claudio Cambra at 2026-08-07T14:15:40+02:00
macosx: Allow grid-mode selection to update the header
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
8c317d98 by Claudio Cambra at 2026-08-07T14:15:40+02:00
macosx: Observe data source reload even when no segment switch happens
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
5 changed files:
- modules/gui/macosx/library/VLCLibraryModel.m
- modules/gui/macosx/library/VLCLibraryWindow.m
- modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarViewController.m
- modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m
- modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
Changes:
=====================================
modules/gui/macosx/library/VLCLibraryModel.m
=====================================
@@ -523,7 +523,7 @@ static void libraryCallback(void *p_data, const vlc_ml_event_t *p_event)
{
dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0), ^{
const vlc_ml_query_params_t queryParams = [self queryParams];
- vlc_ml_artist_list_t * const p_artist_list = vlc_ml_list_artists(self->_p_mediaLibrary, &queryParams, NO);
+ vlc_ml_artist_list_t * const p_artist_list = vlc_ml_list_artists(self->_p_mediaLibrary, &queryParams, YES);
const size_t numberOfArtists = p_artist_list->i_nb_items;
NSMutableArray * const mutableArtistArray = [[NSMutableArray alloc] initWithCapacity:numberOfArtists];
NSMutableDictionary * const mutableArtistDict = [NSMutableDictionary dictionaryWithCapacity:numberOfArtists];
=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -380,7 +380,7 @@ static int ShowController(vlc_object_t * __unused p_this,
- (void)presentLibraryItem:(id<VLCMediaLibraryItemProtocol>)libraryItem
{
VLCLibrarySegment * const segment = [VLCLibrarySegment segmentForLibraryItem:libraryItem];
- [self applySegmentView:segment];
+ [self.splitViewController.navSidebarViewController selectSegment:segment.segmentType];
if ([self.librarySegmentViewController conformsToProtocol:@protocol(VLCLibraryItemPresentingCapable)]) {
[(VLCLibraryAbstractSegmentViewController<VLCLibraryItemPresentingCapable> *)self.librarySegmentViewController presentLibraryItem:libraryItem];
}
=====================================
modules/gui/macosx/library/VLCLibraryWindowNavigationSidebarViewController.m
=====================================
@@ -337,8 +337,8 @@ static NSString * const VLCLibrarySegmentCellIdentifier = @"VLCLibrarySegmentCel
[self.outlineView expandItem:[self nodeForSegmentType:VLCLibraryMusicSegmentType]];
}
- const NSInteger segmentIndex = [self.outlineView rowForItem:targetNode];
[self expandParentsOfNode:targetNode];
+ const NSInteger segmentIndex = [self.outlineView rowForItem:targetNode];
[self.outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:segmentIndex]
byExtendingSelection:NO];
}
=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioDataSource.m
=====================================
@@ -562,6 +562,24 @@ NSString * const VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification
_displayedCollectionUpdating = YES;
dispatch_async(dispatch_get_main_queue(), ^{
+ NSTableView * const gridModeListTableView = self.gridModeListTableView;
+ const NSInteger selectedGridModeRow = gridModeListTableView != nil
+ ? gridModeListTableView.selectedRow
+ : -1;
+ const id<VLCMediaLibraryItemProtocol> selectedGridModeItem =
+ selectedGridModeRow >= 0 && (NSUInteger)selectedGridModeRow < self.displayedCollection.count
+ ? self.displayedCollection[selectedGridModeRow]
+ : nil;
+
+ NSTableView * const collectionSelectionTableView = self.collectionSelectionTableView;
+ const NSInteger selectedListModeRow = collectionSelectionTableView != nil
+ ? collectionSelectionTableView.selectedRow
+ : -1;
+ const id<VLCMediaLibraryItemProtocol> selectedListModeItem =
+ selectedListModeRow >= 0 && (NSUInteger)selectedListModeRow < self.displayedCollection.count
+ ? self.displayedCollection[selectedListModeRow]
+ : nil;
+
self.displayedCollection = [[self collectionToDisplay] mutableCopy];
if (self.displayAllArtistsGenresTableEntry) {
@@ -596,6 +614,22 @@ NSString * const VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification
[self.carouselView reloadData];
}];
+ if (selectedGridModeItem != nil) {
+ const NSUInteger selectedGridModeItemIndex =
+ [self indexForMediaLibraryItemWithId:selectedGridModeItem.libraryID];
+ if (selectedGridModeItemIndex != NSNotFound) {
+ [self tableView:gridModeListTableView selectRowIndices:[NSIndexSet indexSetWithIndex:selectedGridModeItemIndex]];
+ }
+ }
+
+ if (selectedListModeItem != nil) {
+ const NSUInteger selectedListModeItemIndex =
+ [self indexForMediaLibraryItemWithId:selectedListModeItem.libraryID];
+ if (selectedListModeItemIndex != NSNotFound) {
+ [self tableView:collectionSelectionTableView selectRowIndices:[NSIndexSet indexSetWithIndex:selectedListModeItemIndex]];
+ }
+ }
+
[NSNotificationCenter.defaultCenter postNotificationName:VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification object:self];
});
}
=====================================
modules/gui/macosx/library/audio-library/VLCLibraryAudioViewController.m
=====================================
@@ -534,7 +534,10 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
}
VLCLibraryWindow * const libraryWindow = self.libraryWindow;
- if (segmentType == libraryWindow.librarySegmentType) {
+ const BOOL segmentAlreadySelected = segmentType == libraryWindow.librarySegmentType;
+ if (segmentAlreadySelected &&
+ !self.audioDataSource.displayedCollectionUpdating &&
+ (NSUInteger)self.audioDataSource.displayedCollectionCount >= self.audioDataSource.collectionToDisplayCount) {
[self presentLibraryItemWaitForDataSourceFinished:nil];
return;
}
@@ -544,8 +547,10 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
name:VLCLibraryAudioDataSourceDisplayedCollectionChangedNotification
object:self.audioDataSource];
- libraryWindow.librarySegmentType = segmentType;
- [libraryWindow.splitViewController.navSidebarViewController selectSegment:segmentType];
+ if (!segmentAlreadySelected) {
+ libraryWindow.librarySegmentType = segmentType;
+ [libraryWindow.splitViewController.navSidebarViewController selectSegment:segmentType];
+ }
}
- (void)libraryModelUpdated:(NSNotification *)aNotification
@@ -592,6 +597,7 @@ NSString *VLCLibraryPlaceholderAudioViewIdentifier = @"VLCLibraryPlaceholderAudi
fallbackDetail:(NSString *)fallbackDetail
{
if (tableView != self.audioCollectionSelectionTableView &&
+ tableView != self.audioLibraryGridModeSplitViewListTableView &&
tableView != self.audioGroupSelectionTableView &&
![self.audioGroupDataSource.tableViews containsObject:tableView])
return;
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b608461bd835569016531de0b2ddbc379ae62c91...8c317d989a219b7e5ee6aee75a43a2a5f8fc0b04
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/b608461bd835569016531de0b2ddbc379ae62c91...8c317d989a219b7e5ee6aee75a43a2a5f8fc0b04
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help
More information about the vlc-commits
mailing list