Commit Graph

208 Commits

Author SHA1 Message Date
Kovid Goyal
0a89fe2e17
Merge branch 'fix-macos-text-input-beep' of https://github.com/page-down/kitty 2022-01-13 20:23:23 +05:30
pagedown
5b5651ca7d
macOS: Suppress the key combinations beep sound 2022-01-13 22:51:53 +08:00
Kovid Goyal
5e5cd1acc8
Simplify flagsChanged and make it more robust
Now it only sends a key event to kitty if an actual modifier key was
pressed/released.
2022-01-13 20:13:55 +05:30
Kovid Goyal
f9d2167c97
macOS: Respect the users system-wide global keyboard shortcut preferences
Note that we currently dont handle live reload of global shortcut
preferences. I cant be bothered. Patches welcome.
Fixes #4501
2022-01-13 13:36:58 +05:30
Nathan Pearson
7c33d7ef17 Bumps version from 10.15 to 10.15.7 (latest minor) 2022-01-11 07:31:37 -07:00
Nathan Pearson
2ccfecb5ae Fixes comment 2022-01-11 06:39:48 -07:00
Nathan Pearson
a40ff85e1a Fixes traditional fullscreen hide for Mac OS >= 10.15 2022-01-11 06:25:39 -07:00
Kovid Goyal
7023c7a8ae
... 2022-01-10 21:15:24 +05:30
pagedown
f7be4fab48
macOS: Allow mapping secure keyboard entry shortcut 2022-01-09 22:54:03 +08:00
Kovid Goyal
356897a32d
macOS: Persist "Secure Keyboard Entry" across restarts to match the behavior of Terminal.app
Fixes #4471
2022-01-08 14:13:14 +05:30
Kovid Goyal
ac0c10c170
Simplify if condition 2022-01-08 14:06:22 +05:30
pagedown
d0fa0516f5
macOS: Fix keyboard input not working after toggling full screen 2021-12-13 08:58:52 +08:00
Kovid Goyal
bd288bd18f
Linux: Fix release event for the final key in a compose sequence not being reported. Fixes #4285 2021-11-29 19:26:16 +05:30
Kovid Goyal
acdf06bf5d
Tell cocoa the previous character range is invalid when updating IME position
Without this IME popup position is sometimes incorrect, for instance, at
startup
2021-11-28 22:11:21 +05:30
pagedown
088b7cde4f
Update IME status when window lost focus 2021-11-28 23:09:35 +08:00
pagedown
8e87b639fa
Use macOS 11.0 version number 2021-11-19 14:41:19 +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
Kovid Goyal
181178b0ea
macOS: use a consistent technique to get window size
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.
2021-11-13 13:42:12 +05:30
Kovid Goyal
3483722475
Remove pointless code 2021-11-13 12:13:28 +05:30
Kovid Goyal
56e63baf5a
macOS: manually trigger windowDidResize when fullscreening
Fixes #4230
Fixes #4229
2021-11-13 11:49:55 +05:30
Kovid Goyal
f24dc80c49
Send IME events in the correct sequence when cocoa both inserts text and marks new text in response to the same key event 2021-11-12 17:27:37 +05:30
Kovid Goyal
9a9de0038c
Remove unused code 2021-11-12 15:10:33 +05:30
Kovid Goyal
ffa755c723
macOS: Ensure IME position is correct on startup 2021-11-12 09:18:34 +05:30
Kovid Goyal
a060bf7223
Also unmark text on pressing esc
As with backspace, without this the preedit text is not cleared when the
IME is canceled by esc
2021-11-12 08:52:32 +05:30
Kovid Goyal
fac76ddedd
DRYer 2021-11-11 22:41:59 +05:30
Kovid Goyal
f34cc1861a
Clear marked text when text is inserted
This is apparently what Cocoa expects. Fixes committing pre-edit text no
longer working.
2021-11-11 22:35:02 +05:30
Kovid Goyal
bd4ed38a3c
Dump more informatin about what cocoa does when processing key events 2021-11-11 22:32:30 +05:30
Kovid Goyal
8644fed534
Only unmark on backspace key 2021-11-11 22:05:39 +05:30
Kovid Goyal
ca9fdadf3c
Dont clear marked text on every keyDown event
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.
2021-11-11 21:14:53 +05:30
Kovid Goyal
228364e317
oops 2021-11-11 20:53:14 +05:30
Kovid Goyal
e65aee4533
Cleanup calls to unmarkText 2021-11-11 20:44:43 +05:30
Kovid Goyal
9be37f7d2d
cocoa is weird 2021-11-11 12:45:03 +05:30
Kovid Goyal
d95a00df73
GLFW API to check if window is fullscreen 2021-11-11 12:33:12 +05:30
Kovid Goyal
0a4dfa8fd2
macOS: Prevent resizing of fullscreen OS windows as it leads to visual artifacts 2021-10-24 12:38:44 +05:30
Kovid Goyal
edd423aad6
macOS; Fix restoring from fullscreen when resize increments are enabled 2021-10-23 13:06:47 +05:30
Kovid Goyal
a3717436b6
macOS: Fix resize_in_steps not working correctly on high DPI screens
See #4114
2021-10-12 14:39:06 +05:30
Kovid Goyal
61a56a0561
macOS: Fix very first keypress after window creation being sent as a repeat instead of a press event
Now the dummy event on input source changed is sent with no key and only
after an actual change instead of on startup as well.
2021-10-11 12:30:42 +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
c797944923
Also set first underviced render frame request 2021-08-01 12:59:22 +05:30
Kovid Goyal
ade4e67b51
Possible fix for #3890
Try to ensure we have a functioning displaylink always.
GLFW skips over sleeping monitors during a poll and also
had a bug where the display link was not re-created for a monitor
that already had a glfw monitor entry.

Also add a bunch more debug reporting
2021-08-01 12:53:35 +05:30
Kovid Goyal
368bc91eed
macOS: Render colors in the sRGB colorspace to match other macOS terminal applications
Fixes #2249
2021-07-12 17:34:03 +05:30
Kovid Goyal
e4b4a35375
macOS: Fix rendering getting stuck on some machines after sleep/screensaver
This is caused, as far as I can tell, by CVDisplayLink getting stuck.
Apple apparently are incapable of writing a simple timer robustly.
So if it remains stuck after a second delete and recreate it to force it
to restart.

Fixes #2016
2021-05-12 07:30:17 +05:30
Luflosi
6606f51636
Fix compilation on macOS 10.12
The constants `NSControlStateValueOn`, `NSControlStateValueOff` and `NSControlStateValueMixed` are only available for macOS 10.13 or above according to https://developer.apple.com/documentation/appkit/nscontrolstatevalueon?language=objc.
Without this commit, compilation fails with this message:
```
glfw/cocoa_window.m:1537:28: error: use of undeclared identifier 'NSControlStateValueOn'
              item.state = NSControlStateValueOn;
                           ^
glfw/cocoa_window.m:1539:28: error: use of undeclared identifier 'NSControlStateValueMixed'
              item.state = NSControlStateValueMixed;
                           ^
glfw/cocoa_window.m:1542:47: error: use of undeclared identifier 'NSControlStateValueOn'
          item.state = controller.isDesired ? NSControlStateValueOn : NSControlStateValueOff;
                                              ^
glfw/cocoa_window.m:1542:71: error: use of undeclared identifier 'NSControlStateValueOff'
          item.state = controller.isDesired ? NSControlStateValueOn : NSControlStateValueOff;
                                                                      ^
```
To fix this, simply redefine the constants to use the old and now deprecated constants on older macOS versions.

The code that causes this was introduced in 98519bf326.
2021-04-22 10:53:34 +02:00
Kovid Goyal
f3c559ea13
Cleanup secure keyboard entry logging 2021-04-22 09:41:01 +05:30
Kovid Goyal
84f6aabf5b
Clean up debug keyboard on macOS 2021-04-22 09:28:11 +05:30
Kovid Goyal
8c4e426534
Silence some unused parameter warnings 2021-04-19 13:53:27 +05:30
Georgi Yonchev
98519bf326 [macos] - Add "Secure Keyboard Entry" menu item 2021-04-09 16:39:51 +03:00
Kovid Goyal
df7790fdfe
... 2021-03-23 16:31:25 +05:30
Kovid Goyal
34d06fa3e9
Use a struct for IME update events
Allows for easier extension in the future
2021-03-23 16:05:22 +05:30
Kovid Goyal
a981b46ec9
Use an enum for updateimestate as well 2021-03-23 10:52:11 +05:30