Skip to content

Urgency/focus issue in Emacs-Sway interaction (XWayland) #6216

Open
@thblt

Description

  • Sway Version: 1.6 (on NixOS unstable)

  • Debug Log: https://paste.thb.lt/1619006096.log.html

    • Notice I had to killall sway beause I don't know the default quit binding (I reproduced without config). If this shows in the log, it can be ignored.
  • Configuration File: None (removed before reproducing)

Description

Summry

In Emacs, programmatically creating a new Emacs window and focusing back the original one creates a weird focus/urgency situation where the focused window appears urgent and the other window focused.

Steps to reproduce

In Emacs, eval the following snippet (If you don't know how to use Emacs, see the "appendix" below)

(let ((old-frame (selected-frame)) ; Store the current window (= frame, in Emacs speech)
      (new-frame (make-frame))) ; Make a new window
  (set-frame-parameter old-frame 'background-color "blue") ; Make the "old" frame blue
  (set-frame-parameter new-frame 'background-color "yellow") ; Make the "new" frame yellow
  (select-frame-set-input-focus old-frame)) ; Select back the old frame

In i3, the result is as expected: there are two emacs windows, but the focus remains as it was to the original window. In Sway, the following appears:

  • Old/blue window appears as urgent (with a red border)
  • New/yellow window appears focused (blue border)
  • Old/blue window is the one that actually receives input.
  • Moving back and forth to the old window removes the "urgent" (red border) look.

I've dug in the Emacs source code and played with xprop, and I don't believe anything there marks frames as needing attention.

Appendix: evaluating elisp code in Emacs

  • Start Emacs. I assume you don't have an Emacs config; if you do, start emacs -Q to prevent loading it.
  • On the Buffers menu, select *scratch* This shows a buffer starting with the commented-out message ;; This buffer is for text that is not saved….
  • Make sure the cursor is at the end of the buffer, then in the Edit menu, Paste the snippet (Notice paste is Ctrl-y, not Ctrl-V)
  • The buffer should still be at the end of the buffer. In the Lisp Interaction menu, choose Evaluate defun.
  • Observe :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugNot working as intendedclient-compatCompatibility issues with a particular application

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions