wayland-goxel.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. --- /tmp/work/src/goxel-0.10.8/src/main.c 2021-08-09 09:47:27.000000000 +0300
  2. +++ main.c 2021-09-28 05:00:28.696566182 +0300
  3. @@ -214,41 +214,7 @@
  4. }
  5. #endif
  6. -#if GLFW_VERSION_MAJOR >= 3 && GLFW_VERSION_MINOR >= 2
  7. -
  8. -static void load_icon(GLFWimage *image, const char *path)
  9. -{
  10. - uint8_t *img;
  11. - int w, h, bpp = 0, size;
  12. - const void *data;
  13. - data = assets_get(path, &size);
  14. - assert(data);
  15. - img = img_read_from_mem(data, size, &w, &h, &bpp);
  16. - assert(img);
  17. - assert(bpp == 4);
  18. - image->width = w;
  19. - image->height = h;
  20. - image->pixels = img;
  21. -}
  22. -
  23. -static void set_window_icon(GLFWwindow *window)
  24. -{
  25. - GLFWimage icons[7];
  26. - int i;
  27. - load_icon(&icons[0], "asset://data/icons/icon16.png");
  28. - load_icon(&icons[1], "asset://data/icons/icon24.png");
  29. - load_icon(&icons[2], "asset://data/icons/icon32.png");
  30. - load_icon(&icons[3], "asset://data/icons/icon48.png");
  31. - load_icon(&icons[4], "asset://data/icons/icon64.png");
  32. - load_icon(&icons[5], "asset://data/icons/icon128.png");
  33. - load_icon(&icons[6], "asset://data/icons/icon256.png");
  34. - glfwSetWindowIcon(window, 7, icons);
  35. - for (i = 0; i < 7; i++) free(icons[i].pixels);
  36. -}
  37. -
  38. -#else
  39. static void set_window_icon(GLFWwindow *window) {}
  40. -#endif
  41. static void set_window_title(void *user, const char *title)
  42. {
  43. @@ -259,6 +225,7 @@
  44. {
  45. args_t args = {.scale = 1};
  46. GLFWwindow *window;
  47. +
  48. GLFWmonitor *monitor;
  49. const GLFWvidmode *mode;
  50. int width = 640, height = 480, ret = 0;
  51. @@ -274,6 +241,7 @@
  52. glfwSetErrorCallback(on_glfw_error);
  53. glfwInit();
  54. glfwWindowHint(GLFW_SAMPLES, 4);
  55. + glfwWindowHint(GLFW_FOCUSED, GLFW_FALSE);
  56. monitor = glfwGetPrimaryMonitor();
  57. mode = glfwGetVideoMode(monitor);
  58. if (mode) {