fix cli url parse
This commit is contained in:
parent
8df9b661dc
commit
e397b14dbe
2
rose.c
2
rose.c
|
@ -109,7 +109,7 @@ static void run(GtkApplication *app)
|
|||
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);
|
||||
}
|
||||
|
||||
|
|
6
window.c
6
window.c
|
@ -102,14 +102,14 @@ static void rose_window_init(RoseWindow *window)
|
|||
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 *webview = rose_webview_new();
|
||||
window->webview = WEBKIT_WEB_VIEW(webview);
|
||||
|
||||
if (homepage)
|
||||
rose_webview_load_url(WEBKIT_WEB_VIEW(webview), homepage);
|
||||
if (url)
|
||||
rose_webview_load_url(WEBKIT_WEB_VIEW(webview), url);
|
||||
|
||||
gtk_window_set_child(GTK_WINDOW(w), GTK_WIDGET(webview));
|
||||
|
||||
|
|
2
window.h
2
window.h
|
@ -11,7 +11,7 @@ G_BEGIN_DECLS
|
|||
G_DECLARE_FINAL_TYPE(RoseWindow, rose_window, ROSE, WINDOW, GtkApplicationWindow)
|
||||
|
||||
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);
|
||||
|
||||
void rose_window_set_webview(RoseWindow *window, GtkWidget *webview);
|
||||
|
|
Loading…
Reference in New Issue
Block a user