]> Eric's Git Repo - sqlbuddy.git/commitdiff
One window support master
authorEric Wertz <ericdwertz@gmail.com>
Thu, 31 Aug 2017 15:31:17 +0000 (11:31 -0400)
committerEric Wertz <ericdwertz@gmail.com>
Thu, 31 Aug 2017 15:31:17 +0000 (11:31 -0400)
main.c

diff --git a/main.c b/main.c
index fa1eb45e0f45686900a13b27fa5e818817dff1f1..5e45017935e660d2ddd97feeba3408c30573cfd6 100644 (file)
--- a/main.c
+++ b/main.c
@@ -333,6 +333,12 @@ gpointer execute_input( gpointer data )
     return NULL;
 }
 
+gboolean bring_window_to_front( gpointer user )
+{
+    gtk_window_present( GTK_WINDOW( result_window ) );
+    return FALSE;
+}
+
 gpointer fifo_reader( gpointer data )
 {
     char buffer[BUFFER_SIZE];
@@ -344,7 +350,8 @@ gpointer fifo_reader( gpointer data )
         buffer_len = read(fifofd, buffer, BUFFER_SIZE);
         if( buffer_len > 0 )
         {
-            printf( "Read from fifo: %s\n", buffer );
+            //Bring the window to the front and execute the buffer
+            gdk_threads_add_idle( bring_window_to_front, NULL ); 
             g_thread_new( "sqlstuff", execute_input, (gpointer)buffer );
         }
     }