Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 55 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,51 +75,73 @@ busctl --user introspect org.shadowblip.Gamescope /org/shadowblip/Gamescope/XWay
```

```bash
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
org.shadowblip.Gamescope.XWayland interface - - -
.GetAllWindows method u au -
.GetAppId method u u -
.GetWindowChildren method u au -
.GetWindowName method u s -
.HasAppId method u b -
.SetAppId method uu - -
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
org.freedesktop.DBus.Introspectable interface - - -
.Introspect method - s -
org.freedesktop.DBus.Peer interface - - -
.GetMachineId method - s -
.Ping method - - -
org.freedesktop.DBus.Properties interface - - -
.Get method ss v -
.GetAll method s a{sv} -
.Set method ssv - -
.PropertiesChanged signal sa{sv}as - -
org.shadowblip.Gamescope.XWayland interface - - -
.GetAllWindows method u au -
.GetAppId method u u -
.GetExternalOverlay method u u -
.GetGeometryForWindow method u (qqnn) -
.GetPidsForWindow method u au -
.GetWindowChildren method u au -
.GetWindowName method u s -
.GetWindowsForPid method u au -
.HasAppId method u b -
.RemoveAppId method u - -
.SetAppId method uu - -
.UnwatchWindow method u - -
.WatchWindow method u - -
.Name property s ":2" emits-change
.Primary property b true emits-change
.RootWindowId property u 962 emits-change
org.shadowblip.Gamescope.XWayland.Primary interface - - -
.GetBaselayerWindow method - u -
.GetOverlay method u u -
.IsFocusableApp method u b -
.RemoveBaselayerWindow method - - -
.RequestScreenshot method - - -
.SetBaselayerWindow method u - -
.SetExternalOverlay method uu - -
.SetInputFocus method uu - -
.SetMainApp method u - -
.SetNotification method uu - -
.SetOverlay method uu - -
.RootWindowId property u 835 emits-change
.WatchedWindows property au 0 emits-change
.WindowLifecycle signal sub - -
.WindowPropertyChanged signal us - -
org.shadowblip.Gamescope.XWayland.Primary interface - - -
.GetBaselayerAppId method - u -
.GetBaselayerWindow method - u -
.GetOverlay method u u -
.IsFocusableApp method u b -
.RemoveBaselayerAppId method - - -
.RemoveBaselayerWindow method - - -
.RequestScreenshot method - - -
.SetBaselayerAppId method u - -
.SetBaselayerWindow method u - -
.SetExternalOverlay method uu - -
.SetInputFocus method uu - -
.SetMainApp method u - -
.SetModeControl method uuuu - -
.SetNotification method uu - -
.SetOverlay method uu - -
.AllowTearing property b false emits-change writable
.BlurMode property u 0 emits-change writable
.BlurRadius property u 0 emits-change writable
.DisplayRefreshRate property u 165 emits-change
.FocusableApps property au 1 4194306 emits-change
.FocusableWindowNames property as - emits-change
.FocusableWindows property au 3 4194306 4194306 64337 emits-change
.FocusableWindows property au 3 4194306 4194306 32657 emits-change
.FocusedApp property u 0 emits-change
.FocusedAppGfx property u 0 emits-change
.FocusedWindow property u 4194306 emits-change
.FpsLimit property u 0 emits-change writable
.HdrEnabled property b false emits-change writable
.HdrSupported property b false emits-change
.IsDisplayExternal property b false emits-change
.OverlayFocused property b false emits-change
.BaselayerWindowUpdated signal - - -
.VrrEnabled property b false emits-change writable
.VrrSupported property b false emits-change
.BaselayerAppIdUpdated signal - - -
.BaselayerWindowUpdated signal - - -
.WindowCreated signal u - -
```

## Testing
Expand Down
109 changes: 109 additions & 0 deletions bindings/dbus-xml/org-shadowblip-gamescope-wayland.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<?xml version="1.0"?>
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.shadowblip.Gamescope.Wayland.Metrics">
<!--
Update the metrics from gamescope. This should be called regularly to
get the latest frame metrics. Note that calling this frequently can
interfere with MangoApp framerate stats.
-->
<method name="Update">
</method>
<property name="AppFrametimeNs" type="t" access="read"/>
<property name="AppWantsHdr" type="b" access="read"/>
<property name="DisplayRefresh" type="q" access="read"/>
<property name="FsrSharpness" type="y" access="read"/>
<property name="FsrUpscale" type="y" access="read"/>
<!--
Unix timestamp (in milliseconds) when `update()` was last called.
-->
<property name="LastUpdateTime" type="t" access="read"/>
<property name="LatencyNs" type="t" access="read"/>
<property name="OutputHeight" type="u" access="read"/>
<property name="OutputWidth" type="u" access="read"/>
<property name="OverlayFocused" type="b" access="read"/>
<property name="Pid" type="u" access="read"/>
<property name="VisibleFrametimeNs" type="t" access="read"/>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.shadowblip.Gamescope.Wayland">
<!--
Takes a screenshot using Wayland
the screenshot_type u8 converts to [ScreenshotType]
0 => [ScreenshotType::AllRealLayers]
1 => [ScreenshotType::BasePlaneOnly]
2 => [ScreenshotType::FullComposition]
3 => [ScreenshotType::ScreenBuffer]
-->
<method name="TakeScreenshot">
<arg name="file_path" type="s" direction="in"/>
<arg name="screenshot_type" type="y" direction="in"/>
</method>
<!--
Sleeps chosen display
display_type_flags u8 converts to DisplayTypeFlags
It is a bit flag
1 => [DisplayTypeFlags::InternalDisplay]
2 => [DisplayTypeFlags::ExternalDisplay]
[sleep] - whether to sleep - true or wake - false
-->
<method name="DisplaySleep">
<arg name="display_type_flags" type="y" direction="in"/>
<arg name="sleep" type="b" direction="in"/>
</method>
<!--
Updates in-game FPS limit and refresh rate
fps is a number of fps to set
set to 0 to use a native default
refresh_cycle_flags u8 converts to TargetRefreshCycleFlag
It is a bit flag
1 => [TargetRefreshCycleFlag::InternalDisplay]
2 => [TargetRefreshCycleFlag::AllowRefreshSwitching]
4 => [TargetRefreshCycleFlag::OnlyChangeRefreshRate]
-->
<method name="SetAppTargetRefreshCycle">
<arg name="fps" type="u" direction="in"/>
<arg name="refresh_cycle_flags" type="y" direction="in"/>
</method>
<method name="RequestAppPerformanceStats">
<arg name="app_id" type="u" direction="in"/>
<arg type="t" direction="out"/>
</method>
<property name="RefreshRates" type="au" access="read"/>
</interface>
</node>
62 changes: 55 additions & 7 deletions bindings/dbus-xml/org-shadowblip-gamescope-xwayland.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@
-->
<method name="RequestScreenshot">
</method>
<!--
Sets the display mode control for Gamescope on the given xwayland instance
to change the display resolution.
-->
<method name="SetModeControl">
<arg name="xwayland_id" type="u" direction="in"/>
<arg name="width" type="u" direction="in"/>
<arg name="height" type="u" direction="in"/>
<arg name="super_res" type="u" direction="in"/>
</method>
<!--
Whether or not Gamescope should be allowed to screen tear
-->
Expand All @@ -130,6 +140,7 @@
Sets the blur radius size
-->
<property name="BlurRadius" type="u" access="readwrite"/>
<property name="DisplayRefreshRate" type="u" access="read"/>
<!--
Return a list of focusable apps
-->
Expand Down Expand Up @@ -161,16 +172,38 @@
Sets the current Gamescope FPS limit
-->
<property name="FpsLimit" type="u" access="readwrite"/>
<!--
Returns true if HDR is enabled
-->
<!--
Sets if HDR should be enabled
-->
<property name="HdrEnabled" type="b" access="readwrite"/>
<!--
Returns true if HDR is supported by the current display
Doesn't work reliably in nested mode
-->
<property name="HdrSupported" type="b" access="read"/>
<property name="IsDisplayExternal" type="b" access="read"/>
<!--
Returns whether or not the overlay window is currently focused
-->
<property name="OverlayFocused" type="b" access="read"/>
<property name="VrrEnabled" type="b" access="readwrite"/>
<property name="VrrSupported" type="b" access="read"/>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
Expand All @@ -195,13 +228,6 @@
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.shadowblip.Gamescope.XWayland">
<!--
Emitted when a window property changes on a watched window.
Expand Down Expand Up @@ -246,6 +272,13 @@
<arg name="window_id" type="u" direction="in"/>
<arg type="s" direction="out"/>
</method>
<!--
Returns the width, height, x, and y of the window
-->
<method name="GetGeometryForWindow">
<arg name="window_id" type="u" direction="in"/>
<arg type="(qqnn)" direction="out"/>
</method>
<!--
Returns the window ids of the children of the given window
-->
Expand All @@ -260,6 +293,13 @@
<arg name="window_id" type="u" direction="in"/>
<arg type="au" direction="out"/>
</method>
<!--
Get the external overlay property for the given window
-->
<method name="GetExternalOverlay">
<arg name="window_id" type="u" direction="in"/>
<arg type="u" direction="out"/>
</method>
<!--
Returns the currently set app ID on the given window
-->
Expand Down Expand Up @@ -287,6 +327,14 @@
<arg name="window_id" type="u" direction="in"/>
<arg type="b" direction="out"/>
</method>
<!--
Fires when a new window is lifecycle
-->
<signal name="WindowLifecycle">
<arg name="event" type="s"/>
<arg name="window_id" type="u"/>
<arg name="is_primary" type="b"/>
</signal>
<!--
The X display name of the XWayland display (E.g. ":0", ":1")
-->
Expand Down
Loading