Skip to content

Error if window is strongly dedicated #113

@ferrine

Description

@ferrine

exwm/exwm-workspace.el

Lines 1036 to 1040 in 26d24e5

(if window
(set-frame-parameter exwm--frame
'exwm-selected-window window)
(set-window-buffer (frame-selected-window exwm--frame)
buffer-or-name)))

Hi, using this function I noticed that if the selected window is nil, an error can happen for

(set-window-buffer (frame-selected-window exwm--frame)
                                     buffer-or-name)

It happens when returns a window that is strongly dedicated.

as a workaround I had to replace this piece of code with

(let ((selected-window (frame-selected-window exwm--frame)))
   (if (window-dedicated-p selected-window)
       (let ((new-window (split-window selected-window nil 'down)))
         (set-window-buffer new-window buffer-or-name))
     (set-window-buffer selected-window buffer-or-name)))

The solution proposed is weird and I do not like it. The behavior (window placement) is different from the case you first switch to the desired workspace and then switch to buffer.

Background

Initially I was attempting to write similar function but with non-EXWM buffers filtered out. I wanted to easily navigate across opened applications.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions