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