mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-11 13:29:45 -05:00
output: don't emit the mode event if it hasn't changed
This also fixes #535.
This commit is contained in:
parent
63763d3279
commit
94fa6c88f4
3 changed files with 16 additions and 6 deletions
|
|
@ -178,6 +178,11 @@ void wlr_output_update_mode(struct wlr_output *output,
|
|||
|
||||
void wlr_output_update_custom_mode(struct wlr_output *output, int32_t width,
|
||||
int32_t height, int32_t refresh) {
|
||||
if (output->width == width && output->height == height &&
|
||||
output->refresh == refresh) {
|
||||
return;
|
||||
}
|
||||
|
||||
output->width = width;
|
||||
output->height = height;
|
||||
wlr_output_update_matrix(output);
|
||||
|
|
@ -563,7 +568,7 @@ void wlr_output_update_needs_swap(struct wlr_output *output) {
|
|||
wlr_signal_emit_safe(&output->events.needs_swap, output);
|
||||
}
|
||||
|
||||
static void output_damage_whole(struct wlr_output *output) {
|
||||
void wlr_output_damage_whole(struct wlr_output *output) {
|
||||
int width, height;
|
||||
wlr_output_transformed_resolution(output, &width, &height);
|
||||
|
||||
|
|
@ -577,7 +582,7 @@ static void output_fullscreen_surface_reset(struct wlr_output *output) {
|
|||
wl_list_remove(&output->fullscreen_surface_commit.link);
|
||||
wl_list_remove(&output->fullscreen_surface_destroy.link);
|
||||
output->fullscreen_surface = NULL;
|
||||
output_damage_whole(output);
|
||||
wlr_output_damage_whole(output);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -591,7 +596,7 @@ static void output_fullscreen_surface_handle_commit(
|
|||
output->fullscreen_height != surface->current->height) {
|
||||
output->fullscreen_width = surface->current->width;
|
||||
output->fullscreen_height = surface->current->height;
|
||||
output_damage_whole(output);
|
||||
wlr_output_damage_whole(output);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -627,7 +632,7 @@ void wlr_output_set_fullscreen_surface(struct wlr_output *output,
|
|||
output_fullscreen_surface_reset(output);
|
||||
|
||||
output->fullscreen_surface = surface;
|
||||
output_damage_whole(output);
|
||||
wlr_output_damage_whole(output);
|
||||
|
||||
if (surface == NULL) {
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue