Skip to content

Commit e2ef61a

Browse files
committed
Merge branch 'master' of https://github.com/sentialx/node-window-manager into master
2 parents 5de6b7f + ac1a608 commit e2ef61a

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

example.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@ window.setBounds({ x: 0, y: 0 });
1212
window.maximize();
1313

1414
setTimeout(() => {
15-
window.setBounds(bounds);
15+
window.setBounds(bounds);
1616
}, 1000);
1717

1818
console.log("Windows list");
19-
windowManager.getWindows().forEach(window => {
20-
if (window.isVisible()) {
21-
console.log(window.path);
22-
}
19+
windowManager.getWindows().forEach((window) => {
20+
if (window.isVisible()) {
21+
console.log(window.getTitle(), window.path);
22+
}
2323
});
2424

25-
windowManager.on('window-activated', (window) => {
26-
console.log(window.path);
25+
windowManager.on("window-activated", (window) => {
26+
console.log(window.path);
2727
});
2828

2929
console.log("Monitors list");
30-
windowManager.getMonitors().forEach(monitor => {
31-
console.log(monitor.getWorkArea());
32-
});
30+
windowManager.getMonitors().forEach((monitor) => {
31+
console.log(monitor.getWorkArea());
32+
});

lib/macos.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ AXUIElementRef getAXWindowById(int handle) {
192192
auto wInfo = getWindowInfo(handle);
193193

194194
if (wInfo) {
195-
NSString *windowName = wInfo[(id)kCGWindowName];
195+
NSString *windowName = wInfo[(id)kCGWindowOwnerName];
196196
return Napi::String::New(env, [windowName UTF8String]);
197197
}
198198

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"install": "npm run rebuild",
1111
"rebuild": "node-gyp rebuild",
1212
"rebuild-dev": "npm run rebuild -- --debug",
13-
"prepublishOnly": "npm run rebuild",
13+
"prepublishOnly": "npm run rebuild && npm run prebuild",
1414
"prepare": "npm run build"
1515
},
1616
"repository": {

src/classes/window.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { addon } from "..";
2-
import extractFileIcon from 'extract-file-icon';
2+
import extractFileIcon from "extract-file-icon";
33
import { Monitor } from "./monitor";
44
import { IRectangle } from "../interfaces";
55
import { EmptyMonitor } from "./empty-monitor";
@@ -102,13 +102,13 @@ export class Window {
102102
addon.showWindow(this.id, "maximize");
103103
} else if (process.platform === "darwin") {
104104
addon.setWindowMaximized(this.id);
105-
}
105+
}
106106
}
107107

108108
bringToTop() {
109109
if (!addon) return;
110-
111-
if (process.platform === 'darwin') {
110+
111+
if (process.platform === "darwin") {
112112
addon.bringWindowToTop(this.id, this.processId);
113113
} else {
114114
addon.bringWindowToTop(this.id);
@@ -124,9 +124,9 @@ export class Window {
124124
if (!addon) return;
125125

126126
if (process.platform === "win32") {
127-
return this.path && this.path !== '' && addon.isWindow(this.id);
127+
return this.path && this.path !== "" && addon.isWindow(this.id);
128128
} else if (process.platform === "darwin") {
129-
return this.path && this.path !== '' && !!addon.initWindow(this.id);
129+
return this.path && this.path !== "" && !!addon.initWindow(this.id);
130130
}
131131
}
132132

0 commit comments

Comments
 (0)