[vlc-devel] commit: Privatized i_window_style in msw. (Laurent Aimar )
git version control
git at videolan.org
Mon Sep 28 20:56:57 CEST 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Sep 28 20:52:49 2009 +0200| [98ed98bbd4803c7dd0829b607daf60940fb9e3d0] | committer: Laurent Aimar
Privatized i_window_style in msw.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=98ed98bbd4803c7dd0829b607daf60940fb9e3d0
---
modules/video_output/msw/common.c | 4 ++--
modules/video_output/msw/events.c | 15 +++++++++++----
modules/video_output/msw/events.h | 2 +-
modules/video_output/msw/vout.h | 1 -
4 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/modules/video_output/msw/common.c b/modules/video_output/msw/common.c
index de1c93b..7c14f19 100644
--- a/modules/video_output/msw/common.c
+++ b/modules/video_output/msw/common.c
@@ -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 )
{
diff --git a/modules/video_output/msw/events.c b/modules/video_output/msw/events.c
index 0122a52..e81d81d 100644
--- a/modules/video_output/msw/events.c
+++ b/modules/video_output/msw/events.c
@@ -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 )
{
diff --git a/modules/video_output/msw/events.h b/modules/video_output/msw/events.h
index 0b2679f..275e513 100644
--- a/modules/video_output/msw/events.h
+++ b/modules/video_output/msw/events.h
@@ -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 * );
diff --git a/modules/video_output/msw/vout.h b/modules/video_output/msw/vout.h
index 381f780..6de2e5e 100644
--- a/modules/video_output/msw/vout.h
+++ b/modules/video_output/msw/vout.h
@@ -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 */
More information about the vlc-devel
mailing list