95 Commits

Author SHA1 Message Date
Kovid Goyal
cd8bb462c3
Add KITTY_VCS_REV for release builds as well 2023-02-28 19:41:28 +05:30
Kovid Goyal
935a36f5a8
Allow specifying VCS revision on the build command line 2023-02-28 13:05:43 +05:30
Kovid Goyal
a068e3e655
Fix issues reported by ruff 2023-01-09 15:54:41 +05:30
Kovid Goyal
98eacb2067
panel kitten: Do not depend on xprop 2022-09-24 15:44:54 +05:30
Kovid Goyal
2cef9abbd3
Get rid of one call to xprop in the panel kitten 2022-09-24 15:17:11 +05:30
Kovid Goyal
dcf2152a7a
Wayland: Generate a XDG_ACTIVATION_TOKEN when opening URLs or running programs in the background via the launch action 2022-09-11 14:25:49 +05:30
Kovid Goyal
58a3baaf0f
Wayland: Use XDG_ACTIVATION_TOKEN when present at launch 2022-09-11 13:43:52 +05:30
Kovid Goyal
bcfa2a64e4
Start work on new clipboard api support for macos 2022-09-08 21:45:13 +05:30
pagedown
51d591e177
macOS: Allow opening URLs with kitty 2022-02-05 13:05:41 +08:00
pagedown
80a62c8d71
Add preamble to generated file and fix gen-config.py filename 2022-02-05 13:05:13 +08:00
pagedown
ba0f61d752
Refactor: More f-string for kitty 2022-01-29 20:17:46 +08:00
pagedown
dc61adf9d8
Refactor: More f-string 2022-01-28 19:34:13 +08:00
pagedown
4293325539
Cleanup previous PR
Revert the changes related to set_options debug_keyboard.
Remove the Carbon framework flag for glfw.
2022-01-10 10:24:10 +08:00
Kovid Goyal
69e903a4c4
Add more type annotations 2021-10-27 11:13:28 +05:30
Kovid Goyal
9c2f96f7eb
Add more type annotations 2021-10-27 08:45:45 +05:30
Kovid Goyal
853f7cc59a
Make handling of CC more robust
Allows multi-command compilers and makes detection of gcc more robust.
Fixes #4102
2021-10-07 13:35:56 +05:30
Kovid Goyal
1b42f69119
Allow specifying extra lib dirs as well
Also use the extra include and lib dirs when detecting librsync
2021-10-06 10:23:01 +05:30
Kovid Goyal
303e4baa58
Add GLFW API to set WM_COMMAND
Also have create_os_window take keyword arguments
2021-07-30 08:35:40 +05:30
Kovid Goyal
62656b24eb
GNOME: Add a new option to control the color of the kitty window titlebar 2021-04-25 11:22:23 +05:30
Georgi Yonchev
98519bf326 [macos] - Add "Secure Keyboard Entry" menu item 2021-04-09 16:39:51 +03:00
Kovid Goyal
37e3e29c8c
Fix a crash on systems using musl as libc
Fixes #3395
2021-03-17 14:13:50 +05:30
Kovid Goyal
f70c9842f5
macOS: Allow opening script and command
Fixes #3366
2021-03-10 21:33:29 +05:30
Kovid Goyal
4fea7bd8ef
Fix building on systems with xkbcommon < 1.0 2021-01-17 07:22:21 +05:30
Kovid Goyal
86ce72e725
Port the Cocoa backend to use unicode key numbers 2021-01-16 20:52:16 +05:30
Kovid Goyal
9193a20b44
macOS: Fix minimize not working for chromeless windows
Fixes #3112
2020-11-20 07:30:46 +05:30
Kovid Goyal
e2b1ca10c9
Save a line :P 2020-08-24 12:08:09 +05:30
Kovid Goyal
11942ed6dc
Fix compilation on OpenBSD
Fixes #2935
2020-08-24 12:05:39 +05:30
Kovid Goyal
03b1484c96
Wayland: Abort on fatal error should bypass quit confirmation 2020-06-03 14:39:27 +05:30
Luflosi
7441cefdbb
Make paths to libraries configurable at build time 2020-05-19 18:36:46 +02:00
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
Kovid Goyal
2e63a4c83f
Wayland: Remove unused link-time dependency
6aca3e99f0
2020-05-01 15:00:38 +05:30
James McCoy
0dff0d03f9 Use -fPIC instead of -fpic
With large objects, use of -fpic will fail to link on certain
architectures due to size limitations of the global offset table (GOT).
For example, the link stage for glfw-wayland.so fails on sparc64, as
below.  Using -fPIC avoids these size limitations.

    ./glfw/osmesa_context.c:73:(.text+0xf2c): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `swapIntervalEGL':
    ./glfw/egl_context.c:238:(.text+0xf68): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `destroyContextOSMesa':
    ./glfw/osmesa_context.c:80:(.text+0x10a4): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `data_offer_action':
    ./glfw/wl_window.c:1692:(.text+0x15e4): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `data_offer_source_actions':
    ./glfw/wl_window.c:1683:(.text+0x1648): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `keyboardHandleRepeatInfo':
    ./glfw/wl_init.c:471:(.text+0x1704): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `checkScaleChange':
    ./glfw/wl_window.c:55:(.text+0x1768): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `primary_selection_copy_callback_done':
    ./glfw/wl_window.c:1833:(.text+0x18bc): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `clipboard_copy_callback_done':
    ./glfw/wl_window.c:1825:(.text+0x1910): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `primary_selection_source_canceled':
    ./glfw/wl_window.c:1582:(.text+0x1968): relocation truncated to fit: R_SPARC_GOT13 against symbol `_glfw' defined in .bss section in /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o
    /tmp/glfw-wayland.so.SYvdxr.ltrans0.ltrans.o: in function `data_source_canceled':
    ./glfw/wl_window.c:1576:(.text+0x19c0): additional relocation overflows omitted from the output
    collect2: error: ld returned 1 exit status
2020-04-25 10:08:28 -04:00
Kovid Goyal
76a6bba643
Fix #2466 2020-03-24 17:07:37 +05:30
Kovid Goyal
5956277863
All defs are now typed 2020-03-14 14:37:11 +05:30
Kovid Goyal
8a34fede55
More typing work 2020-03-06 08:35:23 +05:30
Kovid Goyal
296f512bfb
Forgot you cant use sizeof on arrays passed as function parameters 2019-12-28 08:44:32 +05:30
Kovid Goyal
c8f20d0edf
Ensure key name is null terminated 2019-12-28 08:33:13 +05:30
Kovid Goyal
286f3630d7
Merge branch 'macos_fix_keyboard_shortcut_encoding' of https://github.com/Luflosi/kitty 2019-12-28 08:26:03 +05:30
Luflosi
9a3c621eb6
Fix macOS keyboard shortcut encoding
`glfwGetCocoaKeyEquivalent()` in `glfw/cocoa_window.m` expects the returned characters to be of type `unichar`, which won't work for all unicode characters because it is defined as `unsigned short` according to https://developer.apple.com/documentation/foundation/unichar?language=objc, which is only guaranteed to be at least 16 bits in size. The code calling this function also expects the encoding to be UTF-16.
When I added the various keys in https://github.com/kovidgoyal/kitty/pull/1928, I missed these facts. This means, that `glfwGetCocoaKeyEquivalent()` will behave unexpectedly when called with any of the new-ish keys. Luckily this function is currently only used for determining the macOS shortcut for `new_os_window` but I plan on using it more in the future.
Some of the constants, e.g. `NSBackspaceCharacter` are UTF-16 constants, so we can't just use UTF-8 everywhere.
I fixed the problem by using either UTF-8 characters packed into a `uint32_t` or UTF-16 characters in a `unichar` and then converting them to a UTF-8 encoded char string.

`NSEventModifierFlagNumericPad` isn't guaranteed to fit in a `unichar`, which made this undefined behaviour. It also didn't work. I tried to make it work using `NSEventModifierFlagNumericPad` as a modifier instead, as can be seen in this commit, but couldn't get it to work either because the constants used are native key codes and not unicode characters. Therefore the numpad keys will be removed in the next commit.
2019-12-27 12:42:51 +01:00
Luflosi
46dd648380
Use the correct pointer type instead of void* 2019-12-25 11:51:40 +01:00
Luflosi
e0edef6719
Change return type of two functions
`on_application_reopen()` and `intercept_cocoa_fullscreen()` both only have two possible return values and can therefore have a return type of `bool`.
2019-11-24 13:06:46 +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
7f2b98fad7 Rename all uses of 'scancode' to 'native_key' where relevant 2019-10-16 02:25:20 +02:00
Kovid Goyal
97fe38fbbc
monotonic_start_time needs to be a global symbol, not local to each translation unit 2019-09-28 08:18:21 +05:30
Benoit de Chezelles
53275c9137 Extract key event data to struct 2019-09-24 19:15:35 +02:00
James McCoy
34350af61c
Only use linux_joystick.c on Linux
Rather than using null_joystick.c when _plat is a bsd, use
linux_joystick.c when _plat is a linux.  This fixes a build issue with
other non-BSD, non-Linux platforms.
2019-09-03 23:02:16 -04:00
Luflosi
902fc22670
Simplify GLFW compilation code
This commit removes the need for `is_macos` in `glfw/glfw.py` by moving a few lines of code. Instead of relying on the information that the compilation is or isn't happening on macOS, the code now does the right thing based on which `module` is being built.
This changes the order of the compilation flags slightly.
2019-08-26 16:47:19 +02:00
Luflosi
599be7ddc9
Don't add Apple Frameworks twice
These Frameworks are added again a couple lines below in the check for `module == 'cocoa'`.
2019-08-11 02:26:12 +02:00
Luflosi
5f855ce547
Use context managers to open files
Inspired by d50a6ddc1b.
2019-08-01 13:21:26 -05:00
Kovid Goyal
67f23664c9
Generate Wayland protocol definitions in parallel as well 2019-07-05 20:57:56 +05:30