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

View file

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