Commit Graph

1366 Commits

Author SHA1 Message Date
Kovid Goyal
e1199bcee2 Initial implementation of momentum for finger based scrolling on Wayland
Needs configuration and possibly the parameter adjustment once pixel
scrolling is merged.
2026-01-05 19:52:44 +05:30
Kovid Goyal
ba389d68b9 macOS: Fix changes to macos_titlebar_color while in full screen not being applied after exiting fullscreen
Fixes #9350
2026-01-03 00:19:03 +05:30
Kovid Goyal
0f1362524b Store more information about axis events from Wayland 2026-01-01 13:25:30 +05:30
Kovid Goyal
ba3af8f2c3 Refactor GLFW scroll event callback to use a proper event struct 2025-12-31 23:40:34 +05:30
Kovid Goyal
06e7f5ec37 Fix #9306 2025-12-20 08:54:22 +05:30
Kovid Goyal
4f73374a12 YATB: Yet Another Tahoe Bug from the company that should stick to selling fruit
Fixes #9299
2025-12-18 11:13:38 +05:30
Kovid Goyal
99b1eca3c8 Disable NSAutoFillHeuristicController on spec 2025-12-18 10:16:59 +05:30
Kovid Goyal
71a7dda522 ... 2025-12-05 07:51:04 +05:30
Kovid Goyal
3b78fd646e ... 2025-12-03 22:57:14 +05:30
Kovid Goyal
16008b950a Wayland: Fix spurious key repeat events when some user defined callback takes a long time to execute
On compositors that support compositor key repeat events, use those, for
complete robustness. Sadly no actual compositor implements these yet.

Otherwise use a timer fd/pipe to queue the repeat events and only
dispatch them after events from the compositor are handled. This means
release events from the compositor will prevent spurious repeat events.
One can, in the worst case lose some repeat events if there is a very
large interval between the start of the timer and the next poll, but
that is unavoidable and is why repeat events should come from the compositor
in the first place.

Fixes #9224
2025-12-03 22:26:09 +05:30
Kovid Goyal
ca945563bb Wayland: add support for compositor provided key repeat events
Far more robust. Sadly no actual compositors yet support this. Fifteen
years it takes Wayland developers to correct their most basic mistakes.

See #9224
2025-12-03 20:02:46 +05:30
Kovid Goyal
76f9cdc426 ... 2025-11-22 20:03:01 +05:30
Kovid Goyal
35d95d7a43 Also remove shadow from zero sized window
Hopefully that means no clickable region at all?
2025-11-12 14:01:37 +05:30
Kovid Goyal
98e13787a9 ... 2025-11-12 12:23:24 +05:30
Kovid Goyal
81f429d52b Move the code to cycle through OS Windows into glfw 2025-11-12 12:02:38 +05:30
Kovid Goyal
a4a7f77ef1 Use __block rather than __weak since we are in manual ref counting regime 2025-11-12 09:31:31 +05:30
Kovid Goyal
33b9d858ad Nano-optimisation: Avoid using a block with GCD 2025-10-22 13:40:42 +05:30
Kovid Goyal
6a6b0b47a3 Micro-optimize display link callback
Use a GCD block rather than a runtime selector with a boxed number
2025-10-22 13:35:02 +05:30
Kovid Goyal
878b502fc1 Cleanup previous PR
The locks were not being initialized, and since I was there did some
general cleanup as well, moved the locks array into displayLinks rather
than having another global namespaced variable.
2025-10-22 09:54:21 +05:30
Scott Lee
fc8f3ca6e2 Improve macOS idle wakeups handling 2025-10-22 07:38:10 +09:00
Kovid Goyal
94f3da53aa Cleanup previous PR 2025-10-21 09:44:41 +05:30
Evan Goode
80a9bdb999 Smoothly handle VALUE120 scroll events 2025-10-20 09:32:59 -04:00
alex-huff
10e0d11093 panel: use an anchor of 0 for --edge=center-sized
Fixes #9116
2025-10-16 10:04:55 -05:00
Kovid Goyal
3ba6c3f4b9 macOS: Handle dropping of file promises into kitty in addition to file paths
Fixes #9084
2025-10-11 11:02:51 +05:30
alex-huff
1967fd9dd5 panel: implemented --edge=none on X11 2025-10-09 17:18:40 -05:00
Kovid Goyal
2babfa7ebf macOS: Further restrict the live resize callback to only be used when live resize is actually in progress 2025-10-07 18:23:08 +05:30
Kovid Goyal
d3c5cb12c4 macOS: Dont do live resizing when window is fullscreen
The live resize causes crashes on some Tahoe machines due to macOS bugs.
It is not needed anyway when the window is fullscreen, so ignore it.
2025-10-07 08:57:57 +05:30
Kovid Goyal
a0699f5c9e Remove the dropping of the first resize event since it did not fix the issue
Add a check to only callback if the thread is the main thread
2025-10-06 18:39:53 +05:30
Kovid Goyal
270c598f2c macOS: Only live resize for resize events that occur in quick succession
Apparently on some systems Tahoe sends a resize event on wake from
sleep/lid open for obscure reasons and then proceeds to crash if one
redraws during that event. Sigh.
2025-10-02 19:39:13 +05:30
Kovid Goyal
a8e930c167 Fix titlebar color not working for opaque windows
As long as titlebar_color is not nil, we need a background view
2025-09-29 22:36:27 +05:30
Kovid Goyal
75ec41e08b Make titlebar background view a child of the titlebar view itself 2025-09-29 22:02:38 +05:30
Kovid Goyal
13bbaee112 Only insert titlebar background view if the titlebar is transparent 2025-09-29 21:47:40 +05:30
Kovid Goyal
14f75c9a9b DRYer 2025-09-29 17:44:24 +05:30
Kovid Goyal
d2cc22e7c6 macOS: React to changes in effective appearance of the NSApplication not the content view for each window
This is nicer now every OS Windows doesnt cause a notification. Also
fixes #9034 which was caused by us setting an explicit appearance on the
window when the titlebar is set to a specific color thereby preventing
the views in the window from getting appearance change notifications.
2025-09-29 17:17:46 +05:30
Kovid Goyal
f4867928b4 DRYer 2025-09-29 17:00:18 +05:30
Kovid Goyal
1252098016 DRYer 2025-09-29 09:09:49 +05:30
Kovid Goyal
fb4a3d7f17 Revert reversion of Tahoe fix in 7589bf4b11
It is still needed. Instead change the frame to havezero size and leaves
its origin unchanged.
2025-09-29 08:58:41 +05:30
Kovid Goyal
bdae74d7ed Wayland: Ensure color manager get_surface is called just once
This should not be needed since create_surface is called just once, but
good to be safe.
2025-09-29 08:36:51 +05:30
Kovid Goyal
e542cd8378 macOS: Fix a big where the color of a transparent titlebar was off when running in the release build versus the build from source. Also fix using a transparent titlebar causing the background opacity to be darkened.
There were two issues.

1) Setting window background color to a non-zero opacity causes
   darkening (essentially there were two layers of blending)

2) The titlebar background view could end up in the wrong position
   because it was a child of the content view rather than its super view

Fix both issues setting the window background to clear color and
moving the background view into the super view while making sure it is
positioned correctly using explicit constraints. Phew.
2025-09-28 21:24:00 +05:30
Kovid Goyal
e024226b0c Dont need to set origin since we are setting anchors 2025-09-28 20:22:40 +05:30
Kovid Goyal
8bef718c9a Tighten the scope searched for sub views 2025-09-28 19:46:11 +05:30
Kovid Goyal
b6f9080486 Use explicit constraints for the titlebar bg view
Easier to reason about
2025-09-28 17:20:37 +05:30
Kovid Goyal
791902caad ... 2025-09-28 17:03:33 +05:30
Kovid Goyal
09133a7039 Use only one subview for translucent titlebar 2025-09-28 17:01:10 +05:30
Kovid Goyal
57345af8e9 Move titlebar background setting to after window stylemask is set
The titlebar height calculation depends on the stylemask
2025-09-28 16:20:52 +05:30
Ethan Wu
7589bf4b11 Revert "Workaround for latest Apple regression in Tahoe"
This reverts commit d837a64e36.

Commit 24b31d96e9 fixes the original
problem of "ghost windows" that d837a64 was trying to solve. (I have no
idea how or why it does.)

One side-effect of the workaround from d837a64 is that it causes closed
windows to be moved to the (0,0) before being destroyed. This means that
when creating new windows, they are placed on the left-most display,
instead of the display in which the previously closed window was on as
you would expect. Reverting this kludge fixes this bug.
2025-09-22 16:50:31 -07:00
Kovid Goyal
982b5156e1 macOS: When toggling in the quick access terminal move it to the currently active screen
Fixes #9003
2025-09-22 20:04:42 +05:30
Kovid Goyal
7af7aa95c6 Another workaround for another macOS Tahoe bug
Dont redraw an OSWindow during a resize event if the resize event is
accompanied by a screen change as it causes a crash in macOS OpenGL
driver. Fixes #8983
2025-09-19 12:05:34 +05:30
Kovid Goyal
24b31d96e9 No need to use a block as Apple docs guarantee that NSApplicationDidChangeScreenParametersNotification is posted on the main thread 2025-09-19 08:52:09 +05:30
Kovid Goyal
177a3f9e51 DRYer 2025-09-16 08:18:42 +05:30