mirror of
https://github.com/labwc/labwc.git
synced 2026-03-02 01:40:24 -05:00
output: early return on wlopm if requested state is already set
This prevents a unnecessary output commit without buffer, showing up as black flash when repeatedly calling wlopm --on.
This commit is contained in:
parent
c0526d856d
commit
bf02598098
1 changed files with 6 additions and 0 deletions
|
|
@ -1068,10 +1068,16 @@ handle_output_power_manager_set_mode(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
switch (event->mode) {
|
switch (event->mode) {
|
||||||
case ZWLR_OUTPUT_POWER_V1_MODE_OFF:
|
case ZWLR_OUTPUT_POWER_V1_MODE_OFF:
|
||||||
|
if (!event->output->enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
wlr_output_state_set_enabled(&output->pending, false);
|
wlr_output_state_set_enabled(&output->pending, false);
|
||||||
output_state_commit(output);
|
output_state_commit(output);
|
||||||
break;
|
break;
|
||||||
case ZWLR_OUTPUT_POWER_V1_MODE_ON:
|
case ZWLR_OUTPUT_POWER_V1_MODE_ON:
|
||||||
|
if (event->output->enabled) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
wlr_output_state_set_enabled(&output->pending, true);
|
wlr_output_state_set_enabled(&output->pending, true);
|
||||||
if (!event->output->current_mode) {
|
if (!event->output->current_mode) {
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue