aboutsummaryrefslogtreecommitdiffstats
path: root/include/util.h
Commit message (Collapse)AuthorAge
* moved and renamed movement-unit parsing to commonLibravatar Nils Schulte2020-07-21
|
* common/util: fix `get_current_time_msec` returning microsecondsLibravatar Tudor Brindus2020-06-06
| | | | | | | | 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.c` so that it can be reused elsewhere without having to consider these pitfalls.
* cmd_client_*: refactor duplicated codeLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | | This is the second in a series of commits to refactor the color handling in sway. This removes the duplicated color parsing code in sway/commands/client.c. Additionally, this combines the parsing of colors to float arrays with that in sway/config.c and introduces a color_to_rgba function in commom/util.c. As an added bonus, this also makes it so non of the colors in a border color class will be changed unless all of the colors specified are valid. This ensures that an invalid command does not get partially applied.
* parse_color: return success + drop fallback colorLibravatar Brian Ashworth2019-12-28
| | | | | | | | | | | | This is the first in a series of commits to refactor the color handling in sway. This changes parse_color to return whether it was success and no longer uses 0xFFFFFFFF as the fallback color. This also verifies that the string actually contains a valid hexadecimal number along with the length checks. In the process of altering the calls to parse_color, I also took the opportunity to heavily refactor swaybar's ipc_parse_colors function. This allowed for several lines of duplicated code to be removed.
* Rename symbol set_cloexec to sway_set_cloexec, remove duplicates.Libravatar Sheena Artrip2019-11-01
| | | | | | | | set_cloexec is defined by both sway and wlroots (and who-knows-else), so rename the sway one for supporting static linkage. We also remove the duplicate version of this in client/. Fixes: https://github.com/swaywm/sway/issues/4677
* Spawn swaynag as a wayland clientLibravatar Brian Ashworth2019-04-14
| | | | | This spawns swaynag as a wayland client similar to how swaybar and swaybg are already done
* Add support for manually setting subpixel hinting on outputs.Libravatar Geoff Greer2019-03-24
| | | | | | Many laptop screens report unknown subpixel order. Allow users to manually set subpixel hinting to work around this. Addresses https://github.com/swaywm/sway/issues/3163
* util.c: remove numlen functionLibravatar Ian Fan2019-01-22
| | | | Its uses have been replaced by snprintf, which is more in line with its usage.
* Move sway-specific functions in common/util.c into sway/Libravatar M Stoeckl2019-01-21
| | | | | | Modifier handling functions were moved into sway/input/keyboard.c; opposite_direction for enum wlr_direction into sway/tree/output.c; and get_parent_pid into sway/tree/root.c .
* Add scroll factor config option.Libravatar Spencer Michaels2018-11-18
|
* Wrap to fartherest output when running focus outputLibravatar Ryan Dwyer2018-11-01
| | | | | Also moves the `opposite_direction` function into `util.c` as it's used in two places now.
* Revert "Add resolve_path() to utils"Libravatar madblobfish2018-10-31
| | | | This reverts commit c9694ee63d451da62dc50b234b3080a35a40e844.
* Remove enum movement_directionLibravatar Ryan Dwyer2018-10-30
| | | | | | | | | There's no point having both movement_direction and wlr_direction. This replaces the former with the latter. As movement_direction also contained MOVE_PARENT and MOVE_CHILD items, these are now checked specifically in the focus command and handled in separate functions, just like the other focus variants.
* Remove obsolete base64.c fileLibravatar Ian Fan2018-10-04
|
* Remove layout.cLibravatar Ryan Dwyer2018-08-26
| | | | | | | | | | | | | | | | | | | | | | | | | When we have type safety we'll need to have functions for workspace_add_tiling and so on. This means the existing container functions will be just for containers, so they are being moved to container.c. At this point layout.c doesn't contain much else, so I've relocated everything and removed the file. * container_swap and its static functions have been moved to the swap command and made static. * container_recursive_resize has been moved to the resize command and made static. * The following have been moved to container.c: * container_handle_fullscreen_reparent * container_insert_child * container_add_sibling * container_add_child * container_remove_child * container_replace_child * container_split * enum movement_direction and sway_dir_to_wlr have been moved to util.c. Side note: Several commands included layout.h which then included root.h. With layout.h gone, root.h has to be included by those commands.
* util.h: add missing includeLibravatar Eric Engestrom2018-07-30
| | | | parse_boolean() takes and returns a `bool`
* Remove unneeded constLibravatar Brian Ashworth2018-07-23
|
* Switch to using a function to parse booleansLibravatar Brian Ashworth2018-07-23
|
* Rework get_clipboard implementationLibravatar nyorain2017-07-07
|
* Add resolve_path() to utilsLibravatar Jerzi Kaminsky2017-04-16
|
* Removed superfluous include, causing failures if WLC headers aren't ↵Libravatar Sebastian Noack2017-03-14
| | | | installed globally
* implement solid color rendering for swaybgLibravatar Zandr Martin2016-07-30
|
* semi-working (only non-client/server wayland apps)Libravatar Zandr Martin2016-06-10
|
* Revert "s/numlen/log10/g"Libravatar Drew DeVault2016-01-23
| | | | This reverts commit 038bb8cc7c4dee77f8ee4ba3ac1ffc47409b2370.
* s/numlen/log10/gLibravatar Drew DeVault2016-01-23
|
* Add function for getting list of modifier names.Libravatar Mikkel Oscar Lyderik2016-01-08
| | | | Get an array of modifier names from modifier masks.
* Move modifier name table to common/util.cLibravatar Mikkel Oscar Lyderik2016-01-05
| | | | | Lookup of modifier names is required in several places, thus it makes sense to move it to a general place.
* Move numlen(1) to sway/util.cLibravatar Mikkel Oscar Lyderik2015-12-14
|
* added missing util.h/c stuffLibravatar minus2015-08-25
|
* refactored workspace_next/prevLibravatar minus2015-08-25