BrowserWindow

Constructors

Link copied to clipboard
constructor(options: BrowserWindowConstructorOptions = definedExternally)

BrowserWindow

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var accessibleTitle: String

A string property that defines an alternative title provided only to accessibility tools such as screen readers. This string is not directly visible to users.

Link copied to clipboard
open override val alwaysOnTopChangedEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, Boolean>>
Link copied to clipboard
open override val appCommandEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, String>>
Link copied to clipboard
open override var autoHideMenuBar: Boolean

A boolean property that determines whether the window menu bar should hide itself automatically. Once set, the menu bar will only show when users press the single Alt key.

Link copied to clipboard
open override val blurEvent: <Error class: unknown class><<Error class: unknown class><Event<*>>>
Link copied to clipboard
open override var closable: Boolean

A boolean property that determines whether the window can be manually closed by user.

Link copied to clipboard
open override val closedEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val closeEvent: <Error class: unknown class><<Error class: unknown class><Event<*>>>
Link copied to clipboard

A View property for the content view of the window.

Link copied to clipboard
open override var documentEdited: Boolean

A boolean property that specifies whether the window’s document has been edited.

Link copied to clipboard
open override val enterFullScreenEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val enterHtmlFullScreenEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard

A boolean property that determines whether the window is excluded from the application’s Windows menu. false by default.

Link copied to clipboard
open override var focusable: Boolean

A boolean property that determines whether the window is focusable.

Link copied to clipboard
open override val focusEvent: <Error class: unknown class><<Error class: unknown class><Event<*>>>
Link copied to clipboard
open override var fullScreen: Boolean

A boolean property that determines whether the window is in fullscreen mode.

Link copied to clipboard
open override var fullScreenable: Boolean

A boolean property that determines whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

Link copied to clipboard
open override val hideEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val id: Double

A Integer property representing the unique ID of the window. Each ID is unique among all BrowserWindow instances of the entire Electron application.

Link copied to clipboard
open override var kiosk: Boolean

A boolean property that determines whether the window is in kiosk mode.

Link copied to clipboard
open override val leaveFullScreenEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val leaveHtmlFullScreenEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override var maximizable: Boolean

A boolean property that determines whether the window can be manually maximized by user.

Link copied to clipboard
open override val maximizeEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override var menuBarVisible: Boolean

A boolean property that determines whether the menu bar should be visible.

Link copied to clipboard
open override var minimizable: Boolean

A boolean property that determines whether the window can be manually minimized by user.

Link copied to clipboard
open override val minimizeEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override var movable: Boolean

A boolean property that determines Whether the window can be moved by user.

Link copied to clipboard
open override val movedEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val moveEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val newWindowForTabEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val pageTitleUpdatedEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, String, Boolean>>
Link copied to clipboard
val readyToShowEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override var representedFilename: String

A string property that determines the pathname of the file the window represents, and the icon of the file will show in window's title bar.

Link copied to clipboard
open override var resizable: Boolean

A boolean property that determines whether the window can be manually resized by user.

Link copied to clipboard
open override val resizedEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val resizeEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val responsiveEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val restoreEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val rotateGestureEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, Double>>
Link copied to clipboard
open override val sessionEndEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override var shadow: Boolean

A boolean property that determines whether the window has a shadow.

Link copied to clipboard
open override val sheetBeginEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val sheetEndEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override val showEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override var simpleFullScreen: Boolean

A boolean property that determines whether the window is in simple (pre-Lion) fullscreen mode.

Link copied to clipboard
open override val swipeEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, String>>
Link copied to clipboard
open override val systemContextMenuEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, Point>>
Link copied to clipboard
open override val tabbingIdentifier: String?

A string (optional) property that is equal to the tabbingIdentifier passed to the BrowserWindow constructor or undefined if none was set.

Link copied to clipboard
open override var title: String

A string property that determines the title of the native window.

Link copied to clipboard
open override val unmaximizeEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
val unresponsiveEvent: <Error class: unknown class><<Error class: unknown class>>
Link copied to clipboard
open override var visibleOnAllWorkspaces: Boolean

A boolean property that determines whether the window is visible on all workspaces.

Link copied to clipboard

A WebContents object this window owns. All web page related events and operations will be done via it.

Link copied to clipboard
open override val willMoveEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, Rectangle>>
Link copied to clipboard
open override val willResizeEvent: <Error class: unknown class><<Error class: unknown class><Event<*>, Rectangle, WillResizeDetails>>

Functions

Link copied to clipboard
fun addBrowserView(browserView: BrowserView)

Replacement API for setBrowserView supporting work with multi browser views.

Link copied to clipboard
fun addTabbedWindow(baseWindow: BaseWindow)
fun addTabbedWindow(browserWindow: BrowserWindow)

Adds a window as a tab on this window, after the tab for the window instance.

Link copied to clipboard
open override fun blur()

Removes focus from the window.

Link copied to clipboard
Link copied to clipboard
fun capturePage(rect: Rectangle = definedExternally, opts: Opts = definedExternally): <Error class: unknown class><NativeImage>

Resolves with a NativeImage

Link copied to clipboard
open override fun center()

Moves window to the center of the screen.

Link copied to clipboard
open override fun close()

Try to close the window. This has the same effect as a user manually clicking the close button of the window. The web page may cancel the close though. See the close event.

Link copied to clipboard
open override fun closeFilePreview()

Closes the currently open Quick Look panel.

Link copied to clipboard
open override fun destroy()

Force closing the window, the unload and beforeunload event won't be emitted for the web page, and close event will also not be emitted for this window, but it guarantees the closed event will be emitted.

Link copied to clipboard
open override fun flashFrame(flag: Boolean)

Starts or stops flashing the window to attract user's attention.

Link copied to clipboard
open override fun focus()

Focuses on the window.

Link copied to clipboard
Link copied to clipboard
open override fun getBackgroundColor(): String

Gets the background color of the window in Hex (#RRGGBB) format.

Link copied to clipboard
open override fun getBounds(): Rectangle

The bounds of the window as Object.

Link copied to clipboard

The BrowserView attached to win. Returns null if one is not attached. Throws an error if multiple BrowserViews are attached.

Link copied to clipboard
fun getBrowserViews(): <Error class: unknown class><BrowserView>

a sorted by z-index array of all BrowserViews that have been attached with addBrowserView or setBrowserView. The top-most BrowserView is the last element of the array.

Link copied to clipboard
open override fun getChildWindows(): <Error class: unknown class><BrowserWindow>

All child windows.

Link copied to clipboard
open override fun getContentBounds(): Rectangle

The bounds of the window's client area as Object.

Link copied to clipboard
open override fun getContentSize(): <Error class: unknown class><Double>

Contains the window's client area's width and height.

Link copied to clipboard

The content view of the window.

Link copied to clipboard
open override fun getMaximumSize(): <Error class: unknown class><Double>

Contains the window's maximum width and height.

Link copied to clipboard
open override fun getMediaSourceId(): String

Window id in the format of DesktopCapturerSource's id. For example "window:1324:0".

Link copied to clipboard
open override fun getMinimumSize(): <Error class: unknown class><Double>

Contains the window's minimum width and height.

Link copied to clipboard
open override fun getNativeWindowHandle(): <Error class: unknown class><out <Error class: unknown class>>

The platform-specific handle of the window.

Link copied to clipboard
open override fun getNormalBounds(): Rectangle

Contains the window bounds of the normal state

Link copied to clipboard
open override fun getOpacity(): Double

between 0.0 (fully transparent) and 1.0 (fully opaque). On Linux, always returns

Link copied to clipboard
open override fun getParentWindow(): BrowserWindow?

The parent window or null if there is no parent.

Link copied to clipboard
open override fun getPosition(): <Error class: unknown class><Double>

Contains the window's current position.

Link copied to clipboard
open override fun getRepresentedFilename(): String

The pathname of the file the window represents.

Link copied to clipboard
open override fun getSize(): <Error class: unknown class><Double>

Contains the window's width and height.

Link copied to clipboard
open override fun getTitle(): String

The title of the native window.

Link copied to clipboard
open override fun getWindowButtonPosition(): Point?

The custom position for the traffic light buttons in frameless window, null will be returned when there is no custom position.

Link copied to clipboard
open override fun hasShadow(): Boolean

Whether the window has a shadow.

Link copied to clipboard
open override fun hide()

Hides the window.

Link copied to clipboard
open override fun hookWindowMessage(    message: Double,     callback: (<Error class: unknown class><out <Error class: unknown class>>, <Error class: unknown class><out <Error class: unknown class>>) -> Unit)

Hooks a windows message. The callback is called when the message is received in the WndProc.

Link copied to clipboard
open override fun invalidateShadow()

Invalidates the window shadow so that it is recomputed based on the current window shape.

Link copied to clipboard
open override fun isAlwaysOnTop(): Boolean

Whether the window is always on top of other windows.

Link copied to clipboard
open override fun isClosable(): Boolean

Whether the window can be manually closed by user.

Link copied to clipboard
open override fun isDestroyed(): Boolean

Whether the window is destroyed.

Link copied to clipboard
open override fun isDocumentEdited(): Boolean

Whether the window's document has been edited.

Link copied to clipboard
open override fun isEnabled(): Boolean

whether the window is enabled.

Link copied to clipboard
open override fun isFocusable(): Boolean

Whether the window can be focused.

Link copied to clipboard
open override fun isFocused(): Boolean

Whether the window is focused.

Link copied to clipboard
open override fun isFullScreen(): Boolean

Whether the window is in fullscreen mode.

Link copied to clipboard
open override fun isFullScreenable(): Boolean

Whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

Link copied to clipboard
open override fun isHiddenInMissionControl(): Boolean

Whether the window will be hidden when the user toggles into mission control.

Link copied to clipboard
open override fun isKiosk(): Boolean

Whether the window is in kiosk mode.

Link copied to clipboard
open override fun isMaximizable(): Boolean

Whether the window can be manually maximized by user.

Link copied to clipboard
open override fun isMaximized(): Boolean

Whether the window is maximized.

Link copied to clipboard
open override fun isMenuBarAutoHide(): Boolean

Whether menu bar automatically hides itself.

Link copied to clipboard
open override fun isMenuBarVisible(): Boolean

Whether the menu bar is visible.

Link copied to clipboard
open override fun isMinimizable(): Boolean

Whether the window can be manually minimized by the user.

Link copied to clipboard
open override fun isMinimized(): Boolean

Whether the window is minimized.

Link copied to clipboard
open override fun isModal(): Boolean

Whether current window is a modal window.

Link copied to clipboard
open override fun isMovable(): Boolean

Whether the window can be moved by user.

Link copied to clipboard
open override fun isNormal(): Boolean

Whether the window is in normal state (not maximized, not minimized, not in fullscreen mode).

Link copied to clipboard
open override fun isResizable(): Boolean

Whether the window can be manually resized by the user.

Link copied to clipboard
open override fun isSimpleFullScreen(): Boolean

Whether the window is in simple (pre-Lion) fullscreen mode.

Link copied to clipboard
open override fun isTabletMode(): Boolean

Whether the window is in Windows 10 tablet mode.

Link copied to clipboard
open override fun isVisible(): Boolean

Whether the window is visible to the user in the foreground of the app.

Link copied to clipboard
open override fun isVisibleOnAllWorkspaces(): Boolean

Whether the window is visible on all workspaces.

Link copied to clipboard
open override fun isWindowMessageHooked(message: Double): Boolean

true or false depending on whether the message is hooked.

Link copied to clipboard
fun loadFile(filePath: String, options: LoadFileOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>

the promise will resolve when the page has finished loading (see did-finish-load), and rejects if the page fails to load (see did-fail-load).

Link copied to clipboard
fun loadURL(url: String, options: LoadURLOptions = definedExternally): <Error class: unknown class><<Error class: unknown class>>

the promise will resolve when the page has finished loading (see did-finish-load), and rejects if the page fails to load (see did-fail-load).

Link copied to clipboard
open override fun maximize()

Maximizes the window. This will also show (but not focus) the window if it isn't being displayed already.

Link copied to clipboard
open override fun mergeAllWindows()

Merges all windows into one window with multiple tabs when native tabs are enabled and there is more than one open window.

Link copied to clipboard
open override fun minimize()

Minimizes the window. On some platforms the minimized window will be shown in the Dock.

Link copied to clipboard
open override fun moveAbove(mediaSourceId: String)

Moves window above the source window in the sense of z-order. If the mediaSourceId is not of type window or if the window does not exist then this method throws an error.

Link copied to clipboard
open override fun moveTabToNewWindow()

Moves the current tab into a new window if native tabs are enabled and there is more than one tab in the current window.

Link copied to clipboard
open override fun moveTop()

Moves window to top(z-order) regardless of focus

Link copied to clipboard
open override fun previewFile(path: String, displayName: String)

Uses Quick Look to preview a file at a given path.

Link copied to clipboard
fun reload()

Same as webContents.reload.

Link copied to clipboard
fun removeBrowserView(browserView: BrowserView)
Link copied to clipboard
open override fun removeMenu()

Remove the window's menu bar.

Link copied to clipboard
open override fun restore()

Restores the window from minimized state to its previous state.

Link copied to clipboard
open override fun selectNextTab()

Selects the next tab when native tabs are enabled and there are other tabs in the window.

Link copied to clipboard
open override fun selectPreviousTab()

Selects the previous tab when native tabs are enabled and there are other tabs in the window.

Link copied to clipboard
fun setAlwaysOnTop(flag: Boolean, level: BaseWindowSetAlwaysOnTopLevel = definedExternally, relativeLevel: Double = definedExternally)
fun setAlwaysOnTop(flag: Boolean, level: BrowserWindowSetAlwaysOnTopLevel = definedExternally, relativeLevel: Double = definedExternally)

Sets whether the window should show always on top of other windows. After setting this, the window is still a normal window, not a toolbox window which can not be focused on.

Link copied to clipboard
open override fun setAppDetails(options: AppDetailsOptions)

Sets the properties for the window's taskbar button.

Link copied to clipboard
open override fun setAspectRatio(aspectRatio: Double, extraSize: Size)

This will make a window maintain an aspect ratio. The extra size allows a developer to have space, specified in pixels, not included within the aspect ratio calculations. This API already takes into account the difference between a window's size and its content size.

Link copied to clipboard
open override fun setAutoHideCursor(autoHide: Boolean)

Controls whether to hide cursor when typing.

Link copied to clipboard
open override fun setAutoHideMenuBar(hide: Boolean)

Sets whether the window menu bar should hide itself automatically. Once set the menu bar will only show when users press the single Alt key.

Link copied to clipboard
open override fun setBackgroundColor(backgroundColor: String)

Examples of valid backgroundColor values:

Link copied to clipboard

This method sets the browser window's system-drawn background material, including behind the non-client area.

Link copied to clipboard
open override fun setBounds(bounds: Rectangle, animate: Boolean)

Resizes and moves the window to the supplied bounds. Any properties that are not supplied will default to their current values.

Link copied to clipboard
fun setBrowserView(browserView: BrowserView?)
Link copied to clipboard
open override fun setClosable(closable: Boolean)

Sets whether the window can be manually closed by user. On Linux does nothing.

Link copied to clipboard
open override fun setContentBounds(bounds: Rectangle, animate: Boolean)

Resizes and moves the window's client area (e.g. the web page) to the supplied bounds.

Link copied to clipboard
open override fun setContentProtection(enable: Boolean)

Prevents the window contents from being captured by other apps.

Link copied to clipboard
open override fun setContentSize(width: Double, height: Double, animate: Boolean)

Resizes the window's client area (e.g. the web page) to width and height.

Link copied to clipboard
fun setContentView(view: View)

Sets the content view of the window.

Link copied to clipboard
open override fun setDocumentEdited(edited: Boolean)

Specifies whether the window’s document has been edited, and the icon in title bar will become gray when set to true.

Link copied to clipboard
open override fun setEnabled(enable: Boolean)

Disable or enable the window.

Link copied to clipboard
open override fun setFocusable(focusable: Boolean)

Changes whether the window can be focused.

Link copied to clipboard
open override fun setFullScreen(flag: Boolean)

Sets whether the window should be in fullscreen mode.

Link copied to clipboard
open override fun setFullScreenable(fullscreenable: Boolean)

Sets whether the maximize/zoom window button toggles fullscreen mode or maximizes the window.

Link copied to clipboard
open override fun setHasShadow(hasShadow: Boolean)

Sets whether the window should have a shadow.

Link copied to clipboard
open override fun setHiddenInMissionControl(hidden: Boolean)

Sets whether the window will be hidden when the user toggles into mission control.

Link copied to clipboard
open override fun setIcon(icon: NativeImage)
open override fun setIcon(icon: String)

Changes window icon.

Link copied to clipboard
open override fun setIgnoreMouseEvents(ignore: Boolean, options: IgnoreMouseEventsOptions)

Makes the window ignore all mouse events.

Link copied to clipboard
open override fun setKiosk(flag: Boolean)

Enters or leaves kiosk mode.

Link copied to clipboard
open override fun setMaximizable(maximizable: Boolean)

Sets whether the window can be manually maximized by user. On Linux does nothing.

Link copied to clipboard
open override fun setMaximumSize(width: Double, height: Double)

Sets the maximum size of window to width and height.

Link copied to clipboard
open override fun setMenu(menu: Menu?)

Sets the menu as the window's menu bar.

Link copied to clipboard
open override fun setMenuBarVisibility(visible: Boolean)

Sets whether the menu bar should be visible. If the menu bar is auto-hide, users can still bring up the menu bar by pressing the single Alt key.

Link copied to clipboard
open override fun setMinimizable(minimizable: Boolean)

Sets whether the window can be manually minimized by user. On Linux does nothing.

Link copied to clipboard
open override fun setMinimumSize(width: Double, height: Double)

Sets the minimum size of window to width and height.

Link copied to clipboard
open override fun setMovable(movable: Boolean)

Sets whether the window can be moved by user. On Linux does nothing.

Link copied to clipboard
open override fun setOpacity(opacity: Double)

Sets the opacity of the window. On Linux, does nothing. Out of bound number values are clamped to the 0, 1 range.

Link copied to clipboard
open override fun setOverlayIcon(overlay: NativeImage?, description: String)

Sets a 16 x 16 pixel overlay onto the current taskbar icon, usually used to convey some sort of application status or to passively notify the user.

Link copied to clipboard

Sets parent as current window's parent window, passing null will turn current window into a top-level window.

Link copied to clipboard
open override fun setPosition(x: Double, y: Double, animate: Boolean)

Moves window to x and y.

Link copied to clipboard
open override fun setProgressBar(progress: Double, options: ProgressBarOptions)

Sets progress value in progress bar. Valid range is 0, 1.0.

Link copied to clipboard
open override fun setRepresentedFilename(filename: String)

Sets the pathname of the file the window represents, and the icon of the file will show in window's title bar.

Link copied to clipboard
open override fun setResizable(resizable: Boolean)

Sets whether the window can be manually resized by the user.

Link copied to clipboard
open override fun setShape(rects: <Error class: unknown class><Rectangle>)

Setting a window shape determines the area within the window where the system permits drawing and user interaction. Outside of the given region, no pixels will be drawn and no mouse events will be registered. Mouse events outside of the region will not be received by that window, but will fall through to whatever is behind the window.

Link copied to clipboard
open override fun setSheetOffset(offsetY: Double, offsetX: Double)

Changes the attachment point for sheets on macOS. By default, sheets are attached just below the window frame, but you may want to display them beneath a HTML-rendered toolbar. For example:

Link copied to clipboard
open override fun setSimpleFullScreen(flag: Boolean)

Enters or leaves simple fullscreen mode.

Link copied to clipboard
open override fun setSize(width: Double, height: Double, animate: Boolean)

Resizes the window to width and height. If width or height are below any set minimum size constraints the window will snap to its minimum size.

Link copied to clipboard
open override fun setSkipTaskbar(skip: Boolean)

Makes the window not show in the taskbar.

Link copied to clipboard
open override fun setThumbarButtons(buttons: <Error class: unknown class><ThumbarButton>): Boolean

Whether the buttons were added successfully

Link copied to clipboard
open override fun setThumbnailClip(region: Rectangle)

Sets the region of the window to show as the thumbnail image displayed when hovering over the window in the taskbar. You can reset the thumbnail to be the entire window by specifying an empty region: { x: 0, y: 0, width: 0, height: 0 }.

Link copied to clipboard
open override fun setThumbnailToolTip(toolTip: String)

Sets the toolTip that is displayed when hovering over the window thumbnail in the taskbar.

Link copied to clipboard
open override fun setTitle(title: String)

Changes the title of native window to title.

Link copied to clipboard
open override fun setTitleBarOverlay(options: TitleBarOverlayOptions)

On a window with Window Controls Overlay already enabled, this method updates the style of the title bar overlay.

Link copied to clipboard
fun setTopBrowserView(browserView: BrowserView)

Raises browserView above other BrowserViews attached to win. Throws an error if browserView is not attached to win.

Link copied to clipboard
open override fun setTouchBar(touchBar: TouchBar?)

Sets the touchBar layout for the current window. Specifying null or undefined clears the touch bar. This method only has an effect if the machine has a touch bar.

Link copied to clipboard

Adds a vibrancy effect to the window. Passing null or an empty string will remove the vibrancy effect on the window.

Adds a vibrancy effect to the browser window. Passing null or an empty string will remove the vibrancy effect on the window.

Link copied to clipboard

Sets whether the window should be visible on all workspaces.

Link copied to clipboard
open override fun setWindowButtonPosition(position: Point?)

Set a custom position for the traffic light buttons in frameless window. Passing null will reset the position to default.

Link copied to clipboard
open override fun setWindowButtonVisibility(visible: Boolean)

Sets whether the window traffic light buttons should be visible.

Link copied to clipboard
open override fun show()

Shows and gives focus to the window.

Link copied to clipboard
open override fun showAllTabs()

Shows or hides the tab overview when native tabs are enabled.

Link copied to clipboard

Same as webContents.showDefinitionForSelection().

Link copied to clipboard
open override fun showInactive()

Shows the window but doesn't focus on it.

Link copied to clipboard
open override fun toggleTabBar()

Toggles the visibility of the tab bar if native tabs are enabled and there is only one tab in the current window.

Link copied to clipboard
open override fun unhookAllWindowMessages()

Unhooks all of the window messages.

Link copied to clipboard
open override fun unhookWindowMessage(message: Double)

Unhook the window message.

Link copied to clipboard
open override fun unmaximize()

Unmaximizes the window.