mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: gamescope overlay window
This commit is contained in:
@@ -121,6 +121,8 @@
|
||||
tabbing identifier will be grouped together. This also adds a native new
|
||||
tab button to your window's tab bar and allows your `app` and window to
|
||||
receive the `new-window-for-tab` event.
|
||||
* `gamescopeOverlay` boolean (optional) _Linux_ - Sets the window to appear
|
||||
as an overlay for SteamOS's Gamescope compositor.
|
||||
|
||||
When setting minimum or maximum window size with `minWidth`/`maxWidth`/
|
||||
`minHeight`/`maxHeight`, it only constrains the users. It won't prevent you from
|
||||
|
||||
@@ -360,6 +360,16 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
|
||||
if (!window_type.empty())
|
||||
SetWindowType(static_cast<x11::Window>(GetAcceleratedWidget()),
|
||||
window_type);
|
||||
|
||||
// Allow window to overlay gamescope on SteamOS
|
||||
bool gamescope_overlay = false;
|
||||
if (options.Get("gamescopeOverlay", &gamescope_overlay) &&
|
||||
gamescope_overlay) {
|
||||
auto* connection = x11::Connection::Get();
|
||||
connection->SetProperty(static_cast<x11::Window>(GetAcceleratedWidget()),
|
||||
x11::GetAtom("GAMESCOPE_EXTERNAL_OVERLAY"),
|
||||
x11::Atom::CARDINAL, 1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user