[vlc-commits] xdg-shell: implement version 3 of wl_output

Rémi Denis-Courmont git at videolan.org
Thu May 24 19:33:16 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 24 19:13:21 2018 +0300| [0f1aabbb32b0c91eb59ad3a181bc28fed50ec26a] | committer: Rémi Denis-Courmont

xdg-shell: implement version 3 of wl_output

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0f1aabbb32b0c91eb59ad3a181bc28fed50ec26a
---

 modules/video_output/wayland/output.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/wayland/output.c b/modules/video_output/wayland/output.c
index dc85aac7c7..904132f8fd 100644
--- a/modules/video_output/wayland/output.c
+++ b/modules/video_output/wayland/output.c
@@ -40,6 +40,7 @@ struct output_data
     struct wl_output *wl_output;
 
     uint32_t name;
+    uint32_t version;
     struct wl_list node;
 };
 
@@ -107,8 +108,8 @@ int output_create(vout_window_t *wnd, struct wl_registry *registry,
     if (unlikely(od == NULL))
         return -1;
 
-    if (version > 2)
-        version = 2;
+    if (version > 3)
+        version = 3;
 
     od->wl_output = wl_registry_bind(registry, name, &wl_output_interface,
                                      version);
@@ -120,6 +121,7 @@ int output_create(vout_window_t *wnd, struct wl_registry *registry,
 
     od->owner = wnd;
     od->name = name;
+    od->version = version;
 
     wl_output_add_listener(od->wl_output, &wl_output_cbs, od);
     wl_list_insert(list, &od->node);
@@ -134,7 +136,11 @@ static void output_destroy(struct output_data *od)
     vout_window_ReportOutputDevice(od->owner, idstr, NULL);
 
     wl_list_remove(&od->node);
-    wl_output_destroy(od->wl_output);
+
+    if (od->version >= WL_OUTPUT_RELEASE_SINCE_VERSION)
+        wl_output_release(od->wl_output);
+    else
+        wl_output_destroy(od->wl_output);
     free(od);
 }
 



More information about the vlc-commits mailing list