From 5a2fe9e2f226db509315c8e4290e9794a0ce0557 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Mon, 19 Mar 2018 00:16:25 +0100 Subject: Expand fake monitor to make testing removing machines easier --- src/main.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/main.cc') diff --git a/src/main.cc b/src/main.cc index 9285ccb..f7b3e58 100644 --- a/src/main.cc +++ b/src/main.cc @@ -239,6 +239,12 @@ public: io::write(pipe_, "q", 1); } +#if FAKE_MONITOR + void toggle_fakes() { + io::write(pipe_, " ", 1); + } +#endif + /* void quit_from_main(std::shared_ptr const& atoms) { // Wake up the event thread by sending an event to our window @@ -543,6 +549,12 @@ private: force_draw(); return; } +#if FAKE_MONITOR + if (tmp == ' ') { + monitor_->toggle_fakes(); + return; + } +#endif } } @@ -903,6 +915,13 @@ void xcb_event_loop(x::shared_connection const& conn, } break; } +#if FAKE_MONITOR + case ' ': + if (monmon->match(e->event)) { + monmon->toggle_fakes(); + } + break; +#endif } break; } -- cgit v1.3