This commit is contained in:
parent
7cc8bbd3e5
commit
93eb4eb61a
3 changed files with 21 additions and 39 deletions
|
|
@ -11,6 +11,9 @@
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#include <X11/keysymdef.h>
|
#include <X11/keysymdef.h>
|
||||||
|
|
||||||
|
//
|
||||||
|
#include <sanitizer/msan_interface.h>
|
||||||
|
|
||||||
namespace lt::surface {
|
namespace lt::surface {
|
||||||
|
|
||||||
template<int EventType>
|
template<int EventType>
|
||||||
|
|
@ -165,9 +168,14 @@ try
|
||||||
XSetWMProtocols(display, main_window, &surface.m_native_data.wm_delete_message, 1);
|
XSetWMProtocols(display, main_window, &surface.m_native_data.wm_delete_message, 1);
|
||||||
|
|
||||||
// code to remove decoration
|
// code to remove decoration
|
||||||
auto hints = std::array<unsigned char, 5> { 2, 0, 0, 0, 0 };
|
auto hints = std::array<const unsigned char, 5> { 2, 0, 0, 0, 0 };
|
||||||
const auto motif_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False);
|
const auto motif_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False);
|
||||||
|
|
||||||
|
#if defined(__clang__) && __has_feature(memory_sanitizer)
|
||||||
|
auto bytes = (size_t)(1u) * (size_t)hints.size();
|
||||||
|
__msan_unpoison((void *)hints.data(), bytes);
|
||||||
|
#endif
|
||||||
|
|
||||||
XChangeProperty(
|
XChangeProperty(
|
||||||
display,
|
display,
|
||||||
surface.m_native_data.window,
|
surface.m_native_data.window,
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ public:
|
||||||
|
|
||||||
void on_unregister() override;
|
void on_unregister() override;
|
||||||
|
|
||||||
__attribute__((no_sanitize_memory)) void create_surface_component(
|
__attribute__((no_sanitize("memory"))) void create_surface_component(
|
||||||
ecs::EntityId entity,
|
ecs::EntityId entity,
|
||||||
SurfaceComponent::CreateInfo info
|
SurfaceComponent::CreateInfo info
|
||||||
);
|
);
|
||||||
|
|
@ -40,35 +40,35 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
__attribute__((no_sanitize_memory)) void on_surface_destruct(
|
void on_surface_destruct(ecs::Registry ®istry, ecs::EntityId entity);
|
||||||
ecs::Registry ®istry,
|
|
||||||
ecs::EntityId entity
|
|
||||||
);
|
|
||||||
|
|
||||||
void handle_requests(struct SurfaceComponent &surface);
|
void handle_requests(struct SurfaceComponent &surface);
|
||||||
|
|
||||||
void handle_events(struct SurfaceComponent &surface);
|
void handle_events(struct SurfaceComponent &surface);
|
||||||
|
|
||||||
__attribute__((no_sanitize_memory)) void modify_title(
|
void modify_title(struct SurfaceComponent &surface, const struct ModifyTitleRequest &request);
|
||||||
struct SurfaceComponent &surface,
|
|
||||||
const struct ModifyTitleRequest &request
|
|
||||||
);
|
|
||||||
|
|
||||||
__attribute__((no_sanitize_memory)) void modify_resolution(
|
__attribute__((no_sanitize("memory"))) void modify_resolution(
|
||||||
struct SurfaceComponent &surface,
|
struct SurfaceComponent &surface,
|
||||||
const struct ModifyResolutionRequest &request
|
const struct ModifyResolutionRequest &request
|
||||||
);
|
);
|
||||||
|
|
||||||
__attribute__((no_sanitize_memory)) void modify_position(
|
__attribute__((no_sanitize("memory"))) void modify_position(
|
||||||
struct SurfaceComponent &surface,
|
struct SurfaceComponent &surface,
|
||||||
const struct ModifyPositionRequest &request
|
const struct ModifyPositionRequest &request
|
||||||
);
|
);
|
||||||
|
|
||||||
__attribute__((no_sanitize_memory)) void modify_visiblity(
|
void modify_visiblity(
|
||||||
struct SurfaceComponent &surface,
|
struct SurfaceComponent &surface,
|
||||||
const struct ModifyVisibilityRequest &request
|
const struct ModifyVisibilityRequest &request
|
||||||
);
|
);
|
||||||
|
|
||||||
|
void modify_position(ecs::EntityId surface_entity, const math::ivec2 &new_size);
|
||||||
|
|
||||||
|
void modify_position(ecs::EntityId surface_entity, const math::uvec2 &new_size);
|
||||||
|
|
||||||
|
void set_visibility(ecs::EntityId surface_entity, bool visible);
|
||||||
|
|
||||||
memory::Ref<ecs::Registry> m_registry;
|
memory::Ref<ecs::Registry> m_registry;
|
||||||
|
|
||||||
app::TickResult m_last_tick_result;
|
app::TickResult m_last_tick_result;
|
||||||
|
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
# --- Ignore X11 (libX11) ---
|
|
||||||
fun:_XData32
|
|
||||||
fun:_XSend
|
|
||||||
fun:_XFlush
|
|
||||||
fun:XChangeProperty
|
|
||||||
fun:XFlush
|
|
||||||
|
|
||||||
obj:/msan/lib/libX11.so
|
|
||||||
obj:/msan/lib/libX11.so.6
|
|
||||||
|
|
||||||
# --- Ignore XCB (libxcb) ---
|
|
||||||
fun:write_vec
|
|
||||||
fun:_xcb_conn_wait
|
|
||||||
fun:_xcb_out_send
|
|
||||||
fun:xcb_writev
|
|
||||||
|
|
||||||
obj:/msan/lib/libxcb.so
|
|
||||||
obj:/msan/lib/libxcb.so.1
|
|
||||||
|
|
||||||
# --- Ignore local forwarding/interceptors ---
|
|
||||||
fun:read_iovec
|
|
||||||
fun:writev
|
|
||||||
|
|
||||||
# --- (Optional) ignore your wrapper to avoid noise ---
|
|
||||||
fun:lt::surface::System::create_surface_component
|
|
||||||
|
|
||||||
Loading…
Add table
Reference in a new issue