It was implemented on Mac and Win but not on X11. Tested on Ubuntu 16.04 and 18.04. Also added a unit test in spec/api-browser-window-spec.js. This test BrowserWindow.moveTop verifies that calling moveTop on a window does not give the focus to this window. notes: BrowserWindow.moveTop is now available on Linux/x11 https://github.com/electron/electron/issues/12516
		
			
				
	
	
		
			31 lines
		
	
	
	
		
			892 B
			
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
	
		
			892 B
			
		
	
	
	
		
			C++
		
	
	
	
	
	
// Copyright (c) 2014 GitHub, Inc.
 | 
						|
// Use of this source code is governed by the MIT license that can be
 | 
						|
// found in the LICENSE file.
 | 
						|
 | 
						|
#ifndef ATOM_BROWSER_UI_X_X_WINDOW_UTILS_H_
 | 
						|
#define ATOM_BROWSER_UI_X_X_WINDOW_UTILS_H_
 | 
						|
 | 
						|
#include <string>
 | 
						|
 | 
						|
#include "ui/gfx/x/x11.h"
 | 
						|
 | 
						|
namespace atom {
 | 
						|
 | 
						|
::Atom GetAtom(const char* name);
 | 
						|
 | 
						|
// Sends a message to the x11 window manager, enabling or disabling the |state|
 | 
						|
// for _NET_WM_STATE.
 | 
						|
void SetWMSpecState(::Window xwindow, bool enabled, ::Atom state);
 | 
						|
 | 
						|
// Sets the _NET_WM_WINDOW_TYPE of window.
 | 
						|
void SetWindowType(::Window xwindow, const std::string& type);
 | 
						|
 | 
						|
// Returns true if the bus name "com.canonical.AppMenu.Registrar" is available.
 | 
						|
bool ShouldUseGlobalMenuBar();
 | 
						|
 | 
						|
// Bring the given window to the front and give it the focus.
 | 
						|
void MoveWindowToForeground(::Window xwindow);
 | 
						|
 | 
						|
}  // namespace atom
 | 
						|
 | 
						|
#endif  // ATOM_BROWSER_UI_X_X_WINDOW_UTILS_H_
 |