GNU bug report logs - #60356
30.0.50; individual frame loses keyboard focus, focus cannot be restored

Previous Next

Package: emacs;

Reported by: git <at> sphalerite.org

Date: Tue, 27 Dec 2022 15:36:01 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 60356 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#60356; Package emacs. (Tue, 27 Dec 2022 15:36:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to git <at> sphalerite.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 27 Dec 2022 15:36:01 GMT) Full text and rfc822 format available.

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

From: git <at> sphalerite.org
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; individual frame loses keyboard focus, focus cannot be
 restored
Date: Tue, 27 Dec 2022 13:19:44 +0100
The exact action leading to this bug is not clear to me. It seems to be
related to lsp-mode though -- I've not observed it happening without
lsp-mode.

The symptom is that a single frame will no longer accept keyboard input,
and will visually indicate that it is not focused (outline rectangular
cursor where I'd usually expect a solid rectangular cursor). Mouse input
still works, and other frames still accept keyboard input as normal.

I'd be glad if anyone could point out ways to further debug this issue.
I'm also in #emacs:matrix.org (@linus:schreibt.jetzt) in case
fast-turnaround communication would be helpful :)


In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.34, cairo version 1.16.0)
Repository revision: ad5a67996ddf23df904c09165475759e2e0a68b1
Repository branch: master
System Description: NixOS 22.11 (Raccoon)

Configured using:
 'configure
 --prefix=/nix/store/nj8sffdvjjxqadnv0j46ssj73q1k7z61-emacs-pgtk-20221221.0
 --disable-build-details --with-modules --with-x=no --with-xpm=no
 --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no
 --with-native-compilation --with-pgtk'

Configured features:
CAIRO DBUS FREETYPE GLIB GMP GNUTLS GSETTINGS HARFBUZZ JSON LIBSELINUX
LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK
SECCOMP SOUND SQLITE3 THREADS TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM
GTK3 ZLIB

Important settings:
  value of $EMACSLOADPATH: 
  value of $EMACSNATIVELOADPATH: /nix/store/fpz84pkf3j4cl2xr9qp2a5wszcdw97dl-emacs-packages-deps/share/emacs/native-lisp::
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Nix

Minor modes in effect:
  direnv-mode: t
  counsel-mode: t
  global-git-commit-mode: t
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  evil-mode: t
  evil-local-mode: t
  windmove-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  global-whitespace-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/linus/.nix-profile/share/emacs/site-lisp/site-start hides /nix/store/fpz84pkf3j4cl2xr9qp2a5wszcdw97dl-emacs-packages-deps/share/emacs/site-lisp/site-start
/home/linus/.nix-profile/share/emacs/site-lisp/site-start hides /nix/store/nj8sffdvjjxqadnv0j46ssj73q1k7z61-emacs-pgtk-20221221.0/share/emacs/site-lisp/site-start
/nix/store/fpz84pkf3j4cl2xr9qp2a5wszcdw97dl-emacs-packages-deps/share/emacs/site-lisp/elpa/transient-20221202.1727/transient hides /nix/store/nj8sffdvjjxqadnv0j46ssj73q1k7z61-emacs-pgtk-20221221.0/share/emacs/30.0.50/lisp/transient
/nix/store/fpz84pkf3j4cl2xr9qp2a5wszcdw97dl-emacs-packages-deps/share/emacs/site-lisp/elpa/nadvice-0.3/nadvice hides /nix/store/nj8sffdvjjxqadnv0j46ssj73q1k7z61-emacs-pgtk-20221221.0/share/emacs/30.0.50/lisp/emacs-lisp/nadvice
/nix/store/fpz84pkf3j4cl2xr9qp2a5wszcdw97dl-emacs-packages-deps/share/emacs/site-lisp/elpa/let-alist-1.0.6/let-alist hides /nix/store/nj8sffdvjjxqadnv0j46ssj73q1k7z61-emacs-pgtk-20221221.0/share/emacs/30.0.50/lisp/emacs-lisp/let-alist
/nix/store/fpz84pkf3j4cl2xr9qp2a5wszcdw97dl-emacs-packages-deps/share/emacs/site-lisp/elpa/eldoc-1.13.0/eldoc hides /nix/store/nj8sffdvjjxqadnv0j46ssj73q1k7z61-emacs-pgtk-20221221.0/share/emacs/30.0.50/lisp/emacs-lisp/eldoc

Features:
(shadow sort mail-extr emacsbug misearch multi-isearch mule-util
sh-script treesit executable cua-base sql nix-mode smie nix-repl
nix-shell nix-store nix-log nix-instantiate nix-shebang nix-format nix
lsp-diagnostics company-oddmuse company-keywords company-etags etags
fileloop generator company-gtags company-dabbrev-code company-dabbrev
company-files company-clang company-capf company-cmake company-semantic
company-template company-bbdb company lsp-headerline lsp-icons
lsp-modeline lsp-lens lsp-ui lsp-ui-flycheck lsp-ui-doc lsp-ui-imenu
lsp-ui-peek lsp-ui-sideline flycheck lsp-ui-util face-remap find-func
vc-svn view lsp-zig lsp-steep lsp-svelte lsp-sqls lsp-ruby-syntax-tree
lsp-yaml lsp-xml lsp-vimscript lsp-vhdl lsp-volar lsp-vetur lsp-html
lsp-verilog lsp-vala lsp-v lsp-typeprof lsp-ttcn3 lsp-toml lsp-terraform
lsp-tex lsp-sorbet lsp-solargraph lsp-rust lsp-rf lsp-remark lsp-racket
lsp-r lsp-purescript lsp-pylsp lsp-pyls lsp-pwsh lsp-php lsp-pls
lsp-perlnavigator lsp-perl lsp-openscad lsp-ocaml lsp-magik lsp-nix
lsp-nim lsp-nginx lsp-mint lsp-marksman lsp-markdown lsp-lua lsp-kotlin
lsp-json lsp-javascript lsp-idris lsp-haxe lsp-haskell lsp-groovy
lsp-hack lsp-graphql lsp-gleam lsp-go lsp-completion lsp-gdscript
lsp-fsharp lsp-fortran lsp-eslint lsp-erlang lsp-emmet lsp-elixir
lsp-elm lsp-dockerfile lsp-dhall lsp-d lsp-css lsp-csharp lsp-crystal
lsp-cmake lsp-clojure lsp-semantic-tokens lsp-clangd dom lsp-beancount
lsp-bash lsp-astro lsp-ansible lsp-angular lsp-ada lsp-actionscript
lsp-mode lsp-protocol tree-widget spinner network-stream nsm
markdown-mode noutline outline lv inline ht f f-shortdoc shortdoc s ewoc
vc-git vc-dispatcher rust-utils rust-mode rust-rustfmt rust-playpen
rust-compile rust-cargo dired-aux ffap tramp tramp-loaddefs trampver
tramp-integration cus-edit pp cus-start cus-load files-x tramp-compat
parse-time iso8601 ls-lisp direnv counsel xdg xref project compile
swiper ivy delsel ivy-faces ivy-overlay colir color notmuch notmuch-tree
notmuch-jump notmuch-hello wid-edit notmuch-show notmuch-print
notmuch-crypto notmuch-mua notmuch-message notmuch-draft
notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser
notmuch-wash coolj goto-addr icalendar diary-lib diary-loaddefs cal-menu
calendar cal-loaddefs notmuch-tag notmuch-lib notmuch-version
notmuch-compat pcase hl-line mm-view mml-smime smime gnutls dig
magit-submodule magit-obsolete 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 imenu
magit-diff smerge-mode diff-mode easy-mmode git-commit log-edit message
sendmail yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa
derived epg rfc6068 epg-config gnus-util text-property-search 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-core magit-autorevert autorevert filenotify
magit-margin magit-transient magit-process with-editor server magit-mode
transient magit-git magit-base magit-section format-spec crm dash
compat-27 compat-26 compat compat-macs evil evil-keybindings
evil-integration evil-maps evil-commands reveal flyspell ispell
evil-jumps evil-command-window evil-search evil-ex shell pcomplete
comint ansi-osc ansi-color evil-types evil-macros evil-repeat
evil-states evil-core comp comp-cstr warnings icons rx cl-extra
help-mode advice evil-common windmove calc calc-loaddefs calc-macs
thingatpt rect evil-digraphs evil-vars ring edmacro kmacro undo-tree
diff queue disp-table whitespace yaml-mode-autoloads
vterm-toggle-autoloads vterm-autoloads undo-tree-autoloads
typescript-mode-autoloads transpose-frame-autoloads
terraform-mode-autoloads sudo-edit-autoloads scad-preview-autoloads
scad-mode-autoloads rust-mode-autoloads queue-autoloads
php-mode-autoloads nix-mode-autoloads lsp-ui-autoloads lsp-ivy-autoloads
lsp-haskell-autoloads keyfreq-autoloads jq-mode-autoloads
helm-lsp-autoloads lsp-mode-autoloads lv-autoloads spinner-autoloads
ht-autoloads helm-autoloads popup-autoloads helm-core-autoloads
hcl-mode-autoloads haskell-mode-autoloads forge-autoloads yaml-autoloads
markdown-mode-autoloads magit-autoloads magit-section-autoloads
git-commit-autoloads with-editor-autoloads transient-autoloads
ghub-autoloads treepy-autoloads flycheck-autoloads let-alist-autoloads
pkg-info-autoloads f-autoloads s-autoloads evil-autoloads
goto-chg-autoloads epl-autoloads eldoc-autoloads docbook-autoloads
direnv-autoloads dhall-mode-autoloads reformatter-autoloads
dash-autoloads counsel-autoloads swiper-autoloads ivy-autoloads
company-autoloads closql-autoloads emacsql-sqlite-autoloads
emacsql-autoloads info compat-autoloads nadvice-autoloads
async-autoloads package browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie generate-lisp-file url-domsuf
url-util mailcap url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp
byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd
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 font-core term/tty-colors frame minibuffer nadvice seq
simple cl-generic indonesian philippine 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 emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button
loaddefs theme-loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads dbusbind
inotify dynamic-setting system-font-setting font-render-setting cairo
gtk pgtk multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 525894 67567)
 (symbols 48 39360 0)
 (strings 32 136284 9664)
 (string-bytes 1 4697353)
 (vectors 16 88803)
 (vector-slots 8 1674860 55920)
 (floats 8 533 536)
 (intervals 56 4681 681)
 (buffers 984 37))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60356; Package emacs. (Tue, 27 Dec 2022 16:51:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: git <at> sphalerite.org
Cc: 60356 <at> debbugs.gnu.org
Subject: Re: bug#60356: 30.0.50;
 individual frame loses keyboard focus, focus cannot be restored
Date: Tue, 27 Dec 2022 18:50:46 +0200
> From: git <at> sphalerite.org
> Date: Tue, 27 Dec 2022 13:19:44 +0100
> 
> 
> The exact action leading to this bug is not clear to me. It seems to be
> related to lsp-mode though -- I've not observed it happening without
> lsp-mode.
> 
> The symptom is that a single frame will no longer accept keyboard input,
> and will visually indicate that it is not focused (outline rectangular
> cursor where I'd usually expect a solid rectangular cursor). Mouse input
> still works, and other frames still accept keyboard input as normal.
> 
> I'd be glad if anyone could point out ways to further debug this issue.
> I'm also in #emacs:matrix.org (@linus:schreibt.jetzt) in case
> fast-turnaround communication would be helpful :)

If you attach a debugger to Emacs in that state, and type

  (gdb) thread apply all bt

what do you get?  Please post here everything that GDB prints when you
do that.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60356; Package emacs. (Wed, 28 Dec 2022 23:58:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: git <at> sphalerite.org
Cc: 60356 <at> debbugs.gnu.org
Subject: Re: bug#60356: 30.0.50; individual frame loses keyboard focus,
 focus cannot be restored
Date: Thu, 29 Dec 2022 07:57:08 +0800
git <at> sphalerite.org writes:

> The exact action leading to this bug is not clear to me. It seems to be
> related to lsp-mode though -- I've not observed it happening without
> lsp-mode.
>
> The symptom is that a single frame will no longer accept keyboard input,
> and will visually indicate that it is not focused (outline rectangular
> cursor where I'd usually expect a solid rectangular cursor). Mouse input
> still works, and other frames still accept keyboard input as normal.
>
> I'd be glad if anyone could point out ways to further debug this issue.
> I'm also in #emacs:matrix.org (@linus:schreibt.jetzt) in case
> fast-turnaround communication would be helpful :)

Can you reliably reproduce this issue?

If you can, please add some instrumentation to x_new_focus_frame, like
this:

diff --git a/src/xterm.c b/src/xterm.c
index 1eef8e7a724..cda2897e013 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11695,6 +11695,9 @@ x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame)
     }
 #endif
 
+  fprintf (stderr, "x_new_focus_frame: switching focus to"
+	   " %s\n", SSDATA (frame->name));
+
   if (frame != dpyinfo->x_focus_frame)
     {
       /* Set this before calling other routines, so that they see

and see what is printed out when you try to focus the frame that does
not accept input.  Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60356; Package emacs. (Tue, 03 Jan 2023 13:33:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Linus Heckemann <git <at> sphalerite.org>
Cc: 60356 <at> debbugs.gnu.org
Subject: Re: bug#60356: 30.0.50; individual frame loses keyboard focus,
 focus cannot be restored
Date: Tue, 03 Jan 2023 15:32:55 +0200
> From: Linus Heckemann <git <at> sphalerite.org>
> Cc: 60356 <at> debbugs.gnu.org
> Date: Tue, 03 Jan 2023 14:11:32 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> I'd be glad if anyone could point out ways to further debug this issue.
> >> I'm also in #emacs:matrix.org (@linus:schreibt.jetzt) in case
> >> fast-turnaround communication would be helpful :)
> >
> > If you attach a debugger to Emacs in that state, and type
> >
> >   (gdb) thread apply all bt
> >
> > what do you get?  Please post here everything that GDB prints when you
> > do that.
> 
> Thread 1 (Thread 0x7f923ad21000 (LWP 19849) "emacs"):
> #0  0x00007f923c305151 in pselect () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
> #1  0x0000000000626b92 in really_call_select ()
> #2  0x000000000062731f in thread_select ()
> #3  0x0000000000649a51 in xg_select ()
> #4  0x00000000006005d3 in wait_reading_process_output ()
> #5  0x0000000000435846 in sit_for ()
> #6  0x0000000000524532 in read_char ()
> #7  0x0000000000524b30 in read_key_sequence ()
> #8  0x00000000005268b1 in command_loop_1 ()
> #9  0x000000000059f98f in internal_condition_case ()
> #10 0x0000000000511d86 in command_loop_2 ()
> #11 0x000000000059f8f3 in internal_catch ()
> #12 0x0000000000511d19 in command_loop ()
> #13 0x00000000005165ba in recursive_edit_1 ()
> #14 0x0000000000516937 in Frecursive_edit ()
> #15 0x000000000042abda in main ()

This says Emacs is waiting for input.

So if you type and that has no effect, perhaps the problem really is
that some wrong/non-existent frame has input focus?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60356; Package emacs. (Tue, 03 Jan 2023 23:57:02 GMT) Full text and rfc822 format available.

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

From: Linus Heckemann <git <at> sphalerite.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 60356 <at> debbugs.gnu.org
Subject: Re: bug#60356: 30.0.50; individual frame loses keyboard focus,
 focus cannot be restored
Date: Tue, 03 Jan 2023 14:11:32 +0100
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: git <at> sphalerite.org
>> Date: Tue, 27 Dec 2022 13:19:44 +0100
>> 
>> 
>> The exact action leading to this bug is not clear to me. It seems to be
>> related to lsp-mode though -- I've not observed it happening without
>> lsp-mode.
>> 
>> The symptom is that a single frame will no longer accept keyboard input,
>> and will visually indicate that it is not focused (outline rectangular
>> cursor where I'd usually expect a solid rectangular cursor). Mouse input
>> still works, and other frames still accept keyboard input as normal.
>> 
>> I'd be glad if anyone could point out ways to further debug this issue.
>> I'm also in #emacs:matrix.org (@linus:schreibt.jetzt) in case
>> fast-turnaround communication would be helpful :)
>
> If you attach a debugger to Emacs in that state, and type
>
>   (gdb) thread apply all bt
>
> what do you get?  Please post here everything that GDB prints when you
> do that.
>
> Thanks.

0x00007f923c305151 in pselect () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
(gdb) thread apply all bt

Thread 3 (Thread 0x7f9223fff640 (LWP 19853) "gdbus"):
#0  0x00007f923c3026c9 in poll () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#1  0x00007f923ee61c26 in g_main_context_iterate.constprop () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libglib-2.0.so.0
#2  0x00007f923ee61f73 in g_main_loop_run () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libglib-2.0.so.0
#3  0x00007f923f0c7216 in gdbus_shared_thread_func () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libgio-2.0.so.0
#4  0x00007f923ee8c8cd in g_thread_proxy () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libglib-2.0.so.0
#5  0x00007f923c288e86 in start_thread () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#6  0x00007f923c30fc60 in clone3 () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6

Thread 2 (Thread 0x7f922970b640 (LWP 19851) "gmain"):
#0  0x00007f923c3026c9 in poll () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#1  0x00007f923ee61c26 in g_main_context_iterate.constprop () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libglib-2.0.so.0
#2  0x00007f923ee61d3f in g_main_context_iteration () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libglib-2.0.so.0
#3  0x00007f923ee61d91 in glib_worker_main () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libglib-2.0.so.0
#4  0x00007f923ee8c8cd in g_thread_proxy () from /nix/store/lrvvvkyakljgq3zvpzdwd20cm5hvwy3a-glib-2.74.1/lib/libglib-2.0.so.0
#5  0x00007f923c288e86 in start_thread () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#6  0x00007f923c30fc60 in clone3 () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6

Thread 1 (Thread 0x7f923ad21000 (LWP 19849) "emacs"):
#0  0x00007f923c305151 in pselect () from /nix/store/4nlgxhb09sdr51nc9hdm8az5b08vzkgx-glibc-2.35-163/lib/libc.so.6
#1  0x0000000000626b92 in really_call_select ()
#2  0x000000000062731f in thread_select ()
#3  0x0000000000649a51 in xg_select ()
#4  0x00000000006005d3 in wait_reading_process_output ()
#5  0x0000000000435846 in sit_for ()
#6  0x0000000000524532 in read_char ()
#7  0x0000000000524b30 in read_key_sequence ()
#8  0x00000000005268b1 in command_loop_1 ()
#9  0x000000000059f98f in internal_condition_case ()
#10 0x0000000000511d86 in command_loop_2 ()
#11 0x000000000059f8f3 in internal_catch ()
#12 0x0000000000511d19 in command_loop ()
#13 0x00000000005165ba in recursive_edit_1 ()
#14 0x0000000000516937 in Frecursive_edit ()
#15 0x000000000042abda in main ()
(gdb) c
Continuing.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#60356; Package emacs. (Wed, 04 Jan 2023 01:10:01 GMT) Full text and rfc822 format available.

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

From: Po Lu <luangruo <at> yahoo.com>
To: Linus Heckemann <git <at> sphalerite.org>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 60356 <at> debbugs.gnu.org
Subject: Re: bug#60356: 30.0.50; individual frame loses keyboard focus,
 focus cannot be restored
Date: Wed, 04 Jan 2023 09:08:57 +0800
Would you please do what I asked earlier, namely:

git <at> sphalerite.org writes:

> The exact action leading to this bug is not clear to me. It seems to be
> related to lsp-mode though -- I've not observed it happening without
> lsp-mode.
>
> The symptom is that a single frame will no longer accept keyboard input,
> and will visually indicate that it is not focused (outline rectangular
> cursor where I'd usually expect a solid rectangular cursor). Mouse input
> still works, and other frames still accept keyboard input as normal.
>
> I'd be glad if anyone could point out ways to further debug this issue.
> I'm also in #emacs:matrix.org (@linus:schreibt.jetzt) in case
> fast-turnaround communication would be helpful :)

Can you reliably reproduce this issue?

If you can, please add some instrumentation to x_new_focus_frame, like
this:

diff --git a/src/xterm.c b/src/xterm.c
index 1eef8e7a724..cda2897e013 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -11695,6 +11695,9 @@ x_new_focus_frame (struct x_display_info *dpyinfo, struct frame *frame)
     }
 #endif
 
+  fprintf (stderr, "x_new_focus_frame: switching focus to"
+	   " %s\n", SSDATA (frame->name));
+
   if (frame != dpyinfo->x_focus_frame)
     {
       /* Set this before calling other routines, so that they see

and see what is printed out when you try to focus the frame that does
not accept input.  Thanks.








This bug report was last modified 1 year and 110 days ago.

Previous Next


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