Commit Graph

212 Commits

Author SHA1 Message Date
Geoffrey McRae
9780f51558 [client] x11: fix failure to set window position correctly when set 2021-11-30 13:04:39 +11:00
Geoffrey McRae
9c5e34df0f [client] x11: handle EINTR properly in epoll loop 2021-10-20 15:40:50 +11:00
SytheZN
12321a8880 [client] wayland: implement resizing for libdecor 2021-10-14 18:17:00 +11:00
Quantum
12840a8324 [client] x11: load glXSwapIntervalEXT dynamically
The Linux OpenGL ABI does not guarantee that glXSwapIntervalEXT will be
exported statically from any library, and indeed on some systems this
function does not link at load time, e.g. with amdgpu-pro. All other
GLX functions that we use are from GLX 1.0, which is guaranteed to be
exported statically.

This commit solves this issue by using glXGetProcAddressARB to load the
function. Note that only the ARB version of glXGetProcAddress is
guaranteed to exist by the Linux OpenGL ABI, which is why we must use
it.
2021-09-29 17:47:36 +10:00
Quantum
72f3a9f3cf [client] wayland: free presentation objects
Since the display server owns a graph, it was necessary to move the overlay
graphs destruction so that it happens after display server destruction.
2021-09-11 11:52:52 +10:00
Geoffrey McRae
ab3738624f [client] x11: reduce the scope of deltats 2021-09-11 10:11:00 +10:00
Geoffrey McRae
25ed3632f7 [client] x11: remove dead code 2021-09-11 10:06:52 +10:00
Geoffrey McRae
3adb7ca4b2 [client] wayland: fix possible memory leak 2021-09-11 10:03:27 +10:00
Geoffrey McRae
4b3a79c110 [client] x11: remove print from debugging 2021-08-19 21:35:54 +10:00
Geoffrey McRae
2d470b8deb [client] x11: filter out virtual/grabbed XIEnterEvents 2021-08-19 21:29:03 +10:00
Quantum
1021c9ce92 [client] x11: implement keyboard modifiers 2021-08-19 21:28:21 +10:00
Quantum
ce3f11fd40 [client] x11: implement keyboard typing 2021-08-19 21:28:21 +10:00
Quantum
81c38e825c [client] remove all casts around malloc
The cast is unnecessary in C and should be removed to avoid clutter.
2021-08-16 16:26:58 +10:00
Tudor Brindus
14ad83c6b8 [client] use variable-relative sizeof where possible 2021-08-16 16:22:55 +10:00
Quantum
7cd0c55847 [client] wayland: support high DPI cursors when needed 2021-08-15 09:49:38 +10:00
Quantum
2dd1ad53f8 [client] wayland: respect XCURSOR_THEME and XCURSOR_SIZE env variables 2021-08-15 09:46:55 +10:00
Quantum
d35c448058 [client] wayland: set keyboard LED state when changed 2021-08-15 09:46:31 +10:00
Quantum
7045760490 [client] wayland: add keyboard typing handling with xkbcommon 2021-08-14 14:44:26 +10:00
Quantum
579f998519 [client] all: replace assert with DEBUG_ASSERT 2021-08-14 12:19:07 +10:00
Quantum
22bbc2457e [client] wayland: fix deadlock when using wayland:warpSupport=no 2021-08-11 19:01:18 +10:00
Geoffrey McRae
1128eb0e84 [client] x11: don't hang when there are no message pending 2021-08-10 01:47:03 +10:00
Geoffrey McRae
1fd726eed7 [client] x11: be less sensitive to frame skips
External events like launching other applications can cause latency
spikes while X11 initializes the application, we should only start
adjusting our delay if we see excessive skips over a 1s period.
2021-08-09 15:51:01 +10:00
Geoffrey McRae
bc7e59c9d7 [client] x11: prevent present event loop underruns
Queue up and maintain a list of presentation timestamps to avoid spikes
caused by X11 event processing latency.
2021-08-09 15:24:12 +10:00
Geoffrey McRae
179eaef29d [client] x11: switch to epoll for event wait loop 2021-08-09 15:23:44 +10:00
Geoffrey McRae
64da3465b8 [client] x11: invalidate the full window after timeout from expose
Invalidating the entire window on an Expose event causes poor WM
performance when dragging the window around. Instead flag to redraw and
wait for the expose events to stop for 100ms before doing it.
2021-08-08 08:49:46 +10:00
Geoffrey McRae
3e08e7aafa [client] x11: prevent skew from enter/leave/focus and fullscreen events 2021-08-07 03:49:32 +10:00
Geoffrey McRae
ec56b2760a [client] x11: don't allow window manager events to skew cal timing 2021-08-07 03:39:11 +10:00
Geoffrey McRae
ad256e0b00 [client] x11: improve presentation sync calibration 2021-08-07 02:36:11 +10:00
Geoffrey McRae
0603a55492 [client] x11: prevent possible calibration underflow 2021-08-05 07:11:23 +10:00
Geoffrey McRae
0af558345f [client] wayland: fix build with libdecor after invalidateWindow change 2021-08-05 06:58:43 +10:00
Geoffrey McRae
6e7f39edee [client] app: allow selective full invalidation
Overlays only need to trigger a new frame if they have changed and not
full window invalidation, this change allows for this.
2021-08-05 06:47:36 +10:00
Quantum
51b9cd4e5a [all] copyright: use unicode copyright sign ©
This is done for consistency with the license strings in appstrings.c.
2021-08-04 21:16:35 +10:00
Geoffrey McRae
80c9f7223a [client] wayland: fix failure to build 2021-08-04 07:21:57 +10:00
Geoffrey McRae
c15d0dc672 [client] ds: waitFrame now returns a bool to force rendering if needed
X11 needs to calibrate to get the best possible latency, as such it
needs the scene to render so that the render time of the scene can be
accounted for in the delay calculation.
2021-08-04 06:49:35 +10:00
Geoffrey McRae
0f7fa32d12 [client] x11: move sleep and calibration code outside of the event loop
Sleeping in the x11 event loop is not ideal as it will introduce latency
when processing other events, instead do this in the waitFrame handler.
2021-08-04 06:34:27 +10:00
Geoffrey McRae
6933c278ce [client] x11: cosmetics 2021-08-04 06:14:27 +10:00
Geoffrey McRae
7fc717a839 [client] x11: don't setup XPresent if jitRender is not enabled 2021-08-04 06:12:21 +10:00
Quantum
a25c93b28e [client] wayland: document wlroots viewport handling workaround
Add a comment so we don't forget and remove the "useless" code.
2021-08-03 21:12:25 +10:00
Geoffrey McRae
03ed8b7304 [client] x11: added code to calibrate a delay for presentation
XPresent doesn't give us the time before presentation, but the time just
after. This code calculates and calibrates a delay to sleep for before
signaling the wait event for render when using jitRender
2021-08-03 07:51:03 +10:00
Geoffrey McRae
504bf02855 [client] x11: provide an empty rect region to XPresentPixmap
Providing None informs the comppositor that there is full screen damage,
instead we provide an empty rectangle to prevent this behaviour.
2021-08-03 07:49:59 +10:00
Geoffrey McRae
50f9baedba [client] x11: remove junk code from evaluation 2021-08-03 01:11:46 +10:00
Quantum
8d78a5aa95 [commit] wayland: invalidate window on scale changes
This makes it not require new frames for new scale to be properly applied.
2021-08-03 00:57:04 +10:00
Geoffrey McRae
891ee3e789 [client] x11: make use of the x11 present extension for jitRender
This implementation is a bit dodgy and needs some work but is currently
functional. Consider this feature highly experiemental under X11.
2021-08-02 23:59:26 +10:00
Quantum
f08e2ece93 [client] wayland: implement stopWaitFrame 2021-08-01 19:54:28 +10:00
Quantum
2e4614cbc4 [client] wayland: make waitFrame work when not rendering
Implement skipFrame and do various things to wake waitFrame.
2021-08-01 18:54:55 +10:00
Quantum
77b3d45e0e [client] ds: change signalNextFrame to waitFrame 2021-08-01 17:29:15 +10:00
Quantum
96bcfff28b [client] wayland: use zxdg_output_manager_v1 version 3 if possible
Version 3 does not send xdg_output.done events, instead guaranteeing that
all xdg_output.* events are sent before wl_output.done. This saves us from
doing the work twice.
2021-08-01 13:05:41 +10:00
Quantum
0ad469178a [client] wayland: make it possible to disable fractional scaling
The method used is not guaranteed to work on all Wayland compositors,
so offer a way out. We need to support it anyways in case xdg_output
or wp_viewporter protocols are not available.
2021-08-01 13:05:41 +10:00
Quantum
b3ca872cef [client] wayland: improve fractional scale handling
Currently, we scale the desktop up to the next largest integer, and rely on
the wayland compositor to scale it back down to the correct size.
This is obviously undesirable.

In this commit, we attempt to detect the actual fractional scaling by finding
the current active mode in wl_output, and dividing it by the logical screen
size reported by xdg_output, taking into consideration screen rotation.

We then use wp_viewporter to set the exact buffer and viewport sizes if
fractional scaling is needed.
2021-08-01 13:05:41 +10:00
Quantum
a213ee960a [client] wayland: implement signalNextFrame with frame callbacks 2021-07-31 19:05:21 +10:00