Skip to content

Commit

Permalink
input-method-popup: Fix damage issues
Browse files Browse the repository at this point in the history
Fixes #2539.
  • Loading branch information
soreau committed Dec 26, 2024
1 parent fdadd85 commit 67be461
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
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

0 comments on commit 67be461

Please sign in to comment.