clipboard

This commit is contained in:
Jorijn van der Graaf 2026-05-19 00:45:22 +02:00
commit 850ef7bfb3
4 changed files with 325 additions and 10 deletions

View file

@ -44,6 +44,7 @@ module Crafter.Graphics:Device_impl;
import :Device;
import :Window;
import :Types;
import :Clipboard;
import std;
using namespace Crafter;
@ -418,6 +419,12 @@ void Device::Initialize() {
if (shm == NULL || compositor == NULL || xdgWmBase == NULL) {
throw std::runtime_error("No wl_shm, wl_compositor or xdg_wm_base support");
}
// After the registry roundtrip the data_device (if the compositor
// exposes one) is bound. Clipboard::Initialize attaches the
// selection listener that Clipboard::GetText reads from; doing it
// before the first wl_data_device.selection arrives is what lets
// GetText work the instant a frame is rendered.
Clipboard::Initialize();
#endif
VkApplicationInfo app{VK_STRUCTURE_TYPE_APPLICATION_INFO};