aboutsummaryrefslogtreecommitdiff
path: root/util
AgeCommit message (Collapse)Author
2020-06-06util/time: move `timespec_sub` to time utilitiesTudor Brindus
2020-06-06util/time: de-duplicate `timespec_to_msec`Tudor Brindus
2020-06-06util: fix and move `get_current_time_msec` into a util fileTudor Brindus
This commit makes `get_current_time_msec` correctly return milliseconds as opposed to microseconds. It also considers the value of `tv_sec`, so we don't lose occasionally go back in time by one second. Finally, the function is moved into `util/time.cc` so that it can be reused elsewhere without having to consider these pitfalls.
2020-05-24util/log: use bright black rather than black for WLR_DEBUGTudor Brindus
On some terminals under default settings, black is truly rendered as `#000`, making it unreadable when the background is also black. Refs swaywm/sway#5141.
2020-05-01util/log: write log importanceSimon Ser
When colors aren't used, write the log importance to stderr. This makes it easier to grep for errors and avoids mistaking error messages for debug messages.
2020-03-07util/log: improve time prefixSimon Ser
Log milliseconds. This is useful when debugging a rendering loop. Print the time relative to the compositor start-up.
2020-02-17Fix output rotation directionManuel Stoeckl
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-17util: add wlr_output_destroy_safeSimon Ser
This adds a generic helper to destory transient globals. See [1]. This patch depends on [2] and [3]. [1]: https://gitlab.freedesktop.org/wayland/wayland/issues/10 [2]: https://gitlab.freedesktop.org/wayland/wayland/merge_requests/28 [3]: https://gitlab.freedesktop.org/wayland/wayland/merge_requests/30
2019-12-23meson: Various improvementsScott Anderson
Bumps minimum version to 0.51.0 - Remove all intermediate static libraries. They serve no purpose and are just add a bunch of boilerplate for managing dependencies and options. It's now managed as a list of files which are compiled into libwlroots directly. - Use install_subdir instead of installing headers individually. I've changed my mind since I did that. Listing them out is annoying as hell, and it's easy to forget to do it. - Add not_found_message for all of our optional dependencies that have a meson option. It gives some hints about what option to pass and what the optional dependency is for. - Move all backend subdirectories into their own meson.build. This keeps some of the backend-specific build logic (especially rdp and session) more neatly separated off. - Don't overlink example clients with code they're not using. This was done by merging the protocol dictionaries and setting some variables containing the code and client header file. Example clients now explicitly mention what extension protocols they want to link to. - Split compositor example logic from client example logic. - Minor formatting changes
2019-11-27virtual_keyboard: Accept keycode 0Dorota Czaplejewicz
2019-08-12Simplify checkAntonin Décimo
2019-07-27Remove all wayland-server.h includesSimon Ser
The documentation for wayland-server.h says: > Use of this header file is discouraged. Prefer including > wayland-server-core.h instead, which does not include the server protocol > header and as such only defines the library PI, excluding the deprecated API > below. Replacing wayland-server.h with wayland-server-core.h allows us to drop the WL_HIDE_DEPRECATED declaration.
2019-07-17Use -fmacro-prefix-map to strip build pathManuel Stoeckl
This commit matches sway's 2dc4978d8af326c310057ca8fd22a4c7f5d09335. To help ensure a reproducible build (when debug info is disabled), the meson build script now uses the -fmacro-prefix-map command line argument supported by GCC to strip the build-path dependent bytes of each __FILE__ string used by wlr_log and related functions. A rather ugly algorithm is used to compute the relative path between the build and source folders, because meson has no specific function for this. When the compiler does not support -fmacro-prefix-map, fall back to shifting the start of each __FILE__ string by the length of the relative path to the source directory.
2019-06-16Use a set to track pointer button state.Ashkan Kiani
In addition to `button_count`, we keep track of the current buttons pressed just as in `wlr_keyboard`. Add `set_add` and `set_remove` to assist with this. These functions can only be used with values greater than 0 (such as the button/key masks for keyboards and pointers). Partially addresses: - https://github.com/swaywm/wlroots/issues/1716 - https://github.com/swaywm/wlroots/issues/1593
2019-04-07util/log: setup wayland log handleremersion
2018-11-09Use ftruncate to set shared memory object's sizesghctoma
The posix_fallocate function should only be used with regular files.
2018-11-08Force ftruncate for shared mem. objects on FreeBSDsghctoma
FreeBSD does not allow to use posix_fallocate on shared memory objects.
2018-10-28util: use shm_open for in-memory filesemersion
shm_open is a POSIX function creating an in-memory file. Using it simplifies the code and removes the dependency on XDG_RUNTIME_DIR. The only downside is that we need to generate a random name for the shm file.
2018-09-18Fix implicit conversion of floats to ints in calls to ↵Las
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-18Implement pointer-constraints protocol in wlroots and rootstonLas
2018-09-01Add function wlr_log_get_verbosity()random human
Returns the verbosity passed to wlr_log_init().
2018-07-21util: include config in os-compatibility.cemersion
2018-07-21Use posix_fallocate when availableemersion
2018-07-14Another round of feedback from acrisciMarkus Ongyerth
2018-07-09util: add wlr_ prefix to log symbolsemersion
2018-06-30util/create_tmpfile: set restrictive umask for these filesDominique Martinet
Even if the file is removed right away, a race with someone using inotify is definitely possible, so play safe and restrict umask for our tmpfiles Found through static analysis.
2018-04-25Remove wlr_ prefix from local symbolsemersion
2018-03-26Fix damage tracking for rotated surfacesemersion
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-02-21Rename _strip_path to wlr_strip_pathGuido Günther
since it's a public function
2018-02-19Revert "ELF Visibility"Drew DeVault
2018-02-19Explicitly export EFL symbolsScott Anderson
2018-02-12Reformat all #include directivesemersion
2018-02-12Make wlr_signal_emit_safe privateemersion
2018-02-12Add wlr_signal_emit_safeemersion
2018-01-30rootston: fix urxvt damage on HiDPI outputsemersion
util/region: add wlr_region_expand
2018-01-26Damage tracking for transformed outputsemersion
2018-01-25rootston: damage tracking scale supportemersion
2017-12-31Allow configurable verbosityCalvin Lee
2017-11-30Moved os-compatibility and added headerMoritz
* Moved os-compatibility.c to util * Added header under util * Removed static since it isn't needed (i think so) * Adjusted meson.build to include lib_wlr Improved some codestyle * Added guard to os-compatibility.h * Fixed typo in include statment Adjusted Guard * Changed guard to _WLR_UTIL_OS_COMPATIBILITY
2017-10-21Rename remaining refs to wlr_listDrew DeVault
2017-10-11Add FreeBSD compatibilityGreg V
2017-08-30Refactor meson build filesTony Crisci
Use tabs for indentation and break up function calls over 80 col.
2017-08-16Prevent alloc errors from crashing in `list_t`Calvin Lee
This commit changes the `list_t` api so that alloc errors can be detected and worked around. Also fixes errors not found in 5cc7342
2017-08-15Merge pull request #88 from 4e554c4c/alloc_crashingDrew DeVault
Prevent alloc errors from crashing
2017-08-15Prevent alloc errors from crashingCalvin Lee
Resolves #76
2017-08-14Fix style issuesnyorain
2017-08-13Fix #64Drew DeVault
2017-08-11Refactor meson and move xdg-shell into wlrootsDrew DeVault
2017-08-05Use meson build systemnyorain
2017-08-02Fix #40Drew DeVault