mirror of
https://git.sr.ht/~magic_rb/dotfiles
synced 2024-11-25 09:36:14 +01:00
Disable window switching by mouse
Signed-off-by: MagicRB <richard@brezak.sk>
This commit is contained in:
parent
a50edd6a99
commit
6230949667
|
@ -9,3 +9,24 @@
|
|||
(add-to-list 'default-frame-alist '(alpha-background . 80))
|
||||
#+end_src
|
||||
|
||||
Disable window changing using the mouse, it saves me from accidental switches.
|
||||
|
||||
#+begin_src emacs-lisp
|
||||
(defun cv/mouse-set-point (fun event &optional promote)
|
||||
(let ((window (car (car (cdr event)))))
|
||||
(when (equal window (selected-window))
|
||||
(funcall fun event promote))))
|
||||
(advice-add 'mouse-set-point :around 'cv/mouse-set-point)
|
||||
|
||||
(defun cv/mouse-drag-region (fun event)
|
||||
(let ((window (car (car (cdr event)))))
|
||||
(when (equal window (selected-window))
|
||||
(funcall fun event))))
|
||||
(advice-add 'mouse-drag-region :around 'cv/mouse-drag-region)
|
||||
|
||||
(defun cv/mouse-set-region (fun event)
|
||||
(let ((window (car (car (cdr event)))))
|
||||
(when (equal window (selected-window))
|
||||
(funcall fun event))))
|
||||
(advice-add 'mouse-set-region :around 'cv/mouse-set-region)
|
||||
#+end_src
|
||||
|
|
Loading…
Reference in a new issue