summarylogtreecommitdiffstats
path: root/active-win.patch
blob: 8b6c4eef0576ab66cc69f963ce4aee94babb86ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
diff --git a/linux.js b/linux.js
index 69e5409..949cf48 100644
--- a/linux.js
+++ b/linux.js
@@ -36,7 +36,7 @@ const parseLinux = ({stdout, boundsStdout, activeWindowId}) => {
 	const windowIdProperty = 'WM_CLIENT_LEADER(WINDOW)';
 	const resultKeys = Object.keys(result);
 	const windowId = (resultKeys.indexOf(windowIdProperty) > 0 &&
-		Number.parseInt(result[windowIdProperty].split('#').pop(), 16)) || activeWindowId;
+		Number.parseInt(result[windowIdProperty].split('#').pop(), 16)) || activeWindowId || 114514;
 
 	const processId = Number.parseInt(result['_NET_WM_PID(CARDINAL)'], 10);
 
@@ -46,12 +46,12 @@ const parseLinux = ({stdout, boundsStdout, activeWindowId}) => {
 
 	return {
 		platform: 'linux',
-		title: JSON.parse(result['_NET_WM_NAME(UTF8_STRING)'] || result['WM_NAME(STRING)']) || null,
-		id: windowId,
+		title: result['_NET_WM_NAME(UTF8_STRING)'] || result['WM_NAME(STRING)'] || null,
 		owner: {
-			name: JSON.parse(result['WM_CLASS(STRING)'].split(',').pop()),
+			name: result['WM_CLASS(STRING)'].split(',').pop(),
 			processId
 		},
+		id: windowId,
 		bounds: {
 			x: Number.parseInt(bounds['Absolute upper-left X'], 10),
 			y: Number.parseInt(bounds['Absolute upper-left Y'], 10),