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