Skip to content

focus-follows-mouse and mouse-autoselect-window cause cursor warp when a floating window appears #198

@SqrtMinusOne

Description

@SqrtMinusOne

Whenever one of these two options is enabled:

  • focus-follows-mouse
  • mouse-autoselect-window

a floating window causes the cursor to warp to some weird coordinates. I think this commit 9742498 is the culprit, because it used to work fine before.

Namely, this behaviour is triggered by select-frame-set-input-focus, perhaps because the call happens before xcb's position requests are flushed, which makes Emacs warp the cursor to somewhere on the edge of the screen.

This fixes the issue:

(defun my/exwm-floating--set-floating-around (orig-fun &rest args)
  (let ((focus-follows-mouse nil)
        (mouse-autoselect-window nil))
    (apply orig-fun args)))

(with-eval-after-load 'exwm
  (advice-add 'exwm-floating--set-floating :around
              #'my/exwm-floating--set-floating-around))

I would have submitted a patch but I don't have the copyright papers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions