mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1161802 part 1 - Add FullscreenChanged callback in WidgetListener. r=roc
--HG-- extra : source : dcfb961149d8c8e56ff787fa812dc781a491ee53
This commit is contained in:
parent
76eb787ad4
commit
7699870266
@ -1279,6 +1279,9 @@ void nsCocoaWindow::EnteredFullScreen(bool aFullScreen, bool aNativeMode)
|
||||
mInNativeFullScreenMode = aFullScreen;
|
||||
}
|
||||
DispatchSizeModeEvent();
|
||||
if (mWidgetListener) {
|
||||
mWidgetListener->FullscreenChanged(aFullScreen);
|
||||
}
|
||||
}
|
||||
|
||||
inline bool nsCocoaWindow::ShouldToggleNativeFullscreen(bool aFullScreen)
|
||||
|
@ -605,6 +605,10 @@ nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen*)
|
||||
virtualBounds.width, virtualBounds.height,
|
||||
/*repaint*/true);
|
||||
}
|
||||
|
||||
if (nsIWidgetListener* listener = GetWidgetListener()) {
|
||||
listener->FullscreenChanged(aFullScreen);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -3256,6 +3256,7 @@ nsWindow::OnWindowStateEvent(GtkWidget *aWidget, GdkEventWindowState *aEvent)
|
||||
return;
|
||||
}
|
||||
|
||||
bool wasInFullscreen = mSizeState == nsSizeMode_Fullscreen;
|
||||
if (aEvent->new_window_state & GDK_WINDOW_STATE_ICONIFIED) {
|
||||
LOG(("\tIconified\n"));
|
||||
mSizeState = nsSizeMode_Minimized;
|
||||
@ -3282,8 +3283,14 @@ nsWindow::OnWindowStateEvent(GtkWidget *aWidget, GdkEventWindowState *aEvent)
|
||||
#endif //ACCESSIBILITY
|
||||
}
|
||||
|
||||
if (mWidgetListener)
|
||||
if (mWidgetListener) {
|
||||
mWidgetListener->SizeModeChanged(mSizeState);
|
||||
|
||||
bool isInFullscreen = mSizeState == nsSizeMode_Fullscreen;
|
||||
if (isInFullscreen != wasInFullscreen) {
|
||||
mWidgetListener->FullscreenChanged(isInFullscreen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -54,6 +54,11 @@ nsIWidgetListener::SizeModeChanged(nsSizeMode aSizeMode)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
nsIWidgetListener::FullscreenChanged(bool aInFullscreen)
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
nsIWidgetListener::ZLevelChanged(bool aImmediate,
|
||||
nsWindowZ* aPlacement,
|
||||
|
@ -86,6 +86,11 @@ public:
|
||||
nsIWidget* aRequestBelow,
|
||||
nsIWidget** aActualBelow);
|
||||
|
||||
/**
|
||||
* Called when the window entered or left the fullscreen state.
|
||||
*/
|
||||
virtual void FullscreenChanged(bool aInFullscreen);
|
||||
|
||||
/**
|
||||
* Called when the window is activated and focused.
|
||||
*/
|
||||
|
@ -2897,8 +2897,10 @@ nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen)
|
||||
taskbarInfo->PrepareFullScreenHWND(mWnd, FALSE);
|
||||
}
|
||||
|
||||
if (mWidgetListener)
|
||||
if (mWidgetListener) {
|
||||
mWidgetListener->SizeModeChanged(mSizeMode);
|
||||
mWidgetListener->FullscreenChanged(aFullScreen);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user