GNU bug report logs -
#45844
27.1; unwanted raising of other frame when emacs is in the backgound and switch-to-buffer is used in a dedicated frame
Previous Next
Reported by: emacser <laszlomail <at> protonmail.com>
Date: Wed, 13 Jan 2021 17:09:02 UTC
Severity: normal
Tags: wontfix
Found in version 27.1
Done: Stefan Kangas <stefan <at> marxist.se>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 45844 <at> debbugs.gnu.org (full text, mbox):
> I'll try that, I only found it strange that if a background timer uses
> switch-to-buffer
Timers should never use `switch-to-buffer'. If they want to draw
attention to the object they want to display, they should use
`pop-to-buffer'. Otherwise, `display-buffer' is the function to be
preferred although if that needs a new frame, it will raise that frame
too unless your WM prevents it.
'switch-to-buffer' is a user command and should not be called by any
Lisp code. Unfortunately, it's done a hundred times in the Emacs code
base and there's nothing we can reasonably do about that.
> and the frame is in in the background then why the frame
> is raised. If it's not triggered by a user interaction then there is
> no practical reason to bring the frame into the foreground, because the
> user is using an other app, so he doesn't want to type into that frame
> at that point. The frame should only switch to the buffer and remain in the
> background, so when the user get backs to emacs then he can see the result
> of the background process presented to him.
>
> It sounds like a bug to me, but I accept if you say it's hard to implement
> for some reason and I'll change my code to use an other method.
It's by no means hard to implement (preventing a new frame from getting
raised is much harder). But we cannot change the semantics of
`switch-to-buffer' in this regard. As long as window managers permit us
to do that, it will raise the frame it uses and give it focus.
martin
This bug report was last modified 4 years and 33 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.