@@ -532,27 +532,29 @@ static long createGlfwWindow (Lwjgl3ApplicationConfiguration config, long shared
532
532
Lwjgl3Window .setSizeLimits (windowHandle , config .windowMinWidth , config .windowMinHeight , config .windowMaxWidth ,
533
533
config .windowMaxHeight );
534
534
if (config .fullscreenMode == null ) {
535
- if (config .windowX == -1 && config .windowY == -1 ) {
536
- int windowWidth = Math .max (config .windowWidth , config .windowMinWidth );
537
- int windowHeight = Math .max (config .windowHeight , config .windowMinHeight );
538
- if (config .windowMaxWidth > -1 ) windowWidth = Math .min (windowWidth , config .windowMaxWidth );
539
- if (config .windowMaxHeight > -1 ) windowHeight = Math .min (windowHeight , config .windowMaxHeight );
540
-
541
- long monitorHandle = GLFW .glfwGetPrimaryMonitor ();
542
- if (config .windowMaximized && config .maximizedMonitor != null ) {
543
- monitorHandle = config .maximizedMonitor .monitorHandle ;
544
- }
535
+ if (GLFW .glfwGetPlatform () != GLFW .GLFW_PLATFORM_WAYLAND ) {
536
+ if (config .windowX == -1 && config .windowY == -1 ) {
537
+ int windowWidth = Math .max (config .windowWidth , config .windowMinWidth );
538
+ int windowHeight = Math .max (config .windowHeight , config .windowMinHeight );
539
+ if (config .windowMaxWidth > -1 ) windowWidth = Math .min (windowWidth , config .windowMaxWidth );
540
+ if (config .windowMaxHeight > -1 ) windowHeight = Math .min (windowHeight , config .windowMaxHeight );
541
+
542
+ long monitorHandle = GLFW .glfwGetPrimaryMonitor ();
543
+ if (config .windowMaximized && config .maximizedMonitor != null ) {
544
+ monitorHandle = config .maximizedMonitor .monitorHandle ;
545
+ }
545
546
546
- IntBuffer areaXPos = BufferUtils .createIntBuffer (1 );
547
- IntBuffer areaYPos = BufferUtils .createIntBuffer (1 );
548
- IntBuffer areaWidth = BufferUtils .createIntBuffer (1 );
549
- IntBuffer areaHeight = BufferUtils .createIntBuffer (1 );
550
- GLFW .glfwGetMonitorWorkarea (monitorHandle , areaXPos , areaYPos , areaWidth , areaHeight );
547
+ IntBuffer areaXPos = BufferUtils .createIntBuffer (1 );
548
+ IntBuffer areaYPos = BufferUtils .createIntBuffer (1 );
549
+ IntBuffer areaWidth = BufferUtils .createIntBuffer (1 );
550
+ IntBuffer areaHeight = BufferUtils .createIntBuffer (1 );
551
+ GLFW .glfwGetMonitorWorkarea (monitorHandle , areaXPos , areaYPos , areaWidth , areaHeight );
551
552
552
- GLFW .glfwSetWindowPos (windowHandle , Math .max (0 , areaXPos .get (0 ) + areaWidth .get (0 ) / 2 - windowWidth / 2 ),
553
- Math .max (0 , areaYPos .get (0 ) + areaHeight .get (0 ) / 2 - windowHeight / 2 ));
554
- } else {
555
- GLFW .glfwSetWindowPos (windowHandle , config .windowX , config .windowY );
553
+ GLFW .glfwSetWindowPos (windowHandle , Math .max (0 , areaXPos .get (0 ) + areaWidth .get (0 ) / 2 - windowWidth / 2 ),
554
+ Math .max (0 , areaYPos .get (0 ) + areaHeight .get (0 ) / 2 - windowHeight / 2 ));
555
+ } else {
556
+ GLFW .glfwSetWindowPos (windowHandle , config .windowX , config .windowY );
557
+ }
556
558
}
557
559
558
560
if (config .windowMaximized ) {
0 commit comments