Skip to content
Browse files

[cosmetic] suppresses gcc parenthesis warning. Thx @vdrfan

  • Loading branch information...
1 parent ba63695 commit c275bf382876b592d935ebfde5f196283f00762a @Voyager1 Voyager1 committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 xbmc/Application.cpp
2 xbmc/Application.cpp
@@ -2484,7 +2484,7 @@ bool CApplication::OnAction(const CAction &action)
// Now check with the player if action can be handled.
if (g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
- g_windowManager.GetActiveWindow() == WINDOW_DIALOG_VIDEO_OSD && (action.GetID() == ACTION_NEXT_ITEM || action.GetID() == ACTION_PREV_ITEM || action.GetID() == ACTION_CHANNEL_UP || action.GetID() == ACTION_CHANNEL_DOWN))
+ (g_windowManager.GetActiveWindow() == WINDOW_DIALOG_VIDEO_OSD && (action.GetID() == ACTION_NEXT_ITEM || action.GetID() == ACTION_PREV_ITEM || action.GetID() == ACTION_CHANNEL_UP || action.GetID() == ACTION_CHANNEL_DOWN)))
if (m_pPlayer != NULL && m_pPlayer->OnAction(action))
return true;

5 comments on commit c275bf3


I think a little more proper fix is to put the parentheses around the && part only (i.e. g_windowManager.GetActiveWindow() == WINDOW_DIALOG_VIDEO_OSD && (action.GetID() == ACTION_NEXT_ITEM ) instead of the rest of the || parts; because that's actually how the logic is evaluated. The two values on both sides of the && are evaluated first, then they're treated as a single value which will be OR'ed with the rest of the expression.


Then the logic would be wrong. We only want to fall into that block if the current window is full screen video, or if the current window is the video osd and one of those four actions.

Team Kodi member

@jowadmax that would be wrong. The old logic was player->OnAction only triggered by fullscreenvideo (unconditional), or by osd (with just those four actions). @t-nelson is correct, and with or without the parentheses (since logical "and" takes precedence in expression evaluation).

Team Kodi member

@Voyager1 this don't fix the issue with random channel switches on channel osd (verified in 13 alpha 5). After dialog initialization the control does not get the focus, because of an issue within the control state handling in the dialog class fixed in #2912. If the channel osd control get's the focus it works.

Team Kodi member

In that case the problem was probably related to the fact that the windows (osd or fullscreen) still are getting a chance of handling the action. My first guess was that it was due to the unconditional delegation to player, now it looks as if it's because the windows in casu still go through their remaining OnAction code.
That being said, this has exposed another problem, which you obviously fixed.

Please sign in to comment.
Something went wrong with that request. Please try again.