console/libgnt/gntmain.c

changeset 13973
99603d7e2662
parent 13969
0541f389442e
child 13978
70d7030b7f26
equal deleted inserted replaced
13972:50b7226d8519 13973:99603d7e2662
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <locale.h> 8 #include <locale.h>
9 #include <unistd.h> 9 #include <unistd.h>
10 #include <string.h> 10 #include <string.h>
11 11
12 static int lock_focus_list;
12 static GList *focus_list; 13 static GList *focus_list;
14
13 static int X_MIN; 15 static int X_MIN;
14 static int X_MAX; 16 static int X_MAX;
15 static int Y_MIN; 17 static int Y_MIN;
16 static int Y_MAX; 18 static int Y_MAX;
17 19
39 41
40 void gnt_screen_take_focus(GntWidget *widget) 42 void gnt_screen_take_focus(GntWidget *widget)
41 { 43 {
42 GntWidget *w = NULL; 44 GntWidget *w = NULL;
43 45
46 if (lock_focus_list)
47 return;
48
44 if (focus_list) 49 if (focus_list)
45 w = focus_list->data; 50 w = focus_list->data;
46 51
47 /* XXX: ew */ 52 /* XXX: ew */
48 focus_list = g_list_first(focus_list); 53 focus_list = g_list_first(focus_list);
57 62
58 void gnt_screen_remove_widget(GntWidget *widget) 63 void gnt_screen_remove_widget(GntWidget *widget)
59 { 64 {
60 int pos = g_list_index(g_list_first(focus_list), widget); 65 int pos = g_list_index(g_list_first(focus_list), widget);
61 GList *next; 66 GList *next;
67
68 if (lock_focus_list)
69 return;
62 70
63 if (pos == -1) 71 if (pos == -1)
64 return; 72 return;
65 73
66 focus_list = g_list_first(focus_list); 74 focus_list = g_list_first(focus_list);
295 changed = TRUE; 303 changed = TRUE;
296 } 304 }
297 305
298 if (changed) 306 if (changed)
299 { 307 {
308 lock_focus_list = 1;
300 gnt_widget_hide(widget); 309 gnt_widget_hide(widget);
301 gnt_widget_set_position(widget, x, y); 310 gnt_widget_set_position(widget, x, y);
302 gnt_widget_show(widget); 311 gnt_widget_show(widget);
312 lock_focus_list = 0;
303 } 313 }
304 } 314 }
305 else if (*buffer == '\r') 315 else if (*buffer == '\r')
306 { 316 {
307 mode = GNT_KP_MODE_NORMAL; 317 mode = GNT_KP_MODE_NORMAL;

mercurial