diff --git a/rose.c b/rose.c index bf16d7a..ec6ab74 100644 --- a/rose.c +++ b/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); } diff --git a/window.c b/window.c index 289bbaa..816b8e0 100644 --- a/window.c +++ b/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)); diff --git a/window.h b/window.h index a238a2a..0463c0f 100644 --- a/window.h +++ b/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);