]> git.sesse.net Git - vlc/commitdiff
Privatized i_window_style in msw.
authorLaurent Aimar <fenrir@videolan.org>
Mon, 28 Sep 2009 18:52:49 +0000 (20:52 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Mon, 28 Sep 2009 18:52:49 +0000 (20:52 +0200)
modules/video_output/msw/common.c
modules/video_output/msw/events.c
modules/video_output/msw/events.h
modules/video_output/msw/vout.h

index de1c93b1e18297e4879e0f8cb98ce593ece7cf77..7c14f199879ef66ecdc83bb10584e4c4a6d41a68 100644 (file)
@@ -507,7 +507,7 @@ int Control( vout_thread_t *p_vout, int i_query, va_list args )
         rect_window.bottom = va_arg( args, unsigned int );
         if( !rect_window.right ) rect_window.right = p_vout->i_window_width;
         if( !rect_window.bottom ) rect_window.bottom = p_vout->i_window_height;
-        AdjustWindowRect( &rect_window, p_vout->p_sys->i_window_style, 0 );
+        AdjustWindowRect( &rect_window, EventThreadGetWindowStyle( p_vout->p_sys->p_event ), 0 );
 
         SetWindowPos( p_vout->p_sys->hwnd, 0, 0, 0,
                       rect_window.right - rect_window.left,
@@ -658,7 +658,7 @@ void Win32ToggleFullscreen( vout_thread_t *p_vout )
     {
         msg_Dbg( p_vout, "leaving fullscreen mode" );
         /* Change window style, no borders and no title bar */
-        SetWindowLong( hwnd, GWL_STYLE, p_vout->p_sys->i_window_style );
+        SetWindowLong( hwnd, GWL_STYLE, EventThreadGetWindowStyle( p_vout->p_sys->p_event ) );
 
         if( p_vout->p_sys->hparent )
         {
index 0122a5296e5d8580d436755f33070fcf8d285fea..e81d81d5e3fbab12a1f8666e7fa121a6a224345c 100644 (file)
@@ -95,13 +95,14 @@ struct event_thread_t
 
     /* Title */
     char *psz_title;
+    int  i_window_style;
 
     /* */
     unsigned i_changes;
 
 };
 
-static int  DirectXCreateWindow( vout_thread_t *p_vout );
+static int  DirectXCreateWindow( event_thread_t * );
 static void DirectXCloseWindow ( vout_thread_t *p_vout );
 static long FAR PASCAL DirectXEventProc( HWND, UINT, WPARAM, LPARAM );
 
@@ -137,7 +138,7 @@ static void *EventThread( void *p_this )
     /* Create a window for the video */
     /* Creating a window under Windows also initializes the thread's event
      * message queue */
-    if( DirectXCreateWindow( p_event->p_vout ) )
+    if( DirectXCreateWindow( p_event ) )
         p_event->b_error = true;
 
     p_event->b_ready = true;
@@ -416,8 +417,9 @@ static void *EventThread( void *p_this )
  * the video will be displayed. This window will also allow us to capture the
  * events.
  *****************************************************************************/
-static int DirectXCreateWindow( vout_thread_t *p_vout )
+static int DirectXCreateWindow( event_thread_t *p_event )
 {
+    vout_thread_t *p_vout = p_event->p_vout;
     HINSTANCE  hInstance;
     HMENU      hMenu;
     RECT       rect_window;
@@ -545,7 +547,7 @@ static int DirectXCreateWindow( vout_thread_t *p_vout )
         i_stylex = 0;
     }
 
-    p_vout->p_sys->i_window_style = i_style;
+    p_event->i_window_style = i_style;
 
     /* Create the window */
     p_vout->p_sys->hwnd =
@@ -947,6 +949,11 @@ unsigned EventThreadRetreiveChanges( event_thread_t *p_event )
 
     return i_changes;
 }
+int EventThreadGetWindowStyle( event_thread_t *p_event )
+{
+    /* No need to lock, it is serialized by EventThreadStart */
+    return p_event->i_window_style;
+}
 
 event_thread_t *EventThreadCreate( vout_thread_t *p_vout )
 {
index 0b2679f421b06e25482cf5ea61c08352944b6485..275e513a7fc789462f34b1cd6148be438f5e6c2f 100644 (file)
@@ -35,4 +35,4 @@ void            EventThreadStop( event_thread_t * );
 void            EventThreadMouseAutoHide( event_thread_t * );
 void            EventThreadUpdateTitle( event_thread_t *, const char *psz_fallback );
 unsigned        EventThreadRetreiveChanges( event_thread_t * );
-
+int             EventThreadGetWindowStyle( event_thread_t * );
index 381f7804538b497304b93a8b8ca270c3db281ab8..6de2e5e99e95fe3c8370a0bb96f0de8fb7949447 100644 (file)
@@ -95,7 +95,6 @@ struct vout_sys_t
     int          i_window_y;
     int          i_window_width;
     int          i_window_height;
-    int          i_window_style;
 
     volatile uint16_t i_changes;        /* changes made to the video display */