aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChong Yidong2009-06-28 15:32:20 +0000
committerChong Yidong2009-06-28 15:32:20 +0000
commit098a1589d913ceb640c96551b05f60e50b4c4dca (patch)
treec7a08f8fbc66d556293c5e268a85c08cbb8a381b /src
parent78c383195cc7e9a0bc73cef25e42c868ee884c82 (diff)
downloademacs-098a1589d913ceb640c96551b05f60e50b4c4dca.tar.gz
emacs-098a1589d913ceb640c96551b05f60e50b4c4dca.zip
* xterm.c (x_update_window_begin, x_new_focus_frame)
(x_scroll_bar_handle_click, handle_one_xevent) (handle_one_xevent, XTread_socket, x_focus_on_frame) (x_make_frame_visible, x_make_frame_invisible) (x_wm_set_icon_pixmap, x_initialize): Delete some #ifdef-ed out code chunks that are now obsolete.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/xterm.c190
2 files changed, 11 insertions, 188 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6177e71534d..2c25979d9c5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12009-06-28 Chong Yidong <cyd@stupidchicken.com>
2
3 * xterm.c (x_update_window_begin, x_new_focus_frame)
4 (x_scroll_bar_handle_click, handle_one_xevent)
5 (handle_one_xevent, XTread_socket, x_focus_on_frame)
6 (x_make_frame_visible, x_make_frame_invisible)
7 (x_wm_set_icon_pixmap, x_initialize): Delete some #ifdef-ed out
8 code chunks that are now obsolete.
9
12009-06-28 Michael Albinus <michael.albinus@gmx.de> 102009-06-28 Michael Albinus <michael.albinus@gmx.de>
2 11
3 * dbusbind.c (XD_SYMBOL_TO_DBUS_TYPE): Convert macro into function 12 * dbusbind.c (XD_SYMBOL_TO_DBUS_TYPE): Convert macro into function
diff --git a/src/xterm.c b/src/xterm.c
index 2c946c7a126..f0b4c2e983a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -592,32 +592,6 @@ x_update_window_begin (w)
592 highlighting. */ 592 highlighting. */
593 if (FRAME_GARBAGED_P (f)) 593 if (FRAME_GARBAGED_P (f))
594 display_info->mouse_face_window = Qnil; 594 display_info->mouse_face_window = Qnil;
595
596#if 0 /* Rows in a current matrix containing glyphs in mouse-face have
597 their mouse_face_p flag set, which means that they are always
598 unequal to rows in a desired matrix which never have that
599 flag set. So, rows containing mouse-face glyphs are never
600 scrolled, and we don't have to switch the mouse highlight off
601 here to prevent it from being scrolled. */
602
603 /* Can we tell that this update does not affect the window
604 where the mouse highlight is? If so, no need to turn off.
605 Likewise, don't do anything if the frame is garbaged;
606 in that case, the frame's current matrix that we would use
607 is all wrong, and we will redisplay that line anyway. */
608 if (!NILP (display_info->mouse_face_window)
609 && w == XWINDOW (display_info->mouse_face_window))
610 {
611 int i;
612
613 for (i = 0; i < w->desired_matrix->nrows; ++i)
614 if (MATRIX_ROW_ENABLED_P (w->desired_matrix, i))
615 break;
616
617 if (i < w->desired_matrix->nrows)
618 clear_mouse_face (display_info);
619 }
620#endif /* 0 */
621 } 595 }
622 596
623 UNBLOCK_INPUT; 597 UNBLOCK_INPUT;
@@ -3323,14 +3297,6 @@ x_new_focus_frame (dpyinfo, frame)
3323 if (old_focus && old_focus->auto_lower) 3297 if (old_focus && old_focus->auto_lower)
3324 x_lower_frame (old_focus); 3298 x_lower_frame (old_focus);
3325 3299
3326#if 0
3327 selected_frame = frame;
3328 XSETFRAME (XWINDOW (selected_frame->selected_window)->frame,
3329 selected_frame);
3330 Fselect_window (selected_frame->selected_window, Qnil);
3331 choose_minibuf_frame ();
3332#endif /* ! 0 */
3333
3334 if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise) 3300 if (dpyinfo->x_focus_frame && dpyinfo->x_focus_frame->auto_raise)
3335 pending_autoraise_frame = dpyinfo->x_focus_frame; 3301 pending_autoraise_frame = dpyinfo->x_focus_frame;
3336 else 3302 else
@@ -5493,11 +5459,6 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
5493 emacs_event->arg = Qnil; 5459 emacs_event->arg = Qnil;
5494 emacs_event->timestamp = event->xbutton.time; 5460 emacs_event->timestamp = event->xbutton.time;
5495 { 5461 {
5496#if 0
5497 FRAME_PTR f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
5498 int internal_height
5499 = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, bar->height);
5500#endif
5501 int top_range 5462 int top_range
5502 = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height); 5463 = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height);
5503 int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER; 5464 int y = event->xbutton.y - VERTICAL_SCROLL_BAR_TOP_BORDER;
@@ -5512,17 +5473,6 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
5512 else 5473 else
5513 emacs_event->part = scroll_bar_below_handle; 5474 emacs_event->part = scroll_bar_below_handle;
5514 5475
5515 /* Just because the user has clicked on the handle doesn't mean
5516 they want to drag it. Lisp code needs to be able to decide
5517 whether or not we're dragging. */
5518#if 0
5519 /* If the user has just clicked on the handle, record where they're
5520 holding it. */
5521 if (event->type == ButtonPress
5522 && emacs_event->part == scroll_bar_handle)
5523 XSETINT (bar->dragging, y - bar->start);
5524#endif
5525
5526#ifndef USE_TOOLKIT_SCROLL_BARS 5476#ifndef USE_TOOLKIT_SCROLL_BARS
5527 /* If the user has released the handle, set it to its final position. */ 5477 /* If the user has released the handle, set it to its final position. */
5528 if (event->type == ButtonRelease 5478 if (event->type == ButtonRelease
@@ -5536,18 +5486,7 @@ x_scroll_bar_handle_click (bar, event, emacs_event)
5536 } 5486 }
5537#endif 5487#endif
5538 5488
5539 /* Same deal here as the other #if 0. */
5540#if 0
5541 /* Clicks on the handle are always reported as occurring at the top of
5542 the handle. */
5543 if (emacs_event->part == scroll_bar_handle)
5544 emacs_event->x = bar->start;
5545 else
5546 XSETINT (emacs_event->x, y);
5547#else
5548 XSETINT (emacs_event->x, y); 5489 XSETINT (emacs_event->x, y);
5549#endif
5550
5551 XSETINT (emacs_event->y, top_range); 5490 XSETINT (emacs_event->y, top_range);
5552 } 5491 }
5553} 5492}
@@ -5625,10 +5564,6 @@ x_scroll_bar_report_motion (fp, bar_window, part, x, y, time)
5625 ; 5564 ;
5626 else 5565 else
5627 { 5566 {
5628#if 0
5629 int inside_height
5630 = VERTICAL_SCROLL_BAR_INSIDE_HEIGHT (f, bar->height);
5631#endif
5632 int top_range 5567 int top_range
5633 = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height); 5568 = VERTICAL_SCROLL_BAR_TOP_RANGE (f, bar->height);
5634 5569
@@ -5694,14 +5629,6 @@ x_scroll_bar_clear (f)
5694 5629
5695/* The main X event-reading loop - XTread_socket. */ 5630/* The main X event-reading loop - XTread_socket. */
5696 5631
5697#if 0
5698/* Time stamp of enter window event. This is only used by XTread_socket,
5699 but we have to put it out here, since static variables within functions
5700 sometimes don't work. */
5701
5702static Time enter_timestamp;
5703#endif
5704
5705/* This holds the state XLookupString needs to implement dead keys 5632/* This holds the state XLookupString needs to implement dead keys
5706 and other tricks known as "compose processing". _X Window System_ 5633 and other tricks known as "compose processing". _X Window System_
5707 says that a portable program can't use this, but Stephen Gildea assures 5634 says that a portable program can't use this, but Stephen Gildea assures
@@ -6105,14 +6032,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6105 6032
6106 case PropertyNotify: 6033 case PropertyNotify:
6107 last_user_time = event.xproperty.time; 6034 last_user_time = event.xproperty.time;
6108#if 0 /* This is plain wrong. In the case that we are waiting for a
6109 PropertyNotify used as an ACK in incremental selection
6110 transfer, the property will be on the receiver's window. */
6111#if defined USE_X_TOOLKIT
6112 if (!x_any_window_to_frame (dpyinfo, event.xproperty.window))
6113 goto OTHER;
6114#endif
6115#endif
6116 f = x_top_window_to_frame (dpyinfo, event.xproperty.window); 6035 f = x_top_window_to_frame (dpyinfo, event.xproperty.window);
6117 if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state) 6036 if (f && event.xproperty.atom == dpyinfo->Xatom_net_wm_state)
6118 x_handle_net_wm_state (f, &event.xproperty); 6037 x_handle_net_wm_state (f, &event.xproperty);
@@ -6399,27 +6318,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6399 &status_return); 6318 &status_return);
6400 } 6319 }
6401 /* Xutf8LookupString is a new but already deprecated interface. -stef */ 6320 /* Xutf8LookupString is a new but already deprecated interface. -stef */
6402#if 0 && defined X_HAVE_UTF8_STRING
6403 else if (status_return == XLookupKeySym)
6404 { /* Try again but with utf-8. */
6405 coding_system = Qutf_8;
6406 nbytes = Xutf8LookupString (FRAME_XIC (f),
6407 &event.xkey, copy_bufptr,
6408 copy_bufsiz, &keysym,
6409 &status_return);
6410 if (status_return == XBufferOverflow)
6411 {
6412 copy_bufsiz = nbytes + 1;
6413 copy_bufptr = (unsigned char *) alloca (copy_bufsiz);
6414 nbytes = Xutf8LookupString (FRAME_XIC (f),
6415 &event.xkey,
6416 copy_bufptr,
6417 copy_bufsiz, &keysym,
6418 &status_return);
6419 }
6420 }
6421#endif
6422
6423 if (status_return == XLookupNone) 6321 if (status_return == XLookupNone)
6424 break; 6322 break;
6425 else if (status_return == XLookupChars) 6323 else if (status_return == XLookupChars)
@@ -6665,22 +6563,6 @@ handle_one_xevent (dpyinfo, eventp, finish, hold_quit)
6665 if (f && x_mouse_click_focus_ignore_position) 6563 if (f && x_mouse_click_focus_ignore_position)
6666 ignore_next_mouse_click_timeout = event.xmotion.time + 200; 6564 ignore_next_mouse_click_timeout = event.xmotion.time + 200;
6667 6565
6668#if 0
6669 if (event.xcrossing.focus)
6670 {
6671 /* Avoid nasty pop/raise loops. */
6672 if (f && (!(f->auto_raise)
6673 || !(f->auto_lower)
6674 || (event.xcrossing.time - enter_timestamp) > 500))
6675 {
6676 x_new_focus_frame (dpyinfo, f);
6677 enter_timestamp = event.xcrossing.time;
6678 }
6679 }
6680 else if (f == dpyinfo->x_focus_frame)
6681 x_new_focus_frame (dpyinfo, 0);
6682#endif
6683
6684 /* EnterNotify counts as mouse movement, 6566 /* EnterNotify counts as mouse movement,
6685 so update things that depend on mouse position. */ 6567 so update things that depend on mouse position. */
6686 if (f && !f->output_data.x->hourglass_p) 6568 if (f && !f->output_data.x->hourglass_p)
@@ -7152,9 +7034,6 @@ XTread_socket (terminal, expected, hold_quit)
7152 int count = 0; 7034 int count = 0;
7153 XEvent event; 7035 XEvent event;
7154 int event_found = 0; 7036 int event_found = 0;
7155#if 0
7156 struct x_display_info *dpyinfo;
7157#endif
7158 7037
7159 if (interrupt_input_blocked) 7038 if (interrupt_input_blocked)
7160 { 7039 {
@@ -7200,40 +7079,6 @@ XTread_socket (terminal, expected, hold_quit)
7200 x_io_error_quitter (terminal->display_info.x->display); 7079 x_io_error_quitter (terminal->display_info.x->display);
7201 } 7080 }
7202 7081
7203#if 0 /* This loop is a noop now. */
7204 /* Find the display we are supposed to read input for.
7205 It's the one communicating on descriptor SD. */
7206 for (dpyinfo = x_display_list; dpyinfo; dpyinfo = dpyinfo->next)
7207 {
7208#if 0 /* This ought to be unnecessary; let's verify it. */
7209#ifdef FIOSNBIO
7210 /* If available, Xlib uses FIOSNBIO to make the socket
7211 non-blocking, and then looks for EWOULDBLOCK. If O_NDELAY is set,
7212 FIOSNBIO is ignored, and instead of signaling EWOULDBLOCK,
7213 a read returns 0, which Xlib interprets as equivalent to EPIPE. */
7214 fcntl (dpyinfo->connection, F_SETFL, 0);
7215#endif /* ! defined (FIOSNBIO) */
7216#endif
7217
7218#if 0 /* This code can't be made to work, with multiple displays,
7219 and appears not to be used on any system any more.
7220 Also keyboard.c doesn't turn O_NDELAY on and off
7221 for X connections. */
7222#ifndef SIGIO
7223#ifndef HAVE_SELECT
7224 if (! (fcntl (dpyinfo->connection, F_GETFL, 0) & O_NDELAY))
7225 {
7226 extern int read_alarm_should_throw;
7227 read_alarm_should_throw = 1;
7228 XPeekEvent (dpyinfo->display, &event);
7229 read_alarm_should_throw = 0;
7230 }
7231#endif /* HAVE_SELECT */
7232#endif /* SIGIO */
7233#endif
7234 }
7235#endif
7236
7237#ifndef USE_GTK 7082#ifndef USE_GTK
7238 while (XPending (terminal->display_info.x->display)) 7083 while (XPending (terminal->display_info.x->display))
7239 { 7084 {
@@ -9043,9 +8888,6 @@ void
9043x_focus_on_frame (f) 8888x_focus_on_frame (f)
9044 struct frame *f; 8889 struct frame *f;
9045{ 8890{
9046#if 0 /* This proves to be unpleasant. */
9047 x_raise_frame (f);
9048#endif
9049#if 0 8891#if 0
9050 /* I don't think that the ICCCM allows programs to do things like this 8892 /* I don't think that the ICCCM allows programs to do things like this
9051 without the interaction of the window manager. Whatever you end up 8893 without the interaction of the window manager. Whatever you end up
@@ -9234,12 +9076,6 @@ x_make_frame_visible (f)
9234 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f)); 9076 XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
9235#endif /* not USE_GTK */ 9077#endif /* not USE_GTK */
9236#endif /* not USE_X_TOOLKIT */ 9078#endif /* not USE_X_TOOLKIT */
9237#if 0 /* This seems to bring back scroll bars in the wrong places
9238 if the window configuration has changed. They seem
9239 to come back ok without this. */
9240 if (FRAME_HAS_VERTICAL_SCROLL_BARS (f))
9241 XMapSubwindows (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
9242#endif
9243 } 9079 }
9244 9080
9245 XFlush (FRAME_X_DISPLAY (f)); 9081 XFlush (FRAME_X_DISPLAY (f));
@@ -9367,11 +9203,6 @@ x_make_frame_invisible (f)
9367 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f) 9203 if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f)
9368 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0; 9204 FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0;
9369 9205
9370#if 0/* This might add unreliability; I don't trust it -- rms. */
9371 if (! f->async_visible && ! f->async_iconified)
9372 return;
9373#endif
9374
9375 BLOCK_INPUT; 9206 BLOCK_INPUT;
9376 9207
9377 /* Before unmapping the window, update the WM_SIZE_HINTS property to claim 9208 /* Before unmapping the window, update the WM_SIZE_HINTS property to claim
@@ -9865,19 +9696,9 @@ x_wm_set_icon_pixmap (f, pixmap_id)
9865 } 9696 }
9866 else 9697 else
9867 { 9698 {
9868 /* It seems there is no way to turn off use of an icon pixmap. 9699 /* It seems there is no way to turn off use of an icon
9869 The following line does it, only if no icon has yet been created, 9700 pixmap. */
9870 for some window managers. But with mwm it crashes.
9871 Some people say it should clear the IconPixmapHint bit in this case,
9872 but that doesn't work, and the X consortium said it isn't the
9873 right thing at all. Since there is no way to win,
9874 best to explicitly give up. */
9875#if 0
9876 f->output_data.x->wm_hints.icon_pixmap = None;
9877 f->output_data.x->wm_hints.icon_mask = None;
9878#else
9879 return; 9701 return;
9880#endif
9881 } 9702 }
9882 9703
9883 9704
@@ -10891,13 +10712,6 @@ x_initialize ()
10891 XSetErrorHandler (x_error_handler); 10712 XSetErrorHandler (x_error_handler);
10892 XSetIOErrorHandler (x_io_error_quitter); 10713 XSetIOErrorHandler (x_io_error_quitter);
10893 10714
10894 /* Disable Window Change signals; they are handled by X events. */
10895#if 0 /* Don't. We may want to open tty frames later. */
10896#ifdef SIGWINCH
10897 signal (SIGWINCH, SIG_DFL);
10898#endif /* SIGWINCH */
10899#endif
10900
10901 signal (SIGPIPE, x_connection_signal); 10715 signal (SIGPIPE, x_connection_signal);
10902} 10716}
10903 10717