]> git.mdlowis.com Git - proto/labwc.git/commitdiff
output: fix incorrect call to private wlroots function
authorJohan Malm <jgm323@gmail.com>
Tue, 15 Mar 2022 21:30:25 +0000 (21:30 +0000)
committerJohan Malm <jgm323@gmail.com>
Tue, 15 Mar 2022 21:30:25 +0000 (21:30 +0000)
Use wlr_output_test() instead of output_ensure_buffer() which is not a
public function and only compiled when linking statically to wlroots.

Also wlr_output_rollback() on failed test.

Fixes issue #273

src/output.c

index 20f7c91655d069e30031a27dc16e2143b398924b..12ef53edd9b64ff715ea552d21ad09171a05adbe 100644 (file)
@@ -9,10 +9,9 @@
 #define _POSIX_C_SOURCE 200809L
 #include "config.h"
 #include <assert.h>
-#include <types/wlr_output.h>
 #include <wlr/types/wlr_buffer.h>
+#include <wlr/types/wlr_output.h>
 #include <wlr/types/wlr_xdg_output_v1.h>
-#include <wlr/types/wlr_output_damage.h>
 #include <wlr/types/wlr_scene.h>
 #include <wlr/util/region.h>
 #include <wlr/util/log.h>
@@ -412,7 +411,9 @@ handle_output_power_manager_set_mode(struct wl_listener *listener, void *data)
                break;
        case ZWLR_OUTPUT_POWER_V1_MODE_ON:
                wlr_output_enable(event->output, true);
-               output_ensure_buffer(event->output);
+               if (!wlr_output_test(event->output)) {
+                       wlr_output_rollback(event->output);
+               }
                wlr_output_commit(event->output);
                break;
        }