Skip to content

Commit

Permalink
Bump wayland wl_seat interface to version 9
Browse files Browse the repository at this point in the history
Needed on Arch.
  • Loading branch information
2hdddg committed Oct 25, 2024
1 parent c3328bb commit 9fb3c6e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 15 deletions.
7 changes: 4 additions & 3 deletions zen/Registry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void Registry::Register(struct wl_registry *registry, uint32_t name, const char
spdlog::warn("Registration of additional seat, ignoring");
return;
}
wanted_version = 5;
wanted_version = 9;
build_version = wl_seat_interface.version;
auto wlseat =
(wl_seat *)wl_registry_bind(registry, name, &wl_seat_interface, wanted_version);
Expand All @@ -60,8 +60,9 @@ void Registry::Register(struct wl_registry *registry, uint32_t name, const char
spdlog::trace("Ignored global interface: {} version {}", interface, version);
return;
}
spdlog::info("Bound to global interface {} version {}. Max version {}. Built with version {}.",
interface, wanted_version, version, build_version);
spdlog::info(
"Bound to global interface {} wanted version {}. Given version {}. Built with version {}.",
interface, wanted_version, version, build_version);
}

void Registry::Unregister(struct wl_registry *, uint32_t /*name*/) {
Expand Down
14 changes: 6 additions & 8 deletions zen/Seat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ static void on_axis_stop(void* /*data*/, struct wl_pointer*, uint32_t /*time*/,
}
static void on_axis_discrete(void* /*data*/, struct wl_pointer*, uint32_t /*axis*/,
int32_t /*discrete*/) {}
/*
[2024-01-24 19:34:07.087] [trace] on_axis_source: 0
[2024-01-24 19:34:07.087] [trace] on_axis_discrete axis 0, discrete: 1
[2024-01-24 19:34:07.087] [trace] on_axis, axis: 0, value: 3840
*/
static void on_axis_value120(void* /*data*/, struct wl_pointer* /*wl_pointer*/, uint32_t /*axis*/,
int32_t /*value120*/) {}
static void on_axis_relative_direction(void* /*data*/, struct wl_pointer* /*wl_pointer*/,
uint32_t /*axis*/, uint32_t /*direction*/) {}

static const wl_pointer_listener pointer_listener = {
.enter = on_pointer_enter,
Expand All @@ -66,9 +65,8 @@ static const wl_pointer_listener pointer_listener = {
.axis_source = on_axis_source,
.axis_stop = on_axis_stop,
.axis_discrete = on_axis_discrete,
// Version > supported
//.axis_value120 = nullptr,
//.axis_relative_direction = nullptr,
.axis_value120 = on_axis_value120,
.axis_relative_direction = on_axis_relative_direction,
};

std::unique_ptr<Pointer> Pointer::Create(wl_seat* seat) {
Expand Down
11 changes: 8 additions & 3 deletions zen/ShellSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,19 @@ static void on_closed(void *data, struct zwlr_layer_surface_v1 *) {
static void on_enter(void * /*data*/, struct wl_surface *, struct wl_output *) {}

static void on_leave(void * /*data*/, struct wl_surface *, struct wl_output *) {}
static void on_preferred_buffer_scale(void * /*data*/, struct wl_surface * /*wl_surface*/,
int32_t /*factor*/) {}
static void on_preferred_buffer_transform(void * /*data*/, struct wl_surface * /*wl_surface*/,
uint32_t /*transform*/) {}

static const zwlr_layer_surface_v1_listener layer_listener = {.configure = on_configure,
.closed = on_closed};

static const wl_surface_listener surface_listener = {
.enter = on_enter, .leave = on_leave,
//.preferred_buffer_scale = nullptr,
//.preferred_buffer_transform = nullptr,
.enter = on_enter,
.leave = on_leave,
.preferred_buffer_scale = on_preferred_buffer_scale,
.preferred_buffer_transform = on_preferred_buffer_transform,
};

std::unique_ptr<ShellSurface> ShellSurface::Create(const Registry &registry, wl_output *output,
Expand Down
2 changes: 1 addition & 1 deletion zen/Sources/NetworkSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void NetworkSource::ReadState() {
}
// extended flags SIOCGIFPFLAGS
// SIOCGIWSTATS
NetworkState network = {.isAlerted = false};
NetworkState network = {.isAlerted = false, .isUp = false, .address = ""};
network.isUp = (item->ifr_flags & IFF_UP) != 0;
// Get interface address
if (ioctl(m_socket, SIOCGIFADDR, item) < 0) {
Expand Down

0 comments on commit 9fb3c6e

Please sign in to comment.