diff --git a/README.md b/README.md index 640a52f..f9fbeb1 100644 --- a/README.md +++ b/README.md @@ -39,10 +39,16 @@ See issue [#26]. For an experimental Live Update feature compile the application $ nimble build -d:live ``` +Live update feature makes more sense right now in the windowed mode to enabled windowed mode use the following flags: + +```console +$ nimble build -d:live -d:windowed +``` + For a faster Live Update feature based on MIT-SHM X11 extension use `-d:mitshm`: ```console -$ nimble build -d:live -d:mitshm +$ nimble build -d:live -d:windowed -d:mitshm ``` The MIT-SHM support would probably not work for you until diff --git a/src/boomer.nim b/src/boomer.nim index e0ad0a4..b48ff7b 100644 --- a/src/boomer.nim +++ b/src/boomer.nim @@ -182,8 +182,9 @@ proc main() = swa.event_mask = ButtonPressMask or ButtonReleaseMask or KeyPressMask or KeyReleaseMask or PointerMotionMask or ExposureMask or ClientMessage - swa.override_redirect = 1 - swa.save_under = 1 + when not defined(windowed): + swa.override_redirect = 1 + swa.save_under = 1 var attributes: TXWindowAttributes discard XGetWindowAttributes( @@ -303,7 +304,8 @@ proc main() = let dt = 1.0 / rate.float while not quitting: # TODO(#78): Is there a better solution to keep the focus always on the window? - discard XSetInputFocus(display, win, RevertToParent, CurrentTime); + when not defined(windowed): + discard XSetInputFocus(display, win, RevertToParent, CurrentTime); var wa: TXWindowAttributes discard XGetWindowAttributes(display, win, addr wa)