Skip to content

Commit

Permalink
no no null confures
Browse files Browse the repository at this point in the history
  • Loading branch information
vaxerski committed Feb 21, 2024
1 parent 0127370 commit 0bd6203
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
16 changes: 5 additions & 11 deletions src/core/LockSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,19 @@ CSessionLockSurface::CSessionLockSurface(COutput* output) : output(output) {
exit(1);
}

configure(output->size, {});

ext_session_lock_surface_v1_add_listener(lockSurface, &lockListener, this);
}

void CSessionLockSurface::configure(const Vector2D& size_, std::optional<uint32_t> serial_) {
Debug::log(LOG, "configure with serial {}", serial_.value_or(0));
void CSessionLockSurface::configure(const Vector2D& size_, uint32_t serial_) {
Debug::log(LOG, "configure with serial {}", serial_);

serial = serial_.value_or(0);
serial = serial_;
size = (size_ * fractionalScale).floor();
logicalSize = size_;

Debug::log(LOG, "Configuring surface for logical {} and pixel {}", logicalSize, size);

if (serial_.has_value())
ext_session_lock_surface_v1_ack_configure(lockSurface, serial);
ext_session_lock_surface_v1_ack_configure(lockSurface, serial);

if (fractional)
wp_viewport_set_destination(viewport, logicalSize.x, logicalSize.y);
Expand Down Expand Up @@ -101,10 +98,7 @@ void CSessionLockSurface::configure(const Vector2D& size_, std::optional<uint32_

readyForFrame = true;

if (serial_.has_value())
render();
else
eglSwapBuffers(g_pEGL->eglDisplay, eglSurface);
render();
}

static void handleDone(void* data, wl_callback* wl_callback, uint32_t callback_data) {
Expand Down
3 changes: 1 addition & 2 deletions src/core/LockSurface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <wayland-egl.h>
#include "../helpers/Vector2D.hpp"
#include <EGL/egl.h>
#include <optional>

class COutput;
class CRenderer;
Expand All @@ -17,7 +16,7 @@ class CSessionLockSurface {
CSessionLockSurface(COutput* output);
~CSessionLockSurface();

void configure(const Vector2D& size, std::optional<uint32_t> serial);
void configure(const Vector2D& size, uint32_t serial);

bool readyForFrame = false;

Expand Down

0 comments on commit 0bd6203

Please sign in to comment.