2009-10-28 Eric Carlson <eric.carlson@apple.com>

        Reviewed by Simon Fraser.

        <rdar://problem/7303145> 
        Can't exit full screen mode or restart movie after pressing command -R.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::removedFromDocument):
        (WebCore::HTMLMediaElement::documentWillBecomeInactive):
            Exit from fullscreen if necessary.
        * html/HTMLMediaElement.h:

2009-10-28  Eric Carlson  <eric.carlson@apple.com>

        Reviewed by Simon Fraser.

        <rdar://problem/7303145> 
        Can't exit full screen mode or restart movie after pressing command -R.

        * WebView/WebVideoFullscreenController.mm:
        (-[WebVideoFullscreenController _requestExit]): 
            New, call media element's exitFullscreen method.
        (-[WebVideoFullscreenController requestExitFullscreenWithAnimation:]): 
            Call mediaElement->exitFullscreen() after a delay as it turns around and calls
            WebVideoFullscreenController:exitFullscreen.

        * WebView/WebVideoFullscreenHUDWindowController.h:
        * WebView/WebVideoFullscreenHUDWindowController.mm:
        (-[WebVideoFullscreenHUDWindow resignFirstResponder]):
            New, don't give up responder status.
        (-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
            New, block all command key events.
        (-[WebVideoFullscreenHUDWindowController exitFullscreen:]):
            Remember when we are in the process of exiting fullscreen, don't allow recursion.

        * WebView/WebView.mm:
        (-[WebView _exitFullscreen]):
            Early return if fullscreen controller is nil.

        * WebView/WebWindowAnimation.h: 
            Correct comment about _window retain status.
        * WebView/WebWindowAnimation.m:
        (-[WebWindowScaleAnimation dealloc]):
            Don't release _window, we never reatained it.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50242 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7f664819
2009-10-28 Eric Carlson <eric.carlson@apple.com>
Reviewed by Simon Fraser.
<rdar://problem/7303145>
Can't exit full screen mode or restart movie after pressing command -R.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFromDocument):
(WebCore::HTMLMediaElement::documentWillBecomeInactive):
Exit from fullscreen if necessary.
* html/HTMLMediaElement.h:
2009-10-28 Alexey Proskuryakov <ap@apple.com>
Unreviewed - a trivial fix to get Windows bots running.
......@@ -247,16 +247,12 @@ void HTMLMediaElement::insertedIntoDocument()
scheduleLoad();
}
void HTMLMediaElement::willRemove()
{
if (m_isFullscreen)
exitFullscreen();
HTMLElement::willRemove();
}
void HTMLMediaElement::removedFromDocument()
{
if (m_networkState > NETWORK_EMPTY)
pause();
if (m_isFullscreen)
exitFullscreen();
HTMLElement::removedFromDocument();
}
......@@ -1678,6 +1674,9 @@ void HTMLMediaElement::userCancelledLoad()
void HTMLMediaElement::documentWillBecomeInactive()
{
if (m_isFullscreen)
exitFullscreen();
m_inActiveDocument = false;
userCancelledLoad();
......
......@@ -57,7 +57,6 @@ public:
virtual bool rendererIsNeeded(RenderStyle*);
virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
virtual void insertedIntoDocument();
virtual void willRemove();
virtual void removedFromDocument();
virtual void attach();
virtual void recalcStyle(StyleChange);
......
2009-10-28 Eric Carlson <eric.carlson@apple.com>
Reviewed by Simon Fraser.
<rdar://problem/7303145>
Can't exit full screen mode or restart movie after pressing command -R.
* WebView/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController _requestExit]):
New, call media element's exitFullscreen method.
(-[WebVideoFullscreenController requestExitFullscreenWithAnimation:]):
Call mediaElement->exitFullscreen() after a delay as it turns around and calls
WebVideoFullscreenController:exitFullscreen.
* WebView/WebVideoFullscreenHUDWindowController.h:
* WebView/WebVideoFullscreenHUDWindowController.mm:
(-[WebVideoFullscreenHUDWindow resignFirstResponder]):
New, don't give up responder status.
(-[WebVideoFullscreenHUDWindow performKeyEquivalent:]):
New, block all command key events.
(-[WebVideoFullscreenHUDWindowController exitFullscreen:]):
Remember when we are in the process of exiting fullscreen, don't allow recursion.
* WebView/WebView.mm:
(-[WebView _exitFullscreen]):
Early return if fullscreen controller is nil.
* WebView/WebWindowAnimation.h:
Correct comment about _window retain status.
* WebView/WebWindowAnimation.m:
(-[WebWindowScaleAnimation dealloc]):
Don't release _window, we never reatained it.
2009-10-27 Shinichiro Hamaji <hamaji@chromium.org>
Reviewed by Darin Adler.
......
......@@ -280,14 +280,21 @@ static NSWindow *createBackgroundFullscreenWindow(NSRect frame, int level)
#pragma mark -
#pragma mark Window callback
- (void)_requestExit
{
if (_mediaElement)
_mediaElement->exitFullscreen();
_forceDisableAnimation = NO;
}
- (void)requestExitFullscreenWithAnimation:(BOOL)animation
{
if (_isEndingFullscreen)
return;
_forceDisableAnimation = !animation;
_mediaElement->exitFullscreen();
_forceDisableAnimation = NO;
[self performSelector:@selector(_requestExit) withObject:nil afterDelay:0];
}
- (void)requestExitFullscreen
......
......@@ -38,6 +38,7 @@
NSTrackingArea *_area;
#endif
BOOL _mouseIsInHUD;
BOOL _isEndingFullscreen;
NSControl *_timeline;
NSTextField *_remainingTimeText;
......
......@@ -117,6 +117,23 @@ using namespace std;
[[self windowController] fadeWindowIn];
}
- (BOOL)resignFirstResponder
{
return NO;
}
- (BOOL)performKeyEquivalent:(NSEvent *)event
{
// Block all command key events while the fullscreen window is up.
if ([event type] != NSKeyDown)
return NO;
if (!([event modifierFlags] & NSCommandKeyMask))
return NO;
return YES;
}
@end
//
......@@ -604,6 +621,9 @@ static NSString *stringToTimeTextAttributed(NSString *string, NSTextAlignment al
- (void)exitFullscreen:(id)sender
{
if (_isEndingFullscreen)
return;
_isEndingFullscreen = YES;
[_delegate requestExitFullscreen];
}
......
......@@ -5544,6 +5544,8 @@ static void layerSyncRunLoopObserverCallBack(CFRunLoopObserverRef, CFRunLoopActi
- (void)_exitFullscreen
{
if (!_private->fullscreenController)
return;
[_private->fullscreenController exitFullscreen];
[_private->fullscreenController release];
_private->fullscreenController = nil;
......
......@@ -46,7 +46,7 @@
@interface WebWindowFadeAnimation : NSAnimation {
@private
CGFloat _initialAlpha, _finalAlpha;
NSWindow *_window; // (retain)
NSWindow *_window; // (assign)
BOOL _isStopped;
}
......
......@@ -80,7 +80,6 @@ - (id)initWithHintedDuration:(NSTimeInterval)duration window:(NSWindow *)window
- (void) dealloc
{
[_window release];
[_subAnimation release];
[super dealloc];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment