output-management-v1: send head identifying information

With version 2 we send make, model and serial number to allow clients the
identification of heads.
This commit is contained in:
Roman Gilg 2020-09-03 14:42:35 +02:00 committed by Simon Ser
parent e4a7075a9e
commit bae8d7593c
1 changed files with 11 additions and 1 deletions

View File

@ -6,7 +6,7 @@
#include "util/signal.h"
#include "wlr-output-management-unstable-v1-protocol.h"
#define OUTPUT_MANAGER_VERSION 1
#define OUTPUT_MANAGER_VERSION 2
enum {
HEAD_STATE_ENABLED = 1 << 0,
@ -761,6 +761,16 @@ static void manager_send_head(struct wlr_output_manager_v1 *manager,
output->phys_width, output->phys_height);
}
if (version >= ZWLR_OUTPUT_HEAD_V1_MAKE_SINCE_VERSION && output->make[0] != '\0') {
zwlr_output_head_v1_send_make(head_resource, output->make);
}
if (version >= ZWLR_OUTPUT_HEAD_V1_MODEL_SINCE_VERSION && output->model[0] != '\0') {
zwlr_output_head_v1_send_model(head_resource, output->model);
}
if (version >= ZWLR_OUTPUT_HEAD_V1_SERIAL_NUMBER_SINCE_VERSION && output->serial[0] != '\0') {
zwlr_output_head_v1_send_serial_number(head_resource, output->serial);
}
struct wlr_output_mode *mode;
wl_list_for_each(mode, &output->modes, link) {
head_send_mode(head, head_resource, mode);