From c33bba0db6e5c0d439a8aa5a1eb3a8a4ebcf03cf Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Sun, 18 Dec 2022 13:34:54 +0100 Subject: WM reconfiguration code. * main.scm: Added wm-reconifgure call to set initial config * wm.scm: Added wiring to call C code for reconfiguration * schewm.c: bugfix in ev_unmap_notify(); new wm_reconfigure() function --- wm.scm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'wm.scm') diff --git a/wm.scm b/wm.scm index a778dae..346d6a4 100644 --- a/wm.scm +++ b/wm.scm @@ -4,6 +4,7 @@ #:use-module (system foreign) #:export (wm-init make-config + wm-reconfigure make-key make-shift-key wm-grab-keys @@ -88,6 +89,42 @@ (define wm-run (schewm-func void "wm_run" '())) +(define c/parse-color + (schewm-func uint32 "parse_color" (list '*))) + +(define (parse-color s) + (c/parse-color (string->pointer s))) + +(define c/wm-reconfigure + (schewm-func void + "wm_reconfigure" + (list uint16 + uint16 + uint16 + int16 + int16 + uint16 + uint16 + uint32 + uint32 + uint32 + uint32 + uint32))) + +(define (wm-reconfigure config) + (c/wm-reconfigure (config-inner-border-width config) + (config-outer-border-width config) + (config-magnet-border-width config) + (config-offset-x config) + (config-offset-y config) + (config-offset-width config) + (config-offset-height config) + (parse-color (config-focused-color config)) + (parse-color (config-unfocused-color config)) + (parse-color (config-unkillable-color config)) + (parse-color (config-empty-color config)) + (parse-color (config-outer-color config)))) + (define wm-focus-prev (schewm-func void "wm_focus_prev" '())) -- cgit v1.2.3