Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ jobs:
container: alpine:latest
steps:
- run: apk --no-cache add git gcc g++ binutils pkgconf meson ninja musl-dev wayland-protocols libinput-dev libevdev-dev libxkbcommon-dev pixman-dev glm-dev mesa-dev cairo-dev pango-dev eudev-dev libxml2-dev libseat-dev libxcb-dev xcb-util-wm-dev xwayland doctest doctest-dev cmake libdisplay-info-dev hwdata-dev libdrm-dev yyjson-dev wayland-dev
- run: git clone https://gitlab.freedesktop.org/wayland/wayland-protocols -b 1.47 && cd wayland-protocols && meson setup build --prefix=/usr && ninja -C build && ninja -C build install && cd .. && rm -rf wayland-protocols
- uses: actions/checkout@v1
- run: git config --global --add safe.directory /__w/wayfire/wayfire
- run: git submodule sync --recursive && git submodule update --init --force --recursive
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ libdl = cpp.find_library('dl')
udev = dependency('libudev')
json = subproject('wf-json', default_options: ['install_header=true']).get_variable('wfjson')

wlroots_base_version = '0.19'
wlroots_base_version = '0.20'
wlroots_dep_name = 'wlroots-' + wlroots_base_version
wlroots_min_version = '>=' + wlroots_base_version + '.0'
wlroots_max_version = '<=' + wlroots_base_version + '.99'
Expand Down
2 changes: 1 addition & 1 deletion plugins/protocols/input-method-v1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ class wayfire_input_method_v1 : public wf::plugin_interface_t, public wf::text_i
if (enable_text_input_v3)
{
wf::get_core().protocols.text_input = wlr_text_input_manager_v3_create(wf::get_core().display);
on_text_input_v3_created.connect(&wf::get_core().protocols.text_input->events.text_input);
on_text_input_v3_created.connect(&wf::get_core().protocols.text_input->events.new_text_input);
on_text_input_v3_created.set_callback([&] (void *data)
{
handle_text_input_v3_created(static_cast<wlr_text_input_v3*>(data));
Expand Down
3 changes: 2 additions & 1 deletion src/api/wayfire/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ class compositor_core_t : public wf::object_base_t, public signal::provider_t
wlr_screencopy_manager_v1 *screencopy;
wlr_ext_foreign_toplevel_list_v1 *foreign_toplevel_list;
wlr_ext_image_copy_capture_manager_v1 *image_copy_capture;
wlr_ext_output_image_capture_source_manager_v1 *image_capture_source;
wlr_ext_output_image_capture_source_manager_v1 *output_image_capture_source;
wlr_ext_foreign_toplevel_image_capture_source_manager_v1 *foreign_toplevel_image_capture_source;
wlr_export_dmabuf_manager_v1 *export_dmabuf;
wlr_server_decoration_manager *decorator_manager;
wlr_xdg_decoration_manager_v1 *xdg_decorator;
Expand Down
1 change: 1 addition & 0 deletions src/api/wayfire/nonstd/wlroots-full.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ extern "C"
#include <wlr/types/wlr_primary_selection_v1.h>
#include <wlr/types/wlr_fractional_scale_v1.h>
#include <wlr/types/wlr_single_pixel_buffer_v1.h>
#include <wlr/types/wlr_color_representation_v1.h>
#include <wlr/types/wlr_session_lock_v1.h>
#include <wlr/types/wlr_security_context_v1.h>
#if __has_include(<cursor-shape-v1-protocol.h>)
Expand Down
1 change: 1 addition & 0 deletions src/api/wayfire/nonstd/wlroots.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ extern "C"
struct wlr_ext_foreign_toplevel_list_v1;
struct wlr_ext_image_copy_capture_manager_v1;
struct wlr_ext_output_image_capture_source_manager_v1;
struct wlr_ext_foreign_toplevel_image_capture_source_manager_v1;
struct wlr_foreign_toplevel_manager_v1;
struct wlr_pointer_gestures_v1;
struct wlr_relative_pointer_manager_v1;
Expand Down
2 changes: 1 addition & 1 deletion src/api/wayfire/plugin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ using wayfire_plugin_load_func = wf::plugin_interface_t * (*)();
/**
* The version is defined as macro as well, to allow conditional compilation.
*/
#define WAYFIRE_API_ABI_VERSION_MACRO 2026'01'22
#define WAYFIRE_API_ABI_VERSION_MACRO 2026'03'27

/**
* The version of Wayfire's API/ABI
Expand Down
5 changes: 4 additions & 1 deletion src/core/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ void wf::compositor_core_impl_t::init()
protocols.screencopy = wlr_screencopy_manager_v1_create(display);
protocols.foreign_toplevel_list = wlr_ext_foreign_toplevel_list_v1_create(display, 1);
protocols.image_copy_capture = wlr_ext_image_copy_capture_manager_v1_create(display, 1);
protocols.image_capture_source = wlr_ext_output_image_capture_source_manager_v1_create(display, 1);
protocols.output_image_capture_source = wlr_ext_output_image_capture_source_manager_v1_create(display, 1);
protocols.foreign_toplevel_image_capture_source =
wlr_ext_foreign_toplevel_image_capture_source_manager_v1_create(display, 1);
protocols.gamma_v1 = wlr_gamma_control_manager_v1_create(display);
protocols.export_dmabuf = wlr_export_dmabuf_manager_v1_create(display);
protocols.output_manager = wlr_xdg_output_manager_v1_create(display,
Expand Down Expand Up @@ -243,6 +245,7 @@ void wf::compositor_core_impl_t::init()

wlr_fractional_scale_manager_v1_create(display, 1);
wlr_single_pixel_buffer_manager_v1_create(display);
wlr_color_representation_manager_v1_create_with_renderer(display, 1, renderer);
Comment thread
ammen99 marked this conversation as resolved.

this->bindings = std::make_unique<bindings_repository_t>();
image_io::init();
Expand Down
47 changes: 17 additions & 30 deletions src/core/seat/input-method-relay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ wf::input_method_relay::input_method_relay()
auto new_input_method = static_cast<wlr_input_method_v2*>(data);
if (input_method != nullptr)
{
LOGI("Attempted to connect second input method");
LOGC(IM, "Attempted to connect second input method");
wlr_input_method_v2_send_unavailable(new_input_method);

return;
}

LOGD("new input method connected");
LOGC(IM, "new input method connected");
input_method = new_input_method;
last_done_serial.reset();
next_done_serial = 0;
Expand All @@ -68,9 +68,6 @@ wf::input_method_relay::input_method_relay()

on_input_method_commit.set_callback([&] (void *data)
{
auto evt_input_method = static_cast<wlr_input_method_v2*>(data);
assert(evt_input_method == input_method);

// When we switch focus, we send a done event to the IM.
// The IM may need time to process further events and may send additional commits after switching
// focus, which belong to the old text input.
Expand All @@ -79,7 +76,7 @@ wf::input_method_relay::input_method_relay()
// compositor.
if (input_method->current_serial < last_done_serial.value_or(0))
{
LOGD("focus just changed, ignore input method commit");
LOGC(IM, "focus just changed, ignore input method commit");
return;
}

Expand Down Expand Up @@ -116,9 +113,6 @@ wf::input_method_relay::input_method_relay()

on_input_method_destroy.set_callback([&] (void *data)
{
auto evt_input_method = static_cast<wlr_input_method_v2*>(data);
assert(evt_input_method == input_method);

on_input_method_commit.disconnect();
on_input_method_destroy.disconnect();
on_grab_keyboard.disconnect();
Expand Down Expand Up @@ -172,8 +166,8 @@ wf::input_method_relay::input_method_relay()
auto& core = wf::get_core();
if (core.protocols.text_input && core.protocols.input_method)
{
on_text_input_new.connect(&wf::get_core().protocols.text_input->events.text_input);
on_input_method_new.connect(&wf::get_core().protocols.input_method->events.input_method);
on_text_input_new.connect(&wf::get_core().protocols.text_input->events.new_text_input);
on_input_method_new.connect(&wf::get_core().protocols.input_method->events.new_input_method);
wf::get_core().connect(&keyboard_focus_changed);
}
}
Expand Down Expand Up @@ -205,7 +199,7 @@ void wf::input_method_relay::disable_text_input(wlr_text_input_v3 *input)
{
if (input_method == nullptr)
{
LOGI("Disabling text input, but input method is gone");
LOGC(IM, "Disabling text input, but input method is gone");

return;
}
Expand Down Expand Up @@ -335,6 +329,11 @@ void wf::input_method_relay::set_focus(wlr_surface *surface)
{
for (auto & text_input : text_inputs)
{
if (!text_input->input->current_enabled)
{
continue;
}

if (text_input->pending_focused_surface != nullptr)
{
assert(text_input->input->focused_surface == nullptr);
Expand All @@ -351,7 +350,7 @@ void wf::input_method_relay::set_focus(wlr_surface *surface)
wlr_text_input_v3_send_leave(text_input->input);
} else
{
LOGD("set_focus an already focused surface");
LOGC(IM, "set_focus an already focused surface");
continue;
}
}
Expand All @@ -378,12 +377,9 @@ wf::text_input::text_input(wf::input_method_relay *rel, wlr_text_input_v3 *in) :
{
on_text_input_enable.set_callback([&] (void *data)
{
auto wlr_text_input = static_cast<wlr_text_input_v3*>(data);
assert(input == wlr_text_input);

if (relay->input_method == nullptr)
{
LOGI("Enabling text input, but input method is gone");
LOGC(IM, "Enabling text input, but input method is gone");

return;
}
Expand All @@ -394,19 +390,16 @@ wf::text_input::text_input(wf::input_method_relay *rel, wlr_text_input_v3 *in) :

on_text_input_commit.set_callback([&] (void *data)
{
auto wlr_text_input = static_cast<wlr_text_input_v3*>(data);
assert(input == wlr_text_input);

if (!input->current_enabled)
{
LOGI("Inactive text input tried to commit");
LOGC(IM, "Inactive text input tried to commit");

return;
}

if (relay->input_method == nullptr)
{
LOGI("Committing text input, but input method is gone");
LOGC(IM, "Committing text input, but input method is gone");

return;
}
Expand All @@ -420,20 +413,14 @@ wf::text_input::text_input(wf::input_method_relay *rel, wlr_text_input_v3 *in) :

on_text_input_disable.set_callback([&] (void *data)
{
auto wlr_text_input = static_cast<wlr_text_input_v3*>(data);
assert(input == wlr_text_input);

relay->disable_text_input(input);
});

on_text_input_destroy.set_callback([&] (void *data)
{
auto wlr_text_input = static_cast<wlr_text_input_v3*>(data);
assert(input == wlr_text_input);

if (input->current_enabled)
{
relay->disable_text_input(wlr_text_input);
relay->disable_text_input(input);
}

set_pending_focused_surface(nullptr);
Expand All @@ -443,7 +430,7 @@ wf::text_input::text_input(wf::input_method_relay *rel, wlr_text_input_v3 *in) :
on_text_input_destroy.disconnect();

// NOTE: the call destroys `this`
relay->remove_text_input(wlr_text_input);
relay->remove_text_input(input);
});

on_pending_focused_surface_destroy.set_callback([&] (void *data)
Expand Down
3 changes: 1 addition & 2 deletions src/view/xwayland.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ void wf::xwayland_update_default_cursor()
if (cursor && (cursor->image_count > 0))
{
auto image = cursor->images[0];
wlr_xwayland_set_cursor(xwayland_handle, image->buffer,
image->width * 4, image->width, image->height,
wlr_xwayland_set_cursor(xwayland_handle, wlr_xcursor_image_get_buffer(image),
image->hotspot_x, image->hotspot_y);
}

Expand Down
2 changes: 1 addition & 1 deletion subprojects/wlroots
Submodule wlroots updated from 8c9e6b to c1d385
Loading