diff --git a/modules/background/Background.qml b/modules/background/Background.qml new file mode 100644 index 0000000..98c18dd --- /dev/null +++ b/modules/background/Background.qml @@ -0,0 +1,44 @@ +import QtQuick +import Quickshell +import Quickshell.Wayland + +Variants { + id: root + + // Automatically generates a trap for every connected monitor + model: Quickshell.screens + + delegate: PanelWindow { + screen: modelData + + // Force the panel window to take up the full screen real estate + anchors.top: true + anchors.bottom: true + anchors.left: true + anchors.right: true + + // Push it to the background layer below normal windows + WlrLayershell.layer: WlrLayer.Background + WlrLayershell.namespace: "transparent-focus-trap" + + // Keep it transparent so your current wallpaper shows right through + color: "transparent" + + // The core trap mechanism + MouseArea { + anchors.fill: parent + hoverEnabled: true + + // Having an active hover area on the background layer forces the + // Wayland compositor to shift cursor target focus to this surface + // the exact millisecond your mouse exits a tiled/floating window. + onEntered: { + console.log("DEBUG: Mouse entered background (Focus Trap Active)"); + } + + onExited: { + console.log("DEBUG: Mouse left background (Focusing on Window)"); + } + } + } +} \ No newline at end of file diff --git a/modules/bar/widgets/WindowInfo.qml b/modules/bar/widgets/WindowInfo.qml index 424fa3a..1d95e38 100644 --- a/modules/bar/widgets/WindowInfo.qml +++ b/modules/bar/widgets/WindowInfo.qml @@ -21,7 +21,7 @@ Item { const title = Hyprland.activeToplevel?.title; if (!title) return qsTr("Desktop"); - return title.split(/\s+[\-\u2013\u2014\|]\s+/).pop(); + return title.split(/\s+[\-\u2013\u2014\|]\s+/).pop();q } readonly property string appIcon: { @@ -29,10 +29,6 @@ Item { let icon = AppsState.matchIcon(root.windowClass); - if (!icon) { - icon = AppsState.matchIcon(root.windowClass.toLowerCase()); - } - if (!icon) { icon = AppsState.matchIcon(root.windowTitle); } diff --git a/shell.qml b/shell.qml index ab65eb6..8506bd7 100644 --- a/shell.qml +++ b/shell.qml @@ -7,6 +7,7 @@ import "./modules/bar" import "./modules/wp" import "./modules/wlogout" import "./modules/jl" +import "./modules/background" ShellRoot { id: root @@ -25,6 +26,8 @@ ShellRoot { id : wlLoader } + Background {} + function openWlogout() { wlLoader.openWlogout() }