Commit d3415155 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: save window position manually when using the dark interface style

parent 12179aca
...@@ -133,6 +133,7 @@ ...@@ -133,6 +133,7 @@
- (void)setTitle:(NSString *)title; - (void)setTitle:(NSString *)title;
- (void) customZoom: (id)sender; - (void) customZoom: (id)sender;
- (void)windowResizedOrMoved:(NSNotification *)notification;
- (void)showDropZone; - (void)showDropZone;
- (void)hideDropZone; - (void)hideDropZone;
......
...@@ -109,6 +109,7 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -109,6 +109,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
- (void)dealloc - (void)dealloc
{ {
[[NSNotificationCenter defaultCenter] removeObserver: self];
config_PutInt( VLCIntf->p_libvlc, "volume", i_lastShownVolume ); config_PutInt( VLCIntf->p_libvlc, "volume", i_lastShownVolume );
[self saveFrameUsingName: [self frameAutosaveName]]; [self saveFrameUsingName: [self frameAutosaveName]];
[o_sidebaritems release]; [o_sidebaritems release];
...@@ -394,6 +395,9 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -394,6 +395,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
if( b_dark_interface ) if( b_dark_interface )
{ {
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResizedOrMoved:) name: NSWindowDidResizeNotification object: nil];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(windowResizedOrMoved:) name: NSWindowDidMoveNotification object: nil];
NSRect winrect; NSRect winrect;
CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height; CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
winrect = [self frame]; winrect = [self frame];
...@@ -797,6 +801,11 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -797,6 +801,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
[self setFrame: maxRect display: YES animate: YES]; [self setFrame: maxRect display: YES animate: YES];
} }
- (void)windowResizedOrMoved:(NSNotification *)notification
{
[self saveFrameUsingName: [self frameAutosaveName]];
}
#pragma mark - #pragma mark -
#pragma mark Update interface and respond to foreign events #pragma mark Update interface and respond to foreign events
- (void)showDropZone - (void)showDropZone
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment