types/wlr_switch: uniformize events name

This commit is contained in:
Simon Zeni 2022-03-09 15:08:20 -05:00 committed by Kirill Primak
parent 9a17200446
commit 13d7fa2f03
2 changed files with 4 additions and 6 deletions

View File

@ -29,8 +29,7 @@ void handle_switch_toggle(struct libinput_event *event,
struct wlr_switch *wlr_switch) { struct wlr_switch *wlr_switch) {
struct libinput_event_switch *sevent = struct libinput_event_switch *sevent =
libinput_event_get_switch_event (event); libinput_event_get_switch_event (event);
struct wlr_event_switch_toggle wlr_event = { 0 }; struct wlr_switch_toggle_event wlr_event = { 0 };
wlr_event.device = &wlr_switch->base;
switch (libinput_event_switch_get_switch(sevent)) { switch (libinput_event_switch_get_switch(sevent)) {
case LIBINPUT_SWITCH_LID: case LIBINPUT_SWITCH_LID:
wlr_event.switch_type = WLR_SWITCH_TYPE_LID; wlr_event.switch_type = WLR_SWITCH_TYPE_LID;

View File

@ -28,17 +28,16 @@ struct wlr_switch {
}; };
enum wlr_switch_type { enum wlr_switch_type {
WLR_SWITCH_TYPE_LID = 1, WLR_SWITCH_TYPE_LID,
WLR_SWITCH_TYPE_TABLET_MODE, WLR_SWITCH_TYPE_TABLET_MODE,
}; };
enum wlr_switch_state { enum wlr_switch_state {
WLR_SWITCH_STATE_OFF = 0, WLR_SWITCH_STATE_OFF = 0,
WLR_SWITCH_STATE_ON WLR_SWITCH_STATE_ON,
}; };
struct wlr_event_switch_toggle { struct wlr_switch_toggle_event {
struct wlr_input_device *device;
uint32_t time_msec; uint32_t time_msec;
enum wlr_switch_type switch_type; enum wlr_switch_type switch_type;
enum wlr_switch_state switch_state; enum wlr_switch_state switch_state;