mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-05-12 13:20:43 +01:00
LayerSurface: always render in callback (#117)
* LayerSurface: always render in callback
This commit is contained in:
parent
fd77aea026
commit
5bbeaeebd3
3 changed files with 4 additions and 11 deletions
|
@ -66,10 +66,7 @@ CLayerSurface::~CLayerSurface() {
|
|||
static void onCallbackDone(CLayerSurface* surf, uint32_t when) {
|
||||
surf->frameCallback.reset();
|
||||
|
||||
if (surf->dirty || !surf->rendered || surf->forceRerender)
|
||||
g_pHyprpicker->renderSurface(surf);
|
||||
|
||||
surf->forceRerender = false;
|
||||
}
|
||||
|
||||
void CLayerSurface::sendFrame() {
|
||||
|
@ -79,6 +76,8 @@ void CLayerSurface::sendFrame() {
|
|||
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
|
||||
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) { onCallbackDone(this, when); });
|
||||
|
||||
pSurface->sendDamageBuffer(0, 0, 0xFFFF, 0xFFFF);
|
||||
|
||||
pSurface->sendAttach(PBUFFER->buffer.get(), 0, 0);
|
||||
if (!g_pHyprpicker->m_bNoFractional) {
|
||||
pSurface->sendSetBufferScale(1);
|
||||
|
@ -86,10 +85,7 @@ void CLayerSurface::sendFrame() {
|
|||
} else
|
||||
pSurface->sendSetBufferScale(m_pMonitor->scale);
|
||||
|
||||
pSurface->sendDamageBuffer(0, 0, 0xFFFF, 0xFFFF);
|
||||
pSurface->sendCommit();
|
||||
|
||||
dirty = false;
|
||||
}
|
||||
|
||||
void CLayerSurface::markDirty() {
|
||||
|
|
|
@ -38,5 +38,4 @@ class CLayerSurface {
|
|||
bool rendered = false;
|
||||
|
||||
SP<CCWlCallback> frameCallback = nullptr;
|
||||
bool forceRerender = false;
|
||||
};
|
|
@ -169,10 +169,8 @@ void CHyprpicker::recheckACK() {
|
|||
|
||||
void CHyprpicker::markDirty() {
|
||||
for (auto& ls : m_vLayerSurfaces) {
|
||||
if (ls->frameCallback) {
|
||||
ls->forceRerender = true;
|
||||
if (ls->frameCallback)
|
||||
continue;
|
||||
}
|
||||
|
||||
ls->markDirty();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue