Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf@nereid.pl>2022-11-07 03:20:48 +0300
committerBartosz Taudul <wolf@nereid.pl>2022-11-07 03:20:48 +0300
commit4f7fba1fedad5b84729d1cd16efd7b25db057388 (patch)
tree44fce9680949987d3f1dbeeb7d64a4493a2c3c98
parent9645998a97eb2b16e9080f6076dd39fbaf3acb4d (diff)
Hook seat.
-rw-r--r--profiler/src/BackendWayland.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/profiler/src/BackendWayland.cpp b/profiler/src/BackendWayland.cpp
index 08849629..66fe297c 100644
--- a/profiler/src/BackendWayland.cpp
+++ b/profiler/src/BackendWayland.cpp
@@ -29,6 +29,7 @@ static EGLContext s_eglCtx;
static EGLSurface s_eglSurf;
static struct xdg_surface* s_xdgSurf;
static struct xdg_toplevel* s_toplevel;
+static struct wl_seat* s_seat;
static bool s_running = true;
static int s_w, s_h;
@@ -45,6 +46,21 @@ constexpr struct xdg_wm_base_listener wmListener = {
};
+static void SeatCapabilities( void*, struct wl_seat* seat, uint32_t caps )
+{
+}
+
+static void SeatName( void*, struct wl_seat* seat, const char* name )
+{
+}
+
+
+constexpr struct wl_seat_listener seatListener = {
+ .capabilities = SeatCapabilities,
+ .name = SeatName
+};
+
+
static void RegistryGlobalCb( void*, struct wl_registry* reg, uint32_t name, const char* interface, uint32_t version )
{
if( strcmp( interface, wl_compositor_interface.name ) == 0 )
@@ -60,6 +76,11 @@ static void RegistryGlobalCb( void*, struct wl_registry* reg, uint32_t name, con
s_wm = (xdg_wm_base*)wl_registry_bind( reg, name, &xdg_wm_base_interface, 1 );
xdg_wm_base_add_listener( s_wm, &wmListener, nullptr );
}
+ else if( strcmp( interface, wl_seat_interface.name ) == 0 )
+ {
+ s_seat = (wl_seat*)wl_registry_bind( reg, name, &wl_seat_interface, 7 );
+ wl_seat_add_listener( s_seat, &seatListener, nullptr );
+ }
}
constexpr struct wl_registry_listener registryListener = {
@@ -116,6 +137,7 @@ Backend::Backend( const char* title, std::function<void()> redraw, RunQueue* mai
if( !s_comp ) { fprintf( stderr, "No wayland compositor!\n" ); exit( 1 ); }
if( !s_shm ) { fprintf( stderr, "No wayland shared memory!\n" ); exit( 1 ); }
if( !s_wm ) { fprintf( stderr, "No wayland window manager!\n" ); exit( 1 ); }
+ if( !s_seat ) { fprintf( stderr, "No wayland seat!\n" ); exit( 1 ); }
s_surf = wl_compositor_create_surface( s_comp );
s_eglWin = wl_egl_window_create( s_surf, m_winPos.w, m_winPos.h );
@@ -181,6 +203,7 @@ Backend::~Backend()
xdg_surface_destroy( s_xdgSurf );
wl_egl_window_destroy( s_eglWin );
wl_surface_destroy( s_surf );
+ wl_seat_destroy( s_seat );
xdg_wm_base_destroy( s_wm );
wl_shm_destroy( s_shm );
wl_compositor_destroy( s_comp );