Add clipboard

Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-10-10 13:50:28 +03:00
parent e43799d11b
commit 86024e2c03
5 changed files with 267 additions and 66 deletions

View File

@@ -6,6 +6,7 @@
#include <EGL/egl.h>
#include <libportal/portal.h>
#include <wayland-client-protocol.h>
extern "C" {
#include "blur-client-protocol.h"
#define namespace namespace_
@@ -50,13 +51,19 @@ private:
auto ensure_egl_surface() -> void;
auto update_blur_region() -> void;
auto process_pending_text_input() -> void;
auto update_text_input_state(std::pmr::string const &text, usize id,
Rectangle field_rect) -> void;
auto update_text_input_state(
std::pmr::string const &text, usize id, Rectangle field_rect) -> void;
auto theme() const -> ColorScheme const &
{
return m_themes[m_active_theme];
}
auto clipboard() const -> std::pmr::string const &
{
return m_clipboard_cache;
}
auto clipboard(std::string_view const &str) -> void;
static void on_settings_changed(XdpSettings * /*self*/, char const *ns,
char const *key, GVariant * /*value*/, gpointer data);
@@ -75,7 +82,13 @@ private:
org_kde_kwin_blur *kde_blur {};
zwp_text_input_manager_v3 *text_input_mgr {};
zwp_text_input_v3 *text_input {};
wl_data_device_manager *ddm {};
wl_data_device *ddev {};
wl_data_offer *curr_offer {};
wl_data_source *curr_source {};
} m_wayland;
std::pmr::string m_clipboard_cache;
u32 m_last_serial { 0 };
struct {
EGLDisplay edpy { EGL_NO_DISPLAY };