mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-12-20 00:10:02 +01:00
layerSurface: fix circle not following cursor movement (#113)
* layerSurface: fix circle not following cursor movement * misc: format code
This commit is contained in:
parent
b85b06577d
commit
e990630562
1 changed files with 9 additions and 3 deletions
|
|
@ -71,11 +71,12 @@ static void onCallbackDone(CLayerSurface* surf, uint32_t when) {
|
|||
}
|
||||
|
||||
void CLayerSurface::sendFrame() {
|
||||
lastBuffer = lastBuffer == 0 ? 1 : 0;
|
||||
const auto& PBUFFER = buffers[lastBuffer];
|
||||
|
||||
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
|
||||
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) { onCallbackDone(this, when); });
|
||||
|
||||
const auto& PBUFFER = lastBuffer == 0 ? buffers[0] : buffers[1];
|
||||
|
||||
pSurface->sendAttach(PBUFFER->buffer.get(), 0, 0);
|
||||
if (!g_pHyprpicker->m_bNoFractional) {
|
||||
pSurface->sendSetBufferScale(1);
|
||||
|
|
@ -83,7 +84,6 @@ void CLayerSurface::sendFrame() {
|
|||
} else
|
||||
pSurface->sendSetBufferScale(m_pMonitor->scale);
|
||||
|
||||
pSurface->sendDamageBuffer(0, 0, 0xFFFF, 0xFFFF);
|
||||
pSurface->sendCommit();
|
||||
|
||||
dirty = false;
|
||||
|
|
@ -92,6 +92,12 @@ void CLayerSurface::sendFrame() {
|
|||
void CLayerSurface::markDirty() {
|
||||
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
|
||||
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) { onCallbackDone(this, when); });
|
||||
|
||||
pSurface->sendDamageBuffer(0, 0, 0xFFFF, 0xFFFF);
|
||||
|
||||
if (buffers[lastBuffer])
|
||||
pSurface->sendAttach(buffers[lastBuffer]->buffer.get(), 0, 0);
|
||||
|
||||
pSurface->sendCommit();
|
||||
|
||||
dirty = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue