Commit 6444fb21 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

vout: eliminate dead window state code

parent 8ae8abfe
...@@ -367,11 +367,6 @@ static int Control(vout_display_t *vd, int query, va_list ap) ...@@ -367,11 +367,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
const vout_display_cfg_t *c = va_arg(ap, const vout_display_cfg_t *); const vout_display_cfg_t *c = va_arg(ap, const vout_display_cfg_t *);
return vout_window_SetFullScreen(sys->embed, c->is_fullscreen); return vout_window_SetFullScreen(sys->embed, c->is_fullscreen);
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{
unsigned state = va_arg(ap, unsigned);
return vout_window_SetState(sys->embed, state);
}
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
{ {
const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *); const vout_display_cfg_t *cfg = va_arg(ap, const vout_display_cfg_t *);
......
...@@ -251,13 +251,6 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -251,13 +251,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
return vout_window_SetFullScreen (sys->gl->surface, c->is_fullscreen); return vout_window_SetFullScreen (sys->gl->surface, c->is_fullscreen);
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{
unsigned state = va_arg (ap, unsigned);
return vout_window_SetState (sys->gl->surface, state);
}
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM: case VOUT_DISPLAY_CHANGE_ZOOM:
......
...@@ -463,12 +463,7 @@ static int Control( vout_display_t *vd, int query, va_list args ) ...@@ -463,12 +463,7 @@ static int Control( vout_display_t *vd, int query, va_list args )
const unsigned state = va_arg( args, unsigned ); const unsigned state = va_arg( args, unsigned );
const bool is_on_top = (state & VOUT_WINDOW_STATE_ABOVE) != 0; const bool is_on_top = (state & VOUT_WINDOW_STATE_ABOVE) != 0;
if( sys->parent_window ) if( is_on_top )
{
if( vout_window_SetState( sys->parent_window, state ))
return VLC_EGENERIC;
}
else if( is_on_top )
WinSetWindowPos( sys->frame, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER ); WinSetWindowPos( sys->frame, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER );
sys->is_on_top = is_on_top; sys->is_on_top = is_on_top;
......
...@@ -330,11 +330,6 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -330,11 +330,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{
unsigned state = va_arg (ap, unsigned);
return vout_window_SetState (sys->embed, state);
}
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM: case VOUT_DISPLAY_CHANGE_ZOOM:
case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
......
...@@ -595,19 +595,14 @@ int CommonControl(vout_display_t *vd, int query, va_list args) ...@@ -595,19 +595,14 @@ int CommonControl(vout_display_t *vd, int query, va_list args)
if (sys->use_desktop && is_on_top) if (sys->use_desktop && is_on_top)
return VLC_EGENERIC; return VLC_EGENERIC;
#endif #endif
if (sys->parent_window) { HMENU hMenu = GetSystemMenu(sys->hwnd, FALSE);
if (vout_window_SetState(sys->parent_window, state))
return VLC_EGENERIC; if (is_on_top && !(GetWindowLong(sys->hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)) {
} else { CheckMenuItem(hMenu, IDM_TOGGLE_ON_TOP, MF_BYCOMMAND | MFS_CHECKED);
HMENU hMenu = GetSystemMenu(sys->hwnd, FALSE); SetWindowPos(sys->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
} else if (!is_on_top && (GetWindowLong(sys->hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)) {
if (is_on_top && !(GetWindowLong(sys->hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)) { CheckMenuItem(hMenu, IDM_TOGGLE_ON_TOP, MF_BYCOMMAND | MFS_UNCHECKED);
CheckMenuItem(hMenu, IDM_TOGGLE_ON_TOP, MF_BYCOMMAND | MFS_CHECKED); SetWindowPos(sys->hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
SetWindowPos(sys->hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
} else if (!is_on_top && (GetWindowLong(sys->hwnd, GWL_EXSTYLE) & WS_EX_TOPMOST)) {
CheckMenuItem(hMenu, IDM_TOGGLE_ON_TOP, MF_BYCOMMAND | MFS_UNCHECKED);
SetWindowPos(sys->hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE);
}
} }
sys->is_on_top = is_on_top; sys->is_on_top = is_on_top;
return VLC_SUCCESS; return VLC_SUCCESS;
......
...@@ -278,12 +278,6 @@ static int Control(vout_display_t *vd, int query, va_list ap) ...@@ -278,12 +278,6 @@ static int Control(vout_display_t *vd, int query, va_list ap)
return vout_window_SetFullScreen(sys->embed, cfg->is_fullscreen); return vout_window_SetFullScreen(sys->embed, cfg->is_fullscreen);
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{
unsigned state = va_arg(ap, unsigned);
return vout_window_SetState(sys->embed, state);
}
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM: case VOUT_DISPLAY_CHANGE_ZOOM:
......
...@@ -221,12 +221,6 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -221,12 +221,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
return vout_window_SetFullScreen (sys->gl->surface, c->is_fullscreen); return vout_window_SetFullScreen (sys->gl->surface, c->is_fullscreen);
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{
unsigned state = va_arg (ap, unsigned);
return vout_window_SetState (sys->gl->surface, state);
}
case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM: case VOUT_DISPLAY_CHANGE_ZOOM:
......
...@@ -495,11 +495,6 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -495,11 +495,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
values); values);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{
unsigned state = va_arg (ap, unsigned);
return vout_window_SetState (sys->embed, state);
}
case VOUT_DISPLAY_CHANGE_ZOOM: case VOUT_DISPLAY_CHANGE_ZOOM:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
......
...@@ -788,11 +788,6 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -788,11 +788,6 @@ static int Control (vout_display_t *vd, int query, va_list ap)
xcb_flush (p_sys->conn); xcb_flush (p_sys->conn);
return VLC_SUCCESS; return VLC_SUCCESS;
} }
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
{
unsigned state = va_arg (ap, unsigned);
return vout_window_SetState (p_sys->embed, state);
}
/* Hide the mouse. It will be send when /* Hide the mouse. It will be send when
* vout_display_t::info.b_hide_mouse is false */ * vout_display_t::info.b_hide_mouse is false */
......
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