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

Fix popup damage issues when toplevel and/or popup uses geometry #2895

Merged
merged 1 commit into from
Oct 20, 2018

Conversation

RyanDwyer
Copy link
Member

The wlr_xdg_popup_get_toplevel_coords function has the following quirks:

  • It does not do anything with the coordinates of the passed popup. Instead, we are required to add them ourselves, which we do by passing them to the function as the surface local values.
  • It adds the geometry (shadows etc) of the toplevel itself, so the coordinates are surface local rather than content local. For this reason, we have to negate the toplevel's geometry (child->view->geometry).
  • I may be wrong, but the popup positions appear to be stored in surface local coordinates rather than content local coordinates. The geometry (shadows etc) of the popup itself must be negated (surface->geometry).

Fixes #2893.

The wlr_xdg_popup_get_toplevel_coords function has the following quirks:

* It does not do anything with the coordinates of the passed popup.
Instead, we are required to add them ourselves, which we do by passing
them to the function as the surface local values.
* It adds the geometry (shadows etc) of the toplevel itself, so the
coordinates are surface local rather than content local. For this
reason, we have to negate the toplevel's geometry
(child->view->geometry).
* I may be wrong, but the popup positions appear to be stored in surface
local coordinates rather than content local coordinates. The geometry
(shadows etc) of the popup itself must be negated (surface->geometry).
@ddevault ddevault merged commit 64534d2 into swaywm:master Oct 20, 2018
@ddevault
Copy link
Contributor

Thanks!

@RyanDwyer RyanDwyer deleted the fix-popup-damage branch October 20, 2018 13:39
@emersion
Copy link
Member

We can probably improve wlr_xdg_popup_get_toplevel_coords

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants