Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions resources/js/electron-plugin/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class NativePHP {
constructor() {
this.processes = [];
this.schedulerInterval = undefined;
this.mainWindow = null;
}
bootstrap(app, icon, phpBinary, cert) {
initialize();
Expand Down Expand Up @@ -66,6 +67,16 @@ class NativePHP {
}
event.preventDefault();
});
if (process.platform === 'win32') {
app.on('second-instance', (event, commandLine, workingDirectory) => {
if (this.mainWindow) {
if (this.mainWindow.isMinimized())
this.mainWindow.restore();
this.mainWindow.focus();
}
this.handleDeepLink(commandLine.pop());
});
}
}
bootstrapApp(app) {
return __awaiter(this, void 0, void 0, function* () {
Expand Down Expand Up @@ -124,6 +135,13 @@ class NativePHP {
else {
app.setAsDefaultProtocolClient(deepLinkProtocol);
}
if (process.platform === 'win32') {
const gotTheLock = app.requestSingleInstanceLock();
if (!gotTheLock) {
app.quit();
return;
}
}
}
}
startAutoUpdater(config) {
Expand Down
5 changes: 5 additions & 0 deletions resources/js/electron-plugin/dist/server/api/menuBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ router.post("/hide", (req, res) => {
res.sendStatus(200);
state.activeMenuBar.hideWindow();
});
router.post("/resize", (req, res) => {
res.sendStatus(200);
const { width, height } = req.body;
state.activeMenuBar.window.setSize(width, height);
});
router.post("/create", (req, res) => {
res.sendStatus(200);
let shouldSendCreatedEvent = true;
Expand Down
8 changes: 8 additions & 0 deletions resources/js/electron-plugin/src/server/api/menuBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ router.post("/hide", (req, res) => {
state.activeMenuBar.hideWindow();
});

router.post("/resize", (req, res) => {
res.sendStatus(200);

const { width, height } = req.body;

state.activeMenuBar.window.setSize(width, height);
});

router.post("/create", (req, res) => {
res.sendStatus(200);

Expand Down
Loading
Loading