diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2016-03-07 23:11:59 +0000 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2016-03-07 23:11:59 +0000 |
| commit | 6c8f8fe691f33fbd19d477b7b94ac6d942113d86 (patch) | |
| tree | fa42f15945558d768ac6a90e3be48f7284bf6c0c /src/client.hh | |
| parent | a15cdeae6ee61a4304890400c647137db6afc049 (diff) | |
Rework client redrawing, delay menu/info methods until next refresh
That avoid sending lots of spurious info_hide/menu_hide, just set
a flag and wait until the client is asked to redraw.
Diffstat (limited to 'src/client.hh')
| -rw-r--r-- | src/client.hh | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/client.hh b/src/client.hh index 4674dce7..3fa36907 100644 --- a/src/client.hh +++ b/src/client.hh @@ -46,7 +46,7 @@ public: CharCoord dimensions() const { return m_ui->dimensions(); } void force_redraw(); - void redraw_ifn(bool force = false); + void redraw_ifn(); void check_if_buffer_needs_reloading(); @@ -74,7 +74,6 @@ private: DisplayLine generate_mode_line() const; - bool m_ui_dirty = false; std::unique_ptr<UserInterface> m_ui; std::unique_ptr<Window> m_window; @@ -83,9 +82,21 @@ private: InputHandler m_input_handler; DisplayLine m_status_line; - DisplayLine m_pending_status_line; DisplayLine m_mode_line; + enum PendingUI : int + { + MenuShow = 1 << 0, + MenuSelect = 1 << 1, + MenuHide = 1 << 2, + InfoShow = 1 << 3, + InfoHide = 1 << 4, + StatusLine = 1 << 5, + Draw = 1 << 6, + Refresh = 1 << 7, + }; + int m_ui_pending = 0; + struct Menu { Vector<DisplayLine> items; |
