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

xdg-popup: include popup's own position in the calculation #2170

Merged
merged 1 commit into from
Mar 2, 2024
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
8 changes: 0 additions & 8 deletions src/view/view-impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,6 @@ wf::pointf_t wf::place_popup_at(wlr_surface *parent, wlr_surface *popup, wf::poi
// Get the {0, 0} of the parent view in output coordinates
popup_offset += popup_parent->get_surface_root_node()->to_global({0, 0});

auto xdg_surface = wlr_xdg_surface_try_from_wlr_surface(parent);
if (xdg_surface)
{
// substract shadows etc; test app: d-feet
popup_offset.x -= xdg_surface->current.geometry.x;
popup_offset.y -= xdg_surface->current.geometry.y;
}

// Apply transformers to the popup position
auto node = popup_parent->get_surface_root_node()->parent();
while (node != popup_parent->get_transformed_node().get())
Expand Down
5 changes: 2 additions & 3 deletions src/view/xdg-shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <wayfire/debug.hpp>
#include "view/view-impl.hpp"
#include "wayfire/core.hpp"
#include "surface-impl.hpp"
#include "wayfire/geometry.hpp"
#include "wayfire/output.hpp"
#include "wayfire/scene-operations.hpp"
Expand Down Expand Up @@ -166,8 +165,8 @@ void wayfire_xdg_popup::update_position()

// Offset relative to the parent surface
wf::pointf_t popup_offset = wf::place_popup_at(popup->parent, popup->base->surface, {
popup->current.geometry.x * 1.0,
popup->current.geometry.y * 1.0,
popup->current.geometry.x * 1.0 - popup->base->current.geometry.x,
popup->current.geometry.y * 1.0 - popup->base->current.geometry.y,
});

this->move(popup_offset.x, popup_offset.y);
Expand Down
Loading