Skip to content

Commit 159e25c

Browse files
authored
flclash: fix silent launching (#4728)
* flclash: fix silent launching ref: chen08209/FlClash#1912 * flclash: rollback pkgrel to 2
1 parent bbf7571 commit 159e25c

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
From 7a9e6dca964518c77feb3e9b1768fca5424dbc3b Mon Sep 17 00:00:00 2001
2+
From: BIGGASSS <timcooksgrandpa@gmail.com>
3+
Date: Thu, 26 Mar 2026 03:29:55 +0800
4+
Subject: [PATCH] fix(linux): silent launching not working
5+
6+
---
7+
linux/runner/my_application.cc | 11 ++---------
8+
1 file changed, 2 insertions(+), 9 deletions(-)
9+
10+
diff --git a/linux/runner/my_application.cc b/linux/runner/my_application.cc
11+
index 9745df677..beffdbb37 100644
12+
--- a/linux/runner/my_application.cc
13+
+++ b/linux/runner/my_application.cc
14+
@@ -14,12 +14,6 @@ struct _MyApplication {
15+
16+
G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION)
17+
18+
-// Called when first Flutter frame received.
19+
-static void first_frame_cb(MyApplication* self, FlView *view)
20+
-{
21+
- gtk_widget_show(gtk_widget_get_toplevel(GTK_WIDGET(view)));
22+
-}
23+
-
24+
// Implements GApplication::activate.
25+
static void my_application_activate(GApplication* application) {
26+
MyApplication* self = MY_APPLICATION(application);
27+
@@ -66,9 +60,8 @@ static void my_application_activate(GApplication* application) {
28+
gtk_widget_show(GTK_WIDGET(view));
29+
gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view));
30+
31+
- // Show the window when Flutter renders.
32+
- // Requires the view to be realized so we can start rendering.
33+
- g_signal_connect_swapped(view, "first-frame", G_CALLBACK(first_frame_cb), self);
34+
+ // Realize the view so Flutter can render even if the window stays hidden
35+
+ // until Dart startup logic explicitly shows it.
36+
gtk_widget_realize(GTK_WIDGET(view));
37+
38+
fl_register_plugins(FL_PLUGIN_REGISTRY(view));

archlinuxcn/flclash/PKGBUILD

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ source=(
4646
"0001-fix-build-error.patch"
4747
"0002-fix-early-return-when-hotkey-not-found-in-map.patch"
4848
"0003-use-local-hotkey_manager.patch"
49+
"0004-fix-silent-launching.patch"
4950
"com.follow.clash.desktop"
5051
"Clash.Meta::git+https://github.com/chen08209/Clash.Meta.git"
5152
"flutter_distributor::git+https://github.com/chen08209/flutter_distributor.git"
@@ -56,6 +57,7 @@ sha256sums=('aaf8c535929ecc642637334799f8396301fbc39a3ea25b2c9a8afdabf4a7e34d'
5657
'b551c46a1577758c13bdd07868d41e4de817c6184114e1b10d39e04ae572a76a'
5758
'b2791f04cd6d0752cc5b0746eec6b3b959def21eb21bfc3cf594deef8c8777d0'
5859
'2c1b44a63729e8882e6f1e061d018f006450403d968aafd1046b0cdf79e50d90'
60+
'bd47657615b3f0925407af1ee5841121374e7c4e4db3b84df3625a9da9820222'
5961
'0601176d0b5df7aafb3c949417b7f0d98ab17d21b6fcc89c6f83a7e031bbe45d'
6062
'SKIP'
6163
'SKIP'
@@ -74,6 +76,8 @@ prepare() {
7476
git -c protocol.file.allow=always submodule update
7577
patch -p1 -i "${srcdir}/0001-fix-build-error.patch"
7678
patch -p1 -i "${srcdir}/0003-use-local-hotkey_manager.patch"
79+
# https://github.com/chen08209/FlClash/pull/1912
80+
patch -p1 -i "${srcdir}/0004-fix-silent-launching.patch"
7781

7882
# go mod download
7983
cd "$srcdir/$pkgname/core"

0 commit comments

Comments
 (0)