| 193 | |
| 194 | public: |
| 195 | void init() override |
| 196 | { |
| 197 | if (!wf::get_core().is_gles2()) |
| 198 | { |
| 199 | const char *render_type = |
| 200 | wf::get_core().is_vulkan() ? "vulkan" : (wf::get_core().is_pixman() ? "pixman" : "unknown"); |
| 201 | LOGE("switcher: requires GLES2 support, but current renderer is ", render_type); |
| 202 | return; |
| 203 | } |
| 204 | |
| 205 | output->add_key( |
| 206 | wf::option_wrapper_t<wf::keybinding_t>{"switcher/next_view"}, |
| 207 | &next_view_binding); |
| 208 | output->add_key( |
| 209 | wf::option_wrapper_t<wf::keybinding_t>{"switcher/prev_view"}, |
| 210 | &prev_view_binding); |
| 211 | output->connect(&view_disappeared); |
| 212 | |
| 213 | input_grab = std::make_unique<wf::input_grab_t>("switcher", output, this, nullptr, nullptr); |
| 214 | grab_interface.cancel = [=] () {deinit_switcher();}; |
| 215 | } |
| 216 | |
| 217 | void handle_keyboard_key(wf::seat_t*, wlr_keyboard_key_event event) override |
| 218 | { |