emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117487: Fix mouse-dragging mode lines on text-mo


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 r117487: Fix mouse-dragging mode lines on text-mode terminals.
Date: Tue, 09 Sep 2014 15:01:15 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117487
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Tue 2014-09-09 18:00:51 +0300
message:
  Fix mouse-dragging mode lines on text-mode terminals.
  
   lisp/mouse.el (mouse-drag-line): On text-mode frames, count the mode
   line and header line as 1 pixel.  This fixes the 1-"pixel" (row)
   discrepancy between window-pixel-edges and mouse events, and
   avoids moving mode line up when the mouse click is on the modeline
   and no drag is attempted.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/mouse.el                  mouse.el-20091113204419-o5vbwnq5f7feedwu-123
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-09-08 05:57:24 +0000
+++ b/lisp/ChangeLog    2014-09-09 15:00:51 +0000
@@ -1,3 +1,11 @@
+2014-09-09  Eli Zaretskii  <address@hidden>
+
+       * mouse.el (mouse-drag-line): On text-mode frames, count the mode
+       line and header line as 1 pixel.  This fixes the 1-"pixel" (row)
+       discrepancy between window-pixel-edges and mouse events, and
+       avoids moving mode line up when the mouse click is on the modeline
+       and no drag is attempted.
+
 2014-09-08  Glenn Morris  <address@hidden>
 
        * calendar/calendar.el (calendar-basic-setup):

=== modified file 'lisp/mouse.el'
--- a/lisp/mouse.el     2014-08-08 16:56:50 +0000
+++ b/lisp/mouse.el     2014-09-09 15:00:51 +0000
@@ -395,7 +395,16 @@
       ;; Check whether header-line can be dragged at all.
       (if (window-at-side-p window 'top)
          (setq draggable nil)
-       (setq height (/ (window-header-line-height window) 2))
+       ;; window-pixel-edges includes the header and mode lines, so
+       ;; we need to account for that when calculating window growth.
+       ;; On GUI frames, assume the mouse is approximately in the
+       ;; middle of the header/mode line, so we need only half the
+       ;; height in pixels.
+       (setq height
+             (cond
+              ((display-graphic-p frame)
+               (/ (window-header-line-height window) 2))
+              (t  (window-header-line-height window))))
        (setq window (window-in-direction 'above window t))))
      ((eq line 'mode)
       ;; Check whether mode-line can be dragged at all.
@@ -410,7 +419,11 @@
                             (eq minibuffer-window
                                 (active-minibuffer-window))))))
          (setq draggable nil)
-       (setq height (/ (window-mode-line-height window) 2))))
+       (setq height
+             (cond
+              ((display-graphic-p frame)
+               (/ (window-mode-line-height window) 2))
+              (t  (window-mode-line-height window))))))
      ((eq line 'vertical)
       ;; Get the window to adjust for the vertical case.  If the scroll
       ;; bar is on the window's right or we drag a vertical divider,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]