use auto for nsecdur, assigning system_tp into steady_tp compiles but is
not correct. just change it to auto.
use {} initialization for timespec structs and returning std::pair.
in timediff, fromTimespec and toTimespec the else case was calculating
wrong. we need to correctly handle the borrow when the nanoseconds of
the first time are smaller than the second, by adding TIMESPEC_NSEC_PER_SEC
and decrementing the seconds.
not all clients supports WM_DELETE_WINDOW like glxgears, so get
supported props in constuctor of surface, and if not supported
forcefully kill the client.
EGL_CONTEXT_RELEASE_BEHAVIOR_KHR determines what happends with implicit
flushes when context changes, on multigpu scenario we change context
frequently when blitting content. while we still rely on explicit sync
fences, the flush is destroying driver optimisations.
setting it to EGL_CONTEXT_RELEASE_BEHAVIOR_NONE_KHR essentially mean
just swap context and continue processing on the next context.
Handle XCB_PROPERTY_NEW_VALUE events for incremental selection transfers.
Previously only DELETE was handled, causing INCR transfers to fail after
the first chunk.
Fixes#11411
- Add return 0 after erasing completed non-incremental transfer to stop event source polling
- Add removeTransfer() helper to SXSelection for cleaning transfers by window ID
- Add removeTransfersForWindow() helper to CXWM for cleaning all selections at once
- Clean orphan transfers in handleDestroy before surface removal
- Clean orphan transfers in handlePropertyNotify on missing window or failed reply
- Add m_dndSelection to handleSelectionPropertyNotify cleanup loop
- Initialize SXTransfer members with safe defaults to prevent undefined behavior
- Fix race condition in getTransferData by using window ID lookup instead of index
* eventloopmgr: use unordered_map for readableWaiters
use an unordered_map with the raw ptr as key, avoids any risk of
dangling ptrs.
* eventloopmgr: read the timerfd fd
the manpage for timerfd_create and read states this.
timefd_create creates a new timer object, and returns a file descriptor
that can be used to read the number of expirations that have occurred.
The FD becomes readable when the timer expires.
read removes the “readable” state from the FD.
so most likely it has somewhat worked because of the scheduleRecalc()
function.
* eventloopmgr: avoid unneeded std::function copy
move the idle functions instead of copying.
* eventloopmgr: remove event source before calling fn
if fn causes a dispatch/reentry its gonna cause UB inside libwayland
itself, remove the event source before calling the fn() avoids that
entirerly. even if a new dispatch occurs.
* eventloopmgr: check if timer fd is readable
check if timerfd is readable before calling read on it, so we dont end
up blocking on an accident, log an error if its not readable.
* eventloopmgr: revert unordered_map change
my mistake, the address wasnt changing on reallocations of the heap
object. the only issue i was triggering was the reentry path in fn()
After suspend/wake, the animation tick timer state (m_lastTickValid,
m_tickScheduled) could be stale, causing framerate drops when blur is
enabled. This was introduced in 2b0fd417 which changed the animation
tick timing mechanism.
Reset the tick state when the session becomes active to ensure a clean
state for the animation system.
set the damage to cursor plane size instead of INT16_MAX and remove
onRenderbufferDestroy, renderbuffer already have a listener that
destroys when buffer is destroyed.
* shader: split CM rgba/rgbx into discard ones
make it branchless if we have no discards.
* shader: ensure we dont stall on vbo uv buffer
if we render a new texture before the previous was done gpu wise its
going to stall until done, call glBufferData to orphan the data.
this allows the driver to return a new memory block immediately
if the GPU is still reading from the previous one
* protocols: ensure we reset GL_PACK_ALIGNMENT
reset GL_PACK_ALIGNMENT back to the default initial value of 4
* shader: use unsigned short in VAO
loose a tiny bit of precision but gain massive bandwidth reductions.
use GL_UNSIGNED_SHORT and set it as normalized. clamp and round the UV
for uint16_t in customUv.
* shader: interleave vertex buffers
use std::array for fullverts, use a single interleaved buffer for
position and uv, should in theory improve cache locality. and also remove
the need to have two buffers around.
* shader: revert precision drop
we need the float precision because we might have 1.01 or similiar
floats entering CM shader maths, and rounding/clamping those means the
maths turns out wrong. so revert back to float, sadly higher bandwidth
usage.
* update doColorManagement api
* convert primaries to XYZ on cpu
* remove unused primaries uniform
---------
Co-authored-by: UjinT34 <ujint34@mail.ru>
gl defaults to 4 and not all formats is divisible with 4 meaning its
going to pad out ouf bounds and cause issues. check if the stride is
divisible with 4 otherwise set it to 1, aka disable it.
GL_UNPACK_ALIGNMENT only takes 1,2,4,8 but formats like RGB888 has
bytesPerBlock 3.