Mercurial > emacs
comparison src/xterm.c @ 106897:68e28bd7d00a
Add bug number.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Mon, 18 Jan 2010 10:07:25 +0900 |
| parents | e9a9fc07702f |
| children | f257bf772280 |
comparison
equal
deleted
inserted
replaced
| 106896:00c4f0387055 | 106897:68e28bd7d00a |
|---|---|
| 5795 GdkEvent *ev; | 5795 GdkEvent *ev; |
| 5796 gpointer data; | 5796 gpointer data; |
| 5797 { | 5797 { |
| 5798 XEvent *xev = (XEvent *) gxev; | 5798 XEvent *xev = (XEvent *) gxev; |
| 5799 | 5799 |
| 5800 BLOCK_INPUT; | |
| 5800 if (current_count >= 0) | 5801 if (current_count >= 0) |
| 5801 { | 5802 { |
| 5802 struct x_display_info *dpyinfo; | 5803 struct x_display_info *dpyinfo; |
| 5803 | 5804 |
| 5804 dpyinfo = x_display_info_for_display (xev->xany.display); | 5805 dpyinfo = x_display_info_for_display (xev->xany.display); |
| 5805 | 5806 |
| 5806 #ifdef HAVE_X_I18N | 5807 #ifdef HAVE_X_I18N |
| 5807 /* Filter events for the current X input method. | 5808 /* Filter events for the current X input method. |
| 5808 GTK calls XFilterEvent but not for key press and release, | 5809 GTK calls XFilterEvent but not for key press and release, |
| 5809 so we do it here. */ | 5810 so we do it here. */ |
| 5810 if (xev->type == KeyPress || xev->type == KeyRelease) | 5811 if ((xev->type == KeyPress || xev->type == KeyRelease) |
| 5811 if (dpyinfo && x_filter_event (dpyinfo, xev)) | 5812 && dpyinfo |
| 5812 return GDK_FILTER_REMOVE; | 5813 && x_filter_event (dpyinfo, xev)) |
| 5814 { | |
| 5815 UNBLOCK_INPUT; | |
| 5816 return GDK_FILTER_REMOVE; | |
| 5817 } | |
| 5813 #endif | 5818 #endif |
| 5814 | 5819 |
| 5815 if (! dpyinfo) | 5820 if (! dpyinfo) |
| 5816 current_finish = X_EVENT_NORMAL; | 5821 current_finish = X_EVENT_NORMAL; |
| 5817 else | 5822 else |
| 5818 { | 5823 current_count += |
| 5819 current_count += | 5824 handle_one_xevent (dpyinfo, xev, ¤t_finish, |
| 5820 handle_one_xevent (dpyinfo, xev, ¤t_finish, | 5825 current_hold_quit); |
| 5821 current_hold_quit); | |
| 5822 } | |
| 5823 } | 5826 } |
| 5824 else | 5827 else |
| 5825 current_finish = x_dispatch_event (xev, xev->xany.display); | 5828 current_finish = x_dispatch_event (xev, xev->xany.display); |
| 5829 | |
| 5830 UNBLOCK_INPUT; | |
| 5826 | 5831 |
| 5827 if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP) | 5832 if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP) |
| 5828 return GDK_FILTER_REMOVE; | 5833 return GDK_FILTER_REMOVE; |
| 5829 | 5834 |
| 5830 return GDK_FILTER_CONTINUE; | 5835 return GDK_FILTER_CONTINUE; |
| 9819 struct frame *f; | 9824 struct frame *f; |
| 9820 int pixmap_id; | 9825 int pixmap_id; |
| 9821 { | 9826 { |
| 9822 Pixmap icon_pixmap, icon_mask; | 9827 Pixmap icon_pixmap, icon_mask; |
| 9823 | 9828 |
| 9824 #ifndef USE_X_TOOLKIT | 9829 #if !defined USE_X_TOOLKIT && !defined USE_GTK |
| 9825 Window window = FRAME_OUTER_WINDOW (f); | 9830 Window window = FRAME_OUTER_WINDOW (f); |
| 9826 #endif | 9831 #endif |
| 9827 | 9832 |
| 9828 if (pixmap_id > 0) | 9833 if (pixmap_id > 0) |
| 9829 { | 9834 { |
| 10074 { | 10079 { |
| 10075 #define NUM_ARGV 10 | 10080 #define NUM_ARGV 10 |
| 10076 int argc; | 10081 int argc; |
| 10077 char *argv[NUM_ARGV]; | 10082 char *argv[NUM_ARGV]; |
| 10078 char **argv2 = argv; | 10083 char **argv2 = argv; |
| 10079 GdkAtom atom; | |
| 10080 guint id; | 10084 guint id; |
| 10081 #ifndef HAVE_GTK_MULTIDISPLAY | 10085 #ifndef HAVE_GTK_MULTIDISPLAY |
| 10082 if (!EQ (Vinitial_window_system, Qx)) | 10086 if (!EQ (Vinitial_window_system, Qx)) |
| 10083 error ("Sorry, you cannot connect to X servers with the GTK toolkit"); | 10087 error ("Sorry, you cannot connect to X servers with the GTK toolkit"); |
| 10084 #endif | 10088 #endif |
| 10213 else | 10217 else |
| 10214 { | 10218 { |
| 10215 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); | 10219 terminal->kboard = (KBOARD *) xmalloc (sizeof (KBOARD)); |
| 10216 init_kboard (terminal->kboard); | 10220 init_kboard (terminal->kboard); |
| 10217 terminal->kboard->Vwindow_system = Qx; | 10221 terminal->kboard->Vwindow_system = Qx; |
| 10222 | |
| 10223 /* Add the keyboard to the list before running Lisp code (via | |
| 10224 Qvendor_specific_keysyms below), since these are not traced | |
| 10225 via terminals but only through all_kboards. */ | |
| 10226 terminal->kboard->next_kboard = all_kboards; | |
| 10227 all_kboards = terminal->kboard; | |
| 10228 | |
| 10218 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) | 10229 if (!EQ (XSYMBOL (Qvendor_specific_keysyms)->function, Qunbound)) |
| 10219 { | 10230 { |
| 10220 char *vendor = ServerVendor (dpy); | 10231 char *vendor = ServerVendor (dpy); |
| 10221 /* Temporarily hide the partially initialized terminal, | 10232 |
| 10222 but make sure it doesn't get garbage collected. */ | 10233 /* Protect terminal from GC before removing it from the |
| 10223 int count = inhibit_garbage_collection (); | 10234 list of terminals. */ |
| 10235 struct gcpro gcpro1; | |
| 10236 Lisp_Object gcpro_term; | |
| 10237 XSETTERMINAL (gcpro_term, terminal); | |
| 10238 GCPRO1 (gcpro_term); | |
| 10239 | |
| 10240 /* Temporarily hide the partially initialized terminal. */ | |
| 10224 terminal_list = terminal->next_terminal; | 10241 terminal_list = terminal->next_terminal; |
| 10225 UNBLOCK_INPUT; | 10242 UNBLOCK_INPUT; |
| 10226 terminal->kboard->Vsystem_key_alist | 10243 terminal->kboard->Vsystem_key_alist |
| 10227 = call1 (Qvendor_specific_keysyms, | 10244 = call1 (Qvendor_specific_keysyms, |
| 10228 vendor ? build_string (vendor) : empty_unibyte_string); | 10245 vendor ? build_string (vendor) : empty_unibyte_string); |
| 10229 BLOCK_INPUT; | 10246 BLOCK_INPUT; |
| 10230 unbind_to (count, Qnil); | |
| 10231 terminal->next_terminal = terminal_list; | 10247 terminal->next_terminal = terminal_list; |
| 10232 terminal_list = terminal; | 10248 terminal_list = terminal; |
| 10249 UNGCPRO; | |
| 10233 } | 10250 } |
| 10234 | 10251 |
| 10235 terminal->kboard->next_kboard = all_kboards; | |
| 10236 all_kboards = terminal->kboard; | |
| 10237 /* Don't let the initial kboard remain current longer than necessary. | 10252 /* Don't let the initial kboard remain current longer than necessary. |
| 10238 That would cause problems if a file loaded on startup tries to | 10253 That would cause problems if a file loaded on startup tries to |
| 10239 prompt in the mini-buffer. */ | 10254 prompt in the mini-buffer. */ |
| 10240 if (current_kboard == initial_kboard) | 10255 if (current_kboard == initial_kboard) |
| 10241 current_kboard = terminal->kboard; | 10256 current_kboard = terminal->kboard; |
| 10580 | 10595 |
| 10581 void | 10596 void |
| 10582 x_delete_display (dpyinfo) | 10597 x_delete_display (dpyinfo) |
| 10583 struct x_display_info *dpyinfo; | 10598 struct x_display_info *dpyinfo; |
| 10584 { | 10599 { |
| 10585 int i; | |
| 10586 struct terminal *t; | 10600 struct terminal *t; |
| 10587 | 10601 |
| 10588 /* Close all frames and delete the generic struct terminal for this | 10602 /* Close all frames and delete the generic struct terminal for this |
| 10589 X display. */ | 10603 X display. */ |
| 10590 for (t = terminal_list; t; t = t->next_terminal) | 10604 for (t = terminal_list; t; t = t->next_terminal) |
| 10732 /* This function is called when the last frame on a display is deleted. */ | 10746 /* This function is called when the last frame on a display is deleted. */ |
| 10733 void | 10747 void |
| 10734 x_delete_terminal (struct terminal *terminal) | 10748 x_delete_terminal (struct terminal *terminal) |
| 10735 { | 10749 { |
| 10736 struct x_display_info *dpyinfo = terminal->display_info.x; | 10750 struct x_display_info *dpyinfo = terminal->display_info.x; |
| 10737 int i; | |
| 10738 | 10751 |
| 10739 /* Protect against recursive calls. delete_frame in | 10752 /* Protect against recursive calls. delete_frame in |
| 10740 delete_terminal calls us back when it deletes our last frame. */ | 10753 delete_terminal calls us back when it deletes our last frame. */ |
| 10741 if (!terminal->name) | 10754 if (!terminal->name) |
| 10742 return; | 10755 return; |
