exwm
exwm copied to clipboard
Split window X application windows
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)))