From e00cb0e154b5fe89b8db1f90ae6256694de38197 Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Mon, 28 Sep 2026 15:04:38 +0200 Subject: [PATCH 1/3] Deprecate the App methods that v3 moves or removes --- src/App.php | 15 +++++++++++++++ src/Facades/App.php | 10 +++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/App.php b/src/App.php index 7633e308..062d1c1d 100644 --- a/src/App.php +++ b/src/App.php @@ -37,16 +37,25 @@ public function isHidden(): bool return $this->client->get('app/is-hidden')->json('is_hidden'); } + /** + * @deprecated v3 moves this to System::language(), which v2 does not have yet. + */ public function getLocale(): string { return $this->client->get('app/locale')->json('locale'); } + /** + * @deprecated v3 moves this to System::region(), which v2 does not have yet. + */ public function getLocaleCountryCode(): string { return $this->client->get('app/locale-country-code')->json('locale_country_code'); } + /** + * @deprecated v3 moves this to System::locale(), which v2 does not have yet. + */ public function getSystemLocale(): string { return $this->client->get('app/system-locale')->json('system_locale'); @@ -57,6 +66,9 @@ public function version(): string return $this->client->get('app/version')->json('version'); } + /** + * @deprecated Use Dock::badge(?string $label) instead, v3 removes this method. + */ public function badgeCount($count = null): int { if ($count === null) { @@ -111,6 +123,9 @@ public function isEmojiPanelSupported(): bool return (bool) $this->client->get('app/is-emoji-panel-supported')->json('supported'); } + /** + * @deprecated v3 removes this method and replaces it with a Blade element. There is no v2 replacement. + */ public function showEmojiPanel(): void { $this->client->post('app/show-emoji-panel'); diff --git a/src/Facades/App.php b/src/Facades/App.php index 42d8c8e8..67515077 100644 --- a/src/Facades/App.php +++ b/src/Facades/App.php @@ -10,18 +10,18 @@ * @method static void focus() * @method static void hide() * @method static bool isHidden() - * @method static string getLocale() - * @method static string getLocaleCountryCode() - * @method static string getSystemLocale() + * @method static string getLocale() Deprecated: v3 moves this to System::language(), which v2 does not have yet. + * @method static string getLocaleCountryCode() Deprecated: v3 moves this to System::region(), which v2 does not have yet. + * @method static string getSystemLocale() Deprecated: v3 moves this to System::locale(), which v2 does not have yet. * @method static string version() - * @method static int badgeCount($count = null) + * @method static int badgeCount($count = null) Deprecated: use Dock::badge(?string $label) instead, v3 removes this method. * @method static void addRecentDocument(string $path) * @method static array recentDocuments() * @method static void clearRecentDocuments() * @method static bool isRunningBundled() * @method static bool openAtLogin(?bool $open = null) * @method static bool isEmojiPanelSupported() - * @method static void showEmojiPanel() + * @method static void showEmojiPanel() Deprecated: v3 removes this method and replaces it with a Blade element. There is no v2 replacement. * @method static static when($value = null, ?callable $callback = null, ?callable $default = null) * @method static static unless($value = null, ?callable $callback = null, ?callable $default = null) */ From 2d9bee4b0b4c22f1a66e85b4d15158325d258aa8 Mon Sep 17 00:00:00 2001 From: gwleuverink <17123491+gwleuverink@users.noreply.github.com> Date: Mon, 28 Sep 2026 13:09:49 +0000 Subject: [PATCH 2/3] Build plugin --- .../electron-plugin/dist/server/api/shell.js | 6 +++-- .../electron-plugin/dist/server/api/window.js | 25 ++++++++++++++++++- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/resources/electron/electron-plugin/dist/server/api/shell.js b/resources/electron/electron-plugin/dist/server/api/shell.js index 0cc894f6..5793a6b9 100644 --- a/resources/electron/electron-plugin/dist/server/api/shell.js +++ b/resources/electron/electron-plugin/dist/server/api/shell.js @@ -40,8 +40,10 @@ router.delete('/trash-item', (req, res) => __awaiter(void 0, void 0, void 0, fun yield shell.trashItem(path); res.sendStatus(200); } - catch (_a) { - res.status(400).json(); + catch (e) { + res.status(400).json({ + error: e instanceof Error ? e.message : String(e), + }); } })); export default router; diff --git a/resources/electron/electron-plugin/dist/server/api/window.js b/resources/electron/electron-plugin/dist/server/api/window.js index ecb11010..c2b68a14 100644 --- a/resources/electron/electron-plugin/dist/server/api/window.js +++ b/resources/electron/electron-plugin/dist/server/api/window.js @@ -116,8 +116,19 @@ router.post('/always-on-top', (req, res) => { (_a = state.windows[id]) === null || _a === void 0 ? void 0 : _a.setAlwaysOnTop(alwaysOnTop); res.sendStatus(200); }); +router.post('/fullscreen', (req, res) => { + var _a; + const { id, fullscreen } = req.body; + (_a = state.windows[id]) === null || _a === void 0 ? void 0 : _a.setFullScreen(fullscreen); + res.sendStatus(200); +}); router.get('/current', (req, res) => { - const currentWindow = Object.values(state.windows).find((window) => window.id === BrowserWindow.getFocusedWindow().id); + const focused = BrowserWindow.getFocusedWindow(); + if (!focused) { + res.sendStatus(404); + return; + } + const currentWindow = Object.values(state.windows).find((window) => window.id === focused.id); const id = Object.keys(state.windows).find((key) => state.windows[key] === currentWindow); res.json(getWindowData(id)); }); @@ -239,6 +250,18 @@ router.post('/open', (req, res) => { payload: [id], }); }); + window.on('enter-full-screen', () => { + notifyLaravel('events', { + event: 'Native\\Desktop\\Events\\Windows\\WindowFullscreened', + payload: [id], + }); + }); + window.on('leave-full-screen', () => { + notifyLaravel('events', { + event: 'Native\\Desktop\\Events\\Windows\\WindowUnfullscreened', + payload: [id], + }); + }); window.on('show', () => { notifyLaravel('events', { event: 'Native\\Desktop\\Events\\Windows\\WindowShown', From 80c61139072f0e06033082dad9a67284a10d4f7e Mon Sep 17 00:00:00 2001 From: gwleuverink Date: Tue, 29 Sep 2026 10:44:28 +0200 Subject: [PATCH 3/3] Deprecate the App facade, renamed to NativeApp in v3 --- src/Facades/App.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Facades/App.php b/src/Facades/App.php index 67515077..9ee12ca1 100644 --- a/src/Facades/App.php +++ b/src/Facades/App.php @@ -5,6 +5,8 @@ use Illuminate\Support\Facades\Facade; /** + * @deprecated v3 renames this facade to NativeApp, because it collides with Laravel's own App facade. Nothing changes in v2. + * * @method static void quit() * @method static void relaunch() * @method static void focus()