diff options
| author | Martin Rudalics | 2014-02-27 20:22:10 +0100 |
|---|---|---|
| committer | Martin Rudalics | 2014-02-27 20:22:10 +0100 |
| commit | 653b6ea317969d0e78f13e7e84e970c4032a298a (patch) | |
| tree | 95a0f100e7b903165885279434a06ac69431e8e2 /src/window.c | |
| parent | 11de63ede082fe5913f9714f4bba05ac6e6b984c (diff) | |
| download | emacs-653b6ea317969d0e78f13e7e84e970c4032a298a.tar.gz emacs-653b6ea317969d0e78f13e7e84e970c4032a298a.zip | |
More fixes for mouse glyph calculations (Bug#16647).
More fixes for mouse glyph calculations (Bug#16647).
* window.c (coordinates_in_window): In intersection of
horizontal and vertical window dividers prefer the horizontal
one. Add some extra parens to last fix.
(window_relative_x_coord): Return x-coordinate for header and
mode line too.
* xdisp.c (remember_mouse_glyph): In text area don't extend
glyph into mode line to show the vertical drag cursor there
immediately. Subdivide mouse glyphs in right fringes to show a
horizontal drag cursor as soon as we enter the "grabbable width"
portion. Handle vertical border case separately. Do not
subdivide window divider areas.
(note_mouse_highlight): On bottom divider of bottommost windows
show vertical drag cursor only when the minibuffer window can be
resized.
Diffstat (limited to 'src/window.c')
| -rw-r--r-- | src/window.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/window.c b/src/window.c index 2fb0dcaadaa..b2a6ff4ff2d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -1266,18 +1266,18 @@ coordinates_in_window (register struct window *w, int x, int y) | |||
| 1266 | if (y < top_y || y >= bottom_y || x < left_x || x >= right_x) | 1266 | if (y < top_y || y >= bottom_y || x < left_x || x >= right_x) |
| 1267 | return ON_NOTHING; | 1267 | return ON_NOTHING; |
| 1268 | 1268 | ||
| 1269 | /* On vertical window divider (which prevails horizontal | 1269 | /* On the horizontal window divider (which prevails the vertical |
| 1270 | dividers)? */ | 1270 | divider)? */ |
| 1271 | if (!WINDOW_RIGHTMOST_P (w) | 1271 | if (WINDOW_BOTTOM_DIVIDER_WIDTH (w) > 0 |
| 1272 | && WINDOW_RIGHT_DIVIDER_WIDTH (w) > 0 | 1272 | && y >= (bottom_y - WINDOW_BOTTOM_DIVIDER_WIDTH (w)) |
| 1273 | && x >= right_x - WINDOW_RIGHT_DIVIDER_WIDTH (w) | 1273 | && y <= bottom_y) |
| 1274 | && x <= right_x) | ||
| 1275 | return ON_RIGHT_DIVIDER; | ||
| 1276 | /* On the horizontal window divider? */ | ||
| 1277 | else if (WINDOW_BOTTOM_DIVIDER_WIDTH (w) > 0 | ||
| 1278 | && y >= (bottom_y - WINDOW_BOTTOM_DIVIDER_WIDTH (w)) | ||
| 1279 | && y <= bottom_y) | ||
| 1280 | return ON_BOTTOM_DIVIDER; | 1274 | return ON_BOTTOM_DIVIDER; |
| 1275 | /* On vertical window divider? */ | ||
| 1276 | else if (!WINDOW_RIGHTMOST_P (w) | ||
| 1277 | && WINDOW_RIGHT_DIVIDER_WIDTH (w) > 0 | ||
| 1278 | && x >= right_x - WINDOW_RIGHT_DIVIDER_WIDTH (w) | ||
| 1279 | && x <= right_x) | ||
| 1280 | return ON_RIGHT_DIVIDER; | ||
| 1281 | /* On the mode or header line? */ | 1281 | /* On the mode or header line? */ |
| 1282 | else if ((WINDOW_WANTS_MODELINE_P (w) | 1282 | else if ((WINDOW_WANTS_MODELINE_P (w) |
| 1283 | && y >= (bottom_y | 1283 | && y >= (bottom_y |
| @@ -1295,12 +1295,12 @@ coordinates_in_window (register struct window *w, int x, int y) | |||
| 1295 | bars. Note: If scrollbars are on the left, the window that | 1295 | bars. Note: If scrollbars are on the left, the window that |
| 1296 | must be eventually resized is that on the left of WINDOW. */ | 1296 | must be eventually resized is that on the left of WINDOW. */ |
| 1297 | if ((WINDOW_RIGHT_DIVIDER_WIDTH (w) == 0) | 1297 | if ((WINDOW_RIGHT_DIVIDER_WIDTH (w) == 0) |
| 1298 | && (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) | 1298 | && ((WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) |
| 1299 | && !WINDOW_LEFTMOST_P (w) | 1299 | && !WINDOW_LEFTMOST_P (w) |
| 1300 | && eabs (x - left_x) < grabbable_width) | 1300 | && eabs (x - left_x) < grabbable_width) |
| 1301 | || (!WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) | 1301 | || (!WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w) |
| 1302 | && !WINDOW_RIGHTMOST_P (w) | 1302 | && !WINDOW_RIGHTMOST_P (w) |
| 1303 | && eabs (x - right_x) < grabbable_width)) | 1303 | && eabs (x - right_x) < grabbable_width))) |
| 1304 | return ON_VERTICAL_BORDER; | 1304 | return ON_VERTICAL_BORDER; |
| 1305 | else | 1305 | else |
| 1306 | return part; | 1306 | return part; |
| @@ -1386,6 +1386,8 @@ window_relative_x_coord (struct window *w, enum window_part part, int x) | |||
| 1386 | case ON_TEXT: | 1386 | case ON_TEXT: |
| 1387 | return x - window_box_left (w, TEXT_AREA); | 1387 | return x - window_box_left (w, TEXT_AREA); |
| 1388 | 1388 | ||
| 1389 | case ON_HEADER_LINE: | ||
| 1390 | case ON_MODE_LINE: | ||
| 1389 | case ON_LEFT_FRINGE: | 1391 | case ON_LEFT_FRINGE: |
| 1390 | return x - left_x; | 1392 | return x - left_x; |
| 1391 | 1393 | ||