comparison finch/libgnt/gntmain.c @ 20309:d256249b22ea

applied changes from 4bbc209c8076ef89135700af844ec6bb04602c0a through 43311ea3963dadd958af56847cc36df60507673f
author Luke Schierer <lschiere@pidgin.im>
date Fri, 19 Oct 2007 17:10:50 +0000
parents 3c415481a943
children e119edfc0fb0 9187d331aebe
comparison
equal deleted inserted replaced
20308:c2d3c9fc71b5 20309:d256249b22ea
221 io_invoke(GIOChannel *source, GIOCondition cond, gpointer null) 221 io_invoke(GIOChannel *source, GIOCondition cond, gpointer null)
222 { 222 {
223 char keys[256]; 223 char keys[256];
224 int rd; 224 int rd;
225 char *k; 225 char *k;
226 char *cvrt = NULL;
226 227
227 if (wm->mode == GNT_KP_MODE_WAIT_ON_CHILD) 228 if (wm->mode == GNT_KP_MODE_WAIT_ON_CHILD)
228 return FALSE; 229 return FALSE;
229 230
230 rd = read(STDIN_FILENO, keys + HOLDING_ESCAPE, sizeof(keys) - 1 - HOLDING_ESCAPE); 231 rd = read(STDIN_FILENO, keys + HOLDING_ESCAPE, sizeof(keys) - 1 - HOLDING_ESCAPE);
241 endwin(); 242 endwin();
242 printf("EOF\n"); 243 printf("EOF\n");
243 raise(SIGABRT); 244 raise(SIGABRT);
244 } 245 }
245 246
246 gnt_wm_set_event_stack(wm, TRUE);
247 rd += HOLDING_ESCAPE; 247 rd += HOLDING_ESCAPE;
248 keys[rd] = 0;
249 if (mouse_enabled && detect_mouse_action(keys))
250 goto end;
251
252 if (HOLDING_ESCAPE) 248 if (HOLDING_ESCAPE)
253 keys[0] = '\033'; 249 keys[0] = '\033';
254 k = keys; 250 keys[rd] = 0;
251 gnt_wm_set_event_stack(wm, TRUE);
252
253 cvrt = g_locale_to_utf8(keys, rd, (gsize*)&rd, NULL, NULL);
254 k = cvrt ? cvrt : keys;
255 if (mouse_enabled && detect_mouse_action(k))
256 goto end;
255 257
256 #if 0 258 #if 0
257 /* I am not sure what's happening here. If this actually does something, 259 /* I am not sure what's happening here. If this actually does something,
258 * then this needs to go in gnt_keys_refine. */ 260 * then this needs to go in gnt_keys_refine. */
259 if (*k < 0) { /* Alt not sending ESC* */ 261 if (*k < 0) { /* Alt not sending ESC* */
288 rd -= p; 290 rd -= p;
289 k += p; 291 k += p;
290 } 292 }
291 end: 293 end:
292 gnt_wm_set_event_stack(wm, FALSE); 294 gnt_wm_set_event_stack(wm, FALSE);
295 g_free(cvrt);
293 return TRUE; 296 return TRUE;
294 } 297 }
295 298
296 static void 299 static void
297 setup_io() 300 setup_io()