mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-14 01:32:29 -04:00
@@ -180,6 +180,7 @@ Variants {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Hyprland implementation
|
// Hyprland implementation
|
||||||
|
Hyprland.focusedWorkspace;
|
||||||
const filtered = CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, screenName);
|
const filtered = CompositorService.filterCurrentWorkspace(CompositorService.sortedToplevels, screenName);
|
||||||
|
|
||||||
if (filtered.length === 0)
|
if (filtered.length === 0)
|
||||||
@@ -381,9 +382,7 @@ Variants {
|
|||||||
const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2 + adjacentLeftBarWidth;
|
const globalX = buttonGlobalPos.x + dock.hoveredButton.width / 2 + adjacentLeftBarWidth;
|
||||||
const tooltipHeight = 32;
|
const tooltipHeight = 32;
|
||||||
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + barSpacing + Theme.spacingM;
|
const tooltipOffset = dock.effectiveBarHeight + SettingsData.dockSpacing + SettingsData.dockBottomGap + SettingsData.dockMargin + barSpacing + Theme.spacingM;
|
||||||
const screenRelativeY = isBottom
|
const screenRelativeY = isBottom ? (screenHeight - tooltipOffset - tooltipHeight) : tooltipOffset;
|
||||||
? (screenHeight - tooltipOffset - tooltipHeight)
|
|
||||||
: tooltipOffset;
|
|
||||||
dockTooltip.show(tooltipText, globalX, screenRelativeY, dock.screen, false, false);
|
dockTooltip.show(tooltipText, globalX, screenRelativeY, dock.screen, false, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -368,18 +368,26 @@ Singleton {
|
|||||||
|
|
||||||
let currentWorkspaceId = null;
|
let currentWorkspaceId = null;
|
||||||
try {
|
try {
|
||||||
const hy = Array.from(Hyprland.toplevels.values);
|
if (Hyprland.monitors) {
|
||||||
for (const t of hy) {
|
const monitor = Hyprland.monitors.values.find(m => m.name === screenName);
|
||||||
const mon = _get(t, ["monitor", "name"], "");
|
if (monitor)
|
||||||
const wsId = _get(t, ["workspace", "id"], null);
|
currentWorkspaceId = _get(monitor, ["activeWorkspace", "id"], null);
|
||||||
const active = !!_get(t, ["activated"], false);
|
}
|
||||||
if (mon === screenName && wsId !== null) {
|
|
||||||
if (active) {
|
if (currentWorkspaceId === null) {
|
||||||
currentWorkspaceId = wsId;
|
const hy = Array.from(Hyprland.toplevels.values);
|
||||||
break;
|
for (const t of hy) {
|
||||||
|
const mon = _get(t, ["monitor", "name"], "");
|
||||||
|
const wsId = _get(t, ["workspace", "id"], null);
|
||||||
|
const active = !!_get(t, ["activated"], false);
|
||||||
|
if (mon === screenName && wsId !== null) {
|
||||||
|
if (active) {
|
||||||
|
currentWorkspaceId = wsId;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (currentWorkspaceId === null)
|
||||||
|
currentWorkspaceId = wsId;
|
||||||
}
|
}
|
||||||
if (currentWorkspaceId === null)
|
|
||||||
currentWorkspaceId = wsId;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -387,7 +395,7 @@ Singleton {
|
|||||||
const wss = Array.from(Hyprland.workspaces.values);
|
const wss = Array.from(Hyprland.workspaces.values);
|
||||||
const focusedId = _get(Hyprland, ["focusedWorkspace", "id"], null);
|
const focusedId = _get(Hyprland, ["focusedWorkspace", "id"], null);
|
||||||
for (const ws of wss) {
|
for (const ws of wss) {
|
||||||
const monName = _get(ws, ["monitor"], "");
|
const monName = _get(ws, ["monitor", "name"], "");
|
||||||
const wsId = _get(ws, ["id"], null);
|
const wsId = _get(ws, ["id"], null);
|
||||||
if (monName === screenName && wsId !== null) {
|
if (monName === screenName && wsId !== null) {
|
||||||
if (focusedId !== null && wsId === focusedId) {
|
if (focusedId !== null && wsId === focusedId) {
|
||||||
@@ -406,7 +414,6 @@ Singleton {
|
|||||||
if (currentWorkspaceId === null)
|
if (currentWorkspaceId === null)
|
||||||
return toplevels;
|
return toplevels;
|
||||||
|
|
||||||
// Map wayland → wsId snapshot
|
|
||||||
let map = new Map();
|
let map = new Map();
|
||||||
try {
|
try {
|
||||||
const hy = Array.from(Hyprland.toplevels.values);
|
const hy = Array.from(Hyprland.toplevels.values);
|
||||||
|
|||||||
Reference in New Issue
Block a user