From: Derk-Jan Hartman Date: Mon, 29 Aug 2005 20:10:59 +0000 (+0000) Subject: * loadNibNamed:withOwner calls awakeFromNib on owner. Therefore opening panels result... X-Git-Tag: 0.8.4~621 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=146cc35a491581fe29fb3976ffd70c95db490124;p=vlc * loadNibNamed:withOwner calls awakeFromNib on owner. Therefore opening panels resulted in reinitializing some of VLCMain's stuff. This included evalutation of p_intf->b_play, which triggered an unintended call to playlist_Play(). this fixes #323 --- diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index 51f457c5c4..abf4202c59 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -94,6 +94,7 @@ struct intf_sys_t id o_extended; /* VLCExtended */ id o_bookmarks; /* VLCBookmarks */ id o_update; /* VLCUpdate */ + BOOL nib_main_loaded; /* reference to the main-nib */ BOOL nib_open_loaded; /* reference to the open-nib */ BOOL nib_about_loaded; /* reference to the about-nib */ BOOL nib_wizard_loaded; /* reference to the wizard-nib */ diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 82118d9087..94fa5ac467 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -323,6 +323,9 @@ static VLCMain *_o_sharedMainInstance = nil; playlist_t *p_playlist; vlc_value_t val; + /* Check if we already did this once. Opening the other nibs calls it too, because VLCMain is the owner */ + if( nib_main_loaded ) return; + [self initStrings]; [o_window setExcludedFromWindowsMenu: TRUE]; [o_msgs_panel setExcludedFromWindowsMenu: TRUE]; @@ -426,6 +429,7 @@ static VLCMain *_o_sharedMainInstance = nil; [o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool )]; vlc_object_release( p_playlist ); } + nib_main_loaded = TRUE; } - (void)dealloc