Factor out `exwm-randr--on-ScreenChangeNotify'
* exwm-randr.el (exwm-randr--on-ScreenChangeNotify) (exwm-randr--init): Factor ScreenChangeNotify event callback into a function.
This commit is contained in:
parent
4f7abf4bfd
commit
d3be64e743
1 changed files with 6 additions and 4 deletions
|
@ -170,6 +170,11 @@ the first one in result being the primary output."
|
||||||
(xcb:flush exwm--connection)
|
(xcb:flush exwm--connection)
|
||||||
(run-hooks 'exwm-randr-refresh-hook))))
|
(run-hooks 'exwm-randr-refresh-hook))))
|
||||||
|
|
||||||
|
(defun exwm-randr--on-ScreenChangeNotify (_data _synthetic)
|
||||||
|
(exwm--log "(RandR) ScreenChangeNotify")
|
||||||
|
(run-hooks 'exwm-randr-screen-change-hook)
|
||||||
|
(exwm-randr--refresh))
|
||||||
|
|
||||||
(defun exwm-randr--init ()
|
(defun exwm-randr--init ()
|
||||||
"Initialize RandR extension and EXWM RandR module."
|
"Initialize RandR extension and EXWM RandR module."
|
||||||
(if (= 0 (slot-value (xcb:get-extension-data exwm--connection 'xcb:randr)
|
(if (= 0 (slot-value (xcb:get-extension-data exwm--connection 'xcb:randr)
|
||||||
|
@ -186,10 +191,7 @@ the first one in result being the primary output."
|
||||||
(run-hooks 'exwm-randr-screen-change-hook)
|
(run-hooks 'exwm-randr-screen-change-hook)
|
||||||
(exwm-randr--refresh)
|
(exwm-randr--refresh)
|
||||||
(xcb:+event exwm--connection 'xcb:randr:ScreenChangeNotify
|
(xcb:+event exwm--connection 'xcb:randr:ScreenChangeNotify
|
||||||
(lambda (_data _synthetic)
|
#'exwm-randr--on-ScreenChangeNotify)
|
||||||
(exwm--log "(RandR) ScreenChangeNotify")
|
|
||||||
(run-hooks 'exwm-randr-screen-change-hook)
|
|
||||||
(exwm-randr--refresh)))
|
|
||||||
;; (xcb:+event exwm--connection 'xcb:randr:Notify
|
;; (xcb:+event exwm--connection 'xcb:randr:Notify
|
||||||
;; (lambda (_data _synthetic)
|
;; (lambda (_data _synthetic)
|
||||||
;; (exwm--log "(RandR) Notify")
|
;; (exwm--log "(RandR) Notify")
|
||||||
|
|
Loading…
Reference in a new issue