Sfoglia il codice sorgente

wayland: implement toggling decorations

Christian Rauch 3 anni fa
parent
commit
ee062c644a

+ 2 - 0
src/video/wayland/SDL_waylanddyn.h

@@ -139,6 +139,8 @@ void SDL_WAYLAND_UnloadSymbols(void);
 #define libdecor_frame_set_capabilities (*WAYLAND_libdecor_frame_set_capabilities)
 #define libdecor_frame_unset_capabilities (*WAYLAND_libdecor_frame_unset_capabilities)
 #define libdecor_frame_has_capability (*WAYLAND_libdecor_frame_has_capability)
+#define libdecor_frame_set_visibility (*WAYLAND_libdecor_frame_set_visibility)
+#define libdecor_frame_is_visible (*WAYLAND_libdecor_frame_is_visible)
 #define libdecor_frame_map (*WAYLAND_libdecor_frame_map)
 #define libdecor_state_new (*WAYLAND_libdecor_state_new)
 #define libdecor_state_free (*WAYLAND_libdecor_state_free)

+ 2 - 0
src/video/wayland/SDL_waylandsym.h

@@ -178,6 +178,8 @@ SDL_WAYLAND_SYM(void, libdecor_frame_unset_capabilities, (struct libdecor_frame
                                                           enum libdecor_capabilities))
 SDL_WAYLAND_SYM(bool, libdecor_frame_has_capability, (struct libdecor_frame *, \
                                                       enum libdecor_capabilities))
+SDL_WAYLAND_SYM(void, libdecor_frame_set_visibility, (struct libdecor_frame *, bool))
+SDL_WAYLAND_SYM(bool, libdecor_frame_is_visible, (struct libdecor_frame *))
 SDL_WAYLAND_SYM(void, libdecor_frame_map, (struct libdecor_frame *))
 SDL_WAYLAND_SYM(struct libdecor_state *, libdecor_state_new, (int, int))
 SDL_WAYLAND_SYM(void, libdecor_state_free, (struct libdecor_state *))

+ 3 - 1
src/video/wayland/SDL_waylandwindow.c

@@ -1234,7 +1234,9 @@ Wayland_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
     const SDL_VideoData *viddata = (const SDL_VideoData *) _this->driverdata;
 #ifdef HAVE_LIBDECOR_H
     if (viddata->shell.libdecor) {
-        SDL_SetError("FIXME libdecor: Implement toggling decorations");
+        if (wind->shell_surface.libdecor.frame) {
+            libdecor_frame_set_visibility(wind->shell_surface.libdecor.frame, bordered);
+        }
     } else
 #endif
     if ((viddata->decoration_manager) && (wind->server_decoration)) {