-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Quick full screen #803
Quick full screen #803
Conversation
I hope that other electron apps can learn from your approach. |
}, | ||
{ | ||
label: 'Enter Quick Full Screen', | ||
accelerator: 'Cmd+Enter', |
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.
Nice choice! (Is it configurable?)
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.
Currently Hyper doesn't support custom hotkeys. But once we do then it will be configurable!
I don't recall if there is an open issue for that or not.
@@ -245,6 +246,16 @@ app.on('ready', () => installDevExtensions(isDev).then(() => { | |||
win.maximize(); | |||
}); | |||
|
|||
rpc.on('enter quick full screen', () => { | |||
const {width, height} = electron.screen.getPrimaryDisplay().workAreaSize; | |||
win.setSize(width, height); |
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.
Does this render on top of the menu bar?
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.
Not currently. I was going to ask what you had in mind for the behavior.
@jordwalke If it works well I can see about abstracting it into an Electron plugin so other apps can add the same functionality easily 👍 |
Here it is in action: https://gfycat.com/BitterScentedBarnowl |
{ | ||
id: 'LEAVE_QUICK_FULL_SCREEN', | ||
label: 'Leave Quick Full Screen', | ||
accelerator: 'Cmd+Enter', |
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.
Please add an accelerator for Linux users 😀 We don't have Cmd
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.
Got it!
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.
@flybayer Any thoughts on what the accelerator should be? 🤔 Alt+Enter
?
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.
That may be ok, although Ctrl+Shift+Enter
might be better. It's similar to Cmd+Shift+F
for OSX.
How about ^⌘F ? |
(not sure it's better, but seems more standard?) |
@rauchg ^⌘F is already reserved for normal full screen on OSX (which triggers the animation). |
Great work, can't wait for it to be merged. Worth noting that the hotkey for entering full screen in iTerm is also ⌘↵. |
Detected a couple of issues after using it for longer time:
|
@shime Yea, I was aware of the first issue, but I'm not totally sure what the best way to handle it is, because Hyper saves your terminal position and size when it exits (as part of another feature). I was debating between:
The former is easier since we just have to track the state in-memory, as opposed to the latter where it must be written out when the app exits. cc @rauchg @jordwalke Any input on how this should work? |
@shime Also, that second issue is interesting. I've only done cursory testing, so the next time I have a look at it I will see if I can reproduce and fix the issue. |
Me? I'm not picky about which of those two solutions you go for as long as it's not buggy. I'm just happy to have full screen! |
rpc.on('leave quick full screen req', () => { | ||
store_.dispatch(uiActions.leaveQuickFullScreen()); | ||
}); | ||
|
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 like this "roundtrip" approach. Gives us lots of flexibility
* master: chore(package): update electron to version 1.4.5 (vercel#949) add onRendererWindow, because it actually available. check ./lib/utils/plugins.js:193 (vercel#924) increase timeout for update checks (vercel#928) Change URL regex - fixes vercel#867 (vercel#943) Make the close menu items less ambiguous Comply to XO's no-warning-comments rule Prefer default export to make XO happy (vercel#931) chore(package): update ms to version 0.7.2 (vercel#933) chore(package): update copy-webpack-plugin to version 4.0.0 (vercel#927) log plugins' errors in Electron console (vercel#923) Improve tabs title (vercel#892) increase notification timeout up to 30m (vercel#913) Create github templates (vercel#919) chore(package): update electron to version 1.4.4 (vercel#907) Prevent Hterm to share same preferences between instances (vercel#906) 0.8.3 0.9.0 Revert "Quick full screen (vercel#803)" Ignore file watch errors. Fixes vercelGH-225 (vercel#893)
Did I miss why this was reverted? |
@jordwalke There was an issue with it where sometimes you would get locked in quick full screen and not be able to get out. Usually it happened if you switched back and forth too fast. I've been meaning to have a look at it, but haven't had any time to devote to it lately 🙁 |
damn i was excited about this |
Bump for this, it is a must have feature for productivity in my opinion. |
Any plans about the |
you can do that with the custom keymaps @asantos00 |
So it will not be added as default behaviour? I think it is default behaviour for all OSX apps :( |
This PR is for investigating/adding the quick full screen functionality that @jordwalke requested in #666 (I guess I'm doing the devil's work here 😱 ).
Currently I have it working quickly by just expanding the window to take up all available space on the screen. It feels a little hacky to me, but it is fast 😄
TODO:
Figure out if there is a more elegant way to do thisBrowserWindow.setFullScreen
, but that still uses the OS X animations.