From 1373c8eeb0a5d867927ba30a9a9bb2d5b0057a87 Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Sat, 22 Jul 2023 17:39:22 +0800 Subject: [PATCH] support setting exclusive zone --- qt-video-wlr-bg.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qt-video-wlr-bg.cpp b/qt-video-wlr-bg.cpp index bf5d2db..67d8ade 100644 --- a/qt-video-wlr-bg.cpp +++ b/qt-video-wlr-bg.cpp @@ -57,10 +57,12 @@ int main(int argc,char *argv[]){ "Widget bottom margin. Defaults to 0.", "margin", "0"); QCommandLineOption leftMarginOption("left-margin", "Widget left margin. Defaults to 0.", "margin", "0"); + QCommandLineOption exclusiveZoneOption({"x", "exclusive-zone"}, + "Exclusive zone distance, -1 to draw over panels. Defaults to 0.", "distance", "0"); parser.addOptions({ layerOption, widthOption, heightOption, colorOption, volumeOption, positionOption, noLoopOption, marginOption, topMarginOption, rightMarginOption, bottomMarginOption, - leftMarginOption }); + leftMarginOption, exclusiveZoneOption }); parser.process(app); bool ok; @@ -134,6 +136,10 @@ int main(int argc,char *argv[]){ if (!ok) parser.showHelp(1); layerShell->setMargins({left_margin, top_margin, right_margin, bottom_margin}); + int32_t exclusive_zone = parser.value(exclusiveZoneOption).toInt(&ok); + if (!ok || exclusive_zone < -1) parser.showHelp(1); + layerShell->setExclusiveZone(exclusive_zone); + layerShell->setKeyboardInteractivity(LayerShellQt::Window::KeyboardInteractivityNone); layerShell->setDesiredOutput(nullptr);