comparison lisp/frame.el @ 47016:876e9026e464

(select-frame-by-name, select-frame-set-input-focus): Always call x-focus-frame, if using x. Use set-mouse-position on all systems, if focus-follows-mouse.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Aug 2002 02:59:27 +0000
parents 923e4481a0b2
children f75902c4cbb5
comparison
equal deleted inserted replaced
47015:7faae7c35e07 47016:876e9026e464
652 (defun select-frame-set-input-focus (frame) 652 (defun select-frame-set-input-focus (frame)
653 "Select FRAME, raise it, and set input focus, if possible." 653 "Select FRAME, raise it, and set input focus, if possible."
654 (select-frame frame) 654 (select-frame frame)
655 (raise-frame frame) 655 (raise-frame frame)
656 ;; Ensure, if possible, that frame gets input focus. 656 ;; Ensure, if possible, that frame gets input focus.
657 (when (eq window-system 'w32) 657 (cond ((eq window-system 'x)
658 (w32-focus-frame frame)) 658 (x-focus-frame frame))
659 ((eq window-system 'w32)
660 (w32-focus-frame frame)))
659 (cond (focus-follows-mouse 661 (cond (focus-follows-mouse
660 (unless (eq window-system 'w32) 662 (set-mouse-position (selected-frame) (1- (frame-width)) 0))))
661 (set-mouse-position (selected-frame) (1- (frame-width)) 0)))
662 (t
663 (when (eq window-system 'x)
664 (x-focus-frame frame)))))
665 663
666 (defun other-frame (arg) 664 (defun other-frame (arg)
667 "Select the ARG'th different visible frame on current display, and raise it. 665 "Select the ARG'th different visible frame on current display, and raise it.
668 All frames are arranged in a cyclic order. 666 All frames are arranged in a cyclic order.
669 This command selects the frame ARG steps away in that order. 667 This command selects the frame ARG steps away in that order.
719 (error "There is no frame named `%s'" name)) 717 (error "There is no frame named `%s'" name))
720 (make-frame-visible frame) 718 (make-frame-visible frame)
721 (raise-frame frame) 719 (raise-frame frame)
722 (select-frame frame) 720 (select-frame frame)
723 ;; Ensure, if possible, that frame gets input focus. 721 ;; Ensure, if possible, that frame gets input focus.
724 (if (eq window-system 'w32) 722 (cond ((eq window-system 'x)
725 (w32-focus-frame frame) 723 (x-focus-frame frame))
726 (when focus-follows-mouse 724 ((eq window-system 'w32)
727 (set-mouse-position (selected-frame) (1- (frame-width)) 0))))) 725 (w32-focus-frame frame)))
726 (when focus-follows-mouse
727 (set-mouse-position frame (1- (frame-width frame)) 0))))
728 728
729 ;;;; Frame configurations 729 ;;;; Frame configurations
730 730
731 (defun current-frame-configuration () 731 (defun current-frame-configuration ()
732 "Return a list describing the positions and states of all frames. 732 "Return a list describing the positions and states of all frames.