Skip to content

Commit 1bd28fc

Browse files
committed
r0b08x [chore] 1/21/2025, 3:41:13 PM
1 parent a546b0b commit 1bd28fc

15 files changed

+105
-34
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88

9-
# 📚 P3X OneNote Linux v2025.4.123
9+
# 📚 P3X OneNote Linux v2025.4.124
1010

1111

1212

@@ -320,7 +320,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
320320
---
321321

322322

323-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
323+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
324324

325325
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
326326

artifacts/arm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
6464
---
6565

6666

67-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
67+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
6868

6969
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
7070

artifacts/flavor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
5454
---
5555

5656

57-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
57+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
5858

5959
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
6060

artifacts/new-language.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
5555
---
5656

5757

58-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
58+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
5959

6060
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
6161

artifacts/npm.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
6868
---
6969

7070

71-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
71+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
7272

7373
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
7474

change-log.2019.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
222222
---
223223

224224

225-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
225+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
226226

227227
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
228228

change-log.2020.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
184184
---
185185

186186

187-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
187+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
188188

189189
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
190190

change-log.2021.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
216216
---
217217

218218

219-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
219+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
220220

221221
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
222222

change-log.2022.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
9191
---
9292

9393

94-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
94+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
9595

9696
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
9797

change-log.2023.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
115115
---
116116

117117

118-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
118+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
119119

120120
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
121121

change-log.2024.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
150150
---
151151

152152

153-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
153+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
154154

155155
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
156156

change-log.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77

88
## Change log
99

10+
### v2025.4.124
11+
Released on 01/21/2025
12+
* FEATURE/BUGFIX: Saving the position of the window as it was years ago
13+
14+
1015
### v2025.4.101
1116
Released on 01/05/2025
1217
* CHORE: Update all packages.
@@ -66,7 +71,7 @@ All my domains, including [patrikx3.com](https://patrikx3.com), [corifeus.eu](ht
6671
---
6772

6873

69-
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.123
74+
[**P3X-ONENOTE**](https://corifeus.com/onenote) Build v2025.4.124
7075

7176
[![NPM](https://img.shields.io/npm/v/p3x-onenote.svg)](https://www.npmjs.com/package/p3x-onenote) [![Donate for Corifeus / P3X](https://img.shields.io/badge/Donate-Corifeus-003087.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=QZVM4V6HVZJW6) [![Contact Corifeus / P3X](https://img.shields.io/badge/Contact-P3X-ff9900.svg)](https://www.patrikx3.com/en/front/contact) [![Like Corifeus @ Facebook](https://img.shields.io/badge/LIKE-Corifeus-3b5998.svg)](https://www.facebook.com/corifeus.software)
7277

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "p3x-onenote",
3-
"version": "2025.4.123",
3+
"version": "2025.4.124",
44
"description": "📚 P3X OneNote Linux",
55
"main": "src/electron/app.js",
66
"corifeus": {
@@ -66,10 +66,10 @@
6666
"angular-material": "1.2.5",
6767
"angular-messages": "1.8.3",
6868
"corifeus-utils": "2025.4.120",
69-
"electron": "^34.0.0",
7069
"electron-store": "8.2.0",
7170
"electron-updater": "6.3.9",
72-
"semver": "7.6.3"
71+
"semver": "7.6.3",
72+
"electron": "^34.0.0"
7373
},
7474
"devDependencies": {
7575
"corifeus-builder": "2025.4.128",

src/electron/main/app-events.js

+70-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,77 @@
1-
const {app} = require('electron')
1+
const { app, powerMonitor } = require('electron');
2+
const path = require('path')
23

3-
app.on('ready', global.p3x.onenote.createWindow.onenote);
4+
let isInSuspended = false;
45

5-
app.on('window-all-closed', function () {
6+
const { net } = require('electron');
7+
function waitForNetworkConnectivity(callback, retries = 60, interval = 1000) {
8+
let attempts = 0;
9+
10+
function checkNetwork() {
11+
const request = net.request('https://www.bing.com'); // Use any lightweight URL
12+
request.on('response', () => {
13+
console.log('Network is available');
14+
callback();
15+
});
16+
request.on('error', () => {
17+
if (attempts < retries) {
18+
attempts++;
19+
console.log(`Waiting for network (${attempts}/${retries})...`);
20+
setTimeout(checkNetwork, interval);
21+
} else {
22+
console.error('Network unavailable after retries.');
23+
callback();
24+
}
25+
});
26+
request.end();
27+
}
28+
29+
checkNetwork();
30+
}
31+
32+
app.on('ready', () => {
33+
console.log('P3X-OneNote is ready');
34+
35+
// Create the main window
36+
global.p3x.onenote.createWindow.onenote();
37+
38+
39+
/*
40+
// Handle power events
41+
powerMonitor.on('suspend', () => {
42+
if (isInSuspended) {
43+
return
44+
}
45+
isInSuspended = true;
46+
console.log('System is suspending...');
47+
// Close the window when the system goes to sleep
48+
//if (global.p3x.onenote.window.onenote) {
49+
// global.p3x.onenote.window.onenote.loadURL('about:blank');
50+
// global.p3x.onenote.window.onenote.hide();
51+
//}
52+
});
653
7-
// if (process.platform !== 'darwin') {
54+
powerMonitor.on('resume', () => {
55+
if (!isInSuspended) {
56+
return
57+
}
58+
isInSuspended = false;
59+
console.log('System has resumed...');
60+
61+
global.p3x.onenote.window.onenote.loadURL(`about:blank`);
62+
waitForNetworkConnectivity(() => {
63+
const url = path.join(app.getAppPath(), 'src/electron/window/onenote/index.html');
64+
console.log('resume url', url)
65+
global.p3x.onenote.window.onenote.loadURL(`file://${url}`);
66+
});
67+
});
68+
*/
69+
});
70+
71+
app.on('window-all-closed', function () {
72+
if (!isInSuspended) {
873
app.quit();
9-
// }
74+
}
1075
});
1176

1277
app.on('activate', function () {
@@ -15,13 +80,10 @@ app.on('activate', function () {
1580
}
1681
});
1782

18-
19-
//FIXME: webview new-window changed
2083
app.on('web-contents-created', function (webContentsCreatedEvent, contents) {
2184
if (contents.getType() === 'webview') {
2285
contents.on('new-window', function (newWindowEvent, url) {
2386
newWindowEvent.preventDefault();
2487
});
2588
}
2689
});
27-

src/electron/main/create/window/onenote.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
const {BrowserWindow, app} = require('electron');
22

3+
const remoteMain = require("@electron/remote/main")
4+
remoteMain.initialize()
35

46
function createWindow() {
57

6-
const remoteMain = require("@electron/remote/main")
7-
remoteMain.initialize()
8+
89

910
global.p3x.onenote.window.onenote = new BrowserWindow({
1011
icon: global.p3x.onenote.iconFile,
@@ -18,9 +19,13 @@ function createWindow() {
1819
nodeIntegrationInSubFrames: true,
1920
contextIsolation: false,
2021
webviewTag: true,
22+
enableRemoteModule: true,
2123
}
2224
});
23-
global.p3x.onenote.window.onenote.loadURL(`file://${__dirname}/../../../window/onenote/index.html`);
25+
const path = require('path')
26+
const loadUrl = path.join(app.getAppPath(), 'src/electron/window/onenote/index.html');
27+
console.log('loadUrl', loadUrl)
28+
global.p3x.onenote.window.onenote.loadURL(`file://${loadUrl}`);
2429

2530
global.p3x.onenote.window.onenote.webContents.on("did-attach-webview", (_, contents) => {
2631
contents.setWindowOpenHandler((details) => {
@@ -84,27 +89,26 @@ function createWindow() {
8489
})
8590
});
8691

92+
8793
if (!process.argv.includes('--minimized')) {
88-
//const windowBounds = global.p3x.onenote.conf.get('window-bounds');
94+
const windowBounds = global.p3x.onenote.conf.get('window-bounds');
8995
const maximized = global.p3x.onenote.conf.get('maximized');
9096

9197
if (maximized === true) {
9298
global.p3x.onenote.window.onenote.maximize()
9399
}
94-
100+
else if (windowBounds !== null && windowBounds !== undefined) {
101+
global.p3x.onenote.window.onenote.setBounds(windowBounds);
102+
}
103+
95104
}
96105

97-
/*
98-
else if (windowBounds !== null && windowBounds !== undefined) {
99-
global.p3x.onenote.window.onenote.setBounds(windowBounds);
100-
}
101106

102107
global.p3x.onenote.window.onenote.on('close', () => {
103108
if (global.p3x.onenote.conf.get('maximized') !== true) {
104109
global.p3x.onenote.conf.set('window-bounds', global.p3x.onenote.window.onenote.getBounds())
105110
}
106111
})
107-
*/
108112

109113
global.p3x.onenote.window.onenote.on('maximize', () => {
110114
global.p3x.onenote.conf.set('maximized', true)

0 commit comments

Comments
 (0)