Fixed hiding the mouse cursor after going full screen.
* This fixes a regression I introduced in hrev43648; the mouse cursor was only being hidden in case the controls were visible (ie. only after an extra mouse move in full screen).
This commit is contained in:
parent
6912e7dc03
commit
c95601d728
@ -32,6 +32,7 @@ VideoView::VideoView(BRect frame, const char* name, uint32 resizeMask)
|
|||||||
fIsPlaying(false),
|
fIsPlaying(false),
|
||||||
fIsFullscreen(false),
|
fIsFullscreen(false),
|
||||||
fFullscreenControlsVisible(false),
|
fFullscreenControlsVisible(false),
|
||||||
|
fFirstAfterFullscreen(false),
|
||||||
fSendHideCounter(0),
|
fSendHideCounter(0),
|
||||||
fLastMouseMove(system_time()),
|
fLastMouseMove(system_time()),
|
||||||
|
|
||||||
@ -115,6 +116,9 @@ VideoView::MessageReceived(BMessage* message)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
Disables the screen saver, and hides the full screen controls.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
VideoView::Pulse()
|
VideoView::Pulse()
|
||||||
{
|
{
|
||||||
@ -124,12 +128,13 @@ VideoView::Pulse()
|
|||||||
bigtime_t now = system_time();
|
bigtime_t now = system_time();
|
||||||
if (now - fLastMouseMove > 1500000) {
|
if (now - fLastMouseMove > 1500000) {
|
||||||
fLastMouseMove = now;
|
fLastMouseMove = now;
|
||||||
// take care of disabling the screen saver
|
|
||||||
BPoint where;
|
BPoint where;
|
||||||
uint32 buttons;
|
uint32 buttons;
|
||||||
GetMouse(&where, &buttons, false);
|
GetMouse(&where, &buttons, false);
|
||||||
if (buttons == 0) {
|
if (buttons == 0) {
|
||||||
if (fFullscreenControlsVisible) {
|
// Hide the full screen controls (and the mouse pointer)
|
||||||
|
// after a while
|
||||||
|
if (fFullscreenControlsVisible || fFirstAfterFullscreen) {
|
||||||
if (fSendHideCounter == 0 || fSendHideCounter == 3) {
|
if (fSendHideCounter == 0 || fSendHideCounter == 3) {
|
||||||
// Send after 1.5s and after 4.5s
|
// Send after 1.5s and after 4.5s
|
||||||
BMessage message(M_HIDE_FULL_SCREEN_CONTROLS);
|
BMessage message(M_HIDE_FULL_SCREEN_CONTROLS);
|
||||||
@ -139,8 +144,10 @@ VideoView::Pulse()
|
|||||||
Window()->PostMessage(&message, Window());
|
Window()->PostMessage(&message, Window());
|
||||||
}
|
}
|
||||||
fSendHideCounter++;
|
fSendHideCounter++;
|
||||||
|
fFirstAfterFullscreen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Take care of disabling the screen saver
|
||||||
ConvertToScreen(&where);
|
ConvertToScreen(&where);
|
||||||
set_mouse_position((int32)where.x, (int32)where.y);
|
set_mouse_position((int32)where.x, (int32)where.y);
|
||||||
}
|
}
|
||||||
@ -303,6 +310,7 @@ VideoView::SetFullscreen(bool fullScreen)
|
|||||||
{
|
{
|
||||||
fIsFullscreen = fullScreen;
|
fIsFullscreen = fullScreen;
|
||||||
fSendHideCounter = 0;
|
fSendHideCounter = 0;
|
||||||
|
fFirstAfterFullscreen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -70,6 +70,7 @@ private:
|
|||||||
bool fIsPlaying;
|
bool fIsPlaying;
|
||||||
bool fIsFullscreen;
|
bool fIsFullscreen;
|
||||||
bool fFullscreenControlsVisible;
|
bool fFullscreenControlsVisible;
|
||||||
|
bool fFirstAfterFullscreen;
|
||||||
uint8 fSendHideCounter;
|
uint8 fSendHideCounter;
|
||||||
bigtime_t fLastMouseMove;
|
bigtime_t fLastMouseMove;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user