Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
2025-10-10 03:45:30 +03:00
parent 18614ccee9
commit 7834724e53
6 changed files with 676 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <string>
#include <unordered_set>
#include <vector>
@@ -9,6 +10,7 @@ extern "C" {
#include "blur-client-protocol.h"
#define namespace namespace_
#include "ext-background-effect-v1-client-protocol.h"
#include "text-input-unstable-v3-client-protocol.h"
#include "wlr-layer-shell-unstable-v1-client-protocol.h"
#include <libportal/settings.h>
#undef namespace
@@ -47,6 +49,9 @@ private:
auto destroy_layer_surface() -> void;
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, std::size_t id,
Rectangle field_rect) -> void;
auto theme() const -> ColorScheme const &
{
return m_themes[m_active_theme];
@@ -68,6 +73,8 @@ private:
ext_background_effect_surface_v1 *eff {};
org_kde_kwin_blur_manager *kde_blur_mgr {};
org_kde_kwin_blur *kde_blur {};
zwp_text_input_manager_v3 *text_input_mgr {};
zwp_text_input_v3 *text_input {};
} m_wayland;
struct {
@@ -144,6 +151,38 @@ private:
FontHandle m_font;
std::shared_ptr<ImGui> m_gui { nullptr };
struct {
bool supported { false };
bool seat_focus { false };
bool enabled { false };
bool pending_done { false };
uint32_t pending_serial { 0 };
uint32_t sent_serial { 0 };
std::pmr::string *bound_text { nullptr };
std::size_t bound_id { 0 };
Rectangle bound_rect {};
struct {
bool has_preedit { false };
std::string preedit_text;
int cursor_begin { 0 };
int cursor_end { 0 };
bool has_commit { false };
std::string commit_text;
bool has_delete { false };
uint32_t before { 0 };
uint32_t after { 0 };
} pending;
std::string last_surrounding;
int last_cursor { 0 };
int last_anchor { 0 };
Rectangle last_cursor_rect {};
bool last_cursor_visible { false };
bool surrounding_dirty { false };
} m_ime;
enum_array<Theme, ColorScheme> m_themes { make_default_themes() };
Theme m_active_theme { Theme::Light };