Commit 643f98a1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

msw: shrink events data structure

parent 7876f294
...@@ -78,11 +78,10 @@ int CommonInit(vout_display_t *vd) ...@@ -78,11 +78,10 @@ int CommonInit(vout_display_t *vd)
#ifdef MODULE_NAME_IS_directdraw #ifdef MODULE_NAME_IS_directdraw
cfg.use_overlay = sys->use_overlay; cfg.use_overlay = sys->use_overlay;
#endif #endif
cfg.win.type = VOUT_WINDOW_TYPE_HWND; cfg.x = var_InheritInteger(vd, "video-x");
cfg.win.x = var_InheritInteger(vd, "video-x"); cfg.y = var_InheritInteger(vd, "video-y");
cfg.win.y = var_InheritInteger(vd, "video-y"); cfg.width = vd->cfg->display.width;
cfg.win.width = vd->cfg->display.width; cfg.height = vd->cfg->display.height;
cfg.win.height = vd->cfg->display.height;
event_hwnd_t hwnd; event_hwnd_t hwnd;
if (EventThreadStart(sys->event, &hwnd, &cfg)) if (EventThreadStart(sys->event, &hwnd, &cfg))
......
...@@ -399,11 +399,10 @@ static int ControlReopenDevice(vout_display_t *vd) ...@@ -399,11 +399,10 @@ static int ControlReopenDevice(vout_display_t *vd)
memset(&cfg, 0, sizeof(cfg)); memset(&cfg, 0, sizeof(cfg));
cfg.use_desktop = sys->use_desktop; cfg.use_desktop = sys->use_desktop;
if (!sys->use_desktop) { if (!sys->use_desktop) {
cfg.win.type = VOUT_WINDOW_TYPE_HWND; cfg.x = sys->desktop_save.win.left;
cfg.win.x = sys->desktop_save.win.left; cfg.y = sys->desktop_save.win.top;
cfg.win.y = sys->desktop_save.win.top; cfg.width = sys->desktop_save.win.right - sys->desktop_save.win.left;
cfg.win.width = sys->desktop_save.win.right - sys->desktop_save.win.left; cfg.height = sys->desktop_save.win.bottom - sys->desktop_save.win.top;
cfg.win.height = sys->desktop_save.win.bottom - sys->desktop_save.win.top;
} }
event_hwnd_t hwnd; event_hwnd_t hwnd;
......
...@@ -75,8 +75,9 @@ struct event_thread_t ...@@ -75,8 +75,9 @@ struct event_thread_t
/* Title */ /* Title */
char *psz_title; char *psz_title;
int i_window_style; int i_window_style;
vout_window_cfg_t wnd_cfg; int x, y;
unsigned width, height;
/* */ /* */
vout_window_t *parent_window; vout_window_t *parent_window;
...@@ -414,15 +415,13 @@ void EventThreadUpdateWindowPosition( event_thread_t *p_event, ...@@ -414,15 +415,13 @@ void EventThreadUpdateWindowPosition( event_thread_t *p_event,
int x, int y, unsigned w, unsigned h ) int x, int y, unsigned w, unsigned h )
{ {
vlc_mutex_lock( &p_event->lock ); vlc_mutex_lock( &p_event->lock );
*pb_moved = x != p_event->wnd_cfg.x || *pb_moved = x != p_event->x || y != p_event->y;
y != p_event->wnd_cfg.y; *pb_resized = w != p_event->width || h != p_event->height;
*pb_resized = w != p_event->wnd_cfg.width ||
h != p_event->wnd_cfg.height; p_event->x = x;
p_event->y = y;
p_event->wnd_cfg.x = x; p_event->width = w;
p_event->wnd_cfg.y = y; p_event->height = h;
p_event->wnd_cfg.width = w;
p_event->wnd_cfg.height = h;
vlc_mutex_unlock( &p_event->lock ); vlc_mutex_unlock( &p_event->lock );
} }
...@@ -495,7 +494,10 @@ int EventThreadStart( event_thread_t *p_event, event_hwnd_t *p_hwnd, const event ...@@ -495,7 +494,10 @@ int EventThreadStart( event_thread_t *p_event, event_hwnd_t *p_hwnd, const event
{ {
p_event->use_desktop = p_cfg->use_desktop; p_event->use_desktop = p_cfg->use_desktop;
p_event->use_overlay = p_cfg->use_overlay; p_event->use_overlay = p_cfg->use_overlay;
p_event->wnd_cfg = p_cfg->win; p_event->x = p_cfg->x;
p_event->y = p_cfg->y;
p_event->width = p_cfg->width;
p_event->height = p_cfg->height;
p_event->has_moved = false; p_event->has_moved = false;
...@@ -683,8 +685,16 @@ static int Win32VoutCreateWindow( event_thread_t *p_event ) ...@@ -683,8 +685,16 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
if( !p_event->use_desktop ) if( !p_event->use_desktop )
{ {
#endif #endif
vout_window_cfg_t wnd_cfg = {
.type = VOUT_WINDOW_TYPE_HWND,
.x = p_event->x,
.y = p_event->y,
.width = p_event->width,
.height = p_event->height,
};
/* If an external window was specified, we'll draw in it. */ /* If an external window was specified, we'll draw in it. */
p_event->parent_window = vout_display_NewWindow(vd, &p_event->wnd_cfg ); p_event->parent_window = vout_display_NewWindow(vd, &wnd_cfg );
if( p_event->parent_window ) if( p_event->parent_window )
p_event->hparent = p_event->parent_window->handle.hwnd; p_event->hparent = p_event->parent_window->handle.hwnd;
else else
...@@ -746,8 +756,8 @@ static int Win32VoutCreateWindow( event_thread_t *p_event ) ...@@ -746,8 +756,8 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
* the window corresponding to the useable surface we want */ * the window corresponding to the useable surface we want */
rect_window.left = 10; rect_window.left = 10;
rect_window.top = 10; rect_window.top = 10;
rect_window.right = rect_window.left + p_event->wnd_cfg.width; rect_window.right = rect_window.left + p_event->width;
rect_window.bottom = rect_window.top + p_event->wnd_cfg.height; rect_window.bottom = rect_window.top + p_event->height;
if( var_GetBool( vd, "video-deco" ) ) if( var_GetBool( vd, "video-deco" ) )
{ {
...@@ -785,10 +795,10 @@ static int Win32VoutCreateWindow( event_thread_t *p_event ) ...@@ -785,10 +795,10 @@ static int Win32VoutCreateWindow( event_thread_t *p_event )
p_event->class_main, /* name of window class */ p_event->class_main, /* name of window class */
_T(VOUT_TITLE) _T(" (VLC Video Output)"), /* window title */ _T(VOUT_TITLE) _T(" (VLC Video Output)"), /* window title */
i_style, /* window style */ i_style, /* window style */
(!p_event->wnd_cfg.x) ? (UINT)CW_USEDEFAULT : (!p_event->x) ? (UINT)CW_USEDEFAULT :
(UINT)p_event->wnd_cfg.x, /* default X coordinate */ (UINT)p_event->x, /* default X coordinate */
(!p_event->wnd_cfg.y) ? (UINT)CW_USEDEFAULT : (!p_event->y) ? (UINT)CW_USEDEFAULT :
(UINT)p_event->wnd_cfg.y, /* default Y coordinate */ (UINT)p_event->y, /* default Y coordinate */
rect_window.right - rect_window.left, /* window width */ rect_window.right - rect_window.left, /* window width */
rect_window.bottom - rect_window.top, /* window height */ rect_window.bottom - rect_window.top, /* window height */
p_event->hparent, /* parent window */ p_event->hparent, /* parent window */
......
...@@ -32,8 +32,10 @@ typedef struct event_thread_t event_thread_t; ...@@ -32,8 +32,10 @@ typedef struct event_thread_t event_thread_t;
typedef struct { typedef struct {
bool use_desktop; /* direct3d */ bool use_desktop; /* direct3d */
bool use_overlay; /* directx */ bool use_overlay; /* directx */
int x;
vout_window_cfg_t win; int y;
unsigned width;
unsigned height;
} event_cfg_t; } event_cfg_t;
typedef struct { typedef struct {
......
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