2014-10-31 11:17:05 -07:00
|
|
|
// Copyright (c) 2014 GitHub, Inc.
|
2014-08-26 13:37:37 +08:00
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-06-19 13:56:58 -07:00
|
|
|
#ifndef SHELL_BROWSER_UI_X_X_WINDOW_UTILS_H_
|
|
|
|
#define SHELL_BROWSER_UI_X_X_WINDOW_UTILS_H_
|
2014-08-26 13:37:37 +08:00
|
|
|
|
2015-02-11 12:12:22 +08:00
|
|
|
#include <string>
|
|
|
|
|
2018-04-18 18:52:58 +02:00
|
|
|
#include "ui/gfx/x/x11.h"
|
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
namespace electron {
|
2014-08-26 13:37:37 +08:00
|
|
|
|
|
|
|
// Sends a message to the x11 window manager, enabling or disabling the |state|
|
|
|
|
// for _NET_WM_STATE.
|
2020-06-22 10:35:10 -07:00
|
|
|
void SetWMSpecState(x11::Window window, bool enabled, x11::Atom state);
|
2014-08-26 13:37:37 +08:00
|
|
|
|
2015-02-11 12:12:22 +08:00
|
|
|
// Sets the _NET_WM_WINDOW_TYPE of window.
|
2020-06-22 10:35:10 -07:00
|
|
|
void SetWindowType(x11::Window window, const std::string& type);
|
2015-02-11 12:12:22 +08:00
|
|
|
|
2015-08-05 13:16:03 +08:00
|
|
|
// Returns true if the bus name "com.canonical.AppMenu.Registrar" is available.
|
|
|
|
bool ShouldUseGlobalMenuBar();
|
|
|
|
|
2019-08-14 23:51:15 -07:00
|
|
|
// Bring the given window to the front regardless of focus.
|
2020-06-22 10:35:10 -07:00
|
|
|
void MoveWindowToForeground(x11::Window window);
|
2019-02-07 12:48:19 -08:00
|
|
|
|
2019-08-14 23:51:15 -07:00
|
|
|
// Move a given window above the other one.
|
2020-06-22 10:35:10 -07:00
|
|
|
void MoveWindowAbove(x11::Window window, x11::Window other_window);
|
2019-08-14 23:51:15 -07:00
|
|
|
|
|
|
|
// Return true is the given window exists, false otherwise.
|
2020-06-22 10:35:10 -07:00
|
|
|
bool IsWindowValid(x11::Window window);
|
2019-08-14 23:51:15 -07:00
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
} // namespace electron
|
2014-08-26 13:37:37 +08:00
|
|
|
|
2019-06-19 13:56:58 -07:00
|
|
|
#endif // SHELL_BROWSER_UI_X_X_WINDOW_UTILS_H_
|