@@ -200,11 +200,7 @@ bool focusWindow(const WindowHandle windowHandle) {
200
200
}
201
201
202
202
/* *
203
- * Resizes and repositions the window provided via its handle to the specified rectangle.
204
- *
205
- * This function retrieves window information using the provided window handle, then uses
206
- * macOS Accessibility APIs to resize and reposition the window to fit within the provided
207
- * rectangle dimensions and location.
203
+ * Resizes the window provided via its handle to the specified width/height.
208
204
*
209
205
* @param windowHandle Handle to the window that needs to be resized.
210
206
* @param newSize The width/height to which the window should be resized.
@@ -255,11 +251,7 @@ bool resizeWindow(const WindowHandle windowHandle, const MMSize newSize) {
255
251
}
256
252
257
253
/* *
258
- * Resizes and repositions the window provided via its handle to the specified rectangle.
259
- *
260
- * This function retrieves window information using the provided window handle, then uses
261
- * macOS Accessibility APIs to resize and reposition the window to fit within the provided
262
- * rectangle dimensions and location.
254
+ * Moves the window provided via its handle to the specified point.
263
255
*
264
256
* @param windowHandle Handle to the window that needs to be resized.
265
257
* @param newOrigin The x/y coordinates to which the window should be repositioned.
@@ -280,8 +272,7 @@ bool moveWindow(const WindowHandle windowHandle, const MMPoint newOrigin) {
280
272
AXUIElementRef app = AXUIElementCreateApplication (pid);
281
273
AXUIElementRef window;
282
274
283
- AXError error = AXUIElementCopyAttributeValue (app, kAXFocusedWindowAttribute ,
284
- (CFTypeRef *) &window);
275
+ AXError error = AXUIElementCopyAttributeValue (app, kAXFocusedWindowAttribute , (CFTypeRef *) &window);
285
276
286
277
// If no error occurred, proceed with the resize and reposition operations
287
278
if (error == kAXErrorSuccess ) {
@@ -299,12 +290,12 @@ bool moveWindow(const WindowHandle windowHandle, const MMPoint newOrigin) {
299
290
CFRelease (app);
300
291
301
292
// Return true to indicate successful resize
302
- return true ;
293
+ return YES ;
303
294
} else {
304
295
// NSLog(@"Could not resize window with window handle %lld", windowHandle);
305
296
CFRelease (app);
306
297
return false ;
307
298
}
308
299
309
- return true ;
300
+ return YES ;
310
301
}
0 commit comments