浏览代码

Wayland: Use enum type to store enum value

Camilla Löwy 3 年之前
父节点
当前提交
80dc0533cf
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      src/wl_platform.h
  2. 3 3
      src/wl_window.c

+ 1 - 1
src/wl_platform.h

@@ -276,7 +276,7 @@ typedef struct _GLFWwindowWayland
     struct {
         struct wl_buffer*                  buffer;
         _GLFWdecorationWayland             top, left, right, bottom;
-        int                                focus;
+        _GLFWdecorationSideWayland         focus;
     } decorations;
 } _GLFWwindowWayland;
 

+ 3 - 3
src/wl_window.c

@@ -976,9 +976,9 @@ static char* readDataOfferAsString(struct wl_data_offer* offer, const char* mime
 }
 
 static _GLFWwindow* findWindowFromDecorationSurface(struct wl_surface* surface,
-                                                    int* which)
+                                                    _GLFWdecorationSideWayland* which)
 {
-    int focus;
+    _GLFWdecorationSideWayland focus;
     _GLFWwindow* window = _glfw.windowListHead;
     if (!which)
         which = &focus;
@@ -1020,7 +1020,7 @@ static void pointerHandleEnter(void* userData,
     if (!surface)
         return;
 
-    int focus = 0;
+    _GLFWdecorationSideWayland focus = mainWindow;
     _GLFWwindow* window = wl_surface_get_user_data(surface);
     if (!window)
     {