Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: implementation of xdg_activation_v1 because I want my auto focuses #3639

Merged
merged 8 commits into from
Oct 30, 2024
2 changes: 2 additions & 0 deletions src/server/frontend_wayland/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ set(
${PROJECT_SOURCE_DIR}/src/include/server/mir/frontend/buffer_stream.h
wp_viewporter.cpp wp_viewporter.h
fractional_scale_v1.cpp fractional_scale_v1.h
xdg_activation_v1.cpp xdg_activation_v1.h
)

add_custom_command(
Expand Down Expand Up @@ -113,5 +114,6 @@ target_link_libraries(mirfrontend-wayland
mircore
PRIVATE
PkgConfig::GIOUnix
PkgConfig::UUID
)

7 changes: 5 additions & 2 deletions src/server/frontend_wayland/wayland_connector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,8 @@ mf::WaylandConnector::WaylandConnector(
WaylandProtocolExtensionFilter const& extension_filter,
bool enable_key_repeat,
std::shared_ptr<scene::SessionLock> const& session_lock,
std::shared_ptr<mir::DecorationStrategy> const& decoration_strategy)
std::shared_ptr<mir::DecorationStrategy> const& decoration_strategy,
std::shared_ptr<scene::SessionCoordinator> const& session_coordinator)
: extension_filter{extension_filter},
display{wl_display_create(), &cleanup_display},
pause_signal{eventfd(0, EFD_CLOEXEC | EFD_SEMAPHORE)},
Expand Down Expand Up @@ -328,7 +329,9 @@ mf::WaylandConnector::WaylandConnector(
main_loop,
desktop_file_manager,
session_lock_,
decoration_strategy});
decoration_strategy,
session_coordinator,
keyboard_observer_registrar});

shm_global = std::make_unique<WlShm>(display.get(), executor);

Expand Down
6 changes: 5 additions & 1 deletion src/server/frontend_wayland/wayland_connector.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class IdleHub;
class Surface;
class TextInputHub;
class SessionLock;
class SessionCoordinator;
}
namespace time
{
Expand Down Expand Up @@ -113,6 +114,8 @@ class WaylandExtensions
std::shared_ptr<DesktopFileManager> desktop_file_manager;
std::shared_ptr<scene::SessionLock> session_lock;
std::shared_ptr<mir::DecorationStrategy> decoration_strategy;
std::shared_ptr<scene::SessionCoordinator> session_coordinator;
std::shared_ptr<ObserverRegistrar<input::KeyboardObserver>> keyboard_observer_registrar;
};

WaylandExtensions() = default;
Expand Down Expand Up @@ -165,7 +168,8 @@ class WaylandConnector : public Connector
WaylandProtocolExtensionFilter const& extension_filter,
bool enable_key_repeat,
std::shared_ptr<scene::SessionLock> const& session_lock,
std::shared_ptr<DecorationStrategy> const& decoration_strategy);
std::shared_ptr<DecorationStrategy> const& decoration_strategy,
std::shared_ptr<scene::SessionCoordinator> const& session_coordinator);

~WaylandConnector() override;

Expand Down
15 changes: 14 additions & 1 deletion src/server/frontend_wayland/wayland_default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "wl_seat.h"
#include "wl_shell.h"
#include "wlr_screencopy_v1.h"
#include "xdg_activation_v1.h"
#include "xdg-decoration-unstable-v1_wrapper.h"
#include "xdg_decoration_unstable_v1.h"
#include "xdg_output_v1.h"
Expand Down Expand Up @@ -226,6 +227,16 @@ std::vector<ExtensionBuilder> const internal_extension_builders = {
{
return mf::create_fractional_scale_v1(ctx.display);
}),
make_extension_builder<mw::XdgActivationV1>([](auto const& ctx)
{
return mf::create_xdg_activation_v1(
ctx.display,
ctx.shell,
ctx.session_coordinator,
ctx.main_loop,
ctx.keyboard_observer_registrar,
*ctx.wayland_executor);
}),
};

ExtensionBuilder const xwayland_builder {
Expand Down Expand Up @@ -327,6 +338,7 @@ auto mf::get_standard_extensions() -> std::vector<std::string>
mw::TextInputManagerV3::interface_name,
mw::MirShellV1::interface_name,
mw::XdgDecorationManagerV1::interface_name,
mw::XdgActivationV1::interface_name,
mw::FractionalScaleManagerV1::interface_name};
}

Expand Down Expand Up @@ -384,7 +396,8 @@ std::shared_ptr<mf::Connector>
wayland_extension_filter,
enable_repeat,
the_session_lock(),
the_decoration_strategy());
the_decoration_strategy(),
the_session_coordinator());
});
}

Expand Down
Loading
Loading