diff options
| author | Po Lu | 2022-01-10 09:00:48 +0800 |
|---|---|---|
| committer | Po Lu | 2022-01-10 09:00:48 +0800 |
| commit | 8d0a2e4dce41fd811319e94e5f01e5fcf8b3c62a (patch) | |
| tree | c591be380801b6d33a0decade89a34248fdd9efe /src | |
| parent | 0f5f2af51ecc4a67c1b4875d2af4dc19fdb8e392 (diff) | |
| download | emacs-8d0a2e4dce41fd811319e94e5f01e5fcf8b3c62a.tar.gz emacs-8d0a2e4dce41fd811319e94e5f01e5fcf8b3c62a.zip | |
Fix build without X11 I18N
* src/xterm.c (event_handler_gdk):
(handle_one_xevent):
(x_draw_window_cursor):
(x_term_init): Fix build without HAVE_X_I18N.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 58 |
1 files changed, 51 insertions, 7 deletions
diff --git a/src/xterm.c b/src/xterm.c index 36b245ddc35..5e4941a4aed 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -194,8 +194,10 @@ static int x_noop_count; | |||
| 194 | static Lisp_Object xg_default_icon_file; | 194 | static Lisp_Object xg_default_icon_file; |
| 195 | #endif | 195 | #endif |
| 196 | 196 | ||
| 197 | #ifdef HAVE_X_I18N | ||
| 197 | /* Some functions take this as char *, not const char *. */ | 198 | /* Some functions take this as char *, not const char *. */ |
| 198 | static char emacs_class[] = EMACS_CLASS; | 199 | static char emacs_class[] = EMACS_CLASS; |
| 200 | #endif | ||
| 199 | 201 | ||
| 200 | enum xembed_info | 202 | enum xembed_info |
| 201 | { | 203 | { |
| @@ -8333,6 +8335,38 @@ event_handler_gdk (GdkXEvent *gxev, GdkEvent *ev, gpointer data) | |||
| 8333 | unblock_input (); | 8335 | unblock_input (); |
| 8334 | return GDK_FILTER_REMOVE; | 8336 | return GDK_FILTER_REMOVE; |
| 8335 | } | 8337 | } |
| 8338 | #elif USE_GTK | ||
| 8339 | if (dpyinfo && (dpyinfo->prefer_native_input | ||
| 8340 | || x_gtk_use_native_input) | ||
| 8341 | && (xev->type == KeyPress | ||
| 8342 | #ifdef HAVE_XINPUT2 | ||
| 8343 | /* GTK claims cookies for us, so we don't have to claim | ||
| 8344 | them here. */ | ||
| 8345 | || (dpyinfo->supports_xi2 | ||
| 8346 | && xev->type == GenericEvent | ||
| 8347 | && (xev->xgeneric.extension | ||
| 8348 | == dpyinfo->xi2_opcode) | ||
| 8349 | && (xev->xgeneric.evtype | ||
| 8350 | == XI_KeyPress)) | ||
| 8351 | #endif | ||
| 8352 | )) | ||
| 8353 | { | ||
| 8354 | struct frame *f; | ||
| 8355 | |||
| 8356 | #ifdef HAVE_XINPUT2 | ||
| 8357 | if (xev->type == GenericEvent) | ||
| 8358 | f = x_any_window_to_frame (dpyinfo, | ||
| 8359 | ((XIDeviceEvent *) xev->xcookie.data)->event); | ||
| 8360 | else | ||
| 8361 | #endif | ||
| 8362 | f = x_any_window_to_frame (dpyinfo, xev->xany.window); | ||
| 8363 | |||
| 8364 | if (f && xg_filter_key (f, xev)) | ||
| 8365 | { | ||
| 8366 | unblock_input (); | ||
| 8367 | return GDK_FILTER_REMOVE; | ||
| 8368 | } | ||
| 8369 | } | ||
| 8336 | #endif | 8370 | #endif |
| 8337 | 8371 | ||
| 8338 | if (! dpyinfo) | 8372 | if (! dpyinfo) |
| @@ -10727,6 +10761,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 10727 | goto XI_OTHER; | 10761 | goto XI_OTHER; |
| 10728 | #endif | 10762 | #endif |
| 10729 | 10763 | ||
| 10764 | x_display_set_last_user_time (dpyinfo, xev->time); | ||
| 10765 | ignore_next_mouse_click_timeout = 0; | ||
| 10766 | |||
| 10767 | f = x_any_window_to_frame (dpyinfo, xev->event); | ||
| 10768 | |||
| 10730 | XKeyPressedEvent xkey; | 10769 | XKeyPressedEvent xkey; |
| 10731 | 10770 | ||
| 10732 | memset (&xkey, 0, sizeof xkey); | 10771 | memset (&xkey, 0, sizeof xkey); |
| @@ -10761,6 +10800,14 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 10761 | goto XI_OTHER; | 10800 | goto XI_OTHER; |
| 10762 | } | 10801 | } |
| 10763 | #endif | 10802 | #endif |
| 10803 | #elif USE_GTK | ||
| 10804 | if ((x_gtk_use_native_input | ||
| 10805 | || dpyinfo->prefer_native_input) | ||
| 10806 | && xg_filter_key (any, event)) | ||
| 10807 | { | ||
| 10808 | *finish = X_EVENT_DROP; | ||
| 10809 | goto XI_OTHER; | ||
| 10810 | } | ||
| 10764 | #endif | 10811 | #endif |
| 10765 | 10812 | ||
| 10766 | #ifdef HAVE_XKB | 10813 | #ifdef HAVE_XKB |
| @@ -10793,11 +10840,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, | |||
| 10793 | if (keysym == NoSymbol) | 10840 | if (keysym == NoSymbol) |
| 10794 | goto XI_OTHER; | 10841 | goto XI_OTHER; |
| 10795 | 10842 | ||
| 10796 | x_display_set_last_user_time (dpyinfo, xev->time); | ||
| 10797 | ignore_next_mouse_click_timeout = 0; | ||
| 10798 | |||
| 10799 | f = x_any_window_to_frame (dpyinfo, xev->event); | ||
| 10800 | |||
| 10801 | /* If mouse-highlight is an integer, input clears out | 10843 | /* If mouse-highlight is an integer, input clears out |
| 10802 | mouse highlighting. */ | 10844 | mouse highlighting. */ |
| 10803 | if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight) | 10845 | if (!hlinfo->mouse_face_hidden && FIXNUMP (Vmouse_highlight) |
| @@ -11754,7 +11796,9 @@ x_draw_window_cursor (struct window *w, struct glyph_row *glyph_row, int x, | |||
| 11754 | int y, enum text_cursor_kinds cursor_type, | 11796 | int y, enum text_cursor_kinds cursor_type, |
| 11755 | int cursor_width, bool on_p, bool active_p) | 11797 | int cursor_width, bool on_p, bool active_p) |
| 11756 | { | 11798 | { |
| 11799 | #ifdef HAVE_X_I18N | ||
| 11757 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 11800 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 11801 | #endif | ||
| 11758 | 11802 | ||
| 11759 | if (on_p) | 11803 | if (on_p) |
| 11760 | { | 11804 | { |
| @@ -15353,13 +15397,13 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 15353 | #endif | 15397 | #endif |
| 15354 | } | 15398 | } |
| 15355 | 15399 | ||
| 15400 | #ifdef HAVE_X_I18N | ||
| 15356 | { | 15401 | { |
| 15357 | AUTO_STRING (inputStyle, "inputStyle"); | 15402 | AUTO_STRING (inputStyle, "inputStyle"); |
| 15358 | AUTO_STRING (InputStyle, "InputStyle"); | 15403 | AUTO_STRING (InputStyle, "InputStyle"); |
| 15359 | Lisp_Object value = gui_display_get_resource (dpyinfo, inputStyle, InputStyle, | 15404 | Lisp_Object value = gui_display_get_resource (dpyinfo, inputStyle, InputStyle, |
| 15360 | Qnil, Qnil); | 15405 | Qnil, Qnil); |
| 15361 | 15406 | ||
| 15362 | #ifdef HAVE_X_I18N | ||
| 15363 | if (STRINGP (value)) | 15407 | if (STRINGP (value)) |
| 15364 | { | 15408 | { |
| 15365 | if (!strcmp (SSDATA (value), "callback")) | 15409 | if (!strcmp (SSDATA (value), "callback")) |
| @@ -15377,8 +15421,8 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 15377 | dpyinfo->prefer_native_input = true; | 15421 | dpyinfo->prefer_native_input = true; |
| 15378 | #endif | 15422 | #endif |
| 15379 | } | 15423 | } |
| 15380 | #endif | ||
| 15381 | } | 15424 | } |
| 15425 | #endif | ||
| 15382 | 15426 | ||
| 15383 | #ifdef HAVE_X_SM | 15427 | #ifdef HAVE_X_SM |
| 15384 | /* Only do this for the very first display in the Emacs session. | 15428 | /* Only do this for the very first display in the Emacs session. |