286 Commits

Author SHA1 Message Date
Kovid Goyal
408cd9cf9b
Wayland: Only print out window attention error once 2019-04-27 14:53:31 +05:30
Kovid Goyal
8b47e63136
Wayland backend: Dont roundtrip to the server just to wakeup the main loop 2019-04-27 14:52:15 +05:30
Kovid Goyal
379ec88776
Only use the tick callback mechanism on macOS
On Linux, just call the tick callback on every loop tick. This is much
simpler, and should fix the issue with screen updates sometimes getting
stuck waiting for an X11 event.

Note that this was what used to happen (global state being checked on
every loop tick) before the refactoring to use a GLFW event loop,
therefore there should be no performance regressions, though we
of course end up checking global state on every group of events on
Linux, instead of only when something of interest happens. I suspect, to
achieve the latter is going to require implementing a mutex/lock in the
main loop to avoid races, which doesn't seem worth it.
2019-04-27 14:40:09 +05:30
Kovid Goyal
a320e8bc25
When debuggin event loop display number of dispatched X11 events 2019-04-27 13:52:44 +05:30
Kovid Goyal
0987a536b1
Add extra logging to debug the event loop
This should make tracking down the root cause of the
event loop pauses on X11 easier. And the infrastructure
should come in handy in the future as well.
2019-04-24 16:16:40 +05:30
Kovid Goyal
b6267d4a8c
X11 backend: Get rid of server roundtrip just to wake up the event loop 2019-04-24 13:42:26 +05:30
Kovid Goyal
2df97e309b
X11 backend: Dispatch X11 events after XFlush 2019-04-24 06:25:00 +05:30
Kovid Goyal
ef86f8a20c
NSGL: Disable swap interval
Swap interval now uses CVDisplayLink.
From upstream: 28f118f4de
2019-04-18 10:14:29 +05:30
Kovid Goyal
b3f1acd400
Cocoa: Fix coordinate transformations
From upstream: 3c3981a4f0
2019-04-18 10:12:41 +05:30
Kovid Goyal
5c4462281e
Cocoa: Upstream fix for mouse hover detection
0e74265426
2019-04-18 09:58:09 +05:30
Kovid Goyal
8969206450
macOS: Fix cocoa mouse y-coord off by one
See https://github.com/glfw/glfw/issues/1461
2019-04-09 22:02:36 +05:30
Kovid Goyal
41318d763b
Fix missing context APIs in version strings 2019-04-09 10:06:10 +05:30
Kovid Goyal
8251b906b6
Add a listener for GPU changed events on macOS
Currently does nothing, but could potentially be used to fix:
https://github.com/kovidgoyal/kitty/issues/794

Will need someone with the hardware though to test
exactly what needs to be done to restore the custom cursor image.
2019-04-06 10:05:21 +05:30
Kovid Goyal
b10312e249
Upstream fixes for vulkan surface creation and the retina hint
e108c0de0d
980fc9b52f
2019-03-28 13:09:22 +05:30
Kovid Goyal
6f3a9d6d29
macOS: Remove check for pre-10.8 SDK 2019-03-28 12:42:14 +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
ecf2c86787
Wayland: Abort on fatal display errors instead of looping forever 2019-03-22 08:53:10 +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
48303bac75
Use "arrow" as the arrow cursor on Linux
Different themes preferentiallyuse left_prt or right_ptr, so use arrow
instead
2019-03-21 13:22:13 +05:30
Kovid Goyal
5ab8a665be
GLFW: Add more standard cursor shapes
Also use an enum for the cursor shapes
2019-03-21 13:06:13 +05:30
Kovid Goyal
733158a2de
Better error reporting when failing to load cursor 2019-03-21 10:38:26 +05:30
Kovid Goyal
a2e47d2d0e
EGL: Warn if non-blocking swap buffers is not available 2019-03-21 09:46:46 +05:30
Kovid Goyal
bfb97a6e6f
Wayland: use correct name for hand cursor 2019-03-21 09:24:51 +05:30
Kovid Goyal
106dc2b03b
Wayland: Load cursor theme at init even if no mouse pointer is currently present 2019-03-20 15:56:34 +05:30
Kovid Goyal
7d9d096fbf
Rationalize change reporting after configure event on Wayland
Fixes #1482 (I hope)
2019-03-19 15:02:11 +05:30
Kovid Goyal
c129dd9331
Wayland: Ignore invalid scale values from compositor 2019-03-19 14:30:43 +05:30
Kovid Goyal
5c75ac0a96
GLFW Wayland backend: Dont fire resize events for Wayland configure events that dont change the window size. Fixes #1473 2019-03-17 15:07:32 +05:30
Kovid Goyal
e9e4ac13ee
Fix #1472 2019-03-16 07:37:36 +05:30
Kovid Goyal
d3cee832ce
Wayland: Dont try to focus window on create/show since it is not allowed anyway 2019-03-07 18:14:12 +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
a1c49a0f7f
Cocoa: Disable shadow for transparent framebuffer
From upstream: 9883cb64f0
2019-03-06 09:12:16 +05:30
Kovid Goyal
4c4c6ab0e6
Various fixes for monitor work area retrieval from upstream 2019-03-06 09:08:08 +05:30
Kovid Goyal
2e0d39b512
Remove windows glfw backend as it is unused 2019-03-06 08:47:45 +05:30
Kovid Goyal
0899019518
Add glfwGetMonitorWorkarea
From upstream: be295ccbea
2019-03-06 08:47:01 +05:30
Kovid Goyal
db16996181
Fix Coverity Scan false positive
From upstream: c20754c4a6
2019-03-06 08:40:02 +05:30
Kovid Goyal
aa2b21456f
Round refresh rate instead of truncating
From upstream: 621ece63c8
2019-03-06 08:36:59 +05:30
Kovid Goyal
3bd1ca0ac3
Avoid using timing related hacks to detect the end of a live resize on macOS
Since cocoa provides start/end notifications for live resizing, rely on
those instead.
2019-03-04 19:52:46 +05:30
Kovid Goyal
f0a2c34eca
Port cocoa backed to use glfw mainloop 2019-03-04 19:52:46 +05:30
Kovid Goyal
9f35b9281b
Avoid needing to continuously add/remove timers 2019-03-04 19:52:46 +05:30
Kovid Goyal
7624578c21
Fix X11/Wayland addTimer returning incorrect timer ids 2019-03-04 19:52:45 +05:30
Kovid Goyal
d4b477ad78
Share main loop implementation between wayland and X11 2019-03-04 19:52:45 +05:30
Kovid Goyal
bef9490fa8
Switch to using the GLFW main loop 2019-03-04 19:52:45 +05:30
Kovid Goyal
d593ccba2f
Add a loop tick callback 2019-03-04 19:52:45 +05:30
Kovid Goyal
1902d8bb19
Explicitly handle the empty events on X11 2019-03-04 19:52:45 +05:30
Kovid Goyal
da507dfd19
Infrastructure for moving the run loop into GLFW
This is needed on Cocoa, where Apple expects to be in control of the run
loop.
2019-03-04 19:52:44 +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
Luflosi
f38b27e923
Add check for NULL after malloc() 2019-02-24 14:48:54 +01:00
Kovid Goyal
cb8116e2af
Fix leak of a few bytes of memory after every update notification
Fixes #1411
2019-02-24 10:19:19 +05:30
Luflosi
a653c17e8a
Fix function returning the wrong type 2019-02-22 15:13:13 +01:00