Skip to content

Split window X application windows #22

Open
@ethanmoss1

Description

@ethanmoss1

The issue I have currently is that when running my interactive function to split a window and then switch to the other window it seems to flip the buffers and keep the focus on the original X window.

The function doesn't do anything crazy, its just does what I would normally do with 2 keybindings but in one. The funny thing is if I run these two commands using M-x split-window-* RET and M-x other-window RET it works how you would expect it.

Also other function such as 'find-file-other-window' work fine when focused on an X Application.

(defun split-window-right-and-focus ()
  (interactive)
  (split-window-right)
  (other-window 1))

I've used other split window function in place but all seem to have the same issue.

(F) = user focus

+-------------------+                                      +-------------------+
|                   |                                      |        |          |
|         (F)       |                                      |        |    (F)   |
|     x window      | --> Split-window-right-and-focus --> | buffer | x window |
|                   |                                      |        |          |
|                   |                                      |        |          |
+-------------------+                                      +-------------------+

Understandably you cant have two windows of the same X application but the movement of the window should be the same as any other buffer?

Currently I've fixed this 'issue' my amending the function to check the major mode an act accordingly. Annoyingly I have to now switch to the other window myself, oh the horror!.

(defun split-window-right-and-focus ()
  (interactive)
    (if (string-equal major-mode "exwm-mode")
        (split-window-right)
      (split-window-right)
      (other-window 1)))

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