[vlc-commits] xdg-shell: implement fullscreen to non-default output
Rémi Denis-Courmont
git at videolan.org
Sun May 20 19:52:31 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May 20 17:06:11 2018 +0300| [db1131e2ae3158a5c08c51c67ade11159ef1c971] | committer: Rémi Denis-Courmont
xdg-shell: implement fullscreen to non-default output
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=db1131e2ae3158a5c08c51c67ade11159ef1c971
---
modules/video_output/wayland/xdg-shell.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/modules/video_output/wayland/xdg-shell.c b/modules/video_output/wayland/xdg-shell.c
index 2554e83368..66046c0296 100644
--- a/modules/video_output/wayland/xdg-shell.c
+++ b/modules/video_output/wayland/xdg-shell.c
@@ -25,8 +25,10 @@
#endif
#include <assert.h>
+#include <inttypes.h>
#include <stdarg.h>
-#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <poll.h>
@@ -150,8 +152,26 @@ static int Control(vout_window_t *wnd, int cmd, va_list ap)
}
case VOUT_WINDOW_SET_FULLSCREEN:
- xdg_toplevel_set_fullscreen(sys->toplevel, NULL);
+ {
+ const char *idstr = va_arg(ap, const char *);
+ struct wl_output *output = NULL;
+
+ if (idstr != NULL)
+ {
+ char *end;
+ unsigned long name = strtoul(idstr, &end, 10);
+
+ assert(*end == '\0' && name <= UINT32_MAX);
+ output = wl_registry_bind(sys->registry, name,
+ &wl_output_interface, 1);
+ }
+
+ xdg_toplevel_set_fullscreen(sys->toplevel, output);
+
+ if (output != NULL)
+ wl_output_destroy(output);
break;
+ }
case VOUT_WINDOW_UNSET_FULLSCREEN:
xdg_toplevel_unset_fullscreen(sys->toplevel);
More information about the vlc-commits
mailing list