[Top][All Lists]

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

Re: [STUMP] Have focus follow move-window

From: Burton Samograd
Subject: Re: [STUMP] Have focus follow move-window
Date: Thu, 20 Oct 2011 09:27:44 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

"Michael Raskin" <address@hidden> writes:

>>I was wondering if there was a way to force the focus to follow a
>>move-window.  I have my mouse focus policy set to :sloppy, so I'm not
>>sure if that is causing me to lose window focus when I do a
>> move-window.
> My StumpWM ignores mouse for focus and focus follows move-window.
> My understanding of sloppy is "focus is where the mouse is", so I cannot
> see why move-window could not lead to focus loss - the window is now not
> where the mouse is, after all.
> You can define a command that does a move-window and then does ratwarp
> to the center of the target frame in your StumpWM rc file. 

I modified move-focus-and-or-window in tile-group.lisp to be as follows:

(defun move-focus-and-or-window (dir &optional win-p)
  (declare (type (member :up :down :left :right) dir))
  (let* ((group (current-group))
         (new-frame (neighbour dir (tile-group-current-frame group) 
(group-frames group)))
         (window (current-window)))
    (when new-frame
      (if (and win-p window)
            (pull-window window new-frame)
            (when (eq *mouse-focus-policy* :sloppy)
                  (focus-frame group new-frame)
                  (warp-pointer (window-screen window)
                                (+ 8 (frame-x new-frame))
                                (+ 8 (frame-y new-frame))))))
          (focus-frame group new-frame)))))

Seems to work for me now. Thanks for the advice.

Burton Samograd

reply via email to

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