diff --git a/pkgs/flatpak/com.github.rafostar.Clapper.json b/pkgs/flatpak/com.github.rafostar.Clapper.json index 7abfa073..ae552021 100644 --- a/pkgs/flatpak/com.github.rafostar.Clapper.json +++ b/pkgs/flatpak/com.github.rafostar.Clapper.json @@ -13,6 +13,7 @@ "--share=network", "--device=all", "--filesystem=xdg-videos", + "--talk-name=org.gnome.Shell", "--env=GST_PLUGIN_SYSTEM_PATH=/app/lib/gstreamer-1.0", "--env=GST_VAAPI_ALL_DRIVERS=1" ], diff --git a/src/dbus.js b/src/dbus.js new file mode 100644 index 00000000..1840d228 --- /dev/null +++ b/src/dbus.js @@ -0,0 +1,37 @@ +const { Gio } = imports.gi; +const Debug = imports.src.debug; + +const { debug } = Debug; + +const ShellProxyWrapper = Gio.DBusProxy.makeProxyWrapper(` + + + + + + + + +` +); + +let shellProxy = new ShellProxyWrapper( + Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell' +); + +function callMakeAbove(isAbove) +{ + const un = (isAbove) ? '' : 'un'; + + debug('changing window keep above'); + shellProxy.EvalRemote( + `global.display.focus_window.${un}make_above()`, + (out) => { + const debugMsg = (out[0]) + ? `window keep above: ${isAbove}` + : new Error(out[1]); + + debug(debugMsg); + } + ); +} diff --git a/src/revealers.js b/src/revealers.js index 6f5e53a0..4e9611f7 100644 --- a/src/revealers.js +++ b/src/revealers.js @@ -1,6 +1,7 @@ const { GLib, GObject, Gtk, Pango } = imports.gi; const { HeaderBar } = imports.src.headerbar; const Debug = imports.src.debug; +const DBus = imports.src.dbus; const REVEAL_TIME = 800; @@ -264,6 +265,8 @@ class ClapperControlsRevealer extends Gtk.Revealer widget.height_request = widget.get_height(); this.reveal_child ^= true; + + DBus.callMakeAbove(!this.reveal_child); } _onControlsRevealed()