Commit Graph
56 Commits
Author SHA1 Message Date
pagedown 8ed6ee97b2 Docs: replace http url with https, use ripgrep project url and fix typo 2021-11-30 18:53:58 +08:00
Kovid Goyal 0965fc45f2 macOS: Fix keyboard input not working after toggling traditional fullscreen till the window is clicked in 2021-11-13 14:20:18 +05:30
Luflosi a1d24028b8 Fix Clang warning
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 f9944e6140.
2021-10-30 16:25:20 +02:00
Kovid Goyal f9944e6140 Pass through more modifier+tab variants 2021-10-17 11:31:54 +05:30
Kovid Goyal f28d9bcd8c Change sybolic constant for insert key 2021-10-14 21:05:21 +05:30
Kovid Goyal c6039fc399 Also passthrough Insert and Shift+Insert which cocoa seems to intercept 2021-10-14 20:27:22 +05:30
Kovid Goyal 820fb6dda9 Pass through all esc + modifier combinations since they arent generally used in macOS 2021-10-11 11:27:24 +05:30
Kovid Goyal dc11b76bea Restrict the overridden cocoa global shortcuts 2021-10-11 06:46:59 +05:30
Kovid Goyal 2b9408c217 macOS: Fix ctrl or cmd with Esc or Function keys not working
Fixes #4109
2021-10-10 21:39:20 +05:30
Kovid Goyal be34af4555 Remove inline from .c files
It is ignored by compilers and hides unused static functions
2021-08-03 09:11:17 +05:30
Kovid Goyal 399c700939 Prevent Cocoa from sending us open file events from command line args
We process command line args ourselves, thank you very much.
2021-03-11 10:59:03 +05:30
Kovid Goyal 077097c112 Also implement openFiles 2021-03-10 21:55:00 +05:30
Kovid Goyal f70c9842f5 macOS: Allow opening script and command
Fixes #3366
2021-03-10 21:33:29 +05:30
Kovid Goyal 86ce72e725 Port the Cocoa backend to use unicode key numbers 2021-01-16 20:52:16 +05:30
Luflosi 785973bb5e GLFW: Make joystick platform code init on demand
From upstream: https://github.com/glfw/glfw/commit/782e6b6cefc9ac2a2b6779f9e658ab948809253b.
2020-07-23 23:56:30 +02:00
Kovid Goyal 03b1484c96 Wayland: Abort on fatal error should bypass quit confirmation 2020-06-03 14:39:27 +05:30
Kovid Goyal 707cb37212 Have the confirm on close also apply to quitting kitty
Use a dedicated API for handling quit requests on macOS rather than a
quit canary. Also create a mappable "quit" action for all platforms.
2020-05-18 16:06:40 +05:30
Luflosi e4fd12001c Cocoa: Add fully dynamic loading of Vulkan loader
From upstream: https://github.com/glfw/glfw/commit/7da87aaae7039cbdc132f8f563a2603c5e3c73a1.
2020-01-17 14:18:28 +01:00
Kovid Goyal 87e2f7f86d Missed a couple of macOS timer calls 2019-12-19 16:34:47 +05:30
Luflosi 2804e1ff81 Cocoa: Update outdated comment
From upstream: https://github.com/glfw/glfw/commit/b3544ca43e2fd328aa084f118789c7eeda5869a8.
2019-12-18 15:41:31 +01:00
Luflosi 4fc733a9c8 Comment commented out code back in
This piece of code is not run when the `GLFW_COCOA_MENUBAR` init hint is set to `0`, which kitty does.
This reduces the difference to GLFW upstream a little.
2019-11-24 13:29:06 +01:00
Luflosi f9fd39b8c1 Create macOS menu bar where GLFW creates it
GLFW creates the menu bar in the applicationWillFinishLaunching method, while kitty creates it in `create_os_window()`. This patch changes the behaviour to match GLFW.
In practice, without this change, there can be a short time where the menu bar is not fully populated.
2019-11-24 08:43:01 +01:00
Benoit de Chezelles 4d6472128c Rename scancode to keycode for cocoa implementation 2019-10-17 20:41:48 +02:00
Luflosi 7ddbb613fe Cocoa: Fix window creation blocking after re-init
From https://github.com/glfw/glfw/commit/2fbb560eb72fea695687d33066c91a329d6d0465.
2019-10-08 13:41:10 +02:00
Luflosi 1f8631cc99 Cocoa: Move app delegate and menu creation to init
From https://github.com/glfw/glfw/commit/ea7eb2ddab823e21c846c68d112d90f91fcba318.
2019-10-07 21:24:58 +02:00
Luflosi f3b9ff5f9f Use datatype monotonic_t instead of double to keep track of time
The time is stored in a signed 64 bit integer with nanosecond accuracy. This eliminates the possibility of floating-point inaccuracies.
`monotonic_t` can currently hold values large enough to work correctly for more than 200 years into the future.
Using a typedef instead of directly using `int64_t` everywhere will also allow easily changing the datatype in the future should the need arise for more precise or bigger time values.
2019-09-25 17:43:11 +02:00
Luflosi 28bb123be8 Update the GLFW version number from 3.3 to 3.4
Closes https://github.com/kovidgoyal/kitty/issues/1884.
From https://github.com/glfw/glfw/commit/a337c568486025d22443535b7c047a563bc34373.
2019-08-02 11:00:16 -05:00
Luflosi 489f3e6c9d Add C dialect reminders to each glfw source file
Reduces the difference to upstream.
From https://github.com/glfw/glfw/commit/56aad76b164be741af21688ea3832093c2069cef.
2019-07-20 21:07:27 -05:00
Luflosi bdc4558a43 Update GLFW copyright years
Reduces the difference to upstream.
From https://github.com/glfw/glfw/commit/ab118b2529a8da3e6b5f847b80ee86bb8c6bf6bb.
2019-07-20 00:30:13 -05:00
Kovid Goyal 1cb15dedac Simplify the event loop code
Also reduce input latency by ignoring repaint_delay when
there is actual pending input.

Gets rid of request_tick_callback(). Now empty events
result in the tick callback being called so there is only a
single mechanism for waking up the main loop and getting
the tick callback called.
2019-07-18 15:51:54 +05:30
Kovid Goyal 39f6071c68 macOS: Fix a deadlock with CVDisplayLink
I had added an optimization to not pass messages to
main thread every time the CVDisplayLink timer fired, unless
a render frame for that monitor was actually requested.

However, this optimization is impossible to implement wihtout a deadlock
since CVDisplayLink has its own internal lock that it does not expose.

So I guess macOS users with multiple monitors will simply have to take
the performance hit of useless wakeups sixty times a second for every
extra monitor.

Fixes #1779
2019-07-05 20:16:32 +05:30
Kovid Goyal 841c907efc Build glfw with all warnings enabled 2019-07-01 10:42:07 +05:30
Luflosi 8ffc841a3a Reduce the difference of glfw/cocoa_* to upstream
This only changes some formatting, whitespace, etc.. There are no
changes to the functionality.
Let me know if you don't like some of those changes.
2019-06-21 15:53:26 +02:00
Kovid Goyal 47acc9ff2f Get rid of GLFW_(TRUE|FALSE) 2019-06-08 08:14:30 +05:30
Kovid Goyal fe62700825 Get rid of GLFWbool 2019-06-08 08:12:42 +05:30
Kovid Goyal 3c7a71772c Wrap memmove in glfw with a nice safe macro 2019-06-07 10:01:10 +05:30
Kovid Goyal 8406d4a8f1 Forgot another print statement
Really should not code when I am busy :)
2019-06-02 20:23:56 +05:30
Kovid Goyal e25b64ae15 ... 2019-06-02 18:01:32 +05:30
Kovid Goyal 59205a4caf macOS: Fix a regression in the previous release that broke using :kbd:ctrl+shift+tab
Fixes #1671
2019-06-02 17:36:16 +05:30
Kovid Goyal 8193b2a44b Use layout depenedent key check for strl+tab as well 2019-05-29 08:43:13 +05:30
Kovid Goyal 8e57fd93c6 macOS: Fix a regression that caused cmd+v to double up in the dvorak keyboard layout
Fixes #1652
2019-05-28 20:35:13 +05:30
Kovid Goyal 41318d763b Fix missing context APIs in version strings 2019-04-09 10:06:10 +05:30
Kovid Goyal c4e89d9d0c macOS: Consolidate compatibility macros for old SDKs in one place 2019-03-28 12:37:05 +05:30
Kovid Goyal fcb26e5dc7 Cocoa: User performSelectorOnMainLoop for render frames as well which means render frames work during modal loops 2019-03-21 16:51:01 +05:30
Kovid Goyal 0dc6ac26c3 Cocoa: user performSelectorOnMainThread instead of postEvent for the tick callback
performSelectorOnMainThread runs in more loop run modes which means that
the tick callback will behave more like it does on other platforms,
during window resizes and other modal event loops.
2019-03-21 15:55:43 +05:30
Kovid Goyal 7ab63525c7 Dont use a global autorelease variable
Use function local @autorelease blocks instead
2019-03-06 09:34:55 +05:30
Kovid Goyal f0a2c34eca Port cocoa backed to use glfw mainloop 2019-03-04 19:52:46 +05:30
Kovid Goyal a1e9b854e3 Move cocoa custom even dispatching into the application object
This allows it to work even with the cocoa run loop
2019-02-25 15:51:39 +05:30
Kovid Goyal 4629ef627f GLFW: Add support for render frames on Cocoa (CVDisplayLink)
Allows vsync to work again since Apple broke OpenGL swap intervals on
Mojave
2019-02-20 15:08:07 +05:30
Kovid Goyal 32a0e28686 macOS: Fix :kbd:cmd+period key not working
Fixes #1318
2019-01-20 13:17:01 +05:30