Skip to content

Commit

Permalink
[cosmetic] suppresses gcc parenthesis warning. Thx @vdrfan
Browse files Browse the repository at this point in the history
  • Loading branch information
Voyager1 committed Jun 29, 2013
1 parent ba63695 commit c275bf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

5 comments on commit c275bf3

@jowadmax
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@t-nelson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Voyager1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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).

@xhaggi
Copy link
Member

@xhaggi xhaggi commented on c275bf3 Jul 1, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@Voyager1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.