don't flush display after disconnect

This commit is contained in:
vaxerski 2023-02-03 10:46:18 +00:00
parent fe4535a273
commit 7ae1d1dabd
2 changed files with 9 additions and 6 deletions

View file

@ -1,7 +1,7 @@
#include "LayerSurface.hpp"
#include "../hyprpicker.hpp"
#include "../events/Events.hpp"
#include "../hyprpicker.hpp"
CLayerSurface::CLayerSurface(SMonitor* pMonitor) {
m_pMonitor = pMonitor;
@ -36,5 +36,6 @@ CLayerSurface::~CLayerSurface() {
wl_surface_destroy(pSurface);
zwlr_layer_surface_v1_destroy(pLayerSurface);
wl_display_flush(g_pHyprpicker->m_pWLDisplay);
if (g_pHyprpicker->m_pWLDisplay)
wl_display_flush(g_pHyprpicker->m_pWLDisplay);
}

View file

@ -1,4 +1,5 @@
#include "hyprpicker.hpp"
#include "events/Events.hpp"
void CHyprpicker::init() {
@ -33,6 +34,9 @@ void CHyprpicker::init() {
while (m_bRunning && wl_display_dispatch(m_pWLDisplay) != -1) {
//renderSurface(m_pLastSurface);
}
wl_display_disconnect(m_pWLDisplay);
m_pWLDisplay = nullptr;
}
void CHyprpicker::finish(int code) {
@ -210,12 +214,11 @@ void CHyprpicker::convertBuffer(SPoolBuffer* pBuffer) {
std::swap(px->red, px->blue);
}
}
}
break;
} break;
default: {
Debug::log(CRIT, "Unsupported format %i", pBuffer->format);
}
g_pHyprpicker->finish(1);
g_pHyprpicker->finish(1);
}
}
@ -271,7 +274,6 @@ void CHyprpicker::renderSurface(CLayerSurface* pSurface, bool forceInactive) {
// | --------- |
//
cairo_restore(PCAIRO);
cairo_save(PCAIRO);