Skip to content

Commit

Permalink
support reposition popups (#1974)
Browse files Browse the repository at this point in the history
  • Loading branch information
lilydjwg authored and ammen99 committed Mar 13, 2024
1 parent 5281af6 commit ca365b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/view/xdg-shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,17 @@ wayfire_xdg_popup::wayfire_xdg_popup(wlr_xdg_popup *popup) : wf::view_interface_
{
wf::view_implementation::emit_ping_timeout_signal(self());
});
on_reposition.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_reposition.connect(&popup->events.reposition);

popup->base->data = this;
parent_geometry_changed.set_callback([=] (auto)
Expand Down Expand Up @@ -222,6 +227,7 @@ void wayfire_xdg_popup::destroy()
on_destroy.disconnect();
on_new_popup.disconnect();
on_ping_timeout.disconnect();
on_reposition.disconnect();
popup = nullptr;
}

Expand Down Expand Up @@ -350,7 +356,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_reposition;

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 ca365b9

Please sign in to comment.