Skip to content

Commit

Permalink
(#26) Add a flag to enable windowed support back
Browse files Browse the repository at this point in the history
  • Loading branch information
rexim committed Dec 26, 2019
1 parent 098203f commit 9ce54ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions src/boomer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9ce54ed

Please sign in to comment.