diff --git a/app/ui/window.js b/app/ui/window.js index 5cf9211e..9b1f3d1f 100644 --- a/app/ui/window.js +++ b/app/ui/window.js @@ -240,6 +240,13 @@ module.exports = class Window { const focusedWindow = BrowserWindow.getFocusedWindow(); execCommand(command, focusedWindow); }); + // pass on the full screen events from the window to react + rpc.win.on('enter-full-screen', () => { + rpc.emit('enter full screen'); + }); + rpc.win.on('leave-full-screen', () => { + rpc.emit('leave full screen'); + }); const deleteSessions = () => { sessions.forEach((session, key) => { session.removeAllListeners(); diff --git a/lib/actions/ui.js b/lib/actions/ui.js index 259192ab..98bab505 100644 --- a/lib/actions/ui.js +++ b/lib/actions/ui.js @@ -20,6 +20,8 @@ import { UI_WINDOW_GEOMETRY_CHANGED, UI_WINDOW_MOVE, UI_OPEN_FILE, + UI_ENTER_FULLSCREEN, + UI_LEAVE_FULLSCREEN, UI_OPEN_SSH_URL, UI_CONTEXTMENU_OPEN, UI_COMMAND_EXEC @@ -281,6 +283,18 @@ export function openFile(path) { }; } +export function enterFullScreen() { + return { + type: UI_ENTER_FULLSCREEN + }; +} + +export function leaveFullScreen() { + return { + type: UI_LEAVE_FULLSCREEN + }; +} + export function openSSH(url) { return dispatch => { dispatch({ diff --git a/lib/components/header.js b/lib/components/header.js index ffeedb5f..5d4675e1 100644 --- a/lib/components/header.js +++ b/lib/components/header.js @@ -92,7 +92,8 @@ export default class Header extends React.PureComponent { tabs: this.props.tabs, borderColor: this.props.borderColor, onClose: this.props.onCloseTab, - onChange: this.onChangeIntent + onChange: this.onChangeIntent, + fullScreen: this.props.fullScreen }); const {borderColor} = props; let title = 'Hyper'; diff --git a/lib/components/tabs.js b/lib/components/tabs.js index 1d411fac..3b521619 100644 --- a/lib/components/tabs.js +++ b/lib/components/tabs.js @@ -9,7 +9,7 @@ const isMac = /Mac/.test(navigator.userAgent); export default class Tabs extends React.PureComponent { render() { - const {tabs = [], borderColor, onChange, onClose} = this.props; + const {tabs = [], borderColor, onChange, onClose, fullScreen} = this.props; const hide = !isMac && tabs.length === 1; @@ -19,7 +19,7 @@ export default class Tabs extends React.PureComponent { {tabs.length === 1 && isMac ?
{tabs[0].title}
: null} {tabs.length > 1 ? [ -