Hey, I have a patch to fix the bug. The issue was that the window configuration to restore to was set to early, i.e. set before popping to the frame the note is taken in.
The other change I have is to raise the frame where the call to take the note is issued from if it's different from the one where it's taken. To restore back the focus as it was when the command to take a note was called, this aligns the behavior as if the only one frame was used. Feel free to rephrase the news entry. I'm not sure if that's the best way of phrasing it.
>From 2567b297fcd224cc61c20d6eb847a97eef19e7b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kettunen?= <[email protected]> Date: Sat, 25 Apr 2026 19:06:26 +0300 Subject: [PATCH 1/2] org: Fix restoring window configuration when the frame is different * lisp/org.el (org-add-log-note): Fix restoring the window configuration when where the command to take the note was started on is different to the frame where the note is taken in. --- lisp/org.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org.el b/lisp/org.el index 05607bd2c..0c8ac6fe1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -11063,11 +11063,11 @@ (defun org-add-log-note (&optional _purpose) (= org-log-note-recursion-depth (recursion-depth))) (remove-hook 'post-command-hook 'org-add-log-note) (setq org-log-setup nil) - (setq org-log-note-window-configuration (current-window-configuration)) (move-marker org-log-note-return-to (point)) (pop-to-buffer (marker-buffer org-log-note-marker) '(org-display-buffer-full-frame)) (goto-char org-log-note-marker) (pop-to-buffer "*Org Note*" '(org-display-buffer-split)) + (setq org-log-note-window-configuration (current-window-configuration)) (erase-buffer) (if (memq org-log-note-how '(time state)) (org-store-log-note) -- 2.53.0
>From 4c4a553da45fd1565aa5f77306e93d6d70f83a9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Kettunen?= <[email protected]> Date: Sat, 25 Apr 2026 19:18:08 +0300 Subject: [PATCH 2/2] org: Go back to the previous frame when taking notes * etc/ORG-NEWS: Document the change. * lisp/org.el (org-log-note-extra): (org-add-log-note): (org-store-log-note): Go back to the frame to the function is called from, if it is different to then one the note is taken in. --- etc/ORG-NEWS | 6 ++++++ lisp/org.el | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index a20dc685e..22597ebfd 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -153,6 +153,12 @@ tangled files. This behavior no longer applies when =:tangle= specifies multiple targets; in that case, absolute links are always used and the variable is ignored. +*** ~org-add-note~ returns to the previous frame if it was different + +Go back to the frame the function or it's versions +i.e. ~org-agenda-add-note~ is called from, if it is different to the +one the note is taken in. + * Version 9.8 ** Important announcements and breaking changes diff --git a/lisp/org.el b/lisp/org.el index 0c8ac6fe1..a47b90ee1 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -10901,6 +10901,7 @@ (defvar org-log-note-purpose nil) (defvar org-log-note-state nil) (defvar org-log-note-previous-state nil) (defvar org-log-note-extra nil) +(defvar org-log-previous-frame) (defvar org-log-note-window-configuration nil) (defvar org-log-note-return-to (make-marker)) (defvar org-log-note-effective-time nil @@ -11062,6 +11063,7 @@ (defun org-add-log-note (&optional _purpose) (when (and (equal org-log-note-this-command this-command) (= org-log-note-recursion-depth (recursion-depth))) (remove-hook 'post-command-hook 'org-add-log-note) + (setq org-log-previous-frame (selected-frame)) (setq org-log-setup nil) (move-marker org-log-note-return-to (point)) (pop-to-buffer (marker-buffer org-log-note-marker) '(org-display-buffer-full-frame)) @@ -11176,6 +11178,8 @@ (defun org-store-log-note () (org-back-to-heading t)))))) ;; Don't add undo information when called from `org-agenda-todo'. (set-window-configuration org-log-note-window-configuration) + (unless (equal org-log-previous-frame (selected-frame)) + (raise-frame org-log-previous-frame)) (with-current-buffer (marker-buffer org-log-note-return-to) (goto-char org-log-note-return-to)) (move-marker org-log-note-return-to nil) -- 2.53.0
