Comments on focusing (on new code in CVS)

Erik Enge erik at nittin.net
Tue Mar 25 13:51:02 UTC 2003


Iban Hatchondo <hatchond at labri.fr> writes:

> I can't see any attached files.

D'oh.  Anyway, it seems that it was fixed when I used focus-widget

> Why don't you just try to call (focus-widget max-b 0)?

Didn't know about it.  But I do now!

Here's the patch I'd like see included in input.lisp:

*** /tmp/erik/input.lisp	2003-03-25 17:47:01.000000000 -0500
--- /tmp/erik/input.lispUEA3HV	2003-03-25 17:47:01.000000000 -0500
***************
*** 389,394 ****
--- 389,395 ----
  (defmethod event-process ((event button-press) (button menu-button))
    (with-slots (window-menu) *root*
      (with-slots (master window armed active-p) button
+       (focus-widget button 0)
        (and window-menu (destroy-substructure window-menu))
        (setf window-menu (make-menu-button-menu master))
        (realize-pop-up window-menu (event-root-x event) (event-root-y event))
***************
*** 397,403 ****
  ;; Maximization
  (defmethod event-process ((event button-release) (max-b maximize-button))
    (when (< (event-code event) 4)
!     (maximize-window (button-master max-b) (event-code event))))
  
  ;; Initialize the resize process.
  (defmethod event-process ((event button-press) (edge edge))
--- 398,405 ----
  ;; Maximization
  (defmethod event-process ((event button-release) (max-b maximize-button))
    (when (< (event-code event) 4)
!     (maximize-window (button-master max-b) (event-code event))
!     (focus-widget max-b 0)))
  
  ;; Initialize the resize process.
  (defmethod event-process ((event button-press) (edge edge))

It will focus the window when you click the menu-button and the
maximization-button.  I'm not testing for :on-click since I guess that
you'd get focus just by moving your mouse over the buttons anyway.

Erik.




More information about the eclipse-devel mailing list