Skip to content

Allow OSX WindowBuilder to specify 'activation behavior'.#769

Merged
tomaka merged 1 commit into
rust-windowing:masterfrom
frewsxcv:activation-policy
Apr 29, 2016
Merged

Allow OSX WindowBuilder to specify 'activation behavior'.#769
tomaka merged 1 commit into
rust-windowing:masterfrom
frewsxcv:activation-policy

Conversation

@frewsxcv
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread Cargo.toml
objc = "0.2"
cgl = "0.1"
cocoa = "0.3"
cocoa = "0.3.2"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to bump cocoa for servo/cocoa-rs#122. Needed the activation policy enum to implement Copy.

@frewsxcv frewsxcv force-pushed the activation-policy branch from 3a95335 to 655efed Compare April 28, 2016 23:37
@tomaka
Copy link
Copy Markdown
Contributor

tomaka commented Apr 29, 2016

Thanks.

The NSApplicationActivationPolicyRegular type shouldn't be public, or we will need to bump glutin whenever cocoa gets bumped. It should either be a custom enum, or maybe just a bool.

@tomaka
Copy link
Copy Markdown
Contributor

tomaka commented Apr 29, 2016

Also platform_specific shouldn't be public in WindowBuilder, or the user could just write builder.platform_specific.activation_policy = ... and then wonder why it doesn't work on other platforms.

The fact that it has to go through a platform-specific trait makes it explicit that it's platform-specific. Ideally the WindowBuilderExt trait should directly expose members if rust-lang/rfcs#1546 gets merged.

@frewsxcv
Copy link
Copy Markdown
Contributor Author

Result of removing the pub field:

coreyf@frewbook-pro ~/D/r/glutin (activation-policy)> cargo build
   Compiling glutin v0.5.1 (file:///Users/coreyf/Development/rust/glutin)
src/os/macos.rs:33:9: 33:31 error: field `platform_specific` of struct `window::WindowBuilder` is private
src/os/macos.rs:33         self.platform_specific.activation_policy = activation_policy;
                           ^~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
error: Could not compile `glutin`.

To learn more, run the command again with --verbose.

@frewsxcv frewsxcv force-pushed the activation-policy branch from 655efed to 54e4c6d Compare April 29, 2016 12:58
@frewsxcv
Copy link
Copy Markdown
Contributor Author

The NSApplicationActivationPolicyRegular type shouldn't be public, or we will need to bump glutin whenever cocoa gets bumped. It should either be a custom enum, or maybe just a bool.

Force pushed with these changes.

@frewsxcv frewsxcv force-pushed the activation-policy branch from 54e4c6d to dc49156 Compare April 29, 2016 14:43
@frewsxcv
Copy link
Copy Markdown
Contributor Author

IRC:

10:28 AM <tomaka> frewsxcv: ah, my bad
10:28 AM <tomaka> frewsxcv: the solution is to mvoe WindowBuilder to lib.rs

Done.

@tomaka tomaka merged commit 2e2feba into rust-windowing:master Apr 29, 2016
@frewsxcv frewsxcv deleted the activation-policy branch April 29, 2016 18:40
bors-servo pushed a commit to servo/glutin that referenced this pull request Apr 29, 2016
Merge from upstream.

We need rust-windowing#769 for servo/servo#10836.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/glutin/84)
<!-- Reviewable:end -->
frewsxcv added a commit to frewsxcv/servo that referenced this pull request Apr 29, 2016
frewsxcv added a commit to frewsxcv/servo that referenced this pull request Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants