diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2021-08-15 04:15:29 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2021-08-15 04:22:57 -0700 |
commit | 553d2ffc8eed9b5f9f2ebd52ee070ed1dcd0c5b6 (patch) | |
tree | 078bdef90d1ee6995d7e35ab75957fc7ffe55ebf /browse-slack | |
parent | 8086b7b6036736d17a017d536194b6f8aedb466b (diff) | |
download | mu-553d2ffc8eed9b5f9f2ebd52ee070ed1dcd0c5b6.tar.gz |
.
Make it more obvious that we always do a full repaint if dirty is set.
Diffstat (limited to 'browse-slack')
-rw-r--r-- | browse-slack/environment.mu | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/browse-slack/environment.mu b/browse-slack/environment.mu index c7f0c04f..3d206604 100644 --- a/browse-slack/environment.mu +++ b/browse-slack/environment.mu @@ -66,20 +66,22 @@ fn initialize-environment _self: (addr environment), _items: (addr item-list) { fn render-environment screen: (addr screen), _env: (addr environment), users: (addr array user), channels: (addr array channel), items: (addr item-list) { var env/esi: (addr environment) <- copy _env - # don't bother repainting the screen when typing into the search bar - # (and screen isn't dirty) { - var cursor-in-search?/eax: (addr boolean) <- get env, cursor-in-search? - compare *cursor-in-search?, 0/false - break-if-= var dirty?/eax: (addr boolean) <- get env, dirty? compare *dirty?, 0/false break-if-!= - render-search-input screen, env - clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg - render-search-menu screen, env - return + # minimize repaints when typing into the search bar + { + var cursor-in-search?/eax: (addr boolean) <- get env, cursor-in-search? + compare *cursor-in-search?, 0/false + break-if-= + render-search-input screen, env + clear-rect screen, 0/x 0x2f/y, 0x80/x 0x30/y, 0/bg + render-search-menu screen, env + return + } } + # full repaint clear-screen screen render-search-input screen, env render-channels screen, env, channels @@ -381,12 +383,7 @@ fn render-menu screen: (addr screen), _env: (addr environment) { render-channels-menu screen, env return } - compare *cursor-in-channels?, 0/false - { - break-if-!= - render-main-menu screen, env - return - } + render-main-menu screen, env } fn render-main-menu screen: (addr screen), _env: (addr environment) { |