Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
07c6122a
Commit
07c6122a
authored
Sep 09, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Centralized mouse auto-hiding code.
parent
b95ba5d2
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
93 deletions
+47
-93
modules/video_output/msw/common.c
modules/video_output/msw/common.c
+0
-5
modules/video_output/msw/direct3d.c
modules/video_output/msw/direct3d.c
+1
-19
modules/video_output/msw/directx.c
modules/video_output/msw/directx.c
+1
-19
modules/video_output/msw/events.c
modules/video_output/msw/events.c
+36
-7
modules/video_output/msw/glwin32.c
modules/video_output/msw/glwin32.c
+1
-19
modules/video_output/msw/vout.h
modules/video_output/msw/vout.h
+7
-5
modules/video_output/msw/wingdi.c
modules/video_output/msw/wingdi.c
+1
-19
No files found.
modules/video_output/msw/common.c
View file @
07c6122a
...
@@ -86,11 +86,6 @@ int CommonInit( vout_thread_t *p_vout )
...
@@ -86,11 +86,6 @@ int CommonInit( vout_thread_t *p_vout )
SetRectEmpty
(
&
p_sys
->
rect_parent
);
SetRectEmpty
(
&
p_sys
->
rect_parent
);
vlc_mutex_init
(
&
p_sys
->
lock
);
vlc_mutex_init
(
&
p_sys
->
lock
);
p_sys
->
b_cursor_hidden
=
0
;
p_sys
->
i_lastmoved
=
mdate
();
p_sys
->
i_mouse_hide_timeout
=
var_GetInteger
(
p_vout
,
"mouse-hide-timeout"
)
*
1000
;
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_vout
,
"video-title"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
/* Set main window's size */
/* Set main window's size */
...
...
modules/video_output/msw/direct3d.c
View file @
07c6122a
...
@@ -442,25 +442,7 @@ static int Manage( vout_thread_t *p_vout )
...
@@ -442,25 +442,7 @@ static int Manage( vout_thread_t *p_vout )
/*
/*
* Pointer change
* Pointer change
*/
*/
if
(
p_vout
->
b_fullscreen
&&
!
p_vout
->
p_sys
->
b_cursor_hidden
&&
EventThreadMouseAutoHide
(
p_vout
->
p_sys
->
p_event
);
(
mdate
()
-
p_vout
->
p_sys
->
i_lastmoved
)
>
p_vout
->
p_sys
->
i_mouse_hide_timeout
)
{
POINT
point
;
HWND
hwnd
;
/* Hide the cursor only if it is inside our window */
GetCursorPos
(
&
point
);
hwnd
=
WindowFromPoint
(
point
);
if
(
hwnd
==
p_vout
->
p_sys
->
hwnd
||
hwnd
==
p_vout
->
p_sys
->
hvideownd
)
{
PostMessage
(
p_vout
->
p_sys
->
hwnd
,
WM_VLC_HIDE_MOUSE
,
0
,
0
);
}
else
{
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
}
}
/*
/*
* "Always on top" status change
* "Always on top" status change
...
...
modules/video_output/msw/directx.c
View file @
07c6122a
...
@@ -554,25 +554,7 @@ static int Manage( vout_thread_t *p_vout )
...
@@ -554,25 +554,7 @@ static int Manage( vout_thread_t *p_vout )
/*
/*
* Pointer change
* Pointer change
*/
*/
if
(
p_vout
->
b_fullscreen
&&
!
p_vout
->
p_sys
->
b_cursor_hidden
&&
EventThreadMouseAutoHide
(
p_vout
->
p_sys
->
p_event
);
(
mdate
()
-
p_vout
->
p_sys
->
i_lastmoved
)
>
p_vout
->
p_sys
->
i_mouse_hide_timeout
)
{
POINT
point
;
HWND
hwnd
;
/* Hide the cursor only if it is inside our window */
GetCursorPos
(
&
point
);
hwnd
=
WindowFromPoint
(
point
);
if
(
hwnd
==
p_vout
->
p_sys
->
hwnd
||
hwnd
==
p_vout
->
p_sys
->
hvideownd
)
{
PostMessage
(
p_vout
->
p_sys
->
hwnd
,
WM_VLC_HIDE_MOUSE
,
0
,
0
);
}
else
{
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
}
}
/*
/*
* "Always on top" status change
* "Always on top" status change
...
...
modules/video_output/msw/events.c
View file @
07c6122a
...
@@ -200,26 +200,26 @@ static void *EventThread( void *p_this )
...
@@ -200,26 +200,26 @@ static void *EventThread( void *p_this )
(
abs
(
mouse_pos
.
y
-
old_mouse_pos
.
y
))
>
2
)
)
(
abs
(
mouse_pos
.
y
-
old_mouse_pos
.
y
))
>
2
)
)
{
{
GetCursorPos
(
&
old_mouse_pos
);
GetCursorPos
(
&
old_mouse_pos
);
p_event
->
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
p_event
->
i_lastmoved
=
mdate
();
if
(
p_event
->
p_vout
->
p_sys
->
b_cursor_hidden
)
if
(
p_event
->
b_cursor_hidden
)
{
{
p_event
->
p_vout
->
p_sys
->
b_cursor_hidden
=
0
;
p_event
->
b_cursor_hidden
=
0
;
ShowCursor
(
TRUE
);
ShowCursor
(
TRUE
);
}
}
}
}
break
;
break
;
case
WM_VLC_HIDE_MOUSE
:
case
WM_VLC_HIDE_MOUSE
:
if
(
p_event
->
p_vout
->
p_sys
->
b_cursor_hidden
)
break
;
if
(
p_event
->
b_cursor_hidden
)
break
;
p_event
->
p_vout
->
p_sys
->
b_cursor_hidden
=
true
;
p_event
->
b_cursor_hidden
=
true
;
GetCursorPos
(
&
old_mouse_pos
);
GetCursorPos
(
&
old_mouse_pos
);
ShowCursor
(
FALSE
);
ShowCursor
(
FALSE
);
break
;
break
;
case
WM_VLC_SHOW_MOUSE
:
case
WM_VLC_SHOW_MOUSE
:
if
(
!
p_event
->
p_vout
->
p_sys
->
b_cursor_hidden
)
break
;
if
(
!
p_event
->
b_cursor_hidden
)
break
;
p_event
->
p_vout
->
p_sys
->
b_cursor_hidden
=
false
;
p_event
->
b_cursor_hidden
=
false
;
GetCursorPos
(
&
old_mouse_pos
);
GetCursorPos
(
&
old_mouse_pos
);
ShowCursor
(
TRUE
);
ShowCursor
(
TRUE
);
break
;
break
;
...
@@ -895,6 +895,30 @@ static int DirectXConvertKey( int i_key )
...
@@ -895,6 +895,30 @@ static int DirectXConvertKey( int i_key )
return
0
;
return
0
;
}
}
void
EventThreadMouseAutoHide
(
event_thread_t
*
p_event
)
{
vout_thread_t
*
p_vout
=
p_event
->
p_vout
;
if
(
p_vout
->
b_fullscreen
&&
!
p_event
->
b_cursor_hidden
&&
(
mdate
()
-
p_event
->
i_lastmoved
)
>
p_event
->
i_mouse_hide_timeout
)
{
/* Hide the cursor only if it is inside our window */
POINT
point
;
GetCursorPos
(
&
point
);
HWND
hwnd
=
WindowFromPoint
(
point
);
if
(
hwnd
==
p_vout
->
p_sys
->
hwnd
||
hwnd
==
p_vout
->
p_sys
->
hvideownd
)
{
PostMessage
(
p_vout
->
p_sys
->
hwnd
,
WM_VLC_HIDE_MOUSE
,
0
,
0
);
}
else
{
p_event
->
i_lastmoved
=
mdate
();
}
}
}
event_thread_t
*
EventThreadCreate
(
vout_thread_t
*
p_vout
)
event_thread_t
*
EventThreadCreate
(
vout_thread_t
*
p_vout
)
{
{
/* Create the Vout EventThread, this thread is created by us to isolate
/* Create the Vout EventThread, this thread is created by us to isolate
...
@@ -913,6 +937,11 @@ event_thread_t *EventThreadCreate( vout_thread_t *p_vout )
...
@@ -913,6 +937,11 @@ event_thread_t *EventThreadCreate( vout_thread_t *p_vout )
vlc_mutex_init
(
&
p_event
->
lock
);
vlc_mutex_init
(
&
p_event
->
lock
);
vlc_cond_init
(
&
p_event
->
wait
);
vlc_cond_init
(
&
p_event
->
wait
);
p_event
->
b_cursor_hidden
=
false
;
p_event
->
i_lastmoved
=
mdate
();
p_event
->
i_mouse_hide_timeout
=
var_GetInteger
(
p_vout
,
"mouse-hide-timeout"
)
*
1000
;
return
p_event
;
return
p_event
;
}
}
...
...
modules/video_output/msw/glwin32.c
View file @
07c6122a
...
@@ -283,25 +283,7 @@ static int Manage( vout_thread_t *p_vout )
...
@@ -283,25 +283,7 @@ static int Manage( vout_thread_t *p_vout )
/*
/*
* Pointer change
* Pointer change
*/
*/
if
(
p_vout
->
b_fullscreen
&&
!
p_vout
->
p_sys
->
b_cursor_hidden
&&
EventThreadMouseAutoHide
(
p_vout
->
p_sys
->
p_event
);
(
mdate
()
-
p_vout
->
p_sys
->
i_lastmoved
)
>
p_vout
->
p_sys
->
i_mouse_hide_timeout
)
{
POINT
point
;
HWND
hwnd
;
/* Hide the cursor only if it is inside our window */
GetCursorPos
(
&
point
);
hwnd
=
WindowFromPoint
(
point
);
if
(
hwnd
==
p_vout
->
p_sys
->
hwnd
||
hwnd
==
p_vout
->
p_sys
->
hvideownd
)
{
PostMessage
(
p_vout
->
p_sys
->
hwnd
,
WM_VLC_HIDE_MOUSE
,
0
,
0
);
}
else
{
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
}
}
/*
/*
* "Always on top" status change
* "Always on top" status change
...
...
modules/video_output/msw/vout.h
View file @
07c6122a
...
@@ -37,6 +37,11 @@ typedef struct
...
@@ -37,6 +37,11 @@ typedef struct
bool
b_done
;
bool
b_done
;
bool
b_error
;
bool
b_error
;
/* Mouse */
volatile
bool
b_cursor_hidden
;
volatile
mtime_t
i_lastmoved
;
mtime_t
i_mouse_hide_timeout
;
}
event_thread_t
;
}
event_thread_t
;
#ifdef MODULE_NAME_IS_wingapi
#ifdef MODULE_NAME_IS_wingapi
...
@@ -112,11 +117,6 @@ struct vout_sys_t
...
@@ -112,11 +117,6 @@ struct vout_sys_t
volatile
uint16_t
i_changes
;
/* changes made to the video display */
volatile
uint16_t
i_changes
;
/* changes made to the video display */
/* Mouse */
volatile
bool
b_cursor_hidden
;
volatile
mtime_t
i_lastmoved
;
mtime_t
i_mouse_hide_timeout
;
/* Misc */
/* Misc */
bool
b_on_top_change
;
bool
b_on_top_change
;
...
@@ -266,6 +266,8 @@ void EventThreadDestroy( event_thread_t * );
...
@@ -266,6 +266,8 @@ void EventThreadDestroy( event_thread_t * );
int
EventThreadStart
(
event_thread_t
*
);
int
EventThreadStart
(
event_thread_t
*
);
void
EventThreadStop
(
event_thread_t
*
);
void
EventThreadStop
(
event_thread_t
*
);
void
EventThreadMouseAutoHide
(
event_thread_t
*
);
/*****************************************************************************
/*****************************************************************************
* Prototypes from common.c
* Prototypes from common.c
*****************************************************************************/
*****************************************************************************/
...
...
modules/video_output/msw/wingdi.c
View file @
07c6122a
...
@@ -411,25 +411,7 @@ static int Manage( vout_thread_t *p_vout )
...
@@ -411,25 +411,7 @@ static int Manage( vout_thread_t *p_vout )
/*
/*
* Pointer change
* Pointer change
*/
*/
if
(
p_vout
->
b_fullscreen
&&
!
p_vout
->
p_sys
->
b_cursor_hidden
&&
EventThreadMouseAutoHide
(
p_vout
->
p_sys
->
p_event
);
(
mdate
()
-
p_vout
->
p_sys
->
i_lastmoved
)
>
p_vout
->
p_sys
->
i_mouse_hide_timeout
)
{
POINT
point
;
HWND
hwnd
;
/* Hide the cursor only if it is inside our window */
GetCursorPos
(
&
point
);
hwnd
=
WindowFromPoint
(
point
);
if
(
hwnd
==
p_vout
->
p_sys
->
hwnd
||
hwnd
==
p_vout
->
p_sys
->
hvideownd
)
{
PostMessage
(
p_vout
->
p_sys
->
hwnd
,
WM_VLC_HIDE_MOUSE
,
0
,
0
);
}
else
{
p_vout
->
p_sys
->
i_lastmoved
=
mdate
();
}
}
/*
/*
* "Always on top" status change
* "Always on top" status change
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment