unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: "N. Jackson" <nljlistbox2@gmail.com>
Cc: 16647@debbugs.gnu.org
Subject: bug#16647: Imprecisions with window-resizing cursors
Date: Fri, 21 Feb 2014 19:53:40 +0100	[thread overview]
Message-ID: <5307A0B4.3070003@gmx.at> (raw)
In-Reply-To: <871tyyh0am.fsf@moondust.localdomain>

[-- Attachment #1: Type: text/plain, Size: 2402 bytes --]

 > Regardless of where the vertical line is, it is now almost impossible to
 > get the <=> handle to appear at all when approaching the vertical line
 > from the left -- I get it once in about fifty attempts. When approaching
 > the vertical line from the right, the <=> handle appears normally (and
 > it now appears normally when the vertical line is all the way to the
 > left as well).

If you can apply the patch I posted earlier (and I attach here again)
you could try the following snippet with emacs -Q:

(let ((i 200)
       (window-on-left (selected-window))
       (window-on-right (split-window-right))
       (lhits 0)
       (rhits 0))
   (tooltip-mode -1)
   (scroll-bar-mode -1)
   (set-mouse-pixel-position (selected-frame) i 200)
   (while (car (setq position (cdr (mouse-pixel-position))))
     (let ((coordinates (coordinates-in-window-p position window-on-left t)))
       (when (eq coordinates 'vertical-line)
	(setq lhits (1+ lhits))))
     (let ((coordinates (coordinates-in-window-p position window-on-right t)))
       (when (eq coordinates 'vertical-line)
	(setq rhits (1+ rhits))))
     (sit-for 0.001)
     (set-mouse-pixel-position
      (selected-frame) (setq i (1+ i)) 200))
   (cons lhits rhits))

Evaluating this returns (8 . 0) here, the cdr of which amounts to the
width of one character on my frame.  So here I have an 8 pixel-wide
corridor entirely in the left window where I am "on the vertical line"
(which occupies virtually the 7 right pixels of the right fringe of the
window on the left).  Evaluating

(let ((i 600)
       (window-on-left (selected-window))
       (window-on-right (split-window-right))
       (lhits 0)
       (rhits 0))
   (tooltip-mode -1)
   (scroll-bar-mode -1)
   (set-mouse-pixel-position (selected-frame) i 200)
   (while (car (setq position (cdr (mouse-pixel-position))))
     (let ((coordinates (coordinates-in-window-p position window-on-left t)))
       (when (eq coordinates 'vertical-line)
	(setq lhits (1+ lhits))))
     (let ((coordinates (coordinates-in-window-p position window-on-right t)))
       (when (eq coordinates 'vertical-line)
	(setq rhits (1+ rhits))))
     (sit-for 0.001)
     (set-mouse-pixel-position
      (selected-frame) (setq i (1- i)) 200))
   (cons lhits rhits))

gets me the same results.  What do you get?  You might have to change
the initial values of `i' to "be in the frame" accordingly.

martin

[-- Attachment #2: coordinates-in-window-p.diff --]
[-- Type: text/plain, Size: 1918 bytes --]

=== modified file 'src/window.c'
--- src/window.c	2014-02-21 08:02:05 +0000
+++ src/window.c	2014-02-21 18:16:00 +0000
@@ -1410,13 +1410,15 @@


 DEFUN ("coordinates-in-window-p", Fcoordinates_in_window_p,
-       Scoordinates_in_window_p, 2, 2, 0,
+       Scoordinates_in_window_p, 2, 3, 0,
        doc: /* Return non-nil if COORDINATES are in WINDOW.
 WINDOW must be a live window and defaults to the selected one.
 COORDINATES is a cons of the form (X . Y), X and Y being distances
 measured in characters from the upper-left corner of the frame.
 \(0 . 0) denotes the character in the upper left corner of the
-frame.
+frame.  Third argument PIXELWISE non-nil means interpret coordinates
+pixelwise.
+
 If COORDINATES are in the text portion of WINDOW,
    the coordinates relative to the window are returned.
 If they are in the mode line of WINDOW, `mode-line' is returned.
@@ -1427,7 +1429,7 @@
   `vertical-line' is returned.
 If they are in the windows's left or right marginal areas, `left-margin'\n\
   or `right-margin' is returned.  */)
-  (register Lisp_Object coordinates, Lisp_Object window)
+  (register Lisp_Object coordinates, Lisp_Object window, Lisp_Object pixelwise)
 {
   struct window *w;
   struct frame *f;
@@ -1439,10 +1441,16 @@
   CHECK_CONS (coordinates);
   lx = Fcar (coordinates);
   ly = Fcdr (coordinates);
-  CHECK_NUMBER_OR_FLOAT (lx);
-  CHECK_NUMBER_OR_FLOAT (ly);
-  x = FRAME_PIXEL_X_FROM_CANON_X (f, lx) + FRAME_INTERNAL_BORDER_WIDTH (f);
-  y = FRAME_PIXEL_Y_FROM_CANON_Y (f, ly) + FRAME_INTERNAL_BORDER_WIDTH (f);
+  CHECK_NUMBER (lx);
+  CHECK_NUMBER (ly);
+  x = ((!NILP (pixelwise)
+    ? XINT (lx)
+    : FRAME_PIXEL_X_FROM_CANON_X (f, lx))
+       + FRAME_INTERNAL_BORDER_WIDTH (f));
+  y = ((!NILP (pixelwise)
+    ? XINT (ly)
+    : FRAME_PIXEL_Y_FROM_CANON_Y (f, ly))
+       + FRAME_INTERNAL_BORDER_WIDTH (f));

   switch (coordinates_in_window (w, x, y))
     {



  reply	other threads:[~2014-02-21 18:53 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-05  6:05 bug#16647: Imprecisions with window-resizing cursors E Sabof
2014-02-05 10:48 ` martin rudalics
2014-02-06  9:21   ` Evgkeni Sampelnikof
2014-02-06 10:26     ` martin rudalics
2014-02-07 17:32       ` E Sabof
2014-02-07 19:14         ` martin rudalics
2014-02-13  9:46           ` E Sabof
2014-02-14 11:39             ` martin rudalics
2014-02-14 16:13               ` N. Jackson
2014-02-14 18:25                 ` martin rudalics
2014-02-14 22:53                   ` N. Jackson
2014-02-16 10:32                     ` martin rudalics
2014-02-16 18:17                       ` N. Jackson
2014-02-20  4:32                         ` N. Jackson
2014-02-21 18:53                           ` martin rudalics [this message]
2014-02-21 23:33                             ` N. Jackson
2014-02-22  9:17                               ` martin rudalics
2014-02-22 18:06                                 ` N. Jackson
2014-02-22 18:33                                   ` E Sabof
2014-02-22 18:52                                     ` martin rudalics
2014-02-22 19:07                                       ` E Sabof
2014-02-23  0:27                                         ` N. Jackson
2014-02-23 10:53                                           ` martin rudalics
2014-02-24  2:01                                             ` N. Jackson
2014-02-24  7:40                                               ` martin rudalics
2014-02-24 15:30                                                 ` N. Jackson
2014-02-24 18:12                                                   ` martin rudalics
2014-02-24 18:39                                                     ` N. Jackson
2014-02-24 18:58                                                       ` martin rudalics
2014-02-27 19:59                                               ` martin rudalics
2014-02-28  0:49                                                 ` N. Jackson
2014-02-28  6:47                                                   ` Eli Zaretskii
2014-02-28 17:30                                                     ` bug#16647: OT: window-resizing cursor for minibuffer (Imprecisions with window-resizing cursors) N. Jackson
2014-03-01  7:18                                                       ` Eli Zaretskii
2014-02-28 10:59                                                   ` bug#16647: Imprecisions with window-resizing cursors martin rudalics
2014-02-28 17:25                                                     ` bug#16647: OT: window-resizing cursor for minibuffer (Imprecisions with window-resizing cursors) N. Jackson
2014-02-28 18:24                                                       ` martin rudalics
2014-02-28 21:19                                                         ` bug#16647: Imprecisions with window-resizing cursors N. Jackson
2014-09-19  8:18                                                           ` martin rudalics
2014-02-23 10:53                                         ` martin rudalics
2014-02-23 23:29                                           ` E Sabof
2014-02-24  7:39                                             ` martin rudalics
2014-02-24 13:00                                               ` E Sabof
2014-02-24 18:12                                                 ` martin rudalics
2014-02-24 23:06                                                   ` E Sabof
2014-02-26 10:17                                                     ` martin rudalics
2014-02-26 16:45                                                       ` Eli Zaretskii
2014-02-27 20:00                                                         ` martin rudalics
2014-02-27 20:38                                                           ` Eli Zaretskii
2014-02-28 11:00                                                             ` martin rudalics
2014-02-28 11:32                                                               ` Eli Zaretskii
2014-02-28 12:47                                                                 ` martin rudalics
2014-02-28 14:29                                                                   ` Eli Zaretskii
2014-02-28 18:23                                                                     ` martin rudalics
2014-03-01  7:43                                                                       ` Eli Zaretskii
2014-02-27 19:59                                                     ` martin rudalics
2014-02-27 19:59                                             ` martin rudalics
2014-02-22 18:44                                   ` martin rudalics
2014-02-22 23:33                                     ` N. Jackson
2014-02-27 19:58                         ` martin rudalics
2014-02-28  0:39                           ` N. Jackson
2014-02-27 19:58                 ` martin rudalics
2014-02-28  0:38                   ` N. Jackson
2014-02-14 23:13               ` Drew Adams
2014-02-06 10:32     ` Eli Zaretskii
2014-02-06 13:34     ` Stefan Monnier
2014-02-07 19:14       ` martin rudalics
2014-02-27 19:58 ` martin rudalics
2014-02-27 20:33   ` Eli Zaretskii
2014-02-28 11:00     ` martin rudalics
2014-02-28 11:28       ` Eli Zaretskii
2014-02-28 12:47         ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5307A0B4.3070003@gmx.at \
    --to=rudalics@gmx.at \
    --cc=16647@debbugs.gnu.org \
    --cc=nljlistbox2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).