Commit 8414047e authored by Cyril Deguet's avatar Cyril Deguet

* fixed a timing issue under windows ?

parent 3435dcce
......@@ -2,7 +2,7 @@
* gtk2_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: gtk2_run.cpp,v 1.16 2003/04/21 01:47:42 asmax Exp $
* $Id: gtk2_run.cpp,v 1.17 2003/04/21 02:50:49 asmax Exp $
*
* Authors: Cyril Deguet <asmax@videolan.org>
*
......@@ -192,38 +192,6 @@ void GTK2Proc( GdkEvent *event, gpointer data )
// Check if vlc is closing
proc->IsClosing();
#if 0
// If Window is parent window
if( hwnd == ( (GTK2Theme *)p_intf->p_sys->p_theme )->GetParentWindow() )
{
if( uMsg == WM_SYSCOMMAND )
{
if( (Event *)wParam != NULL )
( (Event *)wParam )->SendEvent();
return 0;
}
else if( uMsg == WM_RBUTTONDOWN && wParam == 42 &&
lParam == WM_RBUTTONDOWN )
{
int x, y;
OSAPI_GetMousePos( x, y );
TrackPopupMenu(
( (GTK2Theme *)p_intf->p_sys->p_theme )->GetSysMenu(),
0, x, y, 0, hwnd, NULL );
}
}
// If closing parent window
if( uMsg == WM_CLOSE )
{
OSAPI_PostMessage( NULL, VLC_HIDE, VLC_QUIT, 0 );
return 0;
}
// If hwnd does not match any window or message not processed
return DefWindowProc( hwnd, uMsg, wParam, lParam );
#endif
gtk_main_do_event( event );
}
......@@ -257,6 +225,11 @@ bool Instance::OnInit()
p_intf->p_sys->SoutDlg = new SoutDialog( p_intf, NULL );
p_intf->p_sys->PrefsDlg = new PrefsDialog( p_intf, NULL );
p_intf->p_sys->InfoDlg = new FileInfo( p_intf, NULL );
vlc_mutex_lock( &p_intf->p_sys->init_lock );
vlc_cond_signal( &p_intf->p_sys->init_cond );
vlc_mutex_unlock( &p_intf->p_sys->init_lock );
return TRUE;
}
......@@ -287,6 +260,10 @@ void OSRun( intf_thread_t *p_intf )
wxTheApp = new Instance( p_intf, callbackobj );
vlc_mutex_lock( &p_intf->p_sys->init_lock );
vlc_cond_wait( &p_intf->p_sys->init_cond, &p_intf->p_sys->init_lock );
vlc_mutex_unlock( &p_intf->p_sys->init_lock );
// Add timer
g_timeout_add( 200, (GSourceFunc)RefreshTimer, (gpointer)p_intf );
......
......@@ -2,7 +2,7 @@
* skin_common.h: Private Skin interface description
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: skin_common.h,v 1.3 2003/04/21 00:54:26 ipkiss Exp $
* $Id: skin_common.h,v 1.4 2003/04/21 02:50:49 asmax Exp $
*
* Authors: Olivier Teulière <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -73,6 +73,10 @@ struct intf_sys_t
SoutDialog *SoutDlg;
PrefsDialog *PrefsDlg;
FileInfo *InfoDlg;
// Wait wxwindows initialization
vlc_mutex_t init_lock;
vlc_cond_t init_cond;
};
#endif
......
......@@ -2,7 +2,7 @@
* skin-main.cpp: skins plugin for VLC
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: skin_main.cpp,v 1.14 2003/04/21 02:12:06 ipkiss Exp $
* $Id: skin_main.cpp,v 1.15 2003/04/21 02:50:49 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -105,6 +105,10 @@ static int Open ( vlc_object_t *p_this )
p_intf->p_sys->p_playlist = (playlist_t *)vlc_object_find( p_intf,
VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
// Initialize conditions
vlc_mutex_init( p_intf, &p_intf->p_sys->init_lock);
vlc_cond_init( p_intf, &p_intf->p_sys->init_cond);
p_intf->p_sys->p_theme = (Theme *)new OSTheme( p_intf );
return( 0 );
......@@ -134,6 +138,10 @@ static void Close ( vlc_object_t *p_this )
// Unsuscribe to messages bank
msg_Unsubscribe( p_intf, p_intf->p_sys->p_sub );
// Destroy conditions
vlc_cond_destroy( &p_intf->p_sys->init_cond);
vlc_mutex_destroy( &p_intf->p_sys->init_lock);
// Destroy structure
free( p_intf->p_sys );
}
......@@ -144,6 +152,7 @@ static void Close ( vlc_object_t *p_this )
//---------------------------------------------------------------------------
static void Run( intf_thread_t *p_intf )
{
#if !defined WIN32
/* FIXME: should be elsewhere ? */
// Initialize GDK
......
......@@ -2,7 +2,7 @@
* win32_run.cpp:
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: win32_run.cpp,v 1.7 2003/04/21 00:54:26 ipkiss Exp $
* $Id: win32_run.cpp,v 1.8 2003/04/21 02:50:49 asmax Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
* Emmanuel Puig <karibu@via.ecp.fr>
......@@ -95,6 +95,11 @@ bool Instance::OnInit()
p_intf->p_sys->SoutDlg = new SoutDialog( p_intf, NULL );
p_intf->p_sys->PrefsDlg = new PrefsDialog( p_intf, NULL );
p_intf->p_sys->InfoDlg = new FileInfo( p_intf, NULL );
vlc_mutex_lock( &p_intf->p_sys->init_lock );
vlc_cond_signal( &p_intf->p_sys->init_cond );
vlc_mutex_unlock( &p_intf->p_sys->init_lock );
return TRUE;
}
......@@ -165,7 +170,11 @@ void OSRun( intf_thread_t *p_intf )
HANDLE hThread;
hThread = CreateThread( NULL, 0, ThreadFunc, (LPVOID) p_intf, 0, 0 );
// Create refresh timer
vlc_mutex_lock( &p_intf->p_sys->init_lock );
vlc_cond_wait( &p_intf->p_sys->init_cond, &p_intf->p_sys->init_lock );
vlc_mutex_unlock( &p_intf->p_sys->init_lock );
// Create refresh timer
SetTimer( ((OSTheme *)p_intf->p_sys->p_theme)->GetParentWindow(), 42, 200,
(TIMERPROC)RefreshTimer );
......
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