Bug 63217 - Full-screen: Don't change the collectionBehavior of the WebView's NSWindow if not necessary
Summary: Full-screen: Don't change the collectionBehavior of the WebView's NSWindow if...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2011-06-22 18:51 PDT by Jer Noble
Modified: 2011-07-12 14:39 PDT (History)
1 user (show)

See Also:


Attachments
Patch (2.48 KB, patch)
2011-06-22 18:55 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (2.42 KB, patch)
2011-07-11 15:22 PDT, Jer Noble
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jer Noble 2011-06-22 18:51:09 PDT
Full-screen: Don't change the collectionBehavior of the WebView's NSWindow if not necessary
Comment 1 Jer Noble 2011-06-22 18:55:15 PDT
Created attachment 98293 [details]
Patch
Comment 2 Jer Noble 2011-06-22 18:56:09 PDT
<rdar://problem/9660291>
Comment 3 Daniel Bates 2011-07-01 11:51:36 PDT
Comment on attachment 98293 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=98293&action=review

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:332
> +#if !defined(BUILDING_ON_LEOPARD)
> +        if (![webWindow isOnActiveSpace]) {
> +#endif

Have you considered encapsulating this functionality into a static function, say isWindowOnActiveSpace(NSWindow*) or windowIsOnActiveSpace(NSWindow*), that is hardcoded to return false when building on Leopard and sends the specified NSWindow an isOnActiveSpace: message when we aren't building on Leopard?
Comment 4 Mark Rowe (bdash) 2011-07-08 15:52:37 PDT
WebKit2 isn’t built on Leopard so the #if’s aren't necessary.
Comment 5 Jer Noble 2011-07-08 15:56:52 PDT
@Daniel(In reply to comment #3)
> (From update of attachment 98293 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=98293&action=review
> 
> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:332
> > +#if !defined(BUILDING_ON_LEOPARD)
> > +        if (![webWindow isOnActiveSpace]) {
> > +#endif
> 
> Have you considered encapsulating this functionality into a static function, say isWindowOnActiveSpace(NSWindow*) or windowIsOnActiveSpace(NSWindow*), that is hardcoded to return false when building on Leopard and sends the specified NSWindow an isOnActiveSpace: message when we aren't building on Leopard?

Apparently, since WebKit2 isn't built on Leopard, I can just remove those checks entirely. ;-)
Comment 6 Daniel Bates 2011-07-08 15:59:06 PDT
Comment on attachment 98293 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=98293&action=review

>>> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:332
>>> +#endif
>> 
>> Have you considered encapsulating this functionality into a static function, say isWindowOnActiveSpace(NSWindow*) or windowIsOnActiveSpace(NSWindow*), that is hardcoded to return false when building on Leopard and sends the specified NSWindow an isOnActiveSpace: message when we aren't building on Leopard?
> 
> Apparently, since WebKit2 isn't built on Leopard, I can just remove those checks entirely. ;-)

That sounds even better.
Comment 7 Jer Noble 2011-07-11 15:22:24 PDT
Created attachment 100370 [details]
Patch
Comment 8 Darin Adler 2011-07-12 10:46:07 PDT
Comment on attachment 100370 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=100370&action=review

> Source/WebKit2/ChangeLog:9
> +        collectionBehavior.  The isOnActiveSpace API was added in 10.6, so skip this check on Leopard.

This comment is now out of date.

> Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:330
> +        if (![webWindow isOnActiveSpace]) {

This check needs a why comment.
Comment 9 Jer Noble 2011-07-12 11:43:22 PDT
(In reply to comment #8)
> (From update of attachment 100370 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=100370&action=review
> 
> > Source/WebKit2/ChangeLog:9
> > +        collectionBehavior.  The isOnActiveSpace API was added in 10.6, so skip this check on Leopard.
> 
> This comment is now out of date.

I thought I squashed that comment.  Will remove.

> > Source/WebKit2/UIProcess/mac/WKFullScreenWindowController.mm:330
> > +        if (![webWindow isOnActiveSpace]) {
> 
> This check needs a why comment.

The current comment says:

        // The user may have moved the fullScreen window in Spaces, so temporarily change 
        // the collectionBehavior of the webView's window:

I'll change this to:

        // If the user has moved the fullScreen window into a new space, temporarily change 
        // the collectionBehavior of the webView's window so that it is pulled into the active space:
Comment 10 Jer Noble 2011-07-12 14:39:10 PDT
Committed r90851: <http://trac.webkit.org/changeset/90851>