picker: better client detection
This commit is contained in:
parent
6200f400f3
commit
93a779ffbd
1 changed files with 13 additions and 10 deletions
|
|
@ -38,8 +38,14 @@ MouseArea {
|
||||||
property real sh: Math.abs(sy - ey)
|
property real sh: Math.abs(sy - ey)
|
||||||
|
|
||||||
property list<var> clients: {
|
property list<var> clients: {
|
||||||
const ws = Hypr.activeToplevel?.workspace?.id ?? Hypr.activeWsId;
|
const mon = Hypr.monitorFor(screen);
|
||||||
return Hypr.toplevels.values.filter(c => c.workspace?.id === ws).sort((a, b) => {
|
if (!mon)
|
||||||
|
return [];
|
||||||
|
|
||||||
|
const special = mon.lastIpcObject.specialWorkspace;
|
||||||
|
const wsId = special.name ? special.id : mon.activeWorkspace.id;
|
||||||
|
|
||||||
|
return Hypr.toplevels.values.filter(c => c.workspace?.id === wsId).sort((a, b) => {
|
||||||
// Pinned first, then fullscreen, then floating, then any other
|
// Pinned first, then fullscreen, then floating, then any other
|
||||||
const ac = a.lastIpcObject;
|
const ac = a.lastIpcObject;
|
||||||
const bc = b.lastIpcObject;
|
const bc = b.lastIpcObject;
|
||||||
|
|
@ -49,6 +55,9 @@ MouseArea {
|
||||||
|
|
||||||
function checkClientRects(x: real, y: real): void {
|
function checkClientRects(x: real, y: real): void {
|
||||||
for (const client of clients) {
|
for (const client of clients) {
|
||||||
|
if (!client)
|
||||||
|
continue;
|
||||||
|
|
||||||
let {
|
let {
|
||||||
at: [cx, cy],
|
at: [cx, cy],
|
||||||
size: [cw, ch]
|
size: [cw, ch]
|
||||||
|
|
@ -72,6 +81,8 @@ MouseArea {
|
||||||
closeAnim.start();
|
closeAnim.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onClientsChanged: checkClientRects(mouseX, mouseY)
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
opacity: 0
|
opacity: 0
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
@ -175,14 +186,6 @@ MouseArea {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: Hypr
|
|
||||||
|
|
||||||
function onActiveWsIdChanged(): void {
|
|
||||||
root.checkClientRects(root.mouseX, root.mouseY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
running: true
|
running: true
|
||||||
command: ["hyprctl", "-j", "getoption", "general:border_size"]
|
command: ["hyprctl", "-j", "getoption", "general:border_size"]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue