From 0f27b81f7641348c99505ea9ea61575a3cc0ef88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Wed, 13 Jan 2021 22:46:44 +0100 Subject: [PATCH] drag_window add logging. --- internal/desktop/gtk/gtk.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/desktop/gtk/gtk.c b/internal/desktop/gtk/gtk.c index 4840d262..ffdb0ff1 100644 --- a/internal/desktop/gtk/gtk.c +++ b/internal/desktop/gtk/gtk.c @@ -54,13 +54,16 @@ static void drag_end( } void drag_window(char **uris) { - gtk_init(NULL, NULL); + if (gtk_init_check(NULL, NULL) == FALSE) { + fprintf(stderr, "Unable to initialize GTK for drag and drop widget!\n"); + return; + } GtkWidget *widget = gtk_window_new(GTK_WINDOW_TOPLEVEL); GtkWindow *window = GTK_WINDOW(widget); gtk_window_move(window, 0, 0); - gtk_window_set_title(window, "neko-drop"); + gtk_window_set_title(window, "Neko Drag & Drop Window"); gtk_window_set_decorated(window, FALSE); gtk_window_set_keep_above(window, TRUE); gtk_window_set_default_size(window, 0, 0); @@ -76,6 +79,7 @@ void drag_window(char **uris) { g_signal_connect(widget, "drag-end", G_CALLBACK(drag_end), NULL); g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL); + fprintf(stderr, "Preparing to show drag and drop widget.\n"); gtk_widget_show_all(widget); gtk_main(); }