From unknown Sat Jun 21 05:14:21 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#6888 <6888@debbugs.gnu.org> To: bug#6888 <6888@debbugs.gnu.org> Subject: Status: mouse-autoselect-window on OS X Reply-To: bug#6888 <6888@debbugs.gnu.org> Date: Sat, 21 Jun 2025 12:14:21 +0000 retitle 6888 mouse-autoselect-window on OS X reassign 6888 emacs,ns submitter 6888 =C3=89ric Martin severity 6888 normal tag 6888 patch help thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 20 09:52:03 2010 Received: (at submit) by debbugs.gnu.org; 20 Aug 2010 13:52:03 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmS0n-0001cm-L6 for submit@debbugs.gnu.org; Fri, 20 Aug 2010 09:52:03 -0400 Received: from mx10.gnu.org ([199.232.76.166]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmRjg-0001VF-45 for submit@debbugs.gnu.org; Fri, 20 Aug 2010 09:34:21 -0400 Received: from lists.gnu.org ([199.232.76.165]:60471) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1OmRkn-0002Fe-MH for submit@debbugs.gnu.org; Fri, 20 Aug 2010 09:35:29 -0400 Received: from [140.186.70.92] (port=51570 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OmRki-0001yu-5P for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2010 09:35:29 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OmRkc-0002e1-6F for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2010 09:35:23 -0400 Received: from note.orchestra.cse.unsw.edu.au ([129.94.242.24]:48588) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmRkb-0002dC-4Y for bug-gnu-emacs@gnu.org; Fri, 20 Aug 2010 09:35:18 -0400 Received: From new-host.home ([86.210.56.47] == ARennes-257-1-121-47.w86-210.abo.wanadoo.fr) (auth-user emartin) (cse-authentic-sender emartin) (for ) By note With Smtp ; Fri, 20 Aug 2010 23:35:01 +1000 From: =?iso-8859-1?Q?=C9ric_Martin?= To: bug-gnu-emacs@gnu.org Date: Fri, 20 Aug 2010 15:34:52 +0200 Content-Type: multipart/alternative; boundary=Apple-Mail-4--938584987 Subject: 23.2; Problem with focus-follows-mouse on OS X Message-Id: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Fri, 20 Aug 2010 09:52:00 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) --Apple-Mail-4--938584987 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii With .emacs containing: (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(focus-follows-mouse t) '(mouse-autoselect-window t)) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. ) it is still necessary to click on a window to select it. This is a problem that is new in Emacs 23 in contrast to Emacs 22. Best regards, Eric Martin. In GNU Emacs 23.2.1 (x86_64-apple-darwin10.4.0, NS apple-appkit-1038.32) of 2010-08-20 on new-host.home Windowing system distributor `Apple', version 10.3.1038 configured using `configure '--with-ns'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: nil value of $XMODIFIERS: nil locale-coding-system: nil default enable-multibyte-characters: t Major mode: Fundamental Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x 2 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Load-path shadows: None found. Features: (shadow sort mail-extr message ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face files text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) Eric Martin School of Computer Science and Engineering UNSW Sydney NSW 2052 Australia Building K17 Room 409 Email: emartin@cse.unsw.edu.au Phone: +61 2 9385 6936 Fax: +61 2 9385 4936 Disclaimer: http://www.eng.unsw.edu.au/emaildis.htm Cricos Provider No. 00098G --Apple-Mail-4--938584987 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii With .emacs containing:

(custom-set-variables
  ;; custom-set-variables = was added by Custom.
  ;; If you edit it by hand, = you could mess it up, so be careful.
  ;; Your init file should = contain only one such instance.
  ;; If there is more than = one, they won't work right.
'(focus-follows-mouse t)
= '(mouse-autoselect-window t))
(custom-set-faces
  ;; custom-set-faces was = added by Custom.
  = ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should = contain only one such instance.
  ;; If there is more than = one, they won't work right.
)

it is still necessary to click = on a window to select it.
This is a problem that is new in Emacs 23 = in contrast to Emacs 22.

Best regards,

Eric = Martin.




In GNU Emacs 23.2.1 = (x86_64-apple-darwin10.4.0, NS apple-appkit-1038.32)
of 2010-08-20 = on new-host.home
Windowing system distributor `Apple', version = 10.3.1038
configured using `configure  = '--with-ns''

Important settings:
  value of $LC_ALL: = nil
  value of = $LC_COLLATE: nil
  = value of $LC_CTYPE: nil
  value of $LC_MESSAGES: = nil
  value of = $LC_MONETARY: nil
  = value of $LC_NUMERIC: nil
  value of $LC_TIME: = nil
  value of = $LANG: nil
  value = of $XMODIFIERS: nil
 = locale-coding-system: nil
  default = enable-multibyte-characters: t

Major mode: = Fundamental

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: = t
  menu-bar-mode: = t
  = file-name-shadow-mode: t
  global-font-lock-mode: = t
  = auto-encryption-mode: t
  auto-compression-mode: = t
  = line-number-mode: t
 = transient-mark-mode: t

Recent input:
C-x 2 <help-echo> = <help-echo> <help-echo> <help-echo> =
<help-echo> <help-echo> <help-echo> = <help-echo> <down-mouse-1>
<mouse-1> = <help-echo> <down-mouse-1> <mouse-1> = <down-mouse-1>
<mouse-1> <help-echo> = <down-mouse-1> <mouse-1> <menu-bar> =
<help-menu> <send-emacs-bug-report>

Recent = messages:
For information about GNU Emacs and the GNU system, type = C-h C-a.

Load-path shadows:
None = found.

Features:
(shadow sort mail-extr message ecomplete = rfc822 mml mml-sec
password-cache mm-decode mm-bodies mm-encode = mailcap mail-parse rfc2231
rfc2047 rfc2045 qp ietf-drums mailabbrev = nnheader gnus-util netrc
time-date mm-util mail-prsvr gmm-utils = wid-edit mailheader canlock sha1
hex-util hashcash mail-utils = emacsbug tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win = easymenu tool-bar dnd fontset image fringe
lisp-mode register page = menu-bar rfn-eshadow timer select scroll-bar
mldrag mouse jit-lock = font-lock syntax facemenu font-core frame cham
georgian utf-8-lang = misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew = greek romanian slovak czech european ethiopic
indian cyrillic chinese = case-table epa-hook jka-cmpr-hook help simple
abbrev loaddefs button = minibuffer faces cus-face files text-properties
overlay md5 base64 = format env code-pages mule custom widget
hashtable-print-readable = backquote make-network-process ns multi-tty
emacs)


Eric = Martin
SchoolComputer Science and = Engineering
UNSW Sydney NSW = 2052 Australia
Phone: = +61 2 9385 6936
Fax: +61 2 9385 = 4936

= --Apple-Mail-4--938584987-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 20 14:02:49 2010 Received: (at 6888) by debbugs.gnu.org; 20 Aug 2010 18:02:49 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmVvV-0003zg-9d for submit@debbugs.gnu.org; Fri, 20 Aug 2010 14:02:49 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmVvU-0003zb-Dn for 6888@debbugs.gnu.org; Fri, 20 Aug 2010 14:02:48 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OmVwc-00069Z-1c; Fri, 20 Aug 2010 14:03:58 -0400 To: =?iso-8859-1?Q?=C9ric?= Martin Subject: Re: bug#6888: 23.2; Problem with focus-follows-mouse on OS X References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> From: Glenn Morris X-Spook: FTS2000 embassy TELINT Rumsfeld Etacs Rand Corporation X-Ran: N]sHoc?jcu\W-j!YJz3]uwErrP',F$;ts$4*#@fO|))7,tv,Zqow~9K?hL]@{0~_JIN-Y4 X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Fri, 20 Aug 2010 14:03:57 -0400 In-Reply-To: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> (=?iso-8859-1?Q?=22=C9ric?= Martin"'s message of "Fri\, 20 Aug 2010 15\:34\:52 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -6.2 (------) X-Debbugs-Envelope-To: 6888 Cc: 6888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.2 (------) =C9ric Martin wrote: > '(focus-follows-mouse t) > '(mouse-autoselect-window t)) [...] > it is still necessary to click on a window to select it. Your subject says "problem with focus-follows-mouse", but your use of the word "window" above suggests a problem with mouse-autoselect-window. There appears to be no code in src/ns*.m that does anything with mouse_autoselect_window, so it looks to me like this feature is not implemented for NS. > In GNU Emacs 23.2.1 (x86_64-apple-darwin10.4.0, NS apple-appkit-1038.32) > of 2010-08-20 on new-host.home > Windowing system distributor `Apple', version 10.3.1038 > configured using `configure '--with-ns'' From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 20 14:13:10 2010 Received: (at 6888) by debbugs.gnu.org; 20 Aug 2010 18:13:10 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmW5W-00044m-67 for submit@debbugs.gnu.org; Fri, 20 Aug 2010 14:13:10 -0400 Received: from note.orchestra.cse.unsw.edu.au ([129.94.242.24]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OmW3V-00043K-3b for 6888@debbugs.gnu.org; Fri, 20 Aug 2010 14:11:06 -0400 Received: From new-host.home ([81.53.147.221] == ARennes-257-1-68-221.w81-53.abo.wanadoo.fr) (auth-user emartin) (cse-authentic-sender emartin) By note With Smtp ; Sat, 21 Aug 2010 04:12:08 +1000 From: =?iso-8859-1?Q?=C9ric_Martin?= To: Glenn Morris Date: Fri, 20 Aug 2010 20:12:02 +0200 Subject: Re: bug#6888: 23.2; Problem with focus-follows-mouse on OS X Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=iso-8859-1 In-Reply-To: Content-Transfer-Encoding: quoted-printable Message-Id: <073415B0-EB99-43E8-B9F9-F0B00A3789FE@cse.unsw.edu.au> References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> X-Mailer: Apple Mail (2.1081) X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: 6888 X-Mailman-Approved-At: Fri, 20 Aug 2010 14:13:08 -0400 Cc: 6888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) On 20/08/2010, at 8:03 PM, Glenn Morris wrote: > =C9ric Martin wrote: >=20 >> '(focus-follows-mouse t) >> '(mouse-autoselect-window t)) > [...] >> it is still necessary to click on a window to select it. >=20 > Your subject says "problem with focus-follows-mouse", but your use of > the word "window" above suggests a problem with = mouse-autoselect-window. >=20 Sorry, I should have written "problem with mouse_autoselect_window or = focus-follows-mouse", as it seems that both variables need to be set = properly for the feature to work. > There appears to be no code in src/ns*.m that does anything with > mouse_autoselect_window, so it looks to me like this feature is not > implemented for NS. Ok, so some features implemented in Emacs 22 have been dropped in Emacs = 23? >=20 >> In GNU Emacs 23.2.1 (x86_64-apple-darwin10.4.0, NS = apple-appkit-1038.32) >> of 2010-08-20 on new-host.home >> Windowing system distributor `Apple', version 10.3.1038 >> configured using `configure '--with-ns'' From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 21 13:16:51 2013 Received: (at 6888) by debbugs.gnu.org; 21 Aug 2013 17:16:51 +0000 Received: from localhost ([127.0.0.1]:45351 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCC1a-0000Xu-BI for submit@debbugs.gnu.org; Wed, 21 Aug 2013 13:16:50 -0400 Received: from hajek.stat.ubc.ca ([142.103.121.1]:40034) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VCBtM-0000JW-Tt for 6888@debbugs.gnu.org; Wed, 21 Aug 2013 13:08:21 -0400 Received: from whistler.stat.ubc.ca (whistler.stat.ubc.ca [142.103.175.134]) (authenticated bits=0) by hajek.stat.ubc.ca (8.14.5/8.14.5) with ESMTP id r7LH8JIC023332 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for <6888@debbugs.gnu.org>; Wed, 21 Aug 2013 10:08:20 -0700 (PDT) From: Davor Cubranic Content-Type: multipart/mixed; boundary="Apple-Mail=_D7BBB093-89FA-4E9E-9860-C2F33CD88E54" Subject: Patch for mouse-autoselect-window on NextStep platforms Date: Wed, 21 Aug 2013 10:08:19 -0700 Message-Id: To: 6888@debbugs.gnu.org Mime-Version: 1.0 (Apple Message framework v1283) X-Mailer: Apple Mail (2.1283) X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 6888 X-Mailman-Approved-At: Wed, 21 Aug 2013 13:16:49 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) --Apple-Mail=_D7BBB093-89FA-4E9E-9860-C2F33CD88E54 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii FWIW, I was able to copy the SELECT_WINDOW_EVENT code from X (xterm.c) = and Win32 (w32term.c) into nsterm.m, adjusting for a few minor = differences in variable naming. Focus-follows-mouse on windows within = the active frame when mouse-autoselect-window is not nil now works fine = in my (not extensive) use of Emacs on my computer. Patch attached. Davor --Apple-Mail=_D7BBB093-89FA-4E9E-9860-C2F33CD88E54 Content-Disposition: attachment; filename=ns-select-window-event.diff Content-Type: application/octet-stream; name="ns-select-window-event.diff" Content-Transfer-Encoding: 7bit diff --git a/src/ChangeLog b/src/ChangeLog index f62c8ab..6c7ef59 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-08-21 Davor Cubranic + + * nsterm.m (mouseMoved): Add support for mouse-autoselect-window + on nextstep (Bug#6888). + 2013-07-15 Glenn Morris * image.c (Fimage_flush): Fix doc typo. diff --git a/src/nsterm.m b/src/nsterm.m index a57e744..217272e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -169,6 +169,9 @@ struct ns_display_info *x_display_list; /* Chain of existing displays */ Lisp_Object ns_display_name_list; long context_menu_value = 0; +/* Last window where we saw the mouse. Used by mouse-autoselect-window. */ +static Lisp_Object last_window; + /* display update */ NSPoint last_mouse_motion_position; static NSRect last_mouse_glyph; @@ -5316,6 +5319,34 @@ not_in_argv (NSString *arg) previous_help_echo_string = help_echo_string; help_echo_string = Qnil; + if (!NILP (Vmouse_autoselect_window) ) { + NSTRACE (mouse_autoselect_window); + Lisp_Object window; + window = window_from_coordinates(emacsframe, last_mouse_motion_position.x, + last_mouse_motion_position.y, 0, 0); + if (WINDOWP (window) + && !EQ (window, last_window) + && !EQ (window, selected_window) + && (focus_follows_mouse + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) { + NSTRACE (in_window); + emacs_event->kind = SELECT_WINDOW_EVENT; + emacs_event->frame_or_window = window; + emacs_event->timestamp = EV_TIMESTAMP(e); + if (q_event_ptr) + { + n_emacs_events_pending++; + kbd_buffer_store_event_hold (emacs_event, q_event_ptr); + } + else + hold_event (emacs_event); + + EVENT_INIT (*emacs_event); + } + last_window = window; + } + if (!note_mouse_movement (emacsframe, last_mouse_motion_position.x, last_mouse_motion_position.y)) help_echo_string = previous_help_echo_string; --Apple-Mail=_D7BBB093-89FA-4E9E-9860-C2F33CD88E54-- From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 23 03:09:51 2013 Received: (at 6888) by debbugs.gnu.org; 23 Aug 2013 07:09:51 +0000 Received: from localhost ([127.0.0.1]:49319 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VClVG-0000Om-EN for submit@debbugs.gnu.org; Fri, 23 Aug 2013 03:09:50 -0400 Received: from mout.gmx.net ([212.227.17.21]:61071) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VClVD-0000Oa-L2 for 6888@debbugs.gnu.org; Fri, 23 Aug 2013 03:09:48 -0400 Received: from [62.47.51.135] ([62.47.51.135]) by mail.gmx.com (mrgmx102) with ESMTPA (Nemesis) id 0LcVOE-1VtHmX05Ek-00jqDK for <6888@debbugs.gnu.org>; Fri, 23 Aug 2013 09:09:47 +0200 Message-ID: <52170AB7.7080303@gmx.at> Date: Fri, 23 Aug 2013 09:09:43 +0200 From: martin rudalics MIME-Version: 1.0 To: Davor Cubranic Subject: Re: bug#6888: Patch for mouse-autoselect-window on NextStep platforms References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:5EwRv0Ec9DR91m9eefuPKIeenj+j0lIkGWIRSmdzKdZ8rlnqLVA zy8B7KixtVREvDS4GwhiWEWX8i5v/CqY4z883j0O7V4TMZjP1Ix+XdgiYD8vIQG2UlSBiu9 Of6go/kzQJl8yJzkuXk6117m0YvMZ6ZYrqgoZsqpHqeH4ChuIvwjEAH5hxFayxX9LHPrFVq g1SIxXTPb6h0dYKjuUmyQ== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 6888 Cc: 6888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > FWIW, I was able to copy the SELECT_WINDOW_EVENT code from X (xterm.c) > and Win32 (w32term.c) into nsterm.m, adjusting for a few minor > differences in variable naming. Focus-follows-mouse on windows within > the active frame when mouse-autoselect-window is not nil now works > fine in my (not extensive) use of Emacs on my computer. Patch > attached. Thank you. Can someone on NS please check whether Davor's patch compiles cleanly? Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 24 05:24:25 2013 Received: (at 6888) by debbugs.gnu.org; 24 Aug 2013 09:24:25 +0000 Received: from localhost ([127.0.0.1]:51799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDA52-0004k6-Tw for submit@debbugs.gnu.org; Sat, 24 Aug 2013 05:24:25 -0400 Received: from mail01.bdtv.se ([176.10.222.34]:53048) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1VDA4z-0004jw-OW for 6888@debbugs.gnu.org; Sat, 24 Aug 2013 05:24:22 -0400 Received: (qmail 2560 invoked by uid 89); 24 Aug 2013 09:24:20 -0000 Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.57) by mail01.bdtv.se with ESMTPA; 24 Aug 2013 09:24:20 -0000 Received: from [172.20.199.13] (unknown [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id 1076D1A0017; Sat, 24 Aug 2013 09:24:20 +0000 (UTC) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: bug#6888: Patch for mouse-autoselect-window on NextStep platforms From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <52170AB7.7080303@gmx.at> Date: Sat, 24 Aug 2013 11:24:18 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> <52170AB7.7080303@gmx.at> To: martin rudalics X-Mailer: Apple Mail (2.1508) X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 6888 Cc: Davor Cubranic , 6888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello. 23 aug 2013 kl. 09:09 skrev martin rudalics : > > FWIW, I was able to copy the SELECT_WINDOW_EVENT code from X = (xterm.c) > > and Win32 (w32term.c) into nsterm.m, adjusting for a few minor > > differences in variable naming. Focus-follows-mouse on windows = within > > the active frame when mouse-autoselect-window is not nil now works > > fine in my (not extensive) use of Emacs on my computer. Patch > > attached. >=20 > Thank you. Can someone on NS please check whether Davor's patch > compiles cleanly? It does but I don't want to check it in as is. It needs formatting = fixes and there is some unfortunate code duplication that needs to be = done in another way. Jan D. From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 26 09:16:39 2013 Received: (at 6888) by debbugs.gnu.org; 26 Aug 2013 13:16:39 +0000 Received: from localhost ([127.0.0.1]:56644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDwes-0006Rv-Qy for submit@debbugs.gnu.org; Mon, 26 Aug 2013 09:16:39 -0400 Received: from mout.gmx.net ([212.227.15.18]:62767) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDweo-0006Rj-Q1 for 6888@debbugs.gnu.org; Mon, 26 Aug 2013 09:16:35 -0400 Received: from [62.47.36.96] ([62.47.36.96]) by mail.gmx.com (mrgmx001) with ESMTPA (Nemesis) id 0MOf5S-1VA4lr3Nmo-0068P2 for <6888@debbugs.gnu.org>; Mon, 26 Aug 2013 15:16:33 +0200 Message-ID: <521B5529.2040408@gmx.at> Date: Mon, 26 Aug 2013 15:16:25 +0200 From: martin rudalics MIME-Version: 1.0 To: =?ISO-8859-1?Q?Jan_Dj=E4rv?= Subject: Re: bug#6888: Patch for mouse-autoselect-window on NextStep platforms References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> <52170AB7.7080303@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:jrRWCFEptKqWVswg1VH05+prOy1OLf9namAQAFRSI9tqL0xGwhr oe9csCdeojZjHUM5XSCrCv/jQ7YMwK/sX41ZxK7NRvJcBBx8hQj7TqFcLEyrst3ggiII6og I77WJtPoGn4nxNFxUJlxmSzTToQ6oW3z9JbspJn4aV679JuCJ2ktH+CshkPvEV+2jzc07qN +xwVIj+AhQpYlbS6bvY1g== X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 6888 Cc: Davor Cubranic , 6888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > It does but I don't want to check it in as is. It needs formatting fixes and there is some unfortunate code duplication that needs to be done in another way. Can you please tell Davor how to rewrite it? Thanks, martin From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 26 11:07:17 2013 Received: (at 6888) by debbugs.gnu.org; 26 Aug 2013 15:07:17 +0000 Received: from localhost ([127.0.0.1]:57174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDyNw-0000yN-Ms for submit@debbugs.gnu.org; Mon, 26 Aug 2013 11:07:17 -0400 Received: from mail01.bdtv.se ([176.10.222.34]:38055) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1VDyNt-0000yD-T1 for 6888@debbugs.gnu.org; Mon, 26 Aug 2013 11:07:15 -0400 Received: (qmail 29561 invoked by uid 89); 26 Aug 2013 15:07:11 -0000 Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.57) by mail01.bdtv.se with ESMTPA; 26 Aug 2013 15:07:11 -0000 Received: from [172.20.199.13] (unknown [172.20.199.13]) by coolsville.localdomain (Postfix) with ESMTPSA id B553D1A008F; Mon, 26 Aug 2013 15:07:11 +0000 (UTC) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: bug#6888: Patch for mouse-autoselect-window on NextStep platforms From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: <521B5529.2040408@gmx.at> Date: Mon, 26 Aug 2013 17:07:14 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <7C338BEC-71B9-4790-9F53-AF95FF80F3ED@swipnet.se> References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> <52170AB7.7080303@gmx.at> <521B5529.2040408@gmx.at> To: martin rudalics X-Mailer: Apple Mail (2.1508) X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 6888 Cc: Davor Cubranic , 6888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) 26 aug 2013 kl. 15:16 skrev martin rudalics : >> It does but I don't want to check it in as is. It needs formatting = fixes and there is some unfortunate code duplication that needs to be = done in another way. >=20 > Can you please tell Davor how to rewrite it? >=20 > Thanks, martin =3D=3D=3D modified file 'src/nsterm.m' --- src/nsterm.m 2013-08-23 04:03:25 +0000 +++ src/nsterm.m 2013-08-24 09:18:57 +0000 @@ -184,6 +184,9 @@ Lisp_Object ns_display_name_list; long context_menu_value =3D 0; =20 +/* Last window where we saw the mouse. Used by = mouse-autoselect-window. */ +static Lisp_Object last_window; + /* display update */ NSPoint last_mouse_motion_position; static NSRect last_mouse_glyph; @@ -308,8 +311,13 @@ /* This is a piece of code which is common to all the event handling methods. Maybe it should even be a function. */ #define EV_TRAILER(e) = \ - { = \ - XSETFRAME (emacs_event->frame_or_window, emacsframe); = \ + { = \ + XSETFRAME (emacs_event->frame_or_window, emacsframe); = \ + EV_TRAILER2 (e); = \ + } + +#define EV_TRAILER2(e) = \ + { = \ if (e) emacs_event->timestamp =3D EV_TIMESTAMP (e); = \ if (q_event_ptr) = \ { = \ @@ -5490,6 +5498,27 @@ previous_help_echo_string =3D help_echo_string; help_echo_string =3D Qnil; =20 + if (!NILP (Vmouse_autoselect_window)) + { + NSTRACE (mouse_autoselect_window); + Lisp_Object window; + window =3D window_from_coordinates(emacsframe, = last_mouse_motion_position.x, + last_mouse_motion_position.y, 0, = 0); + if (WINDOWP (window) + && !EQ (window, last_window) + && !EQ (window, selected_window) + && (focus_follows_mouse + || (EQ (XWINDOW (window)->frame, + XWINDOW (selected_window)->frame)))) + { + NSTRACE (in_window); + emacs_event->kind =3D SELECT_WINDOW_EVENT; + emacs_event->frame_or_window =3D window; + EV_TRAILER2 (e); + } + last_window =3D window; + } + if (!note_mouse_movement (emacsframe, last_mouse_motion_position.x, last_mouse_motion_position.y)) help_echo_string =3D previous_help_echo_string; From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 26 12:30:12 2013 Received: (at 6888) by debbugs.gnu.org; 26 Aug 2013 16:30:13 +0000 Received: from localhost ([127.0.0.1]:57331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDzgB-00037Y-Rw for submit@debbugs.gnu.org; Mon, 26 Aug 2013 12:30:12 -0400 Received: from hajek.stat.ubc.ca ([142.103.121.1]:51241) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VDzg7-00036p-KI for 6888@debbugs.gnu.org; Mon, 26 Aug 2013 12:30:08 -0400 Received: from whistler.stat.ubc.ca (whistler.stat.ubc.ca [142.103.175.134]) (authenticated bits=0) by hajek.stat.ubc.ca (8.14.5/8.14.5) with ESMTP id r7QGU55J025754 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 26 Aug 2013 09:30:05 -0700 (PDT) Subject: Re: bug#6888: Patch for mouse-autoselect-window on NextStep platforms Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=iso-8859-1 From: Davor Cubranic In-Reply-To: Date: Mon, 26 Aug 2013 09:30:05 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> <52170AB7.7080303@gmx.at> To: =?iso-8859-1?Q?Jan_Dj=E4rv?= X-Mailer: Apple Mail (2.1283) X-Spam-Score: -2.4 (--) X-Debbugs-Envelope-To: 6888 Cc: martin rudalics , 6888@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) On 2013-08-24, at 2:24 AM, Jan Dj=E4rv wrote: > 23 aug 2013 kl. 09:09 skrev martin rudalics : >=20 >> Thank you. Can someone on NS please check whether Davor's patch >> compiles cleanly? >=20 > It does but I don't want to check it in as is. It needs formatting = fixes and there is some unfortunate code duplication that needs to be = done in another way. Yes, I don't know enough about Emacs's source architecture, so I = deliberately duplicated code from other platforms whenever I could. I = just wanted a basic fix that I could submit to this list for further = discussion and refinement. Thanks for taking it, Davor From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 28 12:21:27 2013 Received: (at 6888-done) by debbugs.gnu.org; 28 Aug 2013 16:21:27 +0000 Received: from localhost ([127.0.0.1]:33556 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VEiUm-0006Yo-Id for submit@debbugs.gnu.org; Wed, 28 Aug 2013 12:21:26 -0400 Received: from mail01.bdtv.se ([176.10.222.34]:56798) by debbugs.gnu.org with smtp (Exim 4.80) (envelope-from ) id 1VEiUi-0006Yb-MC for 6888-done@debbugs.gnu.org; Wed, 28 Aug 2013 12:21:21 -0400 Received: (qmail 27412 invoked by uid 89); 28 Aug 2013 16:21:18 -0000 Received: from h-46-59-42-57.na.cust.bahnhof.se (HELO coolsville.localdomain) (boel.djarv@bdtv.se@46.59.42.57) by mail01.bdtv.se with ESMTPA; 28 Aug 2013 16:21:18 -0000 Received: from anon-61-71.vpn.ipredator.se (unknown [46.246.61.71]) by coolsville.localdomain (Postfix) with ESMTPSA id 4ECE11A036E; Wed, 28 Aug 2013 16:21:18 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Subject: Re: bug#6888: Patch for mouse-autoselect-window on NextStep platforms From: =?iso-8859-1?Q?Jan_Dj=E4rv?= In-Reply-To: Date: Wed, 28 Aug 2013 18:21:22 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: References: <3A99758B-67F8-471C-A702-335D6BB5DC14@cse.unsw.edu.au> To: Davor Cubranic X-Mailer: Apple Mail (2.1508) X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 6888-done Cc: 6888-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) Hello. I've checked in a slightly modified version. Jan D. 21 aug 2013 kl. 19:08 skrev Davor Cubranic : > FWIW, I was able to copy the SELECT_WINDOW_EVENT code from X (xterm.c) = and Win32 (w32term.c) into nsterm.m, adjusting for a few minor = differences in variable naming. Focus-follows-mouse on windows within = the active frame when mouse-autoselect-window is not nil now works fine = in my (not extensive) use of Emacs on my computer. Patch attached. >=20 > Davor > From unknown Sat Jun 21 05:14:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 26 Sep 2013 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator