Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b4e5962
feat(split-wl): move tags
fnr1r Mar 23, 2026
7038c48
feat(split-wl): move callback macro
fnr1r Mar 23, 2026
a53f344
feat(split-wl): move libdecor utils
fnr1r Mar 23, 2026
e4b5f2e
feat(split-wl): move out CreateShmBuffer
fnr1r Mar 23, 2026
1350be5
feat(split-wl): move out ID helpers
fnr1r Mar 23, 2026
d370897
feat(split-wl): move out scaling helpers
fnr1r Mar 23, 2026
99bc22c
feat(split-wl): move out externs
fnr1r Mar 23, 2026
3db43ab
feat(split-wl): move out xdg_log
fnr1r Mar 25, 2026
d989730
feat(split-wl): move out WaylandPlane defs
fnr1r Mar 23, 2026
aac38a5
feat(split-wl): move out WaylandConnector def
fnr1r Mar 25, 2026
46be71c
feat(split-wl): move out WaylandFb def
fnr1r Mar 25, 2026
36a1825
feat(split-wl): move out WaylandInputThread defs
fnr1r Mar 25, 2026
97e4023
feat(split-wl): move out WaylandBackend defs
fnr1r Mar 25, 2026
3848242
feat(split-wl): move out WaylandPlane listeners
fnr1r Mar 25, 2026
a19defa
feat(split-wl): move out WaylandFb listeners
fnr1r Mar 25, 2026
fd1a591
feat(split-wl): move out WaylandInputThread listeners
fnr1r Mar 25, 2026
9fcb94a
feat(split-wl): move out WaylandBackend listeners
fnr1r Mar 25, 2026
7c1cf75
feat(split-wl): move out WaylandFb impl
fnr1r Mar 25, 2026
55fab29
feat(split-wl): move out WaylandConnector impl
fnr1r Mar 25, 2026
c0fdefc
feat(split-wl): move out WaylandPlane impl
fnr1r Mar 25, 2026
eb74b0a
feat(split-wl): move out WaylandInputThread impl
fnr1r Mar 25, 2026
005d028
feat(split-wl): move out WaylandBackend impl
fnr1r Mar 25, 2026
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
3,268 changes: 0 additions & 3,268 deletions src/Backends/WaylandBackend.cpp

This file was deleted.

36 changes: 36 additions & 0 deletions src/Backends/wayland/CreateShmBuffer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#include "Utils/Defer.h"
#include "Utils/TempFiles.h"

#include <cstdint>
#include <cstring>
#include <sys/mman.h>
#include <unistd.h>

namespace gamescope {

int CreateShmBuffer(uint32_t uSize, void* pData) {
char szShmBufferPath[PATH_MAX];
int nFd = MakeTempFile(szShmBufferPath, k_szGamescopeTempShmTemplate);
if (nFd < 0)
return -1;

if (ftruncate(nFd, uSize) < 0) {
close(nFd);
return -1;
}

if (pData) {
void* pMappedData = mmap(nullptr, uSize, PROT_READ | PROT_WRITE, MAP_SHARED, nFd, 0);
if (pMappedData == MAP_FAILED) {
close(nFd);
return -1;
}
defer(munmap(pMappedData, uSize));

memcpy(pMappedData, pData, uSize);
}

return nFd;
}

} // namespace gamescope
9 changes: 9 additions & 0 deletions src/Backends/wayland/CreateShmBuffer.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

#include <cstdint>

namespace gamescope {

int CreateShmBuffer(uint32_t uSize, void* pData);

}
Loading