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

input-method-popup: Fix damage issues #2547

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 src/api/wayfire/unstable/wlr-text-input-v3-popup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class text_input_v3_popup : public wf::view_interface_t
private:
wf::geometry_t geometry{0, 0, 0, 0};
wlr_box old_cursor_rect{0, 0, 0, 0};
wf::dimensions_t last_size{0, 0};
std::shared_ptr<wf::scene::wlr_surface_node_t> main_surface;
std::shared_ptr<wf::scene::translation_node_t> surface_root_node;

Expand Down
10 changes: 10 additions & 0 deletions src/core/seat/input-method-popup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,23 @@ void wf::text_input_v3_popup::update_geometry()
// make sure top edge is on screen, sliding down and sacrificing down edge if unavoidable
y = std::max(0, y);

auto last_offset = surface_root_node->get_offset();
surface_root_node->set_offset({x, y});
geometry.x = x;
geometry.y = y;
geometry.width = width;
geometry.height = height;
damage();
wf::scene::update(get_surface_root_node(), wf::scene::update_flag::GEOMETRY);
wf::scene::damage_node(get_surface_root_node(), geometry);

wf::geometry_t last_geometry{last_offset.x, last_offset.y, last_size.width, last_size.height};
if (last_geometry != geometry)
{
wf::scene::damage_node(get_surface_root_node(), last_geometry);
}

last_size = {width, height};
}

bool wf::text_input_v3_popup::is_mapped() const
Expand Down
Loading