Avoid using existing parameter names for local variables.
Avoid using variable names from upper level for nested loops.
Avoid local variables hiding existing global variables.
Apple go on making it harder and harder to support multiple
versions of their pathetic operating system in one code base.
kIOMainPortDefault is the "non-deprecated" replacement for
kIOMasterPortDefault. However, it is now marked as being available only
on macOS 12 and later so it refuses to build in a codebase designed to
run on earlier versions of macOS. Le bubbling sigh.
According to https://developer.apple.com/documentation/iokit/kiomasterportdefault?language=objc
passing NULL has the same effect and avoids the stupid warning.
Hopefully this will work till Apple decides to spend their trillion
dollars doing more stupid shit.
This fixes an issue where restoring from traditional fullscreen to a
maximized state was resulting in an incorrectly sized frame buffer. Now
all framebuffer and window size calculation happens in the same way in
all the various glfw codepaths that do it.
Let the input system do it for us. That wy we can hopefully use calls to
unmarkText as a signal to commit the pre-edit text.
Hopefully not clearing the marked text on key down doesnt break anything
else.
Without this, kitty fails to compile:
```
glfw/cocoa_init.m:462:14: error: case value not in enumerated type
'NSEventModifierFlags' (aka 'enum NSEventModifierFlags')
[-Werror,-Wswitch]
case (NSEventModifierFlagShift | NSEventModifierFlagOption):
^
glfw/cocoa_init.m:465:14: error: case value not in enumerated type
'NSEventModifierFlags' (aka 'enum NSEventModifierFlags')
[-Werror,-Wswitch]
case (NSEventModifierFlagShift | NSEventModifierFlagCommand):
^
```
I thought about changing the type of the `modifierFlags` function parameter from `NSEventModifierFlags` to `NSUInteger` since `NSEventModifierFlags` is defined as an enum according to https://developer.apple.com/documentation/appkit/nseventmodifierflags?language=objc and is technically not the proper type for a bit field. But since Apple themselves define `modifierFlags` as `NSEventModifierFlags` according to https://developer.apple.com/documentation/appkit/nsevent/1534405-modifierflags?language=objc, I think the fix in this commit is better.
This warning was introduced with commit f9944e614088c4977ad9c9f1d1b44d97643e8d5b.