diff options
| author | Martin Rudalics | 2014-10-24 11:58:43 +0200 |
|---|---|---|
| committer | Martin Rudalics | 2014-10-24 11:58:43 +0200 |
| commit | 3110159d1fb6b6071803355951d9ae314095df36 (patch) | |
| tree | 461fd18f8295b9cfc9b6ef7bbc64d4929ba814ab /src | |
| parent | 9321c9c361d106037831ba6bb43f03db2808422d (diff) | |
| download | emacs-3110159d1fb6b6071803355951d9ae314095df36.tar.gz emacs-3110159d1fb6b6071803355951d9ae314095df36.zip | |
Improve mouse dragging of frame edges.
* keyboard.c (make_lispy_position): Return coordinates also when
on scroll bars, fringes, margins or not in a window.
* xdisp.c (show_mouse_face): Don't change cursor face during
mouse tracking.
* mouse.el (mouse-drag-line): Don't use mouse-pixel-position.
Calculate increment from last position instead of window edge.
Add right- and bottom-divider bindings to transient map.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 7 | ||||
| -rw-r--r-- | src/keyboard.c | 26 | ||||
| -rw-r--r-- | src/xdisp.c | 2 |
3 files changed, 32 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ffc9b0c7147..45c559ba2c8 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2014-10-24 Martin Rudalics <rudalics@gmx.at> | ||
| 2 | |||
| 3 | * keyboard.c (make_lispy_position): Return coordinates also when | ||
| 4 | on scroll bars, fringes, margins or not in a window. | ||
| 5 | * xdisp.c (show_mouse_face): Don't change cursor face during | ||
| 6 | mouse tracking. | ||
| 7 | |||
| 1 | 2014-10-23 Martin Rudalics <rudalics@gmx.at> | 8 | 2014-10-23 Martin Rudalics <rudalics@gmx.at> |
| 2 | 9 | ||
| 3 | * frame.c (Fset_frame_height, Fset_frame_width, Fset_frame_size) | 10 | * frame.c (Fset_frame_height, Fset_frame_width, Fset_frame_size) |
diff --git a/src/keyboard.c b/src/keyboard.c index e8143f26681..32d14ab0760 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5332,12 +5332,14 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5332 | &object, &dx, &dy, &width, &height); | 5332 | &object, &dx, &dy, &width, &height); |
| 5333 | if (STRINGP (string)) | 5333 | if (STRINGP (string)) |
| 5334 | string_info = Fcons (string, make_number (charpos)); | 5334 | string_info = Fcons (string, make_number (charpos)); |
| 5335 | xret = wx; | ||
| 5335 | yret = wy - WINDOW_HEADER_LINE_HEIGHT (w); | 5336 | yret = wy - WINDOW_HEADER_LINE_HEIGHT (w); |
| 5336 | } | 5337 | } |
| 5337 | else if (part == ON_LEFT_FRINGE) | 5338 | else if (part == ON_LEFT_FRINGE) |
| 5338 | { | 5339 | { |
| 5339 | posn = Qleft_fringe; | 5340 | posn = Qleft_fringe; |
| 5340 | col = 0; | 5341 | col = 0; |
| 5342 | xret = wx; | ||
| 5341 | dx = wx | 5343 | dx = wx |
| 5342 | - (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) | 5344 | - (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w) |
| 5343 | ? 0 : window_box_width (w, LEFT_MARGIN_AREA)); | 5345 | ? 0 : window_box_width (w, LEFT_MARGIN_AREA)); |
| @@ -5347,6 +5349,7 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5347 | { | 5349 | { |
| 5348 | posn = Qright_fringe; | 5350 | posn = Qright_fringe; |
| 5349 | col = 0; | 5351 | col = 0; |
| 5352 | xret = wx; | ||
| 5350 | dx = wx | 5353 | dx = wx |
| 5351 | - window_box_width (w, LEFT_MARGIN_AREA) | 5354 | - window_box_width (w, LEFT_MARGIN_AREA) |
| 5352 | - window_box_width (w, TEXT_AREA) | 5355 | - window_box_width (w, TEXT_AREA) |
| @@ -5360,9 +5363,23 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5360 | posn = Qvertical_line; | 5363 | posn = Qvertical_line; |
| 5361 | width = 1; | 5364 | width = 1; |
| 5362 | dx = 0; | 5365 | dx = 0; |
| 5366 | xret = wx; | ||
| 5367 | dy = yret = wy; | ||
| 5368 | } | ||
| 5369 | else if (part == ON_VERTICAL_SCROLL_BAR) | ||
| 5370 | { | ||
| 5371 | posn = Qvertical_scroll_bar; | ||
| 5372 | width = WINDOW_SCROLL_BAR_AREA_WIDTH (w); | ||
| 5373 | dx = xret = wx; | ||
| 5374 | dy = yret = wy; | ||
| 5375 | } | ||
| 5376 | else if (part == ON_HORIZONTAL_SCROLL_BAR) | ||
| 5377 | { | ||
| 5378 | posn = Qhorizontal_scroll_bar; | ||
| 5379 | width = WINDOW_SCROLL_BAR_AREA_HEIGHT (w); | ||
| 5380 | dx = xret = wx; | ||
| 5363 | dy = yret = wy; | 5381 | dy = yret = wy; |
| 5364 | } | 5382 | } |
| 5365 | /* Nothing special for part == ON_SCROLL_BAR. */ | ||
| 5366 | else if (part == ON_RIGHT_DIVIDER) | 5383 | else if (part == ON_RIGHT_DIVIDER) |
| 5367 | { | 5384 | { |
| 5368 | posn = Qright_divider; | 5385 | posn = Qright_divider; |
| @@ -5446,7 +5463,12 @@ make_lispy_position (struct frame *f, Lisp_Object x, Lisp_Object y, | |||
| 5446 | extra_info))); | 5463 | extra_info))); |
| 5447 | } | 5464 | } |
| 5448 | else if (f != 0) | 5465 | else if (f != 0) |
| 5449 | XSETFRAME (window, f); | 5466 | { |
| 5467 | /* Return mouse pixel coordinates here. */ | ||
| 5468 | XSETFRAME (window, f); | ||
| 5469 | xret = XINT (x); | ||
| 5470 | yret = XINT (y); | ||
| 5471 | } | ||
| 5450 | else | 5472 | else |
| 5451 | window = Qnil; | 5473 | window = Qnil; |
| 5452 | 5474 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index dca6631a6ff..d27d76d8f5b 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -27961,7 +27961,7 @@ show_mouse_face (Mouse_HLInfo *hlinfo, enum draw_glyphs_face draw) | |||
| 27961 | 27961 | ||
| 27962 | #ifdef HAVE_WINDOW_SYSTEM | 27962 | #ifdef HAVE_WINDOW_SYSTEM |
| 27963 | /* Change the mouse cursor. */ | 27963 | /* Change the mouse cursor. */ |
| 27964 | if (FRAME_WINDOW_P (f)) | 27964 | if (FRAME_WINDOW_P (f) && NILP (do_mouse_tracking)) |
| 27965 | { | 27965 | { |
| 27966 | #if ! defined (USE_GTK) && ! defined (HAVE_NS) | 27966 | #if ! defined (USE_GTK) && ! defined (HAVE_NS) |
| 27967 | if (draw == DRAW_NORMAL_TEXT | 27967 | if (draw == DRAW_NORMAL_TEXT |