mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-05-13 05:40:40 +01:00
Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
980ebd486b | ||
![]() |
5dcb341c13 | ||
![]() |
5bbeaeebd3 | ||
![]() |
fd77aea026 | ||
![]() |
23664963a1 | ||
![]() |
6692091d56 |
4 changed files with 17 additions and 21 deletions
|
@ -1,12 +1,12 @@
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
HeaderFilterRegex: '.*\.hpp'
|
HeaderFilterRegex: '.*\.hpp'
|
||||||
FormatStyle: file
|
FormatStyle: 'file'
|
||||||
Checks: >
|
Checks: >
|
||||||
-*,
|
-*,
|
||||||
bugprone-*,
|
bugprone-*,
|
||||||
-bugprone-easily-swappable-parameters,
|
-bugprone-easily-swappable-parameters,
|
||||||
-bugprone-forward-declararion-namespace,
|
-bugprone-forward-declaration-namespace,
|
||||||
-bugprone-forward-declararion-namespace,
|
-bugprone-forward-declaration-namespace,
|
||||||
-bugprone-macro-parentheses,
|
-bugprone-macro-parentheses,
|
||||||
-bugprone-narrowing-conversions,
|
-bugprone-narrowing-conversions,
|
||||||
-bugprone-branch-clone,
|
-bugprone-branch-clone,
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
0.4.3
|
0.4.5
|
||||||
|
|
|
@ -66,8 +66,7 @@ CLayerSurface::~CLayerSurface() {
|
||||||
static void onCallbackDone(CLayerSurface* surf, uint32_t when) {
|
static void onCallbackDone(CLayerSurface* surf, uint32_t when) {
|
||||||
surf->frameCallback.reset();
|
surf->frameCallback.reset();
|
||||||
|
|
||||||
if (surf->dirty || !surf->rendered)
|
g_pHyprpicker->renderSurface(surf);
|
||||||
g_pHyprpicker->renderSurface(g_pHyprpicker->m_pLastSurface);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLayerSurface::sendFrame() {
|
void CLayerSurface::sendFrame() {
|
||||||
|
@ -77,6 +76,8 @@ void CLayerSurface::sendFrame() {
|
||||||
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
|
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
|
||||||
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) { onCallbackDone(this, when); });
|
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) { onCallbackDone(this, when); });
|
||||||
|
|
||||||
|
pSurface->sendDamageBuffer(0, 0, 0xFFFF, 0xFFFF);
|
||||||
|
|
||||||
pSurface->sendAttach(PBUFFER->buffer.get(), 0, 0);
|
pSurface->sendAttach(PBUFFER->buffer.get(), 0, 0);
|
||||||
if (!g_pHyprpicker->m_bNoFractional) {
|
if (!g_pHyprpicker->m_bNoFractional) {
|
||||||
pSurface->sendSetBufferScale(1);
|
pSurface->sendSetBufferScale(1);
|
||||||
|
@ -85,20 +86,11 @@ void CLayerSurface::sendFrame() {
|
||||||
pSurface->sendSetBufferScale(m_pMonitor->scale);
|
pSurface->sendSetBufferScale(m_pMonitor->scale);
|
||||||
|
|
||||||
pSurface->sendCommit();
|
pSurface->sendCommit();
|
||||||
|
|
||||||
dirty = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CLayerSurface::markDirty() {
|
void CLayerSurface::markDirty() {
|
||||||
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
|
frameCallback = makeShared<CCWlCallback>(pSurface->sendFrame());
|
||||||
frameCallback->setDone([this](CCWlCallback* r, uint32_t when) { onCallbackDone(this, when); });
|
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;
|
dirty = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,7 +341,7 @@ void CHyprpicker::renderSurface(CLayerSurface* pSurface, bool forceInactive) {
|
||||||
const auto PBUFFER = getBufferForLS(pSurface);
|
const auto PBUFFER = getBufferForLS(pSurface);
|
||||||
|
|
||||||
if (!PBUFFER || !pSurface->screenBuffer) {
|
if (!PBUFFER || !pSurface->screenBuffer) {
|
||||||
// Debug::log(ERR, PBUFFER ? "renderSurface: pSurface->screenBuffer null" : "renderSurface: PBUFFER null");
|
Debug::log(ERR, PBUFFER ? "renderSurface: pSurface->screenBuffer null" : "renderSurface: PBUFFER null");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,8 +583,6 @@ void CHyprpicker::initMouse() {
|
||||||
|
|
||||||
m_vLastCoords = {x, y};
|
m_vLastCoords = {x, y};
|
||||||
|
|
||||||
markDirty();
|
|
||||||
|
|
||||||
for (auto& ls : m_vLayerSurfaces) {
|
for (auto& ls : m_vLayerSurfaces) {
|
||||||
if (ls->pSurface->resource() == surface) {
|
if (ls->pSurface->resource() == surface) {
|
||||||
m_pLastSurface = ls.get();
|
m_pLastSurface = ls.get();
|
||||||
|
@ -593,13 +591,19 @@ void CHyprpicker::initMouse() {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_pCursorShapeDevice->sendSetShape(serial, WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR);
|
m_pCursorShapeDevice->sendSetShape(serial, WP_CURSOR_SHAPE_DEVICE_V1_SHAPE_CROSSHAIR);
|
||||||
|
|
||||||
|
markDirty();
|
||||||
});
|
});
|
||||||
m_pPointer->setLeave([this](CCWlPointer* r, uint32_t timeMs, wl_proxy* surf) {
|
m_pPointer->setLeave([this](CCWlPointer* r, uint32_t timeMs, wl_proxy* surface) {
|
||||||
for (auto& ls : m_vLayerSurfaces) {
|
for (auto& ls : m_vLayerSurfaces) {
|
||||||
if (ls->pSurface->resource() == surf) {
|
if (ls->pSurface->resource() == surface) {
|
||||||
renderSurface(ls.get(), true);
|
if (m_pLastSurface == ls.get())
|
||||||
|
m_pLastSurface = nullptr;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markDirty();
|
||||||
});
|
});
|
||||||
m_pPointer->setMotion([this](CCWlPointer* r, uint32_t timeMs, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
m_pPointer->setMotion([this](CCWlPointer* r, uint32_t timeMs, wl_fixed_t surface_x, wl_fixed_t surface_y) {
|
||||||
auto x = wl_fixed_to_double(surface_x);
|
auto x = wl_fixed_to_double(surface_x);
|
||||||
|
|
Loading…
Reference in a new issue