unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Odd problem with KDE, desktop switching and window focus
@ 2022-12-16 21:39 Óscar Fuentes
  2022-12-17  0:51 ` Björn Bidar
  2022-12-17  1:23 ` Po Lu
  0 siblings, 2 replies; 6+ messages in thread
From: Óscar Fuentes @ 2022-12-16 21:39 UTC (permalink / raw)
  To: help-gnu-emacs

Since some weeks ago I'm experiencing a peculiar bug that consists on
the Emacs window receiving focus whenever I switch to its desktop. In
detail:

Desktop 1:
Emacs
Firefox
Konsole
...etc

So let's suppose that I'm on Desktop 1 with focus on Firefox, then I
switch to Desktop 2 and switch back to Desktop 1. Focus goes to Emacs'
window, without bringing it to front.

This is independent of the order I start the applications, their
position on the taskbar, method for switching desktops, etc and only
happens with Emacs: if there is no Emacs window, focus does not change
when switching desktops.

Anyone else experiencing this? Ideas?

Emacs 29.0 " --with-native-compilation --without-toolkit-scroll-bars
--with-x-toolkit=lucid --with-modules --without-imagemagick"

KDE Plasma 5.26.4




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Odd problem with KDE, desktop switching and window focus
  2022-12-16 21:39 Odd problem with KDE, desktop switching and window focus Óscar Fuentes
@ 2022-12-17  0:51 ` Björn Bidar
  2022-12-17  3:45   ` Óscar Fuentes
  2022-12-17  1:23 ` Po Lu
  1 sibling, 1 reply; 6+ messages in thread
From: Björn Bidar @ 2022-12-17  0:51 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs



Hey,

Did you change the focus settings in KDE/Kwin? There's an option to
change the window wherever the mouse cursor is one.

Not sure that this even affects this however try to follow back the
changes that you did recently.

Like did to update Emacs, did you update KDE and so on.

Br,

Björn



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Odd problem with KDE, desktop switching and window focus
  2022-12-16 21:39 Odd problem with KDE, desktop switching and window focus Óscar Fuentes
  2022-12-17  0:51 ` Björn Bidar
@ 2022-12-17  1:23 ` Po Lu
  2022-12-17  3:31   ` Óscar Fuentes
  1 sibling, 1 reply; 6+ messages in thread
From: Po Lu @ 2022-12-17  1:23 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs

Óscar Fuentes <ofv@wanadoo.es> writes:

> Since some weeks ago I'm experiencing a peculiar bug that consists on
> the Emacs window receiving focus whenever I switch to its desktop. In
> detail:
>
> Desktop 1:
> Emacs
> Firefox
> Konsole
> ...etc
>
> So let's suppose that I'm on Desktop 1 with focus on Firefox, then I
> switch to Desktop 2 and switch back to Desktop 1. Focus goes to Emacs'
> window, without bringing it to front.
>
> This is independent of the order I start the applications, their
> position on the taskbar, method for switching desktops, etc and only
> happens with Emacs: if there is no Emacs window, focus does not change
> when switching desktops.
>
> Anyone else experiencing this? Ideas?

What happens if you set x-no-window-manager to t, and then delete all
previously created frames?

Sounds like a user time bug.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Odd problem with KDE, desktop switching and window focus
  2022-12-17  1:23 ` Po Lu
@ 2022-12-17  3:31   ` Óscar Fuentes
  2022-12-17  7:48     ` Po Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Óscar Fuentes @ 2022-12-17  3:31 UTC (permalink / raw)
  To: help-gnu-emacs

Po Lu <luangruo@yahoo.com> writes:

>> Anyone else experiencing this? Ideas?
>
> What happens if you set x-no-window-manager to t, and then delete all
> previously created frames?

starting with just one frame:

M-x eval (setq x-no-window-manager t)

created new frame with C-x 5 2, switch to the original frame, C-x 5 0 to
kill it, set focus to firefox, switch desktops, same thing.

> Sounds like a user time bug.

Sorry, what this means? (if you mean a bug on my configuration or KDE, I
concur.)

But going back to the basics, emacs -Q does not show the problem, so
after resorting to good ol' bisecting of .emacs.el, the problem is
triggered by the presence of this line:

(setq frame-title-format (concat "Emacs: %b %+%+ %f @ " (system-name)))

See my reply to Björn for more details.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Odd problem with KDE, desktop switching and window focus
  2022-12-17  0:51 ` Björn Bidar
@ 2022-12-17  3:45   ` Óscar Fuentes
  0 siblings, 0 replies; 6+ messages in thread
From: Óscar Fuentes @ 2022-12-17  3:45 UTC (permalink / raw)
  To: help-gnu-emacs

Björn Bidar <bjorn.bidar@thaodan.de> writes:

> Hey,
>
> Did you change the focus settings in KDE/Kwin? There's an option to
> change the window wherever the mouse cursor is one.

I know, but no, I didn't. The only KDE setting that is related is a
couple of Windows Shortcuts (keyboard shortcuts for activating a given
window.) For the case at hand, they are not involved with this problem,
I checked after removing them.

> Not sure that this even affects this however try to follow back the
> changes that you did recently.
>
> Like did to update Emacs, did you update KDE and so on.

AFAIR, the problem started with the upgrade to Plasma 5.26.

As stated on my reply to Po Lu, it is triggered by the presence of this
line in .emacs.el:

(setq frame-title-format (concat "Emacs: %b %+%+ %f @ " (system-name)))

The problem also happens if I evaluate that form on emacs -Q *scratch*,
and disappears once the value of frame-title-format is reverted to its
original value.

Somehow the resulting title is special for KDE. Hence my question is
goes mostly to other KDE users.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Odd problem with KDE, desktop switching and window focus
  2022-12-17  3:31   ` Óscar Fuentes
@ 2022-12-17  7:48     ` Po Lu
  0 siblings, 0 replies; 6+ messages in thread
From: Po Lu @ 2022-12-17  7:48 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: help-gnu-emacs

Óscar Fuentes <ofv@wanadoo.es> writes:

> starting with just one frame:
>
> M-x eval (setq x-no-window-manager t)
>
> created new frame with C-x 5 2, switch to the original frame, C-x 5 0 to
> kill it, set focus to firefox, switch desktops, same thing.

[...]

> Sorry, what this means? (if you mean a bug on my configuration or KDE, I
> concur.)

I meant a problem caused by Emacs implementating _NET_WM_USER_TIME
(which can either lie in Emacs or in the window manager.)  But what you
said makes that seem unlikely.

> But going back to the basics, emacs -Q does not show the problem, so
> after resorting to good ol' bisecting of .emacs.el, the problem is
> triggered by the presence of this line:
>
> (setq frame-title-format (concat "Emacs: %b %+%+ %f @ " (system-name)))

Thanks, then I think this sounds like a (weird) bug with your window
manager.



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-17  7:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-16 21:39 Odd problem with KDE, desktop switching and window focus Óscar Fuentes
2022-12-17  0:51 ` Björn Bidar
2022-12-17  3:45   ` Óscar Fuentes
2022-12-17  1:23 ` Po Lu
2022-12-17  3:31   ` Óscar Fuentes
2022-12-17  7:48     ` Po Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).