New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom window level when sending window to top #7296

Merged
merged 6 commits into from Sep 28, 2016

Conversation

Projects
None yet
4 participants
@adammeyer
Contributor

adammeyer commented Sep 21, 2016

This allows for a custom window level to be set when sending a window to the top.

win.setAlwaysOnTop(true, 102);

This can be used when the NSFloatingWindowLevel isn't high enough. I have used this to put a window above the top menu bar.

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Sep 21, 2016

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Sep 21, 2016

Might be useful to include the possible values as well of these https://developer.apple.com/reference/appkit/nswindow/1664726-window_levels#symbols in the docs

@kevinsawicki kevinsawicki self-assigned this Sep 21, 2016

adammeyer
@adammeyer

This comment has been minimized.

Contributor

adammeyer commented Sep 21, 2016

@kevinsawicki Thanks! I added the details to the docs. Currently the parameter is an integer, not a mac window level constant. I like that idea, but I'm not sure how to take a constant in as a string and then convert it to the constant value in the native window controller.

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Sep 21, 2016

I like that idea, but I'm not sure how to take a constant in as a string and then convert it to the constant value in the native window controller.

I can help you update it, what do you think about these string value names for the different integer values:

  • NSNormalWindowLevel -> 'normal'
  • NSFloatingWindowLevel -> 'floating'
  • NSTornOffMenuWindowLevel -> 'torn-off-menu'
  • NSModalPanelWindowLevel -> 'modal-panel'
  • NSMainMenuWindowLevel -> 'main-menu'
  • NSStatusWindowLevel -> 'status'
  • NSPopUpMenuWindowLevel -> 'pop-up-menu'
  • NSScreenSaverWindowLevel -> 'screen-saver'
  • NSDockWindowLevel -> 'dock'
adammeyer
@adammeyer

This comment has been minimized.

Contributor

adammeyer commented Sep 22, 2016

Looks great! I committed my best attempt. I'm getting some errors with the string declarations.

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Sep 22, 2016

@adammeyer I pushed a change that gets things compiling.

When testing this though it is kind of hard to tell the differences between these levels, they seem to all be very similar.

Can you expand on how you plan to use it a bit?

@adammeyer

This comment has been minimized.

Contributor

adammeyer commented Sep 22, 2016

I would like to open a window that fills the screen and is above the menu bar, without the animations that come with making a window "fullscreen". Kind of like showing a PowerPoint presentation.

I could also see it being used if you wanted multiple windows to always be on top, but one to be the top most of those.

@kevinsawicki

This comment has been minimized.

Contributor

kevinsawicki commented Sep 22, 2016

I would like to open a window that fills the screen and is above the menu bar

Which level allows this? Curious to test it locally.

@adammeyer

This comment has been minimized.

Contributor

adammeyer commented Sep 22, 2016

I believe screen-saver.

@adammeyer

This comment has been minimized.

Contributor

adammeyer commented Sep 22, 2016

Yes, just confirmed it is screen-saver

@adammeyer

This comment has been minimized.

Contributor

adammeyer commented Sep 26, 2016

@kevinsawicki Anything left to add?

@zcbenz

This comment has been minimized.

Contributor

zcbenz commented Sep 28, 2016

👍

@zcbenz zcbenz merged commit de76bf5 into electron:master Sep 28, 2016

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@matheuss

This comment has been minimized.

Member

matheuss commented Nov 1, 2016

@adammeyer I just wanted to tell you that you're my hero – this will be very useful on wulkano/kap 😄

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