types/wlr_output: removing the useless pointer

This commit is contained in:
YaoBing Xiao 2024-08-20 17:45:13 +08:00 committed by Alexander Orzechowski
parent cf93d31736
commit 43554c1966
6 changed files with 14 additions and 21 deletions

View file

@ -794,14 +794,12 @@ void wlr_output_send_present(struct wlr_output *output,
assert(event);
event->output = output;
struct timespec now;
if (event->presented && event->when == NULL) {
if (clock_gettime(CLOCK_MONOTONIC, &now) != 0) {
if (event->presented && (event->when.tv_sec == 0 && event->when.tv_nsec == 0)) {
if (clock_gettime(CLOCK_MONOTONIC, &event->when) != 0) {
wlr_log_errno(WLR_ERROR, "failed to send output present event: "
"failed to read clock");
return;
}
event->when = &now;
}
wl_signal_emit_mutable(&output->events.present, event);

View file

@ -239,8 +239,8 @@ void wlr_presentation_event_from_output(struct wlr_presentation_event *event,
const struct wlr_output_event_present *output_event) {
*event = (struct wlr_presentation_event){
.output = output_event->output,
.tv_sec = (uint64_t)output_event->when->tv_sec,
.tv_nsec = (uint32_t)output_event->when->tv_nsec,
.tv_sec = (uint64_t)output_event->when.tv_sec,
.tv_nsec = (uint32_t)output_event->when.tv_nsec,
.refresh = (uint32_t)output_event->refresh,
.seq = (uint64_t)output_event->seq,
.flags = output_event->flags,