Commit graph

16 commits

Author SHA1 Message Date
Kirill Primak
8f58c060fd util/region: forbid "shrinking" a region with wlr_region_expand()
The logic isn't correct.
2022-12-09 16:46:36 +00:00
Simon Ser
9fd28d1e81 util/region: constify 2022-11-11 23:11:17 +00:00
Steven Newbury
ad06c12c89 util: Fix infinite loop in recursive function
When testing Xwayland multi-HiDPI support with Wine + SimCity4
I encountered a 100% CPU lockup from sway.  This turned out to be
triggering a bug in the wlroots pointer contraint code.

region_confine() contains multiple recursive calls where arguments
are modified and resubmitted to the function.  One of the calls
is however made using the original arguments, if/when this triggers
it results in the same codepath being followed each loop so the
condition always applies.

It makes much more sense if this was intended to apply the clamped
values x,y instead of the original x1,y1, and indeed this fixes the
infinite loop and results in correct behaviour.
2022-05-24 20:39:32 +00:00
Simon Zeni
e192d87731 move wlr_box from /types to /util 2021-07-06 21:43:17 +02:00
Simon Ser
00ccb89288 util/region: add wlr_region_scale_xy 2020-06-17 09:10:54 -06:00
Manuel Stoeckl
f22a5d1704 Fix output rotation direction
The Wayland protocol specifies output transform rotations to be
counterclockwise and applied to the surface. Previously, wlroots
copied Weston and incorrectly made rotations act clockwise on
surfaces. This commit fixes that.

This change will break compositors which expect transform rotations
to be clockwise, and the rare applications that make use of surface
transforms.
2020-02-17 21:43:05 +01:00
Antonin Décimo
b400c26b23 Simplify check 2019-08-12 09:37:21 +09:00
Las
afa2e399aa Fix implicit conversion of floats to ints in calls to pixman_region32_contains_point
I do not think the conversion is specifically defined, but on my system and SirCmpwn's
the floats are rounded instead of floored, which is incorrect in this case, since
for a range from 0 to 256, any value greater or equal to 0 and less than 256 is valid.
I.e. [0;256[, or 0 <= x < 256, but if x is e.g. -0.1, then it will be rounded to 0, which
is invalid. The correct behavior would be to floor to -1.
2018-09-18 13:05:44 +02:00
Las
fa2e6e7d9d Implement pointer-constraints protocol in wlroots and rootston 2018-09-18 10:14:33 +02:00
emersion
4555fc8a54
Fix damage tracking for rotated surfaces
It was broken because the damage extents were rotated about its
own center, not about the center of the surface.

This adds a new wlr_region_rotated_bounds that rotates regions.
This allows us to have only one code path (for both non-rotated
views and rotated views) and optimizes rendering for rotated
views.
2018-03-26 15:31:08 -04:00
Drew DeVault
1d9be89e2d
Revert "ELF Visibility" 2018-02-19 18:01:27 -05:00
Scott Anderson
86269052eb Explicitly export EFL symbols 2018-02-19 14:26:40 +13:00
emersion
c2e1474010
Reformat all #include directives 2018-02-12 21:29:23 +01:00
emersion
2a855e6282
rootston: fix urxvt damage on HiDPI outputs
util/region: add wlr_region_expand
2018-01-30 12:01:10 +01:00
emersion
ece2c1e4e2
Damage tracking for transformed outputs 2018-01-26 22:11:09 +01:00
emersion
4223fbc763
rootston: damage tracking scale support 2018-01-25 19:15:20 +01:00