diff options
| author | Karoly Lorentey | 2006-10-14 17:36:28 +0000 |
|---|---|---|
| committer | Karoly Lorentey | 2006-10-14 17:36:28 +0000 |
| commit | 12b6af5c7ed2cfdb9783312bf890cf1e6c80c67a (patch) | |
| tree | 1775f9fd1c92defd8b61304a08ec00da95bc4539 /src/xterm.c | |
| parent | 3f87f67ee215ffeecbd2f53bd7f342cdf03f47df (diff) | |
| parent | f763da8d0808af7c80d72bc586bf4fcf50b37ddd (diff) | |
| download | emacs-12b6af5c7ed2cfdb9783312bf890cf1e6c80c67a.tar.gz emacs-12b6af5c7ed2cfdb9783312bf890cf1e6c80c67a.zip | |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-413
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-414
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-415
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-416
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-417
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-418
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-419
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-420
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-421
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-422
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-423
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-424
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-425
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-426
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-427
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-428
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-429
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-430
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-431
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-432
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-433
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-434
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-435
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-436
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-437
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-438
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-439
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-440
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-441
lisp/url/url-methods.el: Fix format error when http_proxy is empty string
* emacs@sv.gnu.org/emacs--devo--0--patch-442
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-443
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-444
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-445
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-446
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-447
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-448
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-449
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-450
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-451
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-452
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-453
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-454
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-455
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-456
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-457
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-458
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-459
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-460
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-461
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-462
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-463
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-464
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-465
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-466
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-467
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-468
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-469
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-470
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-471
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-472
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-473
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-128
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-129
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-130
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-131
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-132
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-133
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-134
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-135
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-136
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-137
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-138
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-139
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-140
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-141
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-142
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-143
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-144
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-145
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-146
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-147
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-148
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-149
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-582
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 78 |
1 files changed, 53 insertions, 25 deletions
diff --git a/src/xterm.c b/src/xterm.c index 466037c75a2..95b2a87fd4b 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2701,9 +2701,8 @@ x_draw_glyph_string (s) | |||
| 2701 | if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) | 2701 | if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h)) |
| 2702 | h = 1; | 2702 | h = 1; |
| 2703 | 2703 | ||
| 2704 | if (x_underline_at_descent_line) | 2704 | y = s->y + s->height - h; |
| 2705 | y = s->y + s->height - h; | 2705 | if (!x_underline_at_descent_line) |
| 2706 | else | ||
| 2707 | { | 2706 | { |
| 2708 | /* Get the underline position. This is the recommended | 2707 | /* Get the underline position. This is the recommended |
| 2709 | vertical offset in pixels from the baseline to the top of | 2708 | vertical offset in pixels from the baseline to the top of |
| @@ -4105,6 +4104,9 @@ x_send_scroll_bar_event (window, part, portion, whole) | |||
| 4105 | 4104 | ||
| 4106 | /* Make Xt timeouts work while the scroll bar is active. */ | 4105 | /* Make Xt timeouts work while the scroll bar is active. */ |
| 4107 | toolkit_scroll_bar_interaction = 1; | 4106 | toolkit_scroll_bar_interaction = 1; |
| 4107 | #ifdef USE_X_TOOLKIT | ||
| 4108 | x_activate_timeout_atimer (); | ||
| 4109 | #endif | ||
| 4108 | 4110 | ||
| 4109 | /* Setting the event mask to zero means that the message will | 4111 | /* Setting the event mask to zero means that the message will |
| 4110 | be sent to the client that created the window, and if that | 4112 | be sent to the client that created the window, and if that |
| @@ -6597,7 +6599,7 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit) | |||
| 6597 | { | 6599 | { |
| 6598 | 6600 | ||
| 6599 | /* Generate SELECT_WINDOW_EVENTs when needed. */ | 6601 | /* Generate SELECT_WINDOW_EVENTs when needed. */ |
| 6600 | if (mouse_autoselect_window) | 6602 | if (!NILP (Vmouse_autoselect_window)) |
| 6601 | { | 6603 | { |
| 6602 | Lisp_Object window; | 6604 | Lisp_Object window; |
| 6603 | 6605 | ||
| @@ -7517,7 +7519,7 @@ struct x_error_message_stack { | |||
| 7517 | static struct x_error_message_stack *x_error_message; | 7519 | static struct x_error_message_stack *x_error_message; |
| 7518 | 7520 | ||
| 7519 | /* An X error handler which stores the error message in | 7521 | /* An X error handler which stores the error message in |
| 7520 | x_error_message_string. This is called from x_error_handler if | 7522 | *x_error_message. This is called from x_error_handler if |
| 7521 | x_catch_errors is in effect. */ | 7523 | x_catch_errors is in effect. */ |
| 7522 | 7524 | ||
| 7523 | static void | 7525 | static void |
| @@ -7536,7 +7538,7 @@ x_error_catcher (display, error) | |||
| 7536 | 7538 | ||
| 7537 | After calling this function, X protocol errors no longer cause | 7539 | After calling this function, X protocol errors no longer cause |
| 7538 | Emacs to exit; instead, they are recorded in the string | 7540 | Emacs to exit; instead, they are recorded in the string |
| 7539 | stored in x_error_message_string. | 7541 | stored in *x_error_message. |
| 7540 | 7542 | ||
| 7541 | Calling x_check_errors signals an Emacs error if an X error has | 7543 | Calling x_check_errors signals an Emacs error if an X error has |
| 7542 | occurred since the last call to x_catch_errors or x_check_errors. | 7544 | occurred since the last call to x_catch_errors or x_check_errors. |
| @@ -7819,7 +7821,7 @@ x_connection_closed (dpy, error_message) | |||
| 7819 | 7821 | ||
| 7820 | /* We specifically use it before defining it, so that gcc doesn't inline it, | 7822 | /* We specifically use it before defining it, so that gcc doesn't inline it, |
| 7821 | otherwise gdb doesn't know how to properly put a breakpoint on it. */ | 7823 | otherwise gdb doesn't know how to properly put a breakpoint on it. */ |
| 7822 | static void x_error_quitter P_ ((Display *, XErrorEvent *)) NO_RETURN; | 7824 | static void x_error_quitter P_ ((Display *, XErrorEvent *)); |
| 7823 | 7825 | ||
| 7824 | /* This is the first-level handler for X protocol errors. | 7826 | /* This is the first-level handler for X protocol errors. |
| 7825 | It calls x_error_quitter or x_error_catcher. */ | 7827 | It calls x_error_quitter or x_error_catcher. */ |
| @@ -7864,6 +7866,12 @@ x_error_quitter (display, error) | |||
| 7864 | { | 7866 | { |
| 7865 | char buf[256], buf1[356]; | 7867 | char buf[256], buf1[356]; |
| 7866 | 7868 | ||
| 7869 | /* Ignore BadName errors. They can happen because of fonts | ||
| 7870 | or colors that are not defined. */ | ||
| 7871 | |||
| 7872 | if (error->error_code == BadName) | ||
| 7873 | return; | ||
| 7874 | |||
| 7867 | /* Note that there is no real way portable across R3/R4 to get the | 7875 | /* Note that there is no real way portable across R3/R4 to get the |
| 7868 | original error handler. */ | 7876 | original error handler. */ |
| 7869 | 7877 | ||
| @@ -8372,7 +8380,7 @@ x_check_expected_move (f, expected_left, expected_top) | |||
| 8372 | int expected_left; | 8380 | int expected_left; |
| 8373 | int expected_top; | 8381 | int expected_top; |
| 8374 | { | 8382 | { |
| 8375 | int count = 0, current_left = 0, current_top = 0; | 8383 | int current_left = 0, current_top = 0; |
| 8376 | 8384 | ||
| 8377 | /* x_real_positions returns the left and top offsets of the outermost | 8385 | /* x_real_positions returns the left and top offsets of the outermost |
| 8378 | window manager window around the frame. */ | 8386 | window manager window around the frame. */ |
| @@ -10169,6 +10177,11 @@ static XrmOptionDescRec emacs_options[] = { | |||
| 10169 | {"-mc", "*pointerColor", XrmoptionSepArg, (XtPointer) NULL}, | 10177 | {"-mc", "*pointerColor", XrmoptionSepArg, (XtPointer) NULL}, |
| 10170 | {"-cr", "*cursorColor", XrmoptionSepArg, (XtPointer) NULL} | 10178 | {"-cr", "*cursorColor", XrmoptionSepArg, (XtPointer) NULL} |
| 10171 | }; | 10179 | }; |
| 10180 | |||
| 10181 | /* Whether atimer for Xt timeouts is activated or not. */ | ||
| 10182 | |||
| 10183 | static int x_timeout_atimer_activated_flag; | ||
| 10184 | |||
| 10172 | #endif /* USE_X_TOOLKIT */ | 10185 | #endif /* USE_X_TOOLKIT */ |
| 10173 | 10186 | ||
| 10174 | static int x_initialized; | 10187 | static int x_initialized; |
| @@ -10882,13 +10895,39 @@ static void | |||
| 10882 | x_process_timeouts (timer) | 10895 | x_process_timeouts (timer) |
| 10883 | struct atimer *timer; | 10896 | struct atimer *timer; |
| 10884 | { | 10897 | { |
| 10898 | BLOCK_INPUT; | ||
| 10899 | x_timeout_atimer_activated_flag = 0; | ||
| 10885 | if (toolkit_scroll_bar_interaction || popup_activated ()) | 10900 | if (toolkit_scroll_bar_interaction || popup_activated ()) |
| 10886 | { | 10901 | { |
| 10887 | BLOCK_INPUT; | ||
| 10888 | while (XtAppPending (Xt_app_con) & XtIMTimer) | 10902 | while (XtAppPending (Xt_app_con) & XtIMTimer) |
| 10889 | XtAppProcessEvent (Xt_app_con, XtIMTimer); | 10903 | XtAppProcessEvent (Xt_app_con, XtIMTimer); |
| 10890 | UNBLOCK_INPUT; | 10904 | /* Reactivate the atimer for next time. */ |
| 10905 | x_activate_timeout_atimer (); | ||
| 10891 | } | 10906 | } |
| 10907 | UNBLOCK_INPUT; | ||
| 10908 | } | ||
| 10909 | |||
| 10910 | /* Install an asynchronous timer that processes Xt timeout events | ||
| 10911 | every 0.1s as long as either `toolkit_scroll_bar_interaction' or | ||
| 10912 | `popup_activated_flag' (in xmenu.c) is set. Make sure to call this | ||
| 10913 | function whenever these variables are set. This is necessary | ||
| 10914 | because some widget sets use timeouts internally, for example the | ||
| 10915 | LessTif menu bar, or the Xaw3d scroll bar. When Xt timeouts aren't | ||
| 10916 | processed, these widgets don't behave normally. */ | ||
| 10917 | |||
| 10918 | void | ||
| 10919 | x_activate_timeout_atimer () | ||
| 10920 | { | ||
| 10921 | BLOCK_INPUT; | ||
| 10922 | if (!x_timeout_atimer_activated_flag) | ||
| 10923 | { | ||
| 10924 | EMACS_TIME interval; | ||
| 10925 | |||
| 10926 | EMACS_SET_SECS_USECS (interval, 0, 100000); | ||
| 10927 | start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0); | ||
| 10928 | x_timeout_atimer_activated_flag = 1; | ||
| 10929 | } | ||
| 10930 | UNBLOCK_INPUT; | ||
| 10892 | } | 10931 | } |
| 10893 | 10932 | ||
| 10894 | #endif /* USE_X_TOOLKIT */ | 10933 | #endif /* USE_X_TOOLKIT */ |
| @@ -10957,15 +10996,15 @@ x_delete_terminal (struct terminal *terminal) | |||
| 10957 | x_destroy_all_bitmaps (dpyinfo); | 10996 | x_destroy_all_bitmaps (dpyinfo); |
| 10958 | XSetCloseDownMode (dpyinfo->display, DestroyAll); | 10997 | XSetCloseDownMode (dpyinfo->display, DestroyAll); |
| 10959 | 10998 | ||
| 10960 | #ifdef USE_X_TOOLKIT | ||
| 10961 | XtCloseDisplay (dpyinfo->display); | ||
| 10962 | #else | ||
| 10963 | #ifdef USE_GTK | 10999 | #ifdef USE_GTK |
| 10964 | xg_display_close (dpyinfo->display); | 11000 | xg_display_close (dpyinfo->display); |
| 10965 | #else | 11001 | #else |
| 11002 | #ifdef USE_X_TOOLKIT | ||
| 11003 | XtCloseDisplay (dpyinfo->display); | ||
| 11004 | #else | ||
| 10966 | XCloseDisplay (dpyinfo->display); | 11005 | XCloseDisplay (dpyinfo->display); |
| 10967 | #endif | 11006 | #endif |
| 10968 | #endif | 11007 | #endif /* ! USE_GTK */ |
| 10969 | 11008 | ||
| 10970 | x_delete_display (dpyinfo); | 11009 | x_delete_display (dpyinfo); |
| 10971 | UNBLOCK_INPUT; | 11010 | UNBLOCK_INPUT; |
| @@ -11052,17 +11091,6 @@ x_initialize () | |||
| 11052 | XtCacheByDisplay, cvt_pixel_dtor); | 11091 | XtCacheByDisplay, cvt_pixel_dtor); |
| 11053 | 11092 | ||
| 11054 | XtAppSetFallbackResources (Xt_app_con, Xt_default_resources); | 11093 | XtAppSetFallbackResources (Xt_app_con, Xt_default_resources); |
| 11055 | |||
| 11056 | /* Install an asynchronous timer that processes Xt timeout events | ||
| 11057 | every 0.1s. This is necessary because some widget sets use | ||
| 11058 | timeouts internally, for example the LessTif menu bar, or the | ||
| 11059 | Xaw3d scroll bar. When Xt timouts aren't processed, these | ||
| 11060 | widgets don't behave normally. */ | ||
| 11061 | { | ||
| 11062 | EMACS_TIME interval; | ||
| 11063 | EMACS_SET_SECS_USECS (interval, 0, 100000); | ||
| 11064 | start_atimer (ATIMER_CONTINUOUS, interval, x_process_timeouts, 0); | ||
| 11065 | } | ||
| 11066 | #endif | 11094 | #endif |
| 11067 | 11095 | ||
| 11068 | #ifdef USE_TOOLKIT_SCROLL_BARS | 11096 | #ifdef USE_TOOLKIT_SCROLL_BARS |