-
Notifications
You must be signed in to change notification settings - Fork 0
Enhance C++ compatibility and window display logic #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,10 @@ | |
| #include <string> | ||
| #include <unordered_map> | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| // Detect WebKit version for API compatibility | ||
| // webkit2gtk-4.1 deprecates webkit_web_view_run_javascript in favor of webkit_web_view_evaluate_javascript | ||
| #if WEBKIT_MAJOR_VERSION > 2 || (WEBKIT_MAJOR_VERSION == 2 && WEBKIT_MINOR_VERSION >= 40) | ||
|
|
@@ -491,7 +495,10 @@ MoonValue* moon_gui_create(MoonValue* options) { | |
|
|
||
| // Store window | ||
| g_windows[win->id] = win; | ||
|
|
||
|
|
||
| // By default, show window after webview finished loading | ||
| win->showPending = true; | ||
|
|
||
| return moon_int(win->id); | ||
| } | ||
|
|
||
|
|
@@ -1085,3 +1092,7 @@ void moon_gui_tray_on_click(MoonValue* callback) {} | |
| void moon_gui_show_window(MoonValue* show) {} | ||
|
|
||
| #endif // MOON_PLATFORM_LINUX && !MOON_NO_GUI | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
|
Comment on lines
+1096
to
+1097
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The added Useful? React with 👍 / 👎. |
||
| #endif | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initializing
win->showPending = truefor every new window means the firstWEBKIT_LOAD_FINISHEDwill always callgtk_widget_show_all. If an app hides the window before load completion viagui_show(false)orgui_show_win(id,false), those hide paths do not clearshowPending, so the load callback re-shows the window unexpectedly; this regresses hidden/tray startup flows.Useful? React with 👍 / 👎.