Skip to content
This repository
Browse code

[cosmetic] suppresses gcc parenthesis warning. Thx @vdrfan

  • Loading branch information...
commit c275bf382876b592d935ebfde5f196283f00762a 1 parent ba63695
Voyager1 authored June 29, 2013

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  xbmc/Application.cpp
2  xbmc/Application.cpp
@@ -2484,7 +2484,7 @@ bool CApplication::OnAction(const CAction &action)
2484 2484
 
2485 2485
   // Now check with the player if action can be handled.
2486 2486
   if (g_windowManager.GetActiveWindow() == WINDOW_FULLSCREEN_VIDEO ||
2487  
-      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))
  2487
+      (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)))
2488 2488
   {
2489 2489
     if (m_pPlayer != NULL && m_pPlayer->OnAction(action))
2490 2490
       return true;

5 notes on commit c275bf3

jowadmax

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.

Trent Nelson
Collaborator

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
Collaborator

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

Sascha Woo
Collaborator

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

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.