-
Notifications
You must be signed in to change notification settings - Fork 33
window: Add support for setting the app icon on the Mac. #86
Conversation
Should this go upstream first? |
I'd rather get it reviewed here first. |
This makes the app easier to pick out in Instruments.app and so forth. Requires servo/glutin#86, which itself requires servo/cocoa-rs#124.
/// If present, this path must reference a PNG file. | ||
/// | ||
/// The default is `None`. | ||
pub icon: Option<PathBuf>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this belongs in PlatformSpecificWindowBuilderAttributes instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I was thinking other platforms (e.g. Linux, Windows) could use it eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Humm... Yeah, I agree this should be useful for other platforms but, for example, in the case of Linux, to set the icon you need to pass a buffer of pixels (see the _NET_WM_ICON
spec), which with this API would require Glutin to integrate a PNG decoder.
Wouldn't be such a problem for servo if glutin would use our same png decoder of course, and could not be so out of scope for glutin (I guess any serious app or game at some point would want this feature, and having to specify just a file would be really convenient), but...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'd be fine to have Glutin have an optional dependency on a PNG decoder.
r=me with cocoa-rs update. |
FWIW I added support for changing the icon on X11 on top of this here, feel free to cherry-pick it, or I'll make another PR afterwards if not :P |
@bors-servo: r=paulrouget |
📌 Commit bac84fc has been approved by |
window: Add support for setting the app icon on the Mac. Requires servo/cocoa-rs#124. r? @paulrouget <!-- 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/86) <!-- Reviewable:end -->
Requires `cocoa-rs` 0.3.3.
☀️ Test successful - travis |
cocoa: Add some bare-bones menus on the Mac to conform better to the Apple Human Interface Guidelines. Includes #86. Requires servo/cocoa-rs#125. r? @paulrouget <!-- 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/88) <!-- Reviewable:end -->
Requires servo/cocoa-rs#124.
r? @paulrouget
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)