[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[STUMP] [PATCH] update-all-mode-lines added for mouse-based window focus
From: |
John Li |
Subject: |
[STUMP] [PATCH] update-all-mode-lines added for mouse-based window focus events. |
Date: |
Wed, 30 Jul 2008 22:07:16 -0400 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Otherwise, the "current window" highlighting in the window list is
incorrect until the next mode-line update.
---
This fixes the same bug as the patch I sent yesterday
(Subject: [STUMP] [PATCH] update-mode-lines in focus-window for when a
mouse is used.).
I think this version is better. It directly addresses the problem by
updating the mode-line in the event handler instead of adding an
update call in focus-window. The latter would cause two
update-mode-line calls when switching frames with a keyboard command.
events.lisp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/events.lisp b/events.lisp
index fa8fe64..0ba5eb2 100644
--- a/events.lisp
+++ b/events.lisp
@@ -588,7 +588,8 @@ the window in it's frame."
(when (and window (eq mode :normal) (eq *mouse-focus-policy* :sloppy))
(let ((win (find-window window)))
(when (and win (find win (top-windows)))
- (focus-all win)))))
+ (focus-all win)
+ (update-all-mode-lines)))))
(define-stump-event-handler :button-press (window code x y child time)
;; Pass click to client
@@ -601,13 +602,15 @@ the window in it's frame."
(let* ((group (screen-current-group screen))
(frame (find-frame group x y)))
(when frame
- (focus-frame group frame))))
+ (focus-frame group frame)
+ (update-all-mode-lines))))
(run-hook-with-args *root-click-hook* screen code x y))
((setf ml (find-mode-line-window window))
(run-hook-with-args *mode-line-click-hook* ml code x y))
((setf win (find-window-by-parent window (visible-windows)))
(when (eq *mouse-focus-policy* :click)
- (focus-all win))))))
+ (focus-all win)
+ (update-all-mode-lines))))))
;; Handling event :KEY-PRESS
;; (:DISPLAY #<XLIB:DISPLAY :0 (The X.Org Foundation R60700000)> :EVENT-KEY
:KEY-PRESS :EVENT-CODE 2 :SEND-EVENT-P NIL :CODE 45 :SEQUENCE 1419 :TIME
98761213 :ROOT #<XLIB:WINDOW :0 96> :WINDOW #<XLIB:WINDOW :0 6291484>
:EVENT-WINDOW #<XLIB:WINDOW :0 6291484> :CHILD
--
1.5.6.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [STUMP] [PATCH] update-all-mode-lines added for mouse-based window focus events.,
John Li <=