2015-08-25 05:56:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# Frameless Window
  
						 
					
						
							
								
									
										
										
										
											2013-09-09 15:18:53 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-21 15:35:29 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								>  Open a window without toolbars, borders, or other graphical "chrome".
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-04-22 22:53:26 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								A frameless window is a window that has no
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[chrome ](https://developer.mozilla.org/en-US/docs/Glossary/Chrome ), the parts of
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								the window, like toolbars, that are not a part of the web page. These are
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								options on the [`BrowserWindow` ](browser-window.md ) class.
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## Create a frameless window
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:56:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								To create a frameless window, you need to set `frame`  to `false`  in
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 20:17:47 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[BrowserWindow ](browser-window.md )'s `options` :
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const { BrowserWindow } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let win = new BrowserWindow({ width: 800, height: 600, frame: false })
							 
						 
					
						
							
								
									
										
										
										
											2016-07-25 18:39:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								win.show()
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-06-18 15:26:26 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Alternatives on macOS
  
						 
					
						
							
								
									
										
										
										
											2015-09-14 14:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-25 10:59:42 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								There's an alternative way to specify a chromeless window.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Instead of setting `frame`  to `false`  which disables both the titlebar and window controls,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								you may want to have the title bar hidden and your content extend to the full window size,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								yet still preserve the window controls ("traffic lights") for standard window actions.
							 
						 
					
						
							
								
									
										
										
										
											2017-06-05 14:07:57 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								You can do so by specifying the `titleBarStyle`  option:
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 10:41:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								#### `hidden`
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-26 21:33:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Results in a hidden title bar and a full size content window, yet the title bar still has the standard window controls (“traffic lights”) in the top left.
							 
						 
					
						
							
								
									
										
										
										
											2015-09-14 14:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const { BrowserWindow } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let win = new BrowserWindow({ titleBarStyle: 'hidden' })
							 
						 
					
						
							
								
									
										
										
										
											2016-07-25 18:39:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								win.show()
							 
						 
					
						
							
								
									
										
										
										
											2015-09-14 14:15:41 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
									
										
										
										
											2016-10-27 10:41:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-05 14:07:57 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								#### `hiddenInset`
  
						 
					
						
							
								
									
										
										
										
											2016-10-27 10:41:43 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-10-26 21:33:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const { BrowserWindow } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let win = new BrowserWindow({ titleBarStyle: 'hiddenInset' })
							 
						 
					
						
							
								
									
										
										
										
											2016-10-26 21:33:48 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								win.show()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-06-05 14:16:44 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								#### `customButtonsOnHover`
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-12-10 11:05:30 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Uses custom drawn close, and miniaturize buttons that display
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								when hovering in the top left of the window. The fullscreen button
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								is not available due to restrictions of frameless windows as they
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								interface with Apple's MacOS window masks. These custom buttons prevent
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								issues with mouse events that occur with the standard window toolbar buttons.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This option is only applicable for frameless windows.
							 
						 
					
						
							
								
									
										
										
										
											2017-06-05 14:16:44 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const { BrowserWindow } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let win = new BrowserWindow({ titleBarStyle: 'customButtonsOnHover', frame: false })
							 
						 
					
						
							
								
									
										
										
										
											2017-06-05 14:16:44 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								win.show()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-01-12 15:27:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## Transparent window
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								By setting the `transparent`  option to `true` , you can also make the frameless
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								window transparent:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const { BrowserWindow } = require('electron')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let win = new BrowserWindow({ transparent: true, frame: false })
							 
						 
					
						
							
								
									
										
										
										
											2016-07-25 18:39:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								win.show()
							 
						 
					
						
							
								
									
										
										
										
											2015-01-12 15:27:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								### Limitations
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:56:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  You can not click through the transparent area. We are going to introduce an 
						 
					
						
							
								
									
										
										
										
											2016-04-22 22:53:26 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  API to set window shape to solve this, see
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  [our issue ](https://github.com/electron/electron/issues/1335 ) for details.
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:56:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  Transparent windows are not resizable. Setting `resizable`  to `true`  may make 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  a transparent window stop working on some platforms.
							 
						 
					
						
							
								
									
										
										
										
											2015-01-12 15:27:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  The `blur`  filter only applies to the web page, so there is no way to apply 
						 
					
						
							
								
									
										
										
										
											2015-08-26 16:41:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  blur effect to the content below the window (i.e. other applications open on
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  the user's system).
							 
						 
					
						
							
								
									
										
										
										
											2016-06-16 09:31:10 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  On Windows operating systems, transparent windows will not work when DWM is 
						 
					
						
							
								
									
										
										
										
											2015-08-26 16:41:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  disabled.
							 
						 
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  On Linux, users have to put `--enable-transparent-visuals --disable-gpu`  in 
						 
					
						
							
								
									
										
										
										
											2015-08-26 16:41:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  the command line to disable GPU and allow ARGB to make transparent window,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  this is caused by an upstream bug that [alpha channel doesn't work on some
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  NVidia drivers](https://code.google.com/p/chromium/issues/detail?id=369209) on
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  Linux.
							 
						 
					
						
							
								
									
										
										
										
											2017-11-29 11:38:35 +01:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  On Mac, the native window shadow will not be shown on a transparent window. 
						 
					
						
							
								
									
										
										
										
											2015-01-12 15:27:33 -08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2016-06-07 20:32:52 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## Click-through window
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								To create a click-through window, i.e. making the window ignore all mouse
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								events, you can call the [win.setIgnoreMouseEvents(ignore)][ignore-mouse-events]
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								API:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```javascript
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								const { BrowserWindow } = require('electron')
							 
						 
					
						
							
								
									
										
										
										
											2016-07-25 18:39:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								let win = new BrowserWindow()
							 
						 
					
						
							
								
									
										
										
										
											2016-06-07 20:32:52 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								win.setIgnoreMouseEvents(true)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-08-16 01:04:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								### Forwarding
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Ignoring mouse messages makes the web page oblivious to mouse movement, meaning
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								that mouse movement events will not be emitted. On Windows operating systems an
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								optional parameter can be used to forward mouse move messages to the web page,
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								allowing events such as `mouseleave`  to be emitted:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```javascript
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let win = require('electron').remote.getCurrentWindow()
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								let el = document.getElementById('clickThroughElement')
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								el.addEventListener('mouseenter', () => {
							 
						 
					
						
							
								
									
										
										
										
											2018-09-14 02:10:51 +10:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								  win.setIgnoreMouseEvents(true, { forward: true })
							 
						 
					
						
							
								
									
										
										
										
											2017-08-16 01:04:15 +02:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								el.addEventListener('mouseleave', () => {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  win.setIgnoreMouseEvents(false)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								})
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This makes the web page click-through when over `el` , and returns to normal
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								outside it.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								## Draggable region
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								By default, the frameless window is non-draggable. Apps need to specify
							 
						 
					
						
							
								
									
										
										
										
											2015-04-16 11:31:12 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								`-webkit-app-region: drag`  in CSS to tell Electron which regions are draggable 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								(like the OS's standard titlebar), and apps can also use
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								`-webkit-app-region: no-drag`  to exclude the non-draggable area from the 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:56:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 draggable region. Note that only rectangular shapes are currently supported.
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2017-04-10 08:17:55 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Note: `-webkit-app-region: drag`  is known to have problems while the developer tools are open. See this [GitHub issue ](https://github.com/electron/electron/issues/3647 ) for more information including a workaround.
							 
						 
					
						
							
								
									
										
										
										
											2017-04-09 23:05:56 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								To make the whole window draggable, you can add `-webkit-app-region: drag`  as
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								`body` 's style: 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```html
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< body  style = "-webkit-app-region: drag" >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								< / body >  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								And note that if you have made the whole window draggable, you must also mark
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								buttons as non-draggable, otherwise it would be impossible for users to click on
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								them:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								button {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  -webkit-app-region: no-drag;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-05-07 08:46:14 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								If you're only setting a custom titlebar as draggable, you also need to make all
							 
						 
					
						
							
								
									
										
										
										
											2015-08-26 16:41:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								buttons in titlebar non-draggable.
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								## Text selection
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-26 16:41:25 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								In a frameless window the dragging behaviour may conflict with selecting text.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								For example, when you drag the titlebar you may accidentally select the text on
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								the titlebar. To prevent this, you need to disable text selection within a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								draggable area like this:
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```css
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								.titlebar {
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  -webkit-user-select: none;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  -webkit-app-region: drag;
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 15:27:19 +08:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								## Context menu
  
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-25 05:56:38 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								On some platforms, the draggable area will be treated as a non-client frame, so
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								when you right click on it a system menu will pop up. To make the context menu
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								behave correctly on all platforms you should never use a custom context menu on
							 
						 
					
						
							
								
									
										
										
										
											2013-09-09 14:52:46 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								draggable areas.
							 
						 
					
						
							
								
									
										
										
										
											2016-06-07 20:32:52 +09:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-04-09 17:58:10 -03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[ignore-mouse-events]: browser-window.md#winsetignoremouseeventsignore -options