diff --git a/Commons/Settings.qml b/Commons/Settings.qml index a6aafdf..39b22a5 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -145,7 +145,6 @@ Singleton { widget.use12HourClock = widget.use12HourClock !== undefined ? widget.use12HourClock : adapter.location.use12HourClock widget.reverseDayMonth = widget.reverseDayMonth !== undefined ? widget.reverseDayMonth : adapter.location.reverseDayMonth if (widget.showDate !== undefined) { - console.log("HELLLO") widget.displayFormat = "time-date" } else if (widget.showSeconds) { widget.displayFormat = "time-seconds" diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index 0667cb4..a42f982 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -134,7 +134,7 @@ RowLayout { asynchronous: true smooth: true visible: source !== "" - + // Handle loading errors gracefully onStatusChanged: { if (status === Image.Error) { @@ -204,4 +204,4 @@ RowLayout { } } } -} \ No newline at end of file +} diff --git a/Services/CompositorService.qml b/Services/CompositorService.qml index 03f4287..ed8f9b6 100644 --- a/Services/CompositorService.qml +++ b/Services/CompositorService.qml @@ -31,7 +31,7 @@ Singleton { // Debounce timer for updates property Timer updateTimer: Timer { - interval: 50 // 50ms debounce + interval: 50 // 50ms debounce repeat: false onTriggered: { try { @@ -101,6 +101,7 @@ Singleton { return } } catch (e) { + // Hyprland not available } @@ -134,8 +135,7 @@ Singleton { } } - function setupHyprlandConnections() { - // Connections are set up at the top level, this function just marks that Hyprland is ready + function setupHyprlandConnections() {// Connections are set up at the top level, this function just marks that Hyprland is ready } function updateHyprlandWorkspaces() { @@ -145,7 +145,7 @@ Singleton { workspaces.clear() try { const hlWorkspaces = Hyprland.workspaces.values - + // Determine occupied workspace ids from current toplevels const occupiedIds = {} try { @@ -165,26 +165,28 @@ Singleton { } } } catch (e2) { + // ignore occupancy errors; fall back to false } - + for (var i = 0; i < hlWorkspaces.length; i++) { const ws = hlWorkspaces[i] - if (!ws) continue - + if (!ws) + continue + try { // Only append workspaces with id >= 1 if (ws.id >= 1) { workspaces.append({ - "id": i, - "idx": ws.id, - "name": ws.name || "", - "output": ws.monitor?.name || "", - "isActive": ws.active === true, - "isFocused": ws.focused === true, - "isUrgent": ws.urgent === true, - "isOccupied": occupiedIds[ws.id] === true - }) + "id": i, + "idx": ws.id, + "name": ws.name || "", + "output": ws.monitor?.name || "", + "isActive": ws.active === true, + "isFocused": ws.focused === true, + "isUrgent": ws.urgent === true, + "isOccupied": occupiedIds[ws.id] === true + }) } } catch (workspaceError) { Logger.warn("Compositor", "Error processing workspace at index", i, ":", workspaceError) @@ -226,6 +228,7 @@ Singleton { appId = String(toplevel.appId) } } catch (propertyError) { + // Ignore property access errors and continue with empty appId } @@ -237,6 +240,7 @@ Singleton { appId = String(ipcData.class || ipcData.initialClass || ipcData.appId || ipcData.wm_class || "") } } catch (ipcError) { + // Ignore errors when accessing lastIpcObject } } @@ -272,13 +276,12 @@ Singleton { } windowsList.push({ - "id": windowId, - "title": windowTitle, - "appId": appId, - "workspaceId": workspaceId, - "isFocused": isActivated - }) - + "id": windowId, + "title": windowTitle, + "appId": appId, + "workspaceId": workspaceId, + "isFocused": isActivated + }) } catch (toplevelError) { // Log the error but continue processing other toplevels Logger.warn("Compositor", "Error processing toplevel at index", i, ":", toplevelError) @@ -351,23 +354,23 @@ Singleton { for (const ws of workspacesData) { workspacesList.push({ - "id": ws.id, - "idx": ws.idx, - "name": ws.name || "", - "output": ws.output || "", - "isFocused": ws.is_focused === true, - "isActive": ws.is_active === true, - "isUrgent": ws.is_urgent === true, - "isOccupied": ws.active_window_id ? true : false - }) + "id": ws.id, + "idx": ws.idx, + "name": ws.name || "", + "output": ws.output || "", + "isFocused": ws.is_focused === true, + "isActive": ws.is_active === true, + "isUrgent": ws.is_urgent === true, + "isOccupied": ws.active_window_id ? true : false + }) } workspacesList.sort((a, b) => { - if (a.output !== b.output) { - return a.output.localeCompare(b.output) - } - return a.idx - b.idx - }) + if (a.output !== b.output) { + return a.output.localeCompare(b.output) + } + return a.idx - b.idx + }) // Update the workspaces ListModel workspaces.clear() @@ -472,12 +475,12 @@ Singleton { const windowsList = [] for (const win of windowsData) { windowsList.push({ - "id": win.id, - "title": win.title || "", - "appId": win.app_id || "", - "workspaceId": win.workspace_id || null, - "isFocused": win.is_focused === true - }) + "id": win.id, + "title": win.title || "", + "appId": win.app_id || "", + "workspaceId": win.workspace_id || null, + "isFocused": win.is_focused === true + }) } windowsList.sort((a, b) => a.id - b.id) @@ -542,12 +545,12 @@ Singleton { const windowsList = [] for (const win of windowsData) { windowsList.push({ - "id": win.id, - "title": win.title || "", - "appId": win.app_id || "", - "workspaceId": win.workspace_id || null, - "isFocused": win.is_focused === true - }) + "id": win.id, + "title": win.title || "", + "appId": win.app_id || "", + "workspaceId": win.workspace_id || null, + "isFocused": win.is_focused === true + }) } windowsList.sort((a, b) => a.id - b.id) @@ -652,4 +655,4 @@ Singleton { function suspend() { Quickshell.execDetached(["systemctl", "suspend"]) } -} \ No newline at end of file +}