@@ -89,21 +89,20 @@ public boolean isSupported() {
8989
9090 @ Override
9191 public void enable (Window window , Monitor monitor , VideoMode videoMode ) {
92- long handle = MinecraftWindow .getHandle (window );
93- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_DECORATED , GLFW .GLFW_FALSE );
94- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
95-
96- window .x = monitor .getX ();
97- window .y = monitor .getY ();
98- window .width = monitor .getCurrentMode ().getWidth ();
99- window .height = monitor .getCurrentMode ().getHeight ();
100- GLFW .glfwSetWindowMonitor (handle , 0 , window .x , window .y , window .width , window .height , -1 );
92+ GLFW .glfwSetWindowAttrib (window .handle (), GLFW .GLFW_DECORATED , GLFW .GLFW_FALSE );
93+ GLFW .glfwSetWindowAttrib (window .handle (), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
94+
95+ window .x = monitor .x ();
96+ window .y = monitor .y ();
97+ window .width = monitor .currentMode ().getWidth ();
98+ window .height = monitor .currentMode ().getHeight ();
99+ GLFW .glfwSetWindowMonitor (window .handle (), 0 , window .x , window .y , window .width , window .height , -1 );
101100 }
102101
103102 @ Override
104103 public void disable (Window window ) {
105- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_DECORATED , GLFW .GLFW_TRUE );
106- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
104+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_DECORATED , GLFW .GLFW_TRUE );
105+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
107106 }
108107 }
109108
@@ -116,16 +115,15 @@ public String getId() {
116115 //? if >=26.1 {
117116 @ Override
118117 public void enable (Window window , Monitor monitor , VideoMode videoMode ) {
119- long handle = MinecraftWindow .getHandle (window );
120118 GLFW .glfwWindowHint (GLFW .GLFW_SOFT_FULLSCREEN , GLFW .GLFW_TRUE );
121- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
119+ GLFW .glfwSetWindowAttrib (window . handle () , GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
122120
123- window .x = monitor .getX ();
124- window .y = monitor .getY ();
121+ window .x = monitor .x ();
122+ window .y = monitor .y ();
125123 window .width = videoMode .getWidth ();
126124 window .height = videoMode .getHeight ();
127125 int refreshRate = videoMode .getRefreshRate ();
128- GLFW .glfwSetWindowMonitor (handle , monitor .getMonitor (), window .x , window .y , window .width , window .height , refreshRate );
126+ GLFW .glfwSetWindowMonitor (window . handle () , monitor .monitor (), window .x , window .y , window .width , window .height , refreshRate );
129127 }
130128
131129 @ Override
@@ -148,20 +146,19 @@ public boolean isSupported() {
148146
149147 @ Override
150148 public void enable (Window window , Monitor monitor , VideoMode videoMode ) {
151- long handle = MinecraftWindow .getHandle (window );
152- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
153-
154- window .x = monitor .getX ();
155- window .y = monitor .getY ();
156- window .width = monitor .getCurrentMode ().getWidth ();
157- window .height = monitor .getCurrentMode ().getHeight ();
158- int refreshRate = monitor .getCurrentMode ().getRefreshRate ();
159- GLFW .glfwSetWindowMonitor (handle , monitor .getMonitor (), window .x , window .y , window .width , window .height , refreshRate );
149+ GLFW .glfwSetWindowAttrib (window .handle (), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
150+
151+ window .x = monitor .x ();
152+ window .y = monitor .y ();
153+ window .width = monitor .currentMode ().getWidth ();
154+ window .height = monitor .currentMode ().getHeight ();
155+ int refreshRate = monitor .currentMode ().getRefreshRate ();
156+ GLFW .glfwSetWindowMonitor (window .handle (), monitor .monitor (), window .x , window .y , window .width , window .height , refreshRate );
160157 }
161158
162159 @ Override
163160 public void disable (Window window ) {
164- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
161+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
165162 }
166163 }
167164
@@ -178,17 +175,16 @@ public boolean isSupported() {
178175
179176 @ Override
180177 public void enable (Window window , Monitor monitor , VideoMode videoMode ) {
181- long handle = MinecraftWindow .getHandle (window );
182- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_DECORATED , GLFW .GLFW_FALSE );
183- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
178+ GLFW .glfwSetWindowAttrib (window .handle (), GLFW .GLFW_DECORATED , GLFW .GLFW_FALSE );
179+ GLFW .glfwSetWindowAttrib (window .handle (), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
184180 MinecraftWindow .MacOS .setHasShadow (window , false );
185181 MinecraftWindow .MacOS .hideGlobalUI ();
186182
187- window .x = monitor .getX ();
188- window .y = monitor .getY ();
189- window .width = monitor .getCurrentMode ().getWidth ();
190- window .height = monitor .getCurrentMode ().getHeight ();
191- GLFW .glfwSetWindowMonitor (handle , 0 , window .x , window .y , window .width , window .height , -1 );
183+ window .x = monitor .x ();
184+ window .y = monitor .y ();
185+ window .width = monitor .currentMode ().getWidth ();
186+ window .height = monitor .currentMode ().getHeight ();
187+ GLFW .glfwSetWindowMonitor (window . handle () , 0 , window .x , window .y , window .width , window .height , -1 );
192188
193189 // GLFW ignores the GLFW_RESIZABLE flag for undecorated windows because such windows are
194190 // always meant to be non-resizable. However, there was a brief bug where it failed
@@ -204,15 +200,15 @@ public void disable(Window window) {
204200 MinecraftWindow .MacOS .registerWindowWillReturnFieldEditorStub (window );
205201 MinecraftWindow .MacOS .showGlobalUI ();
206202 MinecraftWindow .MacOS .setHasShadow (window , true );
207- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_DECORATED , GLFW .GLFW_TRUE );
208- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_RESIZABLE , GLFW .GLFW_TRUE );
209- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
203+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_DECORATED , GLFW .GLFW_TRUE );
204+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_RESIZABLE , GLFW .GLFW_TRUE );
205+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
210206
211207 // macOS 26.3+ (Tahoe) seems to leave a re-decorated window in a weird state
212208 // where it stops receiving keyboard and mouse inputs.
213209 // Thankfully, manually re-focusing it via `[window makeKeyAndOrderFront:nil]` helps,
214210 // which is exactly what `glfwFocusWindow` does under the hood.
215- GLFW .glfwFocusWindow (MinecraftWindow . getHandle ( window ));
211+ GLFW .glfwFocusWindow (window . handle ( ));
216212 }
217213 }
218214
@@ -249,23 +245,22 @@ public boolean isSupported() {
249245
250246 @ Override
251247 public void enable (Window window , Monitor monitor , VideoMode videoMode ) {
252- long handle = MinecraftWindow .getHandle (window );
253- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_DECORATED , GLFW .GLFW_FALSE );
254- GLFW .glfwSetWindowAttrib (handle , GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
255-
256- window .x = monitor .getX ();
257- window .y = monitor .getY ();
258- window .width = monitor .getCurrentMode ().getWidth ();
259- window .height = monitor .getCurrentMode ().getHeight () + 1 ;
260- GLFW .glfwSetWindowMonitor (handle , 0 , window .x , window .y , window .width , window .height , -1 );
248+ GLFW .glfwSetWindowAttrib (window .handle (), GLFW .GLFW_DECORATED , GLFW .GLFW_FALSE );
249+ GLFW .glfwSetWindowAttrib (window .handle (), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_FALSE );
250+
251+ window .x = monitor .x ();
252+ window .y = monitor .y ();
253+ window .width = monitor .currentMode ().getWidth ();
254+ window .height = monitor .currentMode ().getHeight () + 1 ;
255+ GLFW .glfwSetWindowMonitor (window .handle (), 0 , window .x , window .y , window .width , window .height , -1 );
261256 MinecraftWindow .Windows .pleaseStopDiscardingFuckingFramesThankYou (window );
262257 }
263258
264259 @ Override
265260 public void disable (Window window ) {
266261 MinecraftWindow .Windows .restoreStyle (window );
267- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_DECORATED , GLFW .GLFW_TRUE );
268- GLFW .glfwSetWindowAttrib (MinecraftWindow . getHandle ( window ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
262+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_DECORATED , GLFW .GLFW_TRUE );
263+ GLFW .glfwSetWindowAttrib (window . handle ( ), GLFW .GLFW_AUTO_ICONIFY , GLFW .GLFW_TRUE );
269264 }
270265 }
271266
0 commit comments