Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/util/ipc.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
namespace IPC {

struct Message {
static const size_t size = 32;
static const size_t dataSize = 24;
static constexpr size_t size = 40;
static constexpr size_t dataSize = 32;

uint64_t messageCode { 0 };
uint8_t messageData[dataSize] { 0, };
Expand Down
4 changes: 2 additions & 2 deletions src/wayland-egl/ipc-waylandegl.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace IPC {
namespace WaylandEGL {

struct BufferCommit {
uint8_t padding[24];
uint8_t padding[sizeof(Message::messageData)];

static const uint64_t code = 1;
static void construct(Message& message)
Expand All @@ -52,7 +52,7 @@ struct BufferCommit {
static_assert(sizeof(BufferCommit) == Message::dataSize, "BufferCommit is of correct size");

struct FrameComplete {
int8_t padding[24];
int8_t padding[sizeof(Message::messageData)];

static const uint64_t code = 2;
static void construct(Message& message)
Expand Down
1 change: 1 addition & 0 deletions src/wayland/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,7 @@ void EventDispatcher::sendEvent( wpe_input_axis_event& event )
{
IPC::Message message;
message.messageCode = MsgType::AXIS;
static_assert(sizeof(event) <= sizeof(message.messageData), "Message::messageData is of correct size");
memcpy( message.messageData, &event, sizeof(event) );
m_ipc->sendMessage(IPC::Message::data(message), IPC::Message::size);
}
Expand Down