fix: crash with vulkanmod
This commit is contained in:
parent
981c21e3ce
commit
37f266f35f
@ -32,6 +32,8 @@ public class GLFWMixin {
|
||||
ConcentrationConstants.LOGGER.info("Trying to modify window monitor");
|
||||
|
||||
Window windowInstance = Minecraft.getInstance().getWindow();
|
||||
if (windowInstance == null)
|
||||
return;
|
||||
WindowAccessor accessor = (WindowAccessor) (Object) windowInstance;
|
||||
|
||||
if (windowInstance.isFullscreen())
|
||||
@ -175,6 +177,23 @@ public class GLFWMixin {
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE);
|
||||
GLFW.glfwSetWindowAttrib(windowInstance.getWindow(), 0x20006, 0);
|
||||
if (System.getProperty("os.name").contains("Windows")) {
|
||||
long hWnd = GLFWNativeWin32.glfwGetWin32Window(windowInstance.getWindow());
|
||||
if (hWnd != 0) {
|
||||
User32.SetWindowPos(
|
||||
hWnd,
|
||||
User32.HWND_NOTOPMOST,
|
||||
windowInstance.getX(),
|
||||
windowInstance.getY(),
|
||||
windowInstance.getScreenWidth(),
|
||||
windowInstance.getScreenHeight(),
|
||||
1027
|
||||
);
|
||||
User32.SetWindowLongPtr(hWnd, -16, 369229824);
|
||||
User32.SetWindowLongPtr(hWnd, -20, 34340880);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_TRUE);
|
||||
|
@ -202,6 +202,15 @@ public abstract class WindowMixin {
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE);
|
||||
GLFW.glfwSetWindowAttrib(this.window, 0x20006, 0);
|
||||
if (System.getProperty("os.name").contains("Windows")) {
|
||||
long hWnd = GLFWNativeWin32.glfwGetWin32Window(this.window);
|
||||
if (hWnd != 0) {
|
||||
User32.SetWindowPos(hWnd, User32.HWND_NOTOPMOST, this.x, this.y, this.width, this.height, 1027);
|
||||
User32.SetWindowLongPtr(hWnd, -16, 369229824);
|
||||
User32.SetWindowLongPtr(hWnd, -20, 34340880);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_TRUE);
|
||||
|
@ -222,6 +222,15 @@ public abstract class WindowMixin {
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE);
|
||||
GLFW.glfwSetWindowAttrib(this.window, 0x20006, 0);
|
||||
if (System.getProperty("os.name").contains("Windows")) {
|
||||
long hWnd = GLFWNativeWin32.glfwGetWin32Window(this.window);
|
||||
if (hWnd != 0) {
|
||||
User32.SetWindowPos(hWnd, User32.HWND_NOTOPMOST, this.x, this.y, this.width, this.height, 1027);
|
||||
User32.SetWindowLongPtr(hWnd, -16, 369229824);
|
||||
User32.SetWindowLongPtr(hWnd, -20, 34340880);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_TRUE);
|
||||
|
@ -222,6 +222,15 @@ public abstract class WindowMixin {
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_FALSE);
|
||||
GLFW.glfwSetWindowAttrib(this.window, 0x20006, 0);
|
||||
if (System.getProperty("os.name").contains("Windows")) {
|
||||
long hWnd = GLFWNativeWin32.glfwGetWin32Window(this.window);
|
||||
if (hWnd != 0) {
|
||||
User32.SetWindowPos(hWnd, User32.HWND_NOTOPMOST, this.x, this.y, this.width, this.height, 1027);
|
||||
User32.SetWindowLongPtr(hWnd, -16, 369229824);
|
||||
User32.SetWindowLongPtr(hWnd, -20, 34340880);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
GLFW.glfwSetWindowAttrib(window, GLFW.GLFW_DECORATED, GLFW.GLFW_TRUE);
|
||||
|
Loading…
Reference in New Issue
Block a user