Commit graph

971 commits

Author SHA1 Message Date
Kovid Goyal
aab121b35d
Also check for shiftable shortcuts in the virtual key code case 2022-01-15 10:23:18 +05:30
Kovid Goyal
396906860d
macOS: When checking for global shortcuts handle shifted form of cmd+` 2022-01-15 10:14:06 +05:30
Kovid Goyal
3a0d8ada6a
Merge branch 'feat-macos-kbd-shortcuts' of https://github.com/page-down/kitty 2022-01-14 12:36:01 +05:30
pagedown
704487f0ce
macOS: Release input context 2022-01-14 14:18:03 +08:00
pagedown
a9bdf70275
macOS: Watch for system preferences changes and update global_shortcuts 2022-01-14 13:51:46 +08:00
pagedown
ab5b9fb329
macOS: Only check the "standard" type of the system shortcuts 2022-01-14 10:07:38 +08:00
pagedown
e0700d45de
macOS: Update to the latest and categorize the system shortcut names 2022-01-14 10:05:49 +08:00
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
79fd01093a
fix typo in generating lookup keys for vk code based shortcuts 2022-01-13 19:21:49 +05:30
Kovid Goyal
a56471f7ed
Validate the parameters array 2022-01-13 16:44:43 +05:30
Kovid Goyal
96b46c554e
Add type annotations to dictionaries 2022-01-13 16:29:13 +05:30
Kovid Goyal
a819023ab7
remove redundant cast 2022-01-13 16:05:48 +05:30
Kovid Goyal
9504f50bd4
... 2022-01-13 16:04:50 +05:30
Kovid Goyal
8fe71e3dc8
Dont use a block for dictionary enumeration
Maybe that will fix the mysterious issue @page-down is having
2022-01-13 16:02:29 +05:30
Kovid Goyal
34d7643bed
Ensure global_shosrtcuts is initialized 2022-01-13 15:10:19 +05:30
Kovid Goyal
682eb7d802
Log when events are ignored because no keyWindow is present 2022-01-13 14:22:52 +05:30
Kovid Goyal
f86a954131
ooops 2022-01-13 14:21:58 +05:30
Kovid Goyal
8e3f6d37d9
... 2022-01-13 14:15:39 +05:30
Kovid Goyal
2c38360ca0
Handle no keyWindow case 2022-01-13 13:43:01 +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
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
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
Kovid Goyal
e228f5105e
Merge branch 'refactor' of https://github.com/page-down/kitty 2022-01-02 09:23:25 +05:30
Kovid Goyal
719760fd7b
Remove unused UNUSED 2022-01-02 09:19:40 +05:30
pagedown
15615a4cd1
Avoid defining variables with the same name that already exist
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.
2022-01-01 21:29:32 +08:00
Kovid Goyal
99d06f0714
See if 0 makes Apple happy 2021-12-15 13:14:02 +05:30
Kovid Goyal
e973c45968
Fix build on XCode 13.1
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.
2021-12-15 12:57:46 +05:30
pagedown
d0fa0516f5
macOS: Fix keyboard input not working after toggling full screen 2021-12-13 08:58:52 +08:00
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
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
6da5a8073c
Wayland: Apparently Java doesnt even set text/plain as a mimetype when copying text. Instead it uses UTF8_STRING and STRING.
So check for those as well. Am guessing whoever wrote this code in Java
just copied their old X11 shit without checking the specs. See #4183
2021-11-03 20:46:33 +05:30
Kovid Goyal
ebaac70b27
Fix #4183 (paste in wyland with mime type text/plain) 2021-11-03 07:00:06 +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
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
c381716ecf
Specify we need alpha as well 2021-10-25 17:15:46 +05:30
Kovid Goyal
6c7420f4e7
Add a comment explaining why we do 1,1,1,0 2021-10-24 13:40:18 +05:30
Kovid Goyal
80a357623d
Linux X11: Add support for 10bit colors
Fixes #4150
2021-10-24 13:19:05 +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
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
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
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
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
3728d2cfd9
Add changelog entry for previous PR 2021-09-29 19:43:33 +05:30
Park, Jeongmin
4232904055 ibus: Add support for ForwardKeyEvent signal
The ForwardKeyEvent ibus signal is used to maintain ordering between CommitText events and non-IME key events.
The ordering is important for Korean IMEs, where it automatically commits text whenever a character is fully composed. This is different from Chinese/Japanese IMEs, where user manually presses a key to commit each word.

Without this patch, kitty can't handle non-IME key events when used with ibus-hangul, which utilizes ForwardKeyEvent signal.

Without ForwardKeyEvent:
```
key | sequence of events from application's view
r   | UpdatePreeditText 'ㄱ'
k   | UpdatePreeditText '가'
1   | (receives the reply to ProcessKeyEvent call: "native_key: 0x31 release: 0 handled: 0")
    | -> UpdatePreeditText ''
    | -> CommitText '가'
```
Application receives "1가", which is incorrect.

With ForwardKeyEvent:
```
key | sequence of events from application's view
r   | UpdatePreeditText 'ㄱ'
k   | UpdatePreeditText '가'
1   | (receives the reply to ProcessKeyEvent call: "native_key: 0x31 release: 0 handled: 1", and kitty discards the event)
    | -> UpdatePreeditText ''
    | -> CommitText '가'
    | -> ForwardKeyEvent keysym=0x31("1")
```
Application receives "가1", which is correct.

Relevant ibus-hangul github issue to implement ForwardKeyEvent: https://github.com/libhangul/ibus-hangul/issues/42
Relevant changes in Qt to handle ForwardKeyEvent: https://codereview.qt-project.org/c/qt/qtbase/+/212179, https://codereview.qt-project.org/c/qt/qtbase/+/255587
2021-09-29 21:20:09 +09:00
Kovid Goyal
a038477ce0
Cleanup previous PR 2021-09-26 11:17:54 +05:30
unisgn
d078cb264a
Update ibus_glfw.c 2021-09-25 00:10:53 +08:00
unisgn
c45a656153
ibus's dbus name owner changed detection
fcitx5 works fine with kitty, except that when you restart fcitx5, kitty stop working with fcitx5, because the dbus_connection_get_is_connected(ibus->conn) in #check_connection is always true when you use fcitx5.
this patch add a dbus name owner changed detection to detect the online status of ibus, in case the ibus backend uses the session bus, like fcitx5.
2021-09-24 23:10:38 +08:00
Kovid Goyal
bdebb19648
Merge branch 'wayland-hyper' of https://github.com/orki/kitty 2021-08-18 08:29:51 +05:30
Ravi R Kiran
75df0cbcf5 Gate Wayland modifier autodiscovery behind an environment variable 2021-08-17 21:46:09 -05:00
Ravi R Kiran
1b88a68b55 Be even more conservative in declaring success
This handles the nonsensical case of Alt_X being mapped to two
different modifiers.
2021-08-17 21:11:55 -05:00
Ravi R Kiran
b0c963b650 Heuristic to find hyper and meta on wayland 2021-08-16 21:59:53 -05:00
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
6bfb704f6f
When going from csd->no csd increase window height to compensate for titlebar.
Sway will send the next configure event (for example when focus changes)
with titlebar height added, so to avoid a sudden resize at that time,
bump the height by the titlebar.
2021-07-31 14:56:45 +05:30
Kovid Goyal
80cebdefcd
Better fix for CSD toggling on Wayland
Draw CSD if the compositor wants us to. See #3888
2021-07-31 14:15:38 +05:30
Kovid Goyal
c26665ec4d
Wayland: If the compositor turns off server side decorations after turning them on do not draw client side decorations
This matches the behavior of GNOME based clients and in any case sway
seems to get very confused if CSD is drawn.

Fixes #3888
2021-07-31 11:41:27 +05:30
Kovid Goyal
91d82ebf4b
Remove unused import 2021-07-31 11:27:29 +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
Danilo Horta
890181172f Fix "Cocoa: Failed to find service port...". 2021-07-28 00:39:50 +01:00
Kovid Goyal
2e01c1f37e
Wayland: Inform compositor of new window geometry when setting window size 2021-07-25 12:26:09 +05:30
Kovid Goyal
8dfef58f29
Use a glfw specific name for memfd_create 2021-07-20 21:49:11 +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
219bf564f7
Fix #3719 2021-06-13 09:07:08 +05:30
Kovid Goyal
00828cb804
More reloading work for various options 2021-06-07 09:30:15 +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
Kovid Goyal
e36f11385f
Convert mouse buttons to an enum 2021-05-10 07:16:43 +05:30
Kovid Goyal
6b9b478492
Linux: Fix keyboard layout change keys defined via compose rules not being ignored 2021-05-01 08:09:26 +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
Ravi R Kiran
3c4460ca98 Give shift, control and caps lock precedence over other modifiers 2021-04-23 10:47:26 -05:00
Kovid Goyal
93dfe19c35
GNOME: Fix maximize state not being remembered when focus changes and window decorations are hidden
Apparently mutter needs window geometry set after the surface commit not
before, otherwise it doesnt "stick". When decorations are not hidden
there were other commits caused by the decorations, masking the issue.

Fixes #3507
2021-04-23 14:04:12 +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
cb41683f47
... 2021-04-19 20:12:20 +05:30
Kovid Goyal
629a8ad055
Fix #3501 2021-04-19 19:58:02 +05:30
Kovid Goyal
8c4e426534
Silence some unused parameter warnings 2021-04-19 13:53:27 +05:30
Kovid Goyal
9a2b0b6995
Wayland CSD: Double clicking on titlebar should toggle window maximize 2021-04-19 08:58:29 +05:30
Kovid Goyal
e6ccc2d178
Fix #3485 2021-04-15 08:57:47 +05:30
Kovid Goyal
db719eafac
Remove num/caps locks from modifier processing in mouse events 2021-04-14 10:08:33 +05:30
Kovid Goyal
111c123435
X11: Fix resize_in_steps being applied even when window is maximized
Fixes #3473
2021-04-13 12:48:23 +05:30
Kovid Goyal
ea2db51bbb
Output all modifier indices in debug 2021-04-13 10:21:26 +05:30
Kovid Goyal
cdcf8ed3bd
Add some colors to keyboad debug output 2021-04-13 07:41:47 +05:30
Kovid Goyal
572466eed1
XKB: Honor numlock state when reporting keypad keys 2021-04-13 07:35:13 +05:30
Kovid Goyal
4c644b8556
Add NumLock and CapsLock reporting to the keyboard protocol 2021-04-13 07:10:00 +05:30
Kovid Goyal
c989a7198b
Add support for the keypad Begin key
Fixes #3468
2021-04-11 07:58:27 +05:30
Georgi Yonchev
98519bf326 [macos] - Add "Secure Keyboard Entry" menu item 2021-04-09 16:39:51 +03:00
Ravi R Kiran
b5555b9a8d Handle multiple real modifiers mapping to the same virtual modifier 2021-04-07 21:36:11 -05:00
Kovid Goyal
253de1eeca
Move the CSD metrics initialization into the CSD module 2021-04-07 22:28:04 +05:30
Kovid Goyal
4e6d5d3f1e
Fix GNOME breaking when setting window geometry
The current version of GNOME has a regression that causes the compositor
to send incorrect geometry with the next configure event if the CSD
buffers are created after a call to set_window_geometry.

So call set_window_geometry last. And shake head sadly.
2021-04-07 22:14:09 +05:30
Kovid Goyal
82a5733ec5
_glfwPLatformSetWindowSize() should not be called when handling configure events as it does a bunch of work already done before 2021-04-07 19:55:15 +05:30
Kovid Goyal
4822fa989e
Wayland: wire up live resize notification 2021-04-07 18:29:28 +05:30
Kovid Goyal
fe0e1adb2a
DRYer 2021-04-07 15:26:30 +05:30
Kovid Goyal
850a8218db
Allow toggling xdg configure debug output at runtime 2021-04-07 15:24:58 +05:30
Kovid Goyal
bf3fc5fb92
Also implement programmatic window resizing 2021-04-07 15:13:22 +05:30
Kovid Goyal
a19d1fc140
Restore size after all types of docking not just maximize/unmaximize
We make use of the fact that wayland tells us when the window is being
resized to track actual user requested sizes as opposed to compositor
requested ones.
2021-04-07 15:08:44 +05:30
Kovid Goyal
593eb1d952
Focus state needs to be updated always 2021-04-07 14:28:11 +05:30
Kovid Goyal
75ec801941
Get the window geometry with CSD fully correct (I think)
The co-ordinates are in the surface co-ordinate system. When the
compositor specifies sizes it apparently adds one subsurface size
in both x and y directions, not both. Possibly because the origin is
placed after the top and left subsurfaces. So modify it by adding
and extra subsurface size to that.
2021-04-07 14:21:43 +05:30
Kovid Goyal
5a1bd93518
Handle all known xdg top level states 2021-04-07 13:33:06 +05:30
Kovid Goyal
f849f383cb
Use the proper number for wayland CSD vertical shadow geometry
Apparently set_wayland_geometry uses buffer co-ordinates not surface
co-ords so the numbers need to be multiplied by the scale
2021-04-06 22:19:17 +05:30
Kovid Goyal
ac3080f0e2
Fix #3446 (I hope) 2021-04-06 21:51:03 +05:30
Kovid Goyal
0935dd053c
Modifier indices are unsigned 2021-04-06 21:45:02 +05:30
Kovid Goyal
7e78f30739
Wayland: Fix un-maximizing a window not restoring its size to what it was before being maximized 2021-04-05 13:47:50 +05:30
Kovid Goyal
d0f34e99a6
Fix fringing in shadow due to using integer operations 2021-04-05 11:09:34 +05:30
Kovid Goyal
c781825b00
Make setting sigma independent of kernel size 2021-04-05 10:55:30 +05:30
Kovid Goyal
7199c62b76
... 2021-04-05 10:13:33 +05:30
Kovid Goyal
2074a0d958
Forgot that the top margin is scaled 2021-04-05 09:57:44 +05:30
Kovid Goyal
3e2b626107
Inform compositor of visible window geometry
The numbers dont make logical sense, but they do what is expected on
GNOME and since only GNOME is stupid enough to insist on CSD, that's
all we care about.
2021-04-05 09:10:47 +05:30
Kovid Goyal
07de9c021d
Decrease shadow intensity when un-focused 2021-04-04 23:04:12 +05:30
Kovid Goyal
ff420b6495
Render top CSD shadow 2021-04-04 22:49:07 +05:30
Kovid Goyal
78908e5b93
Finish rendering of side shadows for CSD 2021-04-04 20:16:13 +05:30
Kovid Goyal
bd6643a523
Use a tile to reduce startup CPU cost of shadows 2021-04-04 18:16:33 +05:30
Kovid Goyal
71fddeb1f5
Start work on shadow based CSD 2021-04-04 17:13:50 +05:30
Kovid Goyal
d5448e6902
Add documentation and cleanup previous PR 2021-04-03 06:25:47 +05:30
Kovid Goyal
777b9eb68e
Merge branch 'hyper' of https://github.com/orki/kitty 2021-04-03 06:15:55 +05:30
Kovid Goyal
e209c3329b
Allow specifying a right_margin that is not rendered for the CSD title
Can void double rendering if I ever decide to add button to the titlebar
2021-04-01 22:50:54 +05:30
Kovid Goyal
b7d967b6bc
Dont offset title from left edge 2021-04-01 18:19:59 +05:30
Kovid Goyal
a1669267b3
Fix hiding on window decorations not working with new CSD code 2021-04-01 12:32:48 +05:30
Kovid Goyal
bbb40f2a21
Use a little less contrast for CSD title 2021-04-01 12:20:53 +05:30
Kovid Goyal
b1da76eefa
Set CSD color based on focus state 2021-04-01 10:54:22 +05:30
Kovid Goyal
5d496216e0
Implement rendering of titles in CSD 2021-04-01 10:23:04 +05:30
Kovid Goyal
e92ed67021
Add a callback glfw can use to request text rendering 2021-04-01 08:22:06 +05:30
Ravi R Kiran
b074533b29 Fix regression 2021-03-31 08:54:10 -05:00
Ravi R Kiran
953253de99 Implementation of hyper and meta 2021-03-30 14:23:17 -05:00
Kovid Goyal
53f2df115e
Hook up re-render of title bar when title changes 2021-03-29 12:15:47 +05:30
Kovid Goyal
0593158a86
Refactor CSD code to avoid un-needed rerenders and use a single shm pool for all CSD buffers 2021-03-29 12:15:47 +05:30
Kovid Goyal
c1f8372efc
Hide edges when not focused 2021-03-29 12:15:47 +05:30
Kovid Goyal
6e3db0be3d
Rename variable 2021-03-29 12:15:47 +05:30
Kovid Goyal
0f084faca5
Forgot to scale the title buffer 2021-03-29 12:15:47 +05:30
Kovid Goyal
c6829766bb
Properly scale the decorations buffers 2021-03-29 12:15:47 +05:30
Kovid Goyal
e7931b0121
Get rid of the no longer needed viewporter protocol 2021-03-29 12:15:47 +05:30
Kovid Goyal
aeb82e7fb0
Refactor the rendering of CSD on Wayland 2021-03-29 12:15:47 +05:30
Kovid Goyal
4edbe0ea4f
Remove unnecessary opacity marking for decoration buffers 2021-03-25 16:28:49 +05:30
Kovid Goyal
0788b98ae4
Fix header comment 2021-03-25 16:05:14 +05:30
Kovid Goyal
8a267894f3
Make createShmBuffer re-useable 2021-03-25 16:04:12 +05:30
Kovid Goyal
0510cd47f4
Rename buffer -> edge_buffer 2021-03-25 15:19:11 +05:30
Kovid Goyal
5dbbed3dcc
Ignore text input done if serial is incorrect 2021-03-25 15:05:48 +05:30
Kovid Goyal
7b130dc220
Double buffer pre-edit and commit events 2021-03-25 14:59:58 +05:30
Kovid Goyal
44df11c443
Move CSD metrics into the window object
Makes them potentially configurable
2021-03-25 12:52:09 +05:30
Kovid Goyal
63a50ec066
Use the correct mouse cursor theme on GNOME
Relies on a working desktop settings portal (xdg-desktop-portal-gtk)
2021-03-25 12:20:13 +05:30
Kovid Goyal
fc8e147e4a
Fix mouse handling when using client side decorations
The mouse co-ordinates used by glfw were all wrong.
2021-03-25 09:27:25 +05:30
Kovid Goyal
317ecbc9fa
Wayland: Add support for the text input protocol
Fixes #3410
2021-03-24 11:24:37 +05:30
Kovid Goyal
67445a22d3
... 2021-03-23 16:33:05 +05:30
Kovid Goyal
62997956a0
Start work on Wayland text input protocol support 2021-03-23 16:33:04 +05:30
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
Kovid Goyal
84dcf8fd27
Use an enum for ime_state 2021-03-23 10:42:07 +05:30
Kovid Goyal
37e3e29c8c
Fix a crash on systems using musl as libc
Fixes #3395
2021-03-17 14:13:50 +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
12d7c7314a
Only warn about Wayland's inadequacy once 2021-02-26 19:21:48 +05:30
Kovid Goyal
78854d4a10
macOS: Disable cocoa tabs
kitty has its own tabs, and macOS inserts confusing menu entries for its
non-functional tabs into the global menu. So disable tabs. Fixes #3325
2021-02-25 11:26:55 +05:30
Kovid Goyal
a920919b13
Workaround for bug in libxkbcommon/Debian/Ubuntu on en_IN locale
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903373
2021-02-19 12:35:59 +05:30
Kovid Goyal
0fc93118f2
Make the error message when failing to get monitor display name more informative 2021-01-29 12:45:22 +05:30
Kovid Goyal
68423b3603
Fix compiler warning on newer Xcode
Fixes #3271
2021-01-29 11:29:29 +05:30
Kovid Goyal
6d18223f17
Use an id for keyboard focus tracking as well 2021-01-29 11:22:39 +05:30
Kovid Goyal
0443e5ad7f
Wayland: Use window ids rather than pointers to track windows for key repeat
Might fix #3266
2021-01-29 08:43:00 +05:30
Kovid Goyal
5a2f2767ad
Fix window icon not working on X11 with 64bits
Apparently on X11 the maximum icon size is 128x128. 256x256 is too
large for the X11 protocol because the X server unserializes the icons
using "unsigned long" which is 64 bits on Linux. So we have to use
64bits per pixel instead of 32, with 32bits padded to 0.

While there I also got rid of the kitty.rgba file replacing it with a
128x128 PNG file.

Fixes #3260
2021-01-25 20:54:19 +05:30
Kovid Goyal
60e589f775
Recognize Hyper key
Also use only one implementation for detecting if a key is a modifier
key
2021-01-21 05:33:14 +05:30
Kovid Goyal
654cd54363
Add the ISO level 3 and 5 shift keys to functional keys 2021-01-19 09:11:44 +05:30
Kovid Goyal
6bbf014152
... 2021-01-17 07:24:12 +05:30
Kovid Goyal
4fea7bd8ef
Fix building on systems with xkbcommon < 1.0 2021-01-17 07:22:21 +05:30