223 Commits

Author SHA1 Message Date
Lars Christensen
6bf6ac26ab [uwac] fix rectangular glitch around surface damage regions
Commit 09c12699 ("[uwac] window: fix damage region dimensions (rounding
errors)") added a 1-pixel expansion to the damage rect passed to
wl_surface_damage() (i.e. x-=1, y-=1, w+=2, h+=2) to guard against
rounding errors when a display scale factor is in use.

This causes visible rectangular glitches around every updated region.
The Wayland compositor re-composites exactly the declared damage region
from the attached buffer onto the screen. Because wlf_copy_image() only
writes pixels for the exact update rectangle, the 1-pixel border in the
buffer is never updated. With double-buffering the border pixels contain
stale data from the last time that buffer was used, and the compositor
faithfully composites those stale pixels, producing the artifact.

The floor/ceil rounding applied before the expansion is already
sufficient to cover any sub-pixel precision lost when converting from
buffer coordinates to surface coordinates. Remove the extra ±1 padding.
2026-03-02 19:42:26 +01:00
Armin Novak
402ea0ea0f [c23,uwac] replace NULL with nullptr 2026-02-26 14:02:43 +01:00
Armin Novak
48267edf2f [winpr] add WINPR_C_ARRAY_INIT
since C23 allows c++ style initializing replace direct use with this
macro
2026-02-25 19:23:08 +01:00
Armin Novak
e9723d1b61 [attributes] update attribute definitions
* support C++
* support C23
* replace __inline et al with C11 inline
2026-02-25 11:51:11 +01:00
Armin Novak
3fcc287b16 [warnings] initialize all va_list 2026-02-25 07:41:39 +01:00
Armin Novak
d355082c32 [cmake] static build: populate private
in pkg-config files only add Requires.private and Libs.private if we
build a static library.
2025-09-11 10:59:26 +02:00
akallabeth
3d9dcaece7 [out-of-bounds] fix oob reads 2025-03-11 09:37:11 +01:00
akallabeth
ca964f7c7d [mkstemp] set umask 2025-03-11 09:37:07 +01:00
akallabeth
00fecc61bb [uwac,rdtk] remove duplicated BUILD_TESTING_INTERNAL 2025-03-06 15:30:32 +01:00
akallabeth
a24ffe957c [cmake] make C and C++ standards configurable
use cache variables to allow overriding them from command line
2025-02-13 13:30:06 +01:00
akallabeth
0ae7c4b52d [cmake] refactor configuration
* Split common stuff to reusable files
* Disable INTERPROCEDURAL_OPTIMIZATION for SDL2/3 resource targets
2025-02-11 11:33:34 +01:00
akallabeth
ea2022b76b [clang,tidy] fix warnings 2025-01-15 09:32:52 +01:00
akallabeth
c535d8d4a6 [uwac] fix narrowing int cast 2025-01-07 21:28:16 +01:00
akallabeth
e061c02747 [uwac] fix integer cast warnings 2024-12-19 11:36:07 +01:00
akallabeth
43bfc74721 [cmake] install only header files
skip empty directories on install
2024-12-15 17:54:54 +01:00
akallabeth
180a9d7d72 [cmake,flags] print all configuration flags
Since we do not know wich configuration will be build with
multiconfiguration generators print out all C_FLAGS_XXX and
CXX_FLAGS_XXX variables
2024-12-05 09:36:26 +01:00
akallabeth
ba8fd2ada5 [cmake] force configuration options
limit multiconfiguration options to supported types
2024-12-05 09:36:23 +01:00
akallabeth
faae38120c [cmake,format] reformat all cmake files 2024-11-27 20:41:48 +01:00
stephanebill
4f2afa8c47 spell check with codespell 2024-11-20 16:53:40 -05:00
akallabeth
aa954d9be9 [warnings] fix various compiler warnings 2024-10-29 15:49:43 +01:00
akallabeth
a27d9508e2 [cmake] unify CFLAGS to string
* move to common CMake function
* escape CFLAGS
2024-10-25 11:40:43 +02:00
akallabeth
1675d926d2 Merge pull request #10776 from akallabeth/packaging-tests
[cmake] split tests
2024-10-24 11:26:17 +02:00
akallabeth
de055a6765 Merge pull request #10777 from akallabeth/cmake-build-type
[cmake] enforce a supported build type
2024-10-24 09:47:47 +02:00
Armin Novak
527db6783b [cmake] split tests
* Keep BUILD_TESTING, but only run tests compatible with API (for
  packaging)
* Add BUILD_TESTING_INTERNAL for all tests including internal function
  tests that modify API to be run on our CI
2024-10-24 09:45:44 +02:00
akallabeth
aa9b03df25 [cmake] generate full buildflags.h CFLAGS
Combine current configuration flags with CMAKE_C_FLAGS
2024-10-24 09:08:08 +02:00
Armin Novak
0545a8a5ef [uwac] fix sign warnings 2024-10-23 11:02:52 +02:00
akallabeth
cfc37caeb8 [cmake] cleaning_configure_file
add a wrapper to automatically add generated files to clean target
2024-10-02 23:28:08 +02:00
akallabeth
ba47e1936f [uwac] add strerror_r detection and use 2024-09-30 15:41:52 +02:00
akallabeth
861f699d92 [uwac] fix uwac seat functions
change arguments to match prototypes
2024-09-11 20:49:03 +02:00
akallabeth
e864fed61f [uwac] disable clang-tidy for generated files 2024-09-11 20:48:43 +02:00
akallabeth
5e123735fa [warnings] fixed sign-compare 2024-09-04 10:14:05 +02:00
akallabeth
72ae7fb54f [nolint] add cert-dcl37-c,cert-dcl51-cpp 2024-09-03 12:24:48 +02:00
Armin Novak
fe4cb6de65 [warnings] fix float/double warnings 2024-09-02 16:20:20 +02:00
akallabeth
7c1fd71b7b [uwac] elminate pedantic warnings from defines 2024-08-30 15:40:08 +02:00
akallabeth
457d6f7578 [warnings] fix clang-tidy issues in uwac 2024-08-29 15:20:45 +02:00
akallabeth
1d33095500 [warnings] fix cert-err33-c
Fix unused return values, cast to void if on purpose
2024-08-29 10:19:27 +02:00
akallabeth
b0afe43d34 [uwac] remove broken function attribute 2024-08-28 08:50:17 +02:00
akallabeth
56d660f258 [cmake] mark dependency includes SYSTEM
Mark all dependency include paths SYSTEM so warnings from system headers
are excluded from ci warning statistics
2024-08-26 11:10:49 +02:00
akallabeth
86e2789d9b [coverity] fix warnings 2024-08-26 09:19:06 +02:00
Armin Novak
6289482283 [uwac] fix compiler warnings 2024-07-22 11:06:13 +02:00
Armin Novak
1024a1a195 Revert "[coverity] 1543170 Resource leak"
This reverts commit d24bb658ec.
2024-07-04 12:11:26 +02:00
Armin Novak
e71da381cc [uwac] fix wrong data type 2024-07-03 14:03:24 +02:00
akallabeth
0f567c9ac5 [uwac,window] fix size_t additions 2024-07-02 13:17:12 +02:00
akallabeth
4099bd4e45 [warnings] integer casts/checks 2024-07-02 12:38:00 +02:00
akallabeth
c07ba558cb [warnings] fix various compiler warnings 2024-06-04 13:23:24 +02:00
Mariusz Bialonczyk
839f3e8408 uwac: fix window handling/viewport
Parameters passed to wp_viewport_set_destination was scaled instead of
the actual window size. In fact I noticed this problem when I was
testing the initial change (c29ba7985) but was not sure about how to fix
this and moreover, the tiling manager which I am using (sway) is
immediatelly tiling the window and all seems fine in day-to-day use
with tiled window.
The problem was only visible when the window was changed to floating:
the window content was scaled properly but the viewport was twice as
big (thus a whole window). What is worse it seems that the scaling was
done multiple times making a huge window size in some circumstances.

Now in new sway version 1.9 authors added an assert which prevents from
having a window which overlaps different renderers and this also trigger
this problem in FreeRDP, because when starting the window size was too
big.
This was leading to:
wp_viewport@31: error 2: source rectangle out of buffer bounds
or even sway crash

This commit is fixing this problem by using a proper window size values
(initially passed to a function and saved to additional variables before
scaling calculation).
Window size is now correct even when changed to a floating window.
2024-04-23 12:19:00 +02:00
akallabeth
0d09ae9ad4 [coverity] 1543074 Dereference before null check 2024-04-12 12:41:42 +02:00
akallabeth
d24bb658ec [coverity] 1543170 Resource leak 2024-04-12 09:45:09 +02:00
akallabeth
d7ebec5a65 [tidy] move loop variable declaration to loop 2024-02-22 12:31:50 +01:00
akallabeth
0ba995655d [clang-tidy] cppcoreguidelines-init-variables 2024-02-15 11:49:16 +01:00