comparison finch/libgnt/gntmain.c @ 18425:84d318eadc62

The input was causing some weird issues. This fixes it.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 03 Jul 2007 11:09:19 +0000
parents e16d097c5739
children ec80e921818c c6282dc3fb9f
comparison
equal deleted inserted replaced
18424:0b71d043a1f1 18425:84d318eadc62
63 * 63 *
64 * Need to wattrset for colors to use with PDCurses. 64 * Need to wattrset for colors to use with PDCurses.
65 */ 65 */
66 66
67 static GIOChannel *channel = NULL; 67 static GIOChannel *channel = NULL;
68 static int channel_read_callback;
68 69
69 static gboolean ascii_only; 70 static gboolean ascii_only;
70 static gboolean mouse_enabled; 71 static gboolean mouse_enabled;
71 72
72 static void setup_io(void); 73 static void setup_io(void);
291 g_io_channel_set_encoding(channel, NULL, NULL); 292 g_io_channel_set_encoding(channel, NULL, NULL);
292 g_io_channel_set_buffered(channel, FALSE); 293 g_io_channel_set_buffered(channel, FALSE);
293 g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL ); 294 g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL );
294 #endif 295 #endif
295 296
296 result = g_io_add_watch_full(channel, G_PRIORITY_HIGH, 297 channel_read_callback = result = g_io_add_watch_full(channel, G_PRIORITY_HIGH,
297 (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI), 298 (G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_PRI),
298 io_invoke, NULL, NULL); 299 io_invoke, NULL, NULL);
299 300
300 g_io_add_watch_full(channel, G_PRIORITY_HIGH, 301 g_io_add_watch_full(channel, G_PRIORITY_HIGH,
301 (G_IO_NVAL), 302 (G_IO_NVAL),
654 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD, 655 G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD,
655 (GSpawnChildSetupFunc)endwin, NULL, 656 (GSpawnChildSetupFunc)endwin, NULL,
656 &pid, stin, stout, sterr, NULL)) 657 &pid, stin, stout, sterr, NULL))
657 return FALSE; 658 return FALSE;
658 659
660 g_source_remove(channel_read_callback);
659 wm->mode = GNT_KP_MODE_WAIT_ON_CHILD; 661 wm->mode = GNT_KP_MODE_WAIT_ON_CHILD;
660 g_child_watch_add(pid, reap_child, NULL); 662 g_child_watch_add(pid, reap_child, NULL);
661 663
662 return TRUE; 664 return TRUE;
663 #else 665 #else