소스 검색

Wayland: Fix GLFW_DECORATED for XDG decorations

On a compositor that supports server-side decorations, they were always
enabled in windowed mode, even if GLFW_DECORATED was cleared.
Camilla Löwy 3 년 전
부모
커밋
f35e2274cb
2개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 0
      README.md
  2. 9 3
      src/wl_window.c

+ 2 - 0
README.md

@@ -361,6 +361,8 @@ information on what to include when reporting a bug.
  - [Wayland] Bugfix: `glfwRestoreWindow` had no effect before first show
  - [Wayland] Bugfix: `glfwRestoreWindow` had no effect before first show
  - [Wayland] Bugfix: Hiding and then showing a window caused program abort on
  - [Wayland] Bugfix: Hiding and then showing a window caused program abort on
    wlroots compositors (#1268)
    wlroots compositors (#1268)
+ - [Wayland] Bugfix: `GLFW_DECORATED` was ignored when showing a window with XDG
+   decorations
  - [POSIX] Removed use of deprecated function `gettimeofday`
  - [POSIX] Removed use of deprecated function `gettimeofday`
  - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
  - [POSIX] Bugfix: `CLOCK_MONOTONIC` was not correctly tested for or enabled
  - [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072)
  - [WGL] Disabled the DWM swap interval hack for Windows 8 and later (#1072)

+ 9 - 3
src/wl_window.c

@@ -635,9 +635,15 @@ static GLFWbool createShellObjects(_GLFWwindow* window)
             zxdg_toplevel_decoration_v1_add_listener(window->wl.xdg.decoration,
             zxdg_toplevel_decoration_v1_add_listener(window->wl.xdg.decoration,
                                                      &xdgDecorationListener,
                                                      &xdgDecorationListener,
                                                      window);
                                                      window);
-            zxdg_toplevel_decoration_v1_set_mode(
-                window->wl.xdg.decoration,
-                ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
+
+            uint32_t mode;
+
+            if (window->decorated)
+                mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE;
+            else
+                mode = ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE;
+
+            zxdg_toplevel_decoration_v1_set_mode(window->wl.xdg.decoration, mode);
         }
         }
         else
         else
             createFallbackDecorations(window);
             createFallbackDecorations(window);