mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-11 00:06:00 +01:00
viewporter stuff
This commit is contained in:
parent
8ea06338f9
commit
fe2fe1f359
1 changed files with 2 additions and 2 deletions
|
@ -54,13 +54,13 @@ CViewportResource::CViewportResource(SP<CWpViewport> resource_, SP<CWLSurfaceRes
|
||||||
});
|
});
|
||||||
|
|
||||||
listeners.surfacePrecommit = surface->events.precommit.registerListener([this](std::any d) {
|
listeners.surfacePrecommit = surface->events.precommit.registerListener([this](std::any d) {
|
||||||
if (!surface)
|
if (!surface || !surface->pending.buffer)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (surface->pending.viewport.hasSource) {
|
if (surface->pending.viewport.hasSource) {
|
||||||
auto& src = surface->pending.viewport.source;
|
auto& src = surface->pending.viewport.source;
|
||||||
|
|
||||||
if (src.w + src.x > surface->pending.size.x || src.h + src.y > surface->pending.size.y) {
|
if (src.w + src.x > surface->pending.buffer->size.x || src.h + src.y > surface->pending.buffer->size.y) {
|
||||||
resource->error(WP_VIEWPORT_ERROR_BAD_VALUE, "Box doesn't fit");
|
resource->error(WP_VIEWPORT_ERROR_BAD_VALUE, "Box doesn't fit");
|
||||||
surface->pending.rejected = true;
|
surface->pending.rejected = true;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue