Skip to content

Commit

Permalink
surface: set fully opaque
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Nov 26, 2023
1 parent 38e18b7 commit f3837e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Hyprpaper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,11 +539,19 @@ void CHyprpaper::renderWallpaperForMonitor(SMonitor* pMonitor) {
wl_surface_attach(pMonitor->pCurrentLayerSurface->pSurface, PBUFFER->buffer, 0, 0);
wl_surface_set_buffer_scale(pMonitor->pCurrentLayerSurface->pSurface, pMonitor->pCurrentLayerSurface->pFractionalScaleInfo ? 1 : pMonitor->scale);
wl_surface_damage_buffer(pMonitor->pCurrentLayerSurface->pSurface, 0, 0, 0xFFFF, 0xFFFF);

// our wps are always opaque
auto opaqueRegion = wl_compositor_create_region(g_pHyprpaper->m_sCompositor);
wl_region_add(opaqueRegion, 0, 0, PBUFFER->pixelSize.x, PBUFFER->pixelSize.y);
wl_surface_set_opaque_region(pMonitor->pCurrentLayerSurface->pSurface, opaqueRegion);

if (pMonitor->pCurrentLayerSurface->pFractionalScaleInfo) {
Debug::log(LOG, "Submitting viewport dest size %ix%i for %x", static_cast<int>(std::round(pMonitor->size.x)), static_cast<int>(std::round(pMonitor->size.y)), pMonitor->pCurrentLayerSurface);
wp_viewport_set_destination(pMonitor->pCurrentLayerSurface->pViewport, static_cast<int>(std::round(pMonitor->size.x)), static_cast<int>(std::round(pMonitor->size.y)));
}
wl_surface_commit(pMonitor->pCurrentLayerSurface->pSurface);

wl_region_destroy(opaqueRegion);
}

// check if we dont need to remove a wallpaper
Expand Down

0 comments on commit f3837e9

Please sign in to comment.