fix cli url parse

This commit is contained in:
fenze 2022-05-11 03:26:23 +02:00
parent 8df9b661dc
commit e397b14dbe
3 changed files with 5 additions and 5 deletions

2
rose.c
View File

@ -109,7 +109,7 @@ static void run(GtkApplication *app)
g_object_set(gtk_settings_get_default(), "gtk-application-prefer-dark-theme", true, NULL); g_object_set(gtk_settings_get_default(), "gtk-application-prefer-dark-theme", true, NULL);
} }
xid = rose_window_show(app, window); xid = rose_window_show(app, window, homepage);
setatom(AtomUri, homepage); setatom(AtomUri, homepage);
} }

View File

@ -102,14 +102,14 @@ static void rose_window_init(RoseWindow *window)
window->window = GTK_WINDOW(gtk_window_new()); window->window = GTK_WINDOW(gtk_window_new());
} }
guint rose_window_show(GtkApplication *app, RoseWindow *window) guint rose_window_show(GtkApplication *app, RoseWindow *window, const char *url)
{ {
GtkWidget *w = gtk_application_window_new(app); GtkWidget *w = gtk_application_window_new(app);
GtkWidget *webview = rose_webview_new(); GtkWidget *webview = rose_webview_new();
window->webview = WEBKIT_WEB_VIEW(webview); window->webview = WEBKIT_WEB_VIEW(webview);
if (homepage) if (url)
rose_webview_load_url(WEBKIT_WEB_VIEW(webview), homepage); rose_webview_load_url(WEBKIT_WEB_VIEW(webview), url);
gtk_window_set_child(GTK_WINDOW(w), GTK_WIDGET(webview)); gtk_window_set_child(GTK_WINDOW(w), GTK_WIDGET(webview));

View File

@ -11,7 +11,7 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE(RoseWindow, rose_window, ROSE, WINDOW, GtkApplicationWindow) G_DECLARE_FINAL_TYPE(RoseWindow, rose_window, ROSE, WINDOW, GtkApplicationWindow)
RoseWindow* rose_window_new(); RoseWindow* rose_window_new();
guint rose_window_show(GtkApplication *app, RoseWindow *window); guint rose_window_show(GtkApplication *app, RoseWindow *window, const char *url);
gboolean rose_window_close(RoseWindow *window); gboolean rose_window_close(RoseWindow *window);
void rose_window_set_webview(RoseWindow *window, GtkWidget *webview); void rose_window_set_webview(RoseWindow *window, GtkWidget *webview);