New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[builtins] fix bad access if GetWindow() is called with virtual window id #6990
Conversation
jenkins build this please |
@@ -300,7 +300,8 @@ void CBuiltins::GetHelp(std::string &help) | |||
bool CBuiltins::ActivateWindow(int iWindowID, const std::vector<std::string>& params /* = {} */, bool swappingWindows /* = false */) | |||
{ | |||
// don't activate a window if there are active modal dialogs | |||
if (g_windowManager.HasModalDialog() && !g_windowManager.GetWindow(iWindowID)->IsDialog()) | |||
if (g_windowManager.HasModalDialog() && | |||
!(g_windowManager.GetWindow(iWindowID) != NULL && g_windowManager.GetWindow(iWindowID)->IsDialog())) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@FernetMenta refactored the active modals validation into |
looks good imo |
…uiltins to CGUIWindowManager
9830c6d
to
fa12f18
Compare
squashed .. jenkins build this please |
any objections? |
+1 |
[builtins] fix bad access if GetWindow() is called with virtual window id
@FernetMenta there are different issues where windows can't be activated because of open modals. Take a look at http://trac.kodi.tv/ticket/15960. The first approach with PR #6828 was to only block user-interactive activation (via built-ins) of new windows while a modal dialog is open. After this we block also internal activations like switch to fullscreen which results in the issue described in #7022. IMO we should revert to the old behavior and only block user-interactive activation (via built-ins). I would create a new method for that in |
@xhaggi go ahead with your suggestion. I don't have a better idea |
As pointed out by @mkortstiege this will fix a null access if we call
g_windowManager.GetWindow(iWindowID)
with a virtual window id e.g. WINDOW_MUSIC -> 10005.