| 35 | } |
| 36 | |
| 37 | void waybar::Client::handleOutput(struct waybar_output& output) { |
| 38 | static const struct zxdg_output_v1_listener xdgOutputListener = { |
| 39 | .logical_position = [](void*, struct zxdg_output_v1*, int32_t, int32_t) {}, |
| 40 | .logical_size = [](void*, struct zxdg_output_v1*, int32_t, int32_t) {}, |
| 41 | .done = &handleOutputDone, |
| 42 | .name = &handleOutputName, |
| 43 | .description = &handleOutputDescription, |
| 44 | }; |
| 45 | // owned by output->monitor; no need to destroy |
| 46 | auto* wl_output = gdk_wayland_monitor_get_wl_output(output.monitor->gobj()); |
| 47 | output.xdg_output.reset(zxdg_output_manager_v1_get_xdg_output(xdg_output_manager, wl_output)); |
| 48 | zxdg_output_v1_add_listener(output.xdg_output.get(), &xdgOutputListener, &output); |
| 49 | } |
| 50 | |
| 51 | struct waybar::waybar_output& waybar::Client::getOutput(void* addr) { |
| 52 | auto it = std::find_if(outputs_.begin(), outputs_.end(), |