Mercurial > emacs
comparison src/xterm.c @ 83091:7f60e040ccfc
Merged in changes from CVS HEAD
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-177
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-178
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-179
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-180
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-131
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sat, 03 Apr 2004 20:24:17 +0000 |
parents | 108bb5537c12 ee25175db902 |
children | 1029206e72f2 |
comparison
equal
deleted
inserted
replaced
83090:72c2a3eb27da | 83091:7f60e040ccfc |
---|---|
213 #endif /* USE_X_TOOLKIT */ | 213 #endif /* USE_X_TOOLKIT */ |
214 | 214 |
215 /* Non-zero means user is interacting with a toolkit scroll bar. */ | 215 /* Non-zero means user is interacting with a toolkit scroll bar. */ |
216 | 216 |
217 static int toolkit_scroll_bar_interaction; | 217 static int toolkit_scroll_bar_interaction; |
218 | |
219 /* Non-zero means to not move point as a result of clicking on a | |
220 frame to focus it (when focus-follows-mouse is nil). */ | |
221 | |
222 int x_mouse_click_focus_ignore_position; | |
223 | |
224 /* Non-zero timeout value means ignore next mouse click if it arrives | |
225 before that timeout elapses (i.e. as part of the same sequence of | |
226 events resulting from clicking on a frame to select it). */ | |
227 | |
228 static unsigned long ignore_next_mouse_click_timeout; | |
218 | 229 |
219 /* Mouse movement. | 230 /* Mouse movement. |
220 | 231 |
221 Formerly, we used PointerMotionHintMask (in standard_event_mask) | 232 Formerly, we used PointerMotionHintMask (in standard_event_mask) |
222 so that we would have to call XQueryPointer after each MotionNotify | 233 so that we would have to call XQueryPointer after each MotionNotify |
746 : face->foreground), | 757 : face->foreground), |
747 face->background, depth); | 758 face->background, depth); |
748 | 759 |
749 if (p->overlay_p) | 760 if (p->overlay_p) |
750 { | 761 { |
751 clipmask = XCreatePixmapFromBitmapData (display, | 762 clipmask = XCreatePixmapFromBitmapData (display, |
752 FRAME_X_DISPLAY_INFO (f)->root_window, | 763 FRAME_X_DISPLAY_INFO (f)->root_window, |
753 bits, p->wd, p->h, | 764 bits, p->wd, p->h, |
754 1, 0, 1); | 765 1, 0, 1); |
755 gcv.clip_mask = clipmask; | 766 gcv.clip_mask = clipmask; |
756 gcv.clip_x_origin = p->x; | 767 gcv.clip_x_origin = p->x; |
757 gcv.clip_y_origin = p->y; | 768 gcv.clip_y_origin = p->y; |
758 XChangeGC (display, gc, GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcv); | 769 XChangeGC (display, gc, GCClipMask | GCClipXOrigin | GCClipYOrigin, &gcv); |
759 } | 770 } |
760 | 771 |
761 XCopyArea (display, pixmap, window, gc, 0, 0, | 772 XCopyArea (display, pixmap, window, gc, 0, 0, |
762 p->wd, p->h, p->x, p->y); | 773 p->wd, p->h, p->x, p->y); |
5731 if (! dpyinfo) | 5742 if (! dpyinfo) |
5732 current_finish = X_EVENT_NORMAL; | 5743 current_finish = X_EVENT_NORMAL; |
5733 else | 5744 else |
5734 { | 5745 { |
5735 current_count += | 5746 current_count += |
5736 handle_one_xevent (dpyinfo, xev, ¤t_finish, | 5747 handle_one_xevent (dpyinfo, xev, ¤t_finish, |
5737 current_hold_quit); | 5748 current_hold_quit); |
5738 } | 5749 } |
5739 } | 5750 } |
5740 else | 5751 else |
5741 current_finish = x_dispatch_event (xev, xev->xany.display); | 5752 current_finish = x_dispatch_event (xev, xev->xany.display); |
6172 record_asynch_buffer_change (); | 6183 record_asynch_buffer_change (); |
6173 } | 6184 } |
6174 goto OTHER; | 6185 goto OTHER; |
6175 | 6186 |
6176 case KeyPress: | 6187 case KeyPress: |
6188 | |
6189 ignore_next_mouse_click_timeout = 0; | |
6177 | 6190 |
6178 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 6191 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
6179 /* Dispatch KeyPress events when in menu. */ | 6192 /* Dispatch KeyPress events when in menu. */ |
6180 if (popup_activated ()) | 6193 if (popup_activated ()) |
6181 goto OTHER; | 6194 goto OTHER; |
6532 case EnterNotify: | 6545 case EnterNotify: |
6533 x_detect_focus_change (dpyinfo, &event, &inev); | 6546 x_detect_focus_change (dpyinfo, &event, &inev); |
6534 | 6547 |
6535 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); | 6548 f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); |
6536 | 6549 |
6550 if (f && x_mouse_click_focus_ignore_position) | |
6551 ignore_next_mouse_click_timeout = event.xmotion.time + 200; | |
6552 | |
6537 #if 0 | 6553 #if 0 |
6538 if (event.xcrossing.focus) | 6554 if (event.xcrossing.focus) |
6539 { | 6555 { |
6540 /* Avoid nasty pop/raise loops. */ | 6556 /* Avoid nasty pop/raise loops. */ |
6541 if (f && (!(f->auto_raise) | 6557 if (f && (!(f->auto_raise) |
6775 || f == dpyinfo->x_focus_frame) | 6791 || f == dpyinfo->x_focus_frame) |
6776 { | 6792 { |
6777 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) | 6793 #if defined (USE_X_TOOLKIT) || defined (USE_GTK) |
6778 if (! popup_activated ()) | 6794 if (! popup_activated ()) |
6779 #endif | 6795 #endif |
6780 construct_mouse_click (&inev, &event, f); | 6796 { |
6797 if (ignore_next_mouse_click_timeout) | |
6798 { | |
6799 if (event.type == ButtonPress | |
6800 && (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0) | |
6801 { | |
6802 ignore_next_mouse_click_timeout = 0; | |
6803 construct_mouse_click (&inev, &event, f); | |
6804 } | |
6805 if (event.type == ButtonRelease) | |
6806 ignore_next_mouse_click_timeout = 0; | |
6807 } | |
6808 else | |
6809 construct_mouse_click (&inev, &event, f); | |
6810 } | |
6781 } | 6811 } |
6782 } | 6812 } |
6783 else | 6813 else |
6784 { | 6814 { |
6785 struct scroll_bar *bar | 6815 struct scroll_bar *bar |
6923 if (do_help > 0) | 6953 if (do_help > 0) |
6924 { | 6954 { |
6925 any_help_event_p = 1; | 6955 any_help_event_p = 1; |
6926 gen_help_event (help_echo_string, frame, help_echo_window, | 6956 gen_help_event (help_echo_string, frame, help_echo_window, |
6927 help_echo_object, help_echo_pos); | 6957 help_echo_object, help_echo_pos); |
6928 } | 6958 } |
6929 else | 6959 else |
6930 { | 6960 { |
6931 help_echo_string = Qnil; | 6961 help_echo_string = Qnil; |
6932 gen_help_event (Qnil, frame, Qnil, Qnil, 0); | 6962 gen_help_event (Qnil, frame, Qnil, Qnil, 0); |
6933 } | 6963 } |
8239 if (yoff < 0) | 8269 if (yoff < 0) |
8240 f->size_hint_flags |= YNegative; | 8270 f->size_hint_flags |= YNegative; |
8241 f->win_gravity = NorthWestGravity; | 8271 f->win_gravity = NorthWestGravity; |
8242 } | 8272 } |
8243 x_calc_absolute_position (f); | 8273 x_calc_absolute_position (f); |
8244 | 8274 |
8245 BLOCK_INPUT; | 8275 BLOCK_INPUT; |
8246 x_wm_set_size_hint (f, (long) 0, 0); | 8276 x_wm_set_size_hint (f, (long) 0, 0); |
8247 | 8277 |
8248 modified_left = f->left_pos; | 8278 modified_left = f->left_pos; |
8249 modified_top = f->top_pos; | 8279 modified_top = f->top_pos; |
10363 get_bits_and_offset (dpyinfo->visual->blue_mask, | 10393 get_bits_and_offset (dpyinfo->visual->blue_mask, |
10364 &dpyinfo->blue_bits, &dpyinfo->blue_offset); | 10394 &dpyinfo->blue_bits, &dpyinfo->blue_offset); |
10365 get_bits_and_offset (dpyinfo->visual->green_mask, | 10395 get_bits_and_offset (dpyinfo->visual->green_mask, |
10366 &dpyinfo->green_bits, &dpyinfo->green_offset); | 10396 &dpyinfo->green_bits, &dpyinfo->green_offset); |
10367 } | 10397 } |
10368 | 10398 |
10369 /* See if a private colormap is requested. */ | 10399 /* See if a private colormap is requested. */ |
10370 if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) | 10400 if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) |
10371 { | 10401 { |
10372 if (dpyinfo->visual->class == PseudoColor) | 10402 if (dpyinfo->visual->class == PseudoColor) |
10373 { | 10403 { |
10788 baud_rate = 19200; | 10818 baud_rate = 19200; |
10789 | 10819 |
10790 x_noop_count = 0; | 10820 x_noop_count = 0; |
10791 last_tool_bar_item = -1; | 10821 last_tool_bar_item = -1; |
10792 any_help_event_p = 0; | 10822 any_help_event_p = 0; |
10823 ignore_next_mouse_click_timeout = 0; | |
10793 | 10824 |
10794 #ifdef USE_GTK | 10825 #ifdef USE_GTK |
10795 current_count = -1; | 10826 current_count = -1; |
10796 #endif | 10827 #endif |
10797 | 10828 |
10874 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. | 10905 doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties. |
10875 nil means ignore them. If you encounter fonts with bogus | 10906 nil means ignore them. If you encounter fonts with bogus |
10876 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior | 10907 UNDERLINE_POSITION font properties, for example 7x13 on XFree prior |
10877 to 4.1, set this to nil. */); | 10908 to 4.1, set this to nil. */); |
10878 x_use_underline_position_properties = 1; | 10909 x_use_underline_position_properties = 1; |
10910 | |
10911 DEFVAR_BOOL ("x-mouse-click-focus-ignore-position", | |
10912 &x_mouse_click_focus_ignore_position, | |
10913 doc: /* Non-nil means that a mouse click to focus a frame does not move point. | |
10914 This variable is only used when the window manager requires that you | |
10915 click on a frame to select it (give it focus). In that case, a value | |
10916 of nil, means that the selected window and cursor position changes to | |
10917 reflect the mouse click position, while a non-nil value means that the | |
10918 selected window or cursor position is preserved. */); | |
10919 x_mouse_click_focus_ignore_position = 0; | |
10879 | 10920 |
10880 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, | 10921 DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars, |
10881 doc: /* What X toolkit scroll bars Emacs uses. | 10922 doc: /* What X toolkit scroll bars Emacs uses. |
10882 A value of nil means Emacs doesn't use X toolkit scroll bars. | 10923 A value of nil means Emacs doesn't use X toolkit scroll bars. |
10883 Otherwise, value is a symbol describing the X toolkit. */); | 10924 Otherwise, value is a symbol describing the X toolkit. */); |