From ffc2fc8762f7f496162e4c2fa0d535a9fe1a27fe Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 14 Mar 2021 10:12:06 +0100 Subject: Initialize a GApplication --- badwolf.c | 7 +++++++ keybindings.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/badwolf.c b/badwolf.c index 1202944..6ef4cf3 100644 --- a/badwolf.c +++ b/badwolf.c @@ -1035,11 +1035,18 @@ int main(int argc, char *argv[]) { struct Window *window = &(struct Window){NULL, NULL, NULL, NULL, NULL, NULL}; + GApplication *application; setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, DATADIR "/locale"); bind_textdomain_codeset(PACKAGE, "UTF-8"); textdomain(PACKAGE); + application = g_application_new("me.hacktivis.badwolf", + G_APPLICATION_HANDLES_COMMAND_LINE | + G_APPLICATION_SEND_ENVIRONMENT | G_APPLICATION_NON_UNIQUE); + g_application_register(application, NULL, NULL); + //g_application_activate(application); + gtk_init(&argc, &argv); fprintf(stderr, _("Running Badwolf version: %s\n"), version); diff --git a/keybindings.c b/keybindings.c index cb033fd..7108acd 100644 --- a/keybindings.c +++ b/keybindings.c @@ -102,7 +102,7 @@ commonCb_key_press_event(struct Window *window, GdkEvent *event, struct Client * return TRUE; case GDK_KEY_p: webkit_print_operation_run_dialog(webkit_print_operation_new(browser->webView), - GTK_WINDOW(browser->window)); + GTK_WINDOW(browser->window->main_window)); return TRUE; } } -- cgit v1.3.1-23-gd82d