]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
handles window close event for running on large screens
authorJohn Melton g0orx/n6lyt <john.d.melton@googlemail.com>
Mon, 2 May 2016 07:09:24 +0000 (07:09 +0000)
committerJohn Melton g0orx/n6lyt <john.d.melton@googlemail.com>
Mon, 2 May 2016 07:09:24 +0000 (07:09 +0000)
main.c
pihpsdr
release/pihpsdr.tar
release/pihpsdr/pihpsdr

diff --git a/main.c b/main.c
index 411554bd79cef4df456ee5f07d5c71de3d6a7697..b5bbb6f2d9721a7196e152d340140f5ac582b9b0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -662,6 +662,18 @@ static void* wisdom_thread(void *arg) {
   sem_post(&wisdom_sem);
 }
 
+gboolean main_delete (GtkWidget *widget) {
+#ifdef INCLUDE_GPIO
+  gpio_close();
+#endif
+  if(protocol==ORIGINAL_PROTOCOL) {
+    old_protocol_stop();
+  } else {
+    new_protocol_stop();
+  }
+  _exit(0);
+}
+
 gint init(void* arg) {
 
   GtkWidget *window;
@@ -852,6 +864,7 @@ gint init(void* arg) {
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title (GTK_WINDOW (window), "pihpsdr");
   gtk_container_set_border_width (GTK_CONTAINER (window), 0);
+  g_signal_connect (window, "delete-event", G_CALLBACK (main_delete), NULL);
 
 #ifdef GRID_LAYOUT
   grid = gtk_grid_new();
diff --git a/pihpsdr b/pihpsdr
index 735b8cf309a4daa891889e375cb371eb559665e2..86678a96eca17781fc0007e308c61a4537ee6a88 100755 (executable)
Binary files a/pihpsdr and b/pihpsdr differ
index 6ff19b8998e325224439638473c603f773d8e122..185f2388fbc8ef5c9ee7e6135efa5fd0d96a09bf 100644 (file)
Binary files a/release/pihpsdr.tar and b/release/pihpsdr.tar differ
index 735b8cf309a4daa891889e375cb371eb559665e2..86678a96eca17781fc0007e308c61a4537ee6a88 100755 (executable)
Binary files a/release/pihpsdr/pihpsdr and b/release/pihpsdr/pihpsdr differ