GNU bug report logs - #47731
28.0.50; Switching frame via keyboard does not fire focus change event

Previous Next

Package: emacs;

Reported by: Sean Farley <sean <at> farley.io>

Date: Mon, 12 Apr 2021 16:19:02 UTC

Severity: normal

Tags: confirmed, help

Merged with 3397, 37529

Found in versions 27.0.50, 28.0.50

To reply to this bug, email your comments to 47731 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#47731; Package emacs. (Mon, 12 Apr 2021 16:19:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Sean Farley <sean <at> farley.io>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 12 Apr 2021 16:19:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sean Farley <sean <at> farley.io>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Switching frame via keyboard does not fire focus change event
Date: Mon, 12 Apr 2021 11:17:15 -0500
Here is some testing code:
(defun test--focus-out ()
  (message "FOCUS TEST"))

(add-function :after after-focus-change-function #'test--focus-out)
(make-frame)

On macOS, this code runs fine if you click on the other frame. But if
using the keyboard shortcut Command-` the event doesn't fire. It seems
to be some interaction in the keydown event function where emacs_event
is cleared before the call to windowDidBecomeKey.


In GNU Emacs 28.0.50 (build 2, x86_64-apple-darwin20.3.0, NS appkit-2022.30 Version 11.2.2 (Build 20D80))
 of 2021-03-09 built on laptop
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.2.3

Configured using:
 'configure --disable-dependency-tracking --disable-silent-rules
 --enable-locallisppath=/usr/local/share/emacs/site-lisp
 --infodir=/usr/local/Cellar/emacs-plus <at> 28/28.0.50/share/info/emacs
 --prefix=/usr/local/Cellar/emacs-plus <at> 28/28.0.50 --with-xml2
 --with-gnutls --with-native-compilation --with-dbus --with-imagemagick
 --with-modules --with-rsvg --with-ns --disable-ns-self-contained
 'CFLAGS=-I/usr/local/opt/gcc/include -I/usr/local/opt/libgccjit/include
 -I/usr/local/opt/gmp/include -I/usr/local/opt/jpeg/include'
 'LDFLAGS=-L/usr/local/lib/gcc/10 -I/usr/local/opt/gcc/include
 -I/usr/local/opt/libgccjit/include -I/usr/local/opt/gmp/include
 -I/usr/local/opt/jpeg/include''

Configured features:
ACL DBUS GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG THREADS TIFF
TOOLKIT_SCROLL_BARS XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ObjC//l

Minor modes in effect:
  org-roam-mode: t
  treemacs-filewatch-mode: t
  treemacs-git-mode: simple
  treemacs-fringe-indicator-mode: t
  lsp-diagnostics-mode: t
  lsp-modeline-workspace-status-mode: t
  lsp-modeline-diagnostics-mode: t
  lsp-modeline-code-actions-mode: t
  lsp-ui-mode: t
  lsp-ui-imenu-buffer-mode: t
  lsp-ui-sideline-mode: t
  lsp-completion-mode: t
  lsp-managed-mode: t
  lsp-mode: t
  bug-reference-prog-mode: t
  rainbow-delimiters-mode: t
  highlight-numbers-mode: t
  hl-todo-mode: t
  git-gutter-mode: t
  whitespace-mode: t
  display-fill-column-indicator-mode: t
  vi-tilde-fringe-mode: t
  display-line-numbers-mode: t
  highlight-indent-guides-mode: t
  flycheck-posframe-mode: t
  yas-minor-mode: t
  gcmh-mode: t
  winner-mode: t
  show-paren-mode: t
  smartparens-global-mode: t
  smartparens-mode: t
  global-undo-fu-session-mode: t
  undo-fu-session-mode: t
  undo-fu-mode: t
  global-flycheck-mode: t
  flycheck-mode: t
  ws-butler-global-mode: t
  editorconfig-mode: t
  recentf-mode: t
  save-place-mode: t
  global-so-long-mode: t
  global-git-commit-mode: t
  shell-dirtrack-mode: t
  which-key-mode: t
  savehist-mode: t
  better-jumper-mode: t
  better-jumper-local-mode: t
  company-box-mode: t
  global-company-mode: t
  company-mode: t
  ivy-posframe-mode: t
  ivy-prescient-mode: t
  prescient-persist-mode: t
  ivy-rich-project-root-cache-mode: t
  ivy-rich-mode: t
  ivy-mode: t
  volatile-highlights-mode: t
  global-hl-line-mode: t
  hl-line-mode: t
  dtrt-indent-mode: t
  doom-modeline-mode: t
  global-page-break-lines-mode: t
  whole-line-or-region-global-mode: t
  whole-line-or-region-local-mode: t
  global-dot-mode: t
  dot-mode: t
  fancy-narrow-mode: t
  global-tree-sitter-mode: t
  solaire-global-mode: t
  solaire-mode: t
  persp-mode: t
  delete-selection-mode: t
  projectile-mode: t
  ns-auto-titlebar-mode: t
  +lsp-optimization-mode: t
  +popup-mode: t
  general-override-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  window-divider-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  abbrev-mode: t
  hs-minor-mode: t

Load-path shadows:
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/ht/ht hides /Users/sean/projects/doom-emacs/.local/elpa/ht-20210119.141/ht
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/esxml/esxml-query hides /Users/sean/projects/doom-emacs/.local/elpa/esxml-20201226.1546/esxml-query
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/esxml/esxml hides /Users/sean/projects/doom-emacs/.local/elpa/esxml-20201226.1546/esxml
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/esxml/esxml-pkg hides /Users/sean/projects/doom-emacs/.local/elpa/esxml-20201226.1546/esxml-pkg
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/a/a hides /Users/sean/projects/doom-emacs/.local/elpa/a-20201203.1327/a
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/f/f hides /Users/sean/projects/doom-emacs/.local/elpa/f-20210113.118/f
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/dash-functional/dash-functional hides /Users/sean/projects/doom-emacs/.local/elpa/dash-functional-20210210.849/dash-functional
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/dash/dash hides /Users/sean/projects/doom-emacs/.local/elpa/dash-20210210.849/dash
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/dash/dash-autoloads hides /Users/sean/projects/doom-emacs/.local/elpa/dash-20210210.849/dash-autoloads
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/ov/ov-autoloads hides /Users/sean/projects/doom-emacs/.local/elpa/ov-20200326.542/ov-autoloads
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/ov/ov hides /Users/sean/projects/doom-emacs/.local/elpa/ov-20200326.542/ov
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/request/request hides /Users/sean/projects/doom-emacs/.local/elpa/request-20210213.1837/request
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/s/s hides /Users/sean/projects/doom-emacs/.local/elpa/s-20200330.1554/s
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/cmake-mode/cmake-mode hides /usr/local/share/emacs/site-lisp/cmake/cmake-mode
/Users/sean/projects/doom-emacs/.local/straight/build-28.0.50/map/map hides /usr/local/Cellar/emacs-plus <at> 28/28.0.50/share/emacs/28.0.50/lisp/emacs-lisp/map

Features:
(magit-extras forge-list forge-commands forge-semi forge-bitbucket buck
forge-gogs gogs forge-gitea gtea forge-gitlab glab forge-github
forge-notify forge-revnote forge-pullreq forge-issue forge-topic
forge-post forge-repo forge forge-core forge-db closql emacsql-sqlite
shadow emacsbug magit-gitflow org-eldoc toc-org org-indent ol-bibtex
bibtex windmove vterm term ehelp vterm-module term/xterm xterm
mu4e-patch mu4e-alert time alert log4e notifications gntp org-mu4e mu4e
mu4e-org mu4e-main mu4e-view mu4e-headers mu4e-compose mu4e-context
mu4e-draft mu4e-actions ido rfc2368 smtpmail sendmail mu4e-mark
mu4e-proc mu4e-utils doc-view image-mode exif mu4e-lists mu4e-message
shr kinsoku svg flow-fill mu4e-vars macrostep-c cmacexp macrostep amx
hide-mode-line tramp-archive tramp-gvfs dbus docker-tramp tramp-cache
tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat
parse-time iso8601 ls-lisp jka-compr flycheck-cask flycheck-package
package-lint finder finder-inf lisp-mnt elisp-slime-nav highlight-quoted
org-agenda orgit magit-todos pcre2el rxt re-builder async github-review
ghub-graphql treepy gsexp ghub url-http url-gw url-auth deferred a
treemacs-magit magit-autoloads magit-submodule magit-obsolete
magit-popup magit-blame magit-stash magit-reflog magit-bisect magit-push
magit-pull magit-fetch magit-clone magit-remote magit-commit
magit-sequence magit-notes magit-worktree magit-tag magit-merge
magit-branch magit-reset magit-files magit-refs magit-status magit
magit-repos magit-apply magit-wip magit-log which-func magit-diff
smerge-mode diff magit-core magit-autorevert magit-margin
magit-transient magit-process magit-mode org-roam org-roam-link
org-roam-graph xml org-roam-doctor org-roam-dailies org-roam-capture
org-roam-db emacsql-sqlite3 emacsql emacsql-compiler org-capture
org-roam-completion org-roam-buffer org-roam-faces org-roam-macs
org-roam-compat org-id org-refile smartparens-org org-yt org-element
avl-tree org org-pcomplete org-version ob-emacs-lisp org-table
org-loaddefs ob ob-tangle ol ob-ref ob-lob ob-table ob-exp org-macro
org-footnote org-src org-keys ob-comint ob-core ob-eval lsp-treemacs
lsp-treemacs-themes treemacs-persp treemacs-projectile treemacs
treemacs-header-line treemacs-compatibility treemacs-mode
treemacs-interface treemacs-extensions treemacs-mouse-interface
treemacs-tags treemacs-persistence treemacs-filewatch-mode
treemacs-follow-mode treemacs-rendering treemacs-async
treemacs-workspaces treemacs-dom treemacs-visuals
treemacs-fringe-indicator treemacs-scope treemacs-faces treemacs-icons
treemacs-themes treemacs-core-utils pfuture treemacs-logging
treemacs-customization treemacs-macros company-yasnippet lsp-diagnostics
lsp-modeline lsp-ui lsp-ui-flycheck lsp-ui-doc goto-addr lsp-ui-imenu
lsp-ui-peek lsp-ui-sideline lsp-ui-util view lsp-zig lsp-steep
lsp-svelte lsp-sqls lsp-yaml lsp-xml lsp-vimscript lsp-vhdl lsp-vetur
lsp-html lsp-verilog lsp-vala lsp-terraform lsp-tex lsp-sorbet
lsp-solargraph lsp-rust lsp-rf lsp-r lsp-purescript lsp-pyls lsp-pwsh
lsp-php lsp-perl lsp-ocaml lsp-nix lsp-nim lsp-lua lsp-kotlin lsp-json
lsp-javascript lsp-haxe lsp-groovy lsp-hack lsp-go lsp-completion
lsp-gdscript lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-elixir
lsp-elm lsp-dockerfile lsp-dhall lsp-d lsp-css lsp-csharp gnutls
lsp-crystal lsp-cmake lsp-clojure lsp-clangd dom lsp-bash lsp-angular
lsp-ada lsp-actionscript lsp-python-ms ccls ccls-member-hierarchy
ccls-inheritance-hierarchy ccls-call-hierarchy ccls-tree ccls-code-lens
ccls-semantic-highlight ccls-common lsp-mode lsp-protocol spinner
network-stream nsm lv imenu ht inline ewoc vc bug-reference
rainbow-delimiters highlight-numbers parent-mode hl-todo hideshow
smartparens-c cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs octave smie pyvenv eshell esh-cmd
esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util
org-list org-entities org-faces org-compat org-macs cal-menu calendar
cal-loaddefs core-packages package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf mailcap
url-handlers git-gutter-fringe fringe-helper git-gutter vc-git diff-mode
vc-dispatcher url-util auto-minor-mode disp-table whitespace
display-fill-column-indicator vi-tilde-fringe display-line-numbers
highlight-indent-guides doom-snippets doom-snippets-lib yasnippet
flycheck-posframe elisp-mode adaptive-wrap spell-fu ispell
smartparens-markdown markdown-mode edit-indirect url-parse url-vars
noutline outline editorconfig-core editorconfig-core-handle
editorconfig-fnmatch gcmh winner paren smartparens-config
smartparens-text smartparens undo-fu-session undo-fu flycheck-clj-kondo
flycheck find-func ws-butler editorconfig recentf saveplace so-long
git-commit with-editor shell pcomplete transient format-spec log-edit
message rmc puny rfc822 mml mml-sec epa epg epg-config gnus-util rmail
rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr mailabbrev
mail-utils gmm-utils mailheader pcvs-util add-log magit-git
magit-section magit-utils crm char-fold nav-flash pulse cursor-sensor
counsel-projectile which-key savehist better-jumper company-box
company-box-doc frame-local company-box-icons dash-functional
company-capf company ivy-posframe posframe ivy-prescient prescient etags
fileloop generator ivy-xref ivy-avy avy autorevert filenotify
all-the-icons-ivy ivy-rich counsel xdg swiper ivy ivy-faces ivy-overlay
colir color xref project volatile-highlights server objed objed-objects
hl-line cap-words superword subword face-remap bitwarden tree-widget
wid-edit auth-source eieio eieio-core eieio-loaddefs password-cache json
dtrt-indent doom-modeline doom-modeline-segments doom-modeline-env
doom-modeline-core shrink-path f all-the-icons all-the-icons-faces
data-material data-weathericons data-octicons data-fileicons
data-faicons data-alltheicons dash page-break-lines whole-line-or-region
dot-mode fancy-narrow advice simple-mpc simple-mpc-query
simple-mpc-current-playlist simple-mpc-utils simple-mpc-vars
simple-mpc-mode s tree-sitter tree-sitter-load tree-sitter-cli map tsc
tsc-dyn tsc-dyn-get dired-aux dired dired-loaddefs tsc-obsolete
doom-themes-ext-org doom-themes-ext-treemacs solaire-mode
doom-nord-theme doom-themes doom-themes-base persp-mode delsel
projectile grep compile text-property-search comint ansi-color ring
ibuffer-vc ibuf-ext ibuffer ibuffer-loaddefs thingatpt mu4e-meta
html2text let-alist smartparens-lua ns-auto-titlebar ibuf-macs derived
core-editor core-projects core-ui edmacro kmacro easy-mmode comp
comp-cstr warnings core-keybinds pp general cl-extra help-mode seq
byte-opt cl-seq use-package-core bytecomp byte-compile cconv
core-modules cl tex-site rx realgud-recursive-autoloads core core-lib
cl-macs gv cl-loaddefs cl-lib subr-x iso-transl tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax facemenu
font-core term/tty-colors frame minibuffer cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face pcase macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
kqueue cocoa ns lcms2 multi-tty make-network-process nativecomp emacs)

Memory information:
((conses 16 1874513 799203)
 (symbols 48 82098 111)
 (strings 32 470148 35028)
 (string-bytes 1 11748287)
 (vectors 16 152617)
 (vector-slots 8 4289570 458845)
 (floats 8 2762 2729)
 (intervals 56 96788 26251)
 (buffers 992 39))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47731; Package emacs. (Thu, 06 May 2021 09:55:02 GMT) Full text and rfc822 format available.

Message #8 received at 47731 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Sean Farley <sean <at> farley.io>
Cc: Alan Third <alan <at> idiocy.org>, 47731 <at> debbugs.gnu.org
Subject: Re: bug#47731: 28.0.50; Switching frame via keyboard does not fire
 focus change event
Date: Thu, 06 May 2021 11:54:10 +0200
Sean Farley <sean <at> farley.io> writes:

> Here is some testing code:
> (defun test--focus-out ()
>   (message "FOCUS TEST"))
>
> (add-function :after after-focus-change-function #'test--focus-out)
> (make-frame)
>
> On macOS, this code runs fine if you click on the other frame. But if
> using the keyboard shortcut Command-` the event doesn't fire. It seems
> to be some interaction in the keydown event function where emacs_event
> is cleared before the call to windowDidBecomeKey.

I haven't tested the recipe, but perhaps Alan has some comments here
(added to the CCs).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47731; Package emacs. (Thu, 06 May 2021 17:59:01 GMT) Full text and rfc822 format available.

Message #11 received at 47731 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: Sean Farley <sean <at> farley.io>, 47731 <at> debbugs.gnu.org
Subject: Re: bug#47731: 28.0.50; Switching frame via keyboard does not fire
 focus change event
Date: Thu, 6 May 2021 18:57:53 +0100
On Thu, May 06, 2021 at 11:54:10AM +0200, Lars Ingebrigtsen wrote:
> Sean Farley <sean <at> farley.io> writes:
> 
> > Here is some testing code:
> > (defun test--focus-out ()
> >   (message "FOCUS TEST"))
> >
> > (add-function :after after-focus-change-function #'test--focus-out)
> > (make-frame)
> >
> > On macOS, this code runs fine if you click on the other frame. But if
> > using the keyboard shortcut Command-` the event doesn't fire. It seems
> > to be some interaction in the keydown event function where emacs_event
> > is cleared before the call to windowDidBecomeKey.
> 
> I haven't tested the recipe, but perhaps Alan has some comments here
> (added to the CCs).

Interestingly the NS port only generates Emacs events for things that
happen within the NS run loop, which excludes many things that are
initiated by Emacs itself.

I'm not sure how to fix this as I'm not sure why it's set up this way.
-- 
Alan Third




Merged 3397 47731. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Thu, 26 Aug 2021 18:36:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47731; Package emacs. (Sun, 29 Aug 2021 03:25:02 GMT) Full text and rfc822 format available.

Message #16 received at 47731 <at> debbugs.gnu.org (full text, mbox):

From: Sean Farley <sean <at> farley.io>
To: Alan Third <alan <at> idiocy.org>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 47731 <at> debbugs.gnu.org
Subject: Re: bug#47731: 28.0.50; Switching frame via keyboard does not fire
 focus change event
Date: Sat, 28 Aug 2021 22:23:35 -0500
Alan Third <alan <at> idiocy.org> writes:

> On Thu, May 06, 2021 at 11:54:10AM +0200, Lars Ingebrigtsen wrote:
>> Sean Farley <sean <at> farley.io> writes:
>>
>> > Here is some testing code:
>> > (defun test--focus-out ()
>> >   (message "FOCUS TEST"))
>> >
>> > (add-function :after after-focus-change-function #'test--focus-out)
>> > (make-frame)
>> >
>> > On macOS, this code runs fine if you click on the other frame. But if
>> > using the keyboard shortcut Command-` the event doesn't fire. It seems
>> > to be some interaction in the keydown event function where emacs_event
>> > is cleared before the call to windowDidBecomeKey.
>>
>> I haven't tested the recipe, but perhaps Alan has some comments here
>> (added to the CCs).
>
> Interestingly the NS port only generates Emacs events for things that
> happen within the NS run loop, which excludes many things that are
> initiated by Emacs itself.
>
> I'm not sure how to fix this as I'm not sure why it's set up this way.

Is there anything I can do to help?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#47731; Package emacs. (Sun, 29 Aug 2021 09:39:02 GMT) Full text and rfc822 format available.

Message #19 received at 47731 <at> debbugs.gnu.org (full text, mbox):

From: Alan Third <alan <at> idiocy.org>
To: Sean Farley <sean <at> farley.io>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 47731 <at> debbugs.gnu.org
Subject: Re: bug#47731: 28.0.50; Switching frame via keyboard does not fire
 focus change event
Date: Sun, 29 Aug 2021 10:38:38 +0100
On Sat, Aug 28, 2021 at 10:23:35PM -0500, Sean Farley via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote:
> 
> Alan Third <alan <at> idiocy.org> writes:
> 
> > On Thu, May 06, 2021 at 11:54:10AM +0200, Lars Ingebrigtsen wrote:
> >> Sean Farley <sean <at> farley.io> writes:
> >>
> >> > Here is some testing code:
> >> > (defun test--focus-out ()
> >> >   (message "FOCUS TEST"))
> >> >
> >> > (add-function :after after-focus-change-function #'test--focus-out)
> >> > (make-frame)
> >> >
> >> > On macOS, this code runs fine if you click on the other frame. But if
> >> > using the keyboard shortcut Command-` the event doesn't fire. It seems
> >> > to be some interaction in the keydown event function where emacs_event
> >> > is cleared before the call to windowDidBecomeKey.
> >>
> >> I haven't tested the recipe, but perhaps Alan has some comments here
> >> (added to the CCs).
> >
> > Interestingly the NS port only generates Emacs events for things that
> > happen within the NS run loop, which excludes many things that are
> > initiated by Emacs itself.
> >
> > I'm not sure how to fix this as I'm not sure why it's set up this way.
> 
> Is there anything I can do to help?

Probably not at the moment. I think we need to rewrite the NS event
code so it will create events any time, and then test it to see if it
causes problems. I can't see any way it will, but I don't know why
it's written this way, so maybe I'm missing something.
-- 
Alan Third




Merged 3397 37529 47731. Request was from Alan Third <alan <at> idiocy.org> to control <at> debbugs.gnu.org. (Tue, 31 Aug 2021 19:40:02 GMT) Full text and rfc822 format available.

Added tag(s) help. Request was from Stefan Kangas <stefankangas <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 07 Mar 2025 20:51:01 GMT) Full text and rfc822 format available.

This bug report was last modified 96 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.