mirror of
https://github.com/hyprwm/hyprpicker.git
synced 2025-05-12 21:30:43 +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: '*'
|
||||
HeaderFilterRegex: '.*\.hpp'
|
||||
FormatStyle: file
|
||||
FormatStyle: 'file'
|
||||
Checks: >
|
||||
-*,
|
||||
bugprone-*,
|
||||
-bugprone-easily-swappable-parameters,
|
||||
-bugprone-forward-declararion-namespace,
|
||||
-bugprone-forward-declararion-namespace,
|
||||
-bugprone-forward-declaration-namespace,
|
||||
-bugprone-forward-declaration-namespace,
|
||||
-bugprone-macro-parentheses,
|
||||
-bugprone-narrowing-conversions,
|
||||
-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) {
|
||||
surf->frameCallback.reset();
|
||||
|
||||
if (surf->dirty || !surf->rendered)
|
||||
g_pHyprpicker->renderSurface(g_pHyprpicker->m_pLastSurface);
|
||||
g_pHyprpicker->renderSurface(surf);
|
||||
}
|
||||
|
||||
void CLayerSurface::sendFrame() {
|
||||
|
@ -77,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);
|
||||
|
@ -85,20 +86,11 @@ void CLayerSurface::sendFrame() {
|
|||
pSurface->sendSetBufferScale(m_pMonitor->scale);
|
||||
|
||||
pSurface->sendCommit();
|
||||
|
||||
dirty = false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -341,7 +341,7 @@ void CHyprpicker::renderSurface(CLayerSurface* pSurface, bool forceInactive) {
|
|||
const auto PBUFFER = getBufferForLS(pSurface);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -583,8 +583,6 @@ void CHyprpicker::initMouse() {
|
|||
|
||||
m_vLastCoords = {x, y};
|
||||
|
||||
markDirty();
|
||||
|
||||
for (auto& ls : m_vLayerSurfaces) {
|
||||
if (ls->pSurface->resource() == surface) {
|
||||
m_pLastSurface = ls.get();
|
||||
|
@ -593,13 +591,19 @@ void CHyprpicker::initMouse() {
|
|||
}
|
||||
|
||||
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) {
|
||||
if (ls->pSurface->resource() == surf) {
|
||||
renderSurface(ls.get(), true);
|
||||
if (ls->pSurface->resource() == surface) {
|
||||
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) {
|
||||
auto x = wl_fixed_to_double(surface_x);
|
||||
|
|
Loading…
Reference in a new issue