Skip to content

Implements #2734 “New API to configure BrowserWindow title bar on Mac” - #2776

Merged
zcbenz merged 1 commit into
electron:masterfrom
jaanus:osx-window-titlebar
Sep 14, 2015
Merged

zcbenz merged 1 commit into
electron:masterfrom
jaanus:osx-window-titlebar

Conversation

@jaanus

@jaanus jaanus commented Sep 14, 2015

Copy link
Copy Markdown
Contributor

New API supported on Yosemite 10.10 and newer.

Two new title bar styles:

window = new BrowserWindow({width: 600, height: 400, 'title-bar-style': 'hidden'});

screen shot 2015-09-14 at 14 17 23

window = new BrowserWindow({width: 600, height: 400, 'title-bar-style': 'hidden-inset'});

screen shot 2015-09-14 at 14 17 59

@lipis

lipis commented Sep 14, 2015

Copy link
Copy Markdown

💃

Comment thread docs/api/frameless-window.md Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

'title-bar-style': 'hidden'

@jaanus

jaanus commented Sep 14, 2015

Copy link
Copy Markdown
Contributor Author

About the failing tests…

I don’t understand why the Linux tests fail, or rather, why are the two new tests run on Linux? I have a condition to bail out from those tests when the OS is not Mac—why is that not respected?

The Mac tests fail because I think Travis OSX runtime is 10.9. Should I make the tests conditional on 10.9 so they are not run (how?), or is there a way to make Travis use 10.10 runtime?

Comment thread atom/browser/native_window_mac.mm Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For checking OS X version, you can use base::mac::IsOSYosemiteOrLater() instead.

@zcbenz

zcbenz commented Sep 14, 2015

Copy link
Copy Markdown
Contributor

The Mac tests fail because I think Travis OSX runtime is 10.9. Should I make the tests conditional on 10.9 so they are not run (how?), or is there a way to make Travis use 10.10 runtime?

You can use os.release() to check the version of current operating system, I believe Yosemite is 14.x.x.

Comment thread docs/api/frameless-window.md Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Break lines as the rest of the file mostly <= 80

@jaanus

jaanus commented Sep 14, 2015

Copy link
Copy Markdown
Contributor Author

OK, tests don’t fail any more (they are not run on Travis but are run correctly if you run them locally on a Yosemite machine), I addressed all the comments, and made a squash commit.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks like there is a memory leak here.
From apple's API document, the parameter of setToolbar is descripted as strong property, so we need to release toolbar here.

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.

My bad. Thanks for pointing this out. I assumed ARC, but apparently not, been a while since I worked on a non-ARC codebase. :)

New API supported on Yosemite 10.10 and newer.
@zcbenz

zcbenz commented Sep 14, 2015

Copy link
Copy Markdown
Contributor

Awesome, thanks! ✨

zcbenz added a commit that referenced this pull request Sep 14, 2015
Implements #2734 “New API to configure BrowserWindow title bar on Mac”
@zcbenz
zcbenz merged commit 6bae0ba into electron:master Sep 14, 2015
@jaanus
jaanus deleted the osx-window-titlebar branch September 14, 2015 16:00
@anaisbetts

Copy link
Copy Markdown
Contributor

Ooh, snazzy

@lipis

lipis commented Sep 14, 2015

Copy link
Copy Markdown

Now we just have to wait for the release :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This throws on OS X Mavericks with Electron 0.32.3 when titleBarStyle == "hidden-inset". I thought the base::mac::IsOSYosemiteOrLater() would guard against that?

image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you create a new issue for this? I'm wondering if it is caused by me setting MACOSX_DEPLOYMENT_TARGET to 10.10.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Done: #2790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants