mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 707092 - Add a null check and return proper constants on failure from GetTopLevelWindowActiveState, r=bbondy.
This commit is contained in:
parent
0a87853a4e
commit
d58e948c0c
@ -89,9 +89,11 @@ static PRInt32 GetTopLevelWindowActiveState(nsIFrame *aFrame)
|
||||
// until it finds a real window.
|
||||
nsIWidget* widget = aFrame->GetNearestWidget();
|
||||
nsWindow * window = static_cast<nsWindow*>(widget);
|
||||
if (!window)
|
||||
return mozilla::widget::themeconst::FS_INACTIVE;
|
||||
if (widget && !window->IsTopLevelWidget() &&
|
||||
!(window = window->GetParentWindow(false)))
|
||||
return false;
|
||||
return mozilla::widget::themeconst::FS_INACTIVE;
|
||||
|
||||
if (window->GetWindowHandle() == ::GetActiveWindow())
|
||||
return mozilla::widget::themeconst::FS_ACTIVE;
|
||||
|
Loading…
Reference in New Issue
Block a user