Skip to content

Commit

Permalink
support reposition popups
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg committed Oct 25, 2023
1 parent ada3a6b commit 557c76a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/view/xdg-shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,16 @@ wayfire_xdg_popup::wayfire_xdg_popup(wlr_xdg_popup *popup) : wf::view_interface_
{
wf::view_implementation::emit_ping_timeout_signal(self());
});
on_repostion.set_callback([&] (void*) {
unconstrain();
});

on_map.connect(&popup->base->events.map);
on_unmap.connect(&popup->base->events.unmap);
on_destroy.connect(&popup->base->events.destroy);
on_new_popup.connect(&popup->base->events.new_popup);
on_ping_timeout.connect(&popup->base->events.ping_timeout);
on_repostion.connect(&popup->events.reposition);

popup->base->data = this;
parent_geometry_changed.set_callback([=] (auto)
Expand Down Expand Up @@ -350,7 +354,7 @@ static wlr_xdg_shell *xdg_handle = nullptr;
void wf::init_xdg_shell()
{
static wf::wl_listener_wrapper on_xdg_created;
xdg_handle = wlr_xdg_shell_create(wf::get_core().display, 2);
xdg_handle = wlr_xdg_shell_create(wf::get_core().display, 3);

if (xdg_handle)
{
Expand Down
2 changes: 1 addition & 1 deletion src/view/xdg-shell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class wayfire_xdg_popup : public wf::view_interface_t
{
protected:
wf::wl_listener_wrapper on_destroy, on_new_popup,
on_map, on_unmap, on_ping_timeout;
on_map, on_unmap, on_ping_timeout, on_repostion;

wf::signal::connection_t<wf::view_geometry_changed_signal> parent_geometry_changed;
wf::signal::connection_t<wf::view_title_changed_signal> parent_title_changed;
Expand Down

0 comments on commit 557c76a

Please sign in to comment.