Skip to content

Commit

Permalink
Merge pull request #4169 from koying/fixdvdtouch
Browse files Browse the repository at this point in the history
FIX: do not popup OSD on DVD menu with touch or mouse (fixes #14906)
  • Loading branch information
jmarshallnz authored and Jonathan Marshall committed Jun 15, 2014
1 parent c50fac1 commit 7510732
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 13 deletions.
4 changes: 4 additions & 0 deletions xbmc/Application.cpp
Expand Up @@ -2692,6 +2692,10 @@ bool CApplication::OnAction(const CAction &action)
{
if (m_pPlayer->OnAction(action))
return true;
// Player ignored action; popup the OSD
if ((action.GetID() == ACTION_MOUSE_MOVE && (action.GetAmount(2) || action.GetAmount(3))) // filter "false" mouse move from touch
|| action.GetID() == ACTION_MOUSE_LEFT_CLICK)
CApplicationMessenger::Get().SendAction(CAction(ACTION_TRIGGER_OSD), WINDOW_INVALID, false);
}

// stop : stops playing current audio song
Expand Down
10 changes: 9 additions & 1 deletion xbmc/cores/dvdplayer/DVDPlayer.cpp
Expand Up @@ -3729,7 +3729,15 @@ bool CDVDPlayer::OnAction(const CAction &action)
pt.y *= rs.Height() / rd.Height();
pt += CPoint(rs.x1, rs.y1);
if (action.GetID() == ACTION_MOUSE_LEFT_CLICK)
return pMenus->OnMouseClick(pt);
{
if (pMenus->OnMouseClick(pt))
return true;
else
{
CApplicationMessenger::Get().SendAction(CAction(ACTION_TRIGGER_OSD), WINDOW_INVALID, false); // Trigger the osd
return false;
}
}
return pMenus->OnMouseMove(pt);
}
break;
Expand Down
10 changes: 9 additions & 1 deletion xbmc/cores/omxplayer/OMXPlayer.cpp
Expand Up @@ -3998,7 +3998,15 @@ bool COMXPlayer::OnAction(const CAction &action)
pt.y *= rs.Height() / rd.Height();
pt += CPoint(rs.x1, rs.y1);
if (action.GetID() == ACTION_MOUSE_LEFT_CLICK)
return pMenus->OnMouseClick(pt);
{
if (pMenus->OnMouseClick(pt))
return true;
else
{
CApplicationMessenger::Get().SendAction(CAction(ACTION_TRIGGER_OSD), WINDOW_INVALID, false); // Trigger the osd
return false;
}
}
return pMenus->OnMouseMove(pt);
}
break;
Expand Down
2 changes: 2 additions & 0 deletions xbmc/guilib/Key.h
Expand Up @@ -332,6 +332,8 @@
#define ACTION_SETTINGS_RESET 241
#define ACTION_SETTINGS_LEVEL_CHANGE 242

#define ACTION_TRIGGER_OSD 243 // show autoclosing OSD. Can b used in videoFullScreen.xml window id=2005

// touch actions
#define ACTION_TOUCH_TAP 401
#define ACTION_TOUCH_TAP_TEN 410
Expand Down
25 changes: 14 additions & 11 deletions xbmc/video/windows/GUIWindowFullScreen.cpp
Expand Up @@ -142,6 +142,10 @@ bool CGUIWindowFullScreen::OnAction(const CAction &action)
ToggleOSD();
return true;

case ACTION_TRIGGER_OSD:
TriggerOSD();
return true;

case ACTION_SHOW_GUI:
{
// switch back to the menu
Expand Down Expand Up @@ -538,17 +542,6 @@ EVENT_RESULT CGUIWindowFullScreen::OnMouseEvent(const CPoint &point, const CMous
}
if (event.m_id >= ACTION_GESTURE_NOTIFY && event.m_id <= ACTION_GESTURE_END) // gestures
return EVENT_RESULT_UNHANDLED;
if (event.m_id != ACTION_MOUSE_MOVE || event.m_offsetX || event.m_offsetY)
{ // some other mouse action has occurred - bring up the OSD
// if it is not already running
CGUIDialogVideoOSD *pOSD = (CGUIDialogVideoOSD *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pOSD && !pOSD->IsDialogRunning())
{
pOSD->SetAutoClose(3000);
pOSD->DoModal();
}
return EVENT_RESULT_HANDLED;
}
return EVENT_RESULT_UNHANDLED;
}

Expand Down Expand Up @@ -862,3 +855,13 @@ void CGUIWindowFullScreen::ToggleOSD()
pOSD->DoModal();
}
}

void CGUIWindowFullScreen::TriggerOSD()
{
CGUIDialogVideoOSD *pOSD = (CGUIDialogVideoOSD *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pOSD && !pOSD->IsDialogRunning())
{
pOSD->SetAutoClose(3000);
pOSD->DoModal();
}
}
1 change: 1 addition & 0 deletions xbmc/video/windows/GUIWindowFullScreen.h
Expand Up @@ -44,6 +44,7 @@ class CGUIWindowFullScreen : public CGUIWindow
void SeekChapter(int iChapter);
void FillInTVGroups();
void ToggleOSD();
void TriggerOSD();

enum SEEK_TYPE { SEEK_ABSOLUTE, SEEK_RELATIVE };
enum SEEK_DIRECTION { SEEK_FORWARD, SEEK_BACKWARD };
Expand Down

0 comments on commit 7510732

Please sign in to comment.