aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar
Commit message (Collapse)AuthorAge
* swaybar: log Wayland display errorsLibravatar Simon Ser2021-07-26
|
* swaybar: exit cleanly when disconnected from IPCLibravatar Simon Ser2021-07-26
|
* cairo: Replace <cairo/cairo.h> by <cairo.h>Libravatar Issam E. Maghni2021-05-10
| | | | | | | For full context, read https://gitlab.freedesktop.org/cairo/cairo/-/issues/479 TL;DR, cairo’s pc file adds `/cairo` to CFLAGS. So namespace cairo shouldn’t be used.
* swaybar: fail gracefully on tokener creation failLibravatar Tudor Brindus2021-03-22
| | | | | | | | | | | | | | | This commit adds missing error-handling to the creation of the tokener instance. The stack depth parameter is used to initialize an array that json-c prefaults ahead of time, causing INT_MAX to result in out of memory errors. Also drop the depth to 256 to prevent this OOM. Though this fix is not very satisfactory -- json-c could be made to not prefault -- it should do for now. At the very least, swaybar will not crash. Fixes #6126.
* swaybar: use INT_MAX max JSON depth when parsing IPC responseLibravatar Tudor Brindus2021-03-21
| | | | | | | | There's no inherent limit on the nesting Sway can generate, and the default used by `json_tokener_new`, 32, can plausibly be hit during regular usage. Fixes #6115.
* swaybar: Use position from wl_pointer.enterLibravatar Kenny Levinsen2021-03-20
| | | | | | | | | | | | Only wl_pointer.motion was used to update pointer position, which would cause issues if the pointer was not moved prior to wl_pointer.button. This also fixes touch input through wl_pointer emulation, which fires wl_pointer.button immediately after wl_pointer.enter. Copied from a similar fix made to swaynag. Closes: https://github.com/swaywm/sway/issues/6109
* swaybar: silence missing IconThemePath messageLibravatar Pi-Yueh Chuang2021-03-17
| | | | | | | | | | IconThemePath is not a standard property in XDG's StatusNotifierItem specification, so missing this property should not be logged as an error. This patch changes the log level to SWAY_DEBUG when swaybar queries the value of IconThemePath so that swaybar won't log the returned message as an error if IconThemePath does not exist. Closes: https://github.com/swaywm/sway/issues/6092
* swaybar: use text subpixel antialias only where it would look goodLibravatar Fenveireth2021-03-07
| | | | | | | | | | | | | | | | | | | | | Closes #5605 Text Subpixel antialiasing is : - FreeType makes glyph bitmaps containing coverage percentage for each subpixel, instead of pixel - Then draw by performing the blend for each subpixel, instead of pixel (e.g. dual-source blending in opengl) And there's only one Alpha channel, so this extra coverage data can't leave Cairo to reach the compositor through there. Therefore, it can't work as intended if output text alpha != bar background alpha. Disable it for those cases, enable it elsewhere As for color emojis, they are RGBA bitmaps. If drawn with text alpha=1.0 and background alpha=1.0 (should be completely opaque bar), then with 'CAIRO_OPERATOR_SOURCE' then texels with alpha < 1.0 result in a blend with whatever's behind the bar, instead of the bar background
* Make command line option lists constLibravatar Manuel Stoeckl2021-02-04
|
* Make Wayland request listeners static const when possibleLibravatar Manuel Stoeckl2021-02-04
|
* Changed fprintf(stdout,...) to printf(...) for more readable codeLibravatar SpizzyCoder2021-01-16
|
* Fix #5940Libravatar Mukundan3142021-01-11
| | | | Fallback to focused_statusline instead of statusline on focused output
* man: update maintainerLibravatar Simon Ser2021-01-08
| | | | | Also remove the AUTHORS section from swaybar-protocol(7), for consistency with the rest of the man pages.
* build: introduce sd-bus-provider optionLibravatar Simon Ser2020-12-09
| | | | This allows to select a specific provider for the sd-bus library.
* swaybar: don't expand separator_block_width if separator is falseLibravatar Ludvig Michaelsson2020-10-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | When swaybar receives the following JSON body [ { "full_text": "foo", "separator": false, "separator_block_width": 0 }, { "full_text": "bar" } ] it should not draw any separator or any space between the two blocks. However, since swaybar calculates that separator_block_width 0 is too small to fit any configured separator, it will override the separator_block_width with some non-zero value. This patch changes that such that the necessary separator_block_width is only expanded if the block has 'separator: true'. This should be in line to what i3 does, as its documentation of the i3bar protocol for separator states that "[...] if you disable the separator line, there will still be a gap after the block, unless you also use separator_block_width".
* Add support for workspace_min_width bar option.Libravatar Tarmack2020-10-11
|
* Document required '\n' in swaybar-protocolLibravatar Hubert Hirtz2020-08-04
| | | | | | | | | | | | | | | The following statusbar output is not considered by sway to be following the swaybar-protocol: {"version":1}[[{"full_text":"2.89","urgent":false}], However this one is: {"version":1}\n[[{"full_text":"2.89","urgent":false}], Both outputs contain a header with the required values and an unfinished array of objects with the required values, but the first one is showed verbatim.
* swaybar: allow status line cleanup to proceed when hiddenLibravatar Charmander2020-07-22
| | | | | | | | | | `determine_bar_visibility` stops and starts the status command process according to the bar’s visibility. If the bar was hidden during teardown, teardown would stall while waiting for the stopped status command process to exit. This resumes a stopped status command during teardown and allows, for example, sway to reload or quit without leaving a swaybar instance behind each time. Fixes #5536. CONT before TERM as requested in review.
* swaybar: ensure correct init order for status_lineLibravatar Luke Drummond2020-06-12
| | | | | | | | | | | | | `$WAYLAND_SOCKET` is unset by `wl_display_connect` after it has successfully connected to the wayland socket. However, subprocesses spawned by swaybar (status-command) don't have access to waybar's fds as $WAYLAND_SOCKET is O_CLOEXEC. This means any status command which itself tries to connect to wayland will fail if this environment variable is set. Reorder display and status-command initialization so that this variable is not set and add an assert so we can enforce this invariant in future.
* swaybar: add NULL check when listing workspacesLibravatar Milkey Mouse2020-05-20
| | | | | | | | | | | | For some reason my version of sway doesn't show workspace names: $ swaymsg -t get_outputs Output HDMI-A-1 '(null) (null) (null)' (inactive) Output HDMI-A-2 '(null) (null) (null)' (inactive) Which is weird, but it's no reason to crash swaybar. The field is totally missing from the JSON, so it ends up doing strcmp(NULL, name) which is undefined behavior.
* Fix typo in swaybar-protocol.7.scdLibravatar James Mills2020-04-30
|
* swaybar: Fix scrolling with precise trackpadsLibravatar Martin Dørum2020-04-28
|
* interpret "subpixel none" as CAIRO_ANTIALIAS_GRAYLibravatar Ian Huang2020-04-20
| | | | | | | | See issue #5228. Currently, WL_OUTPUT_SUBPIXEL_NONE is ignored and CAIRO_ANTIALIAS_SUBPIXEL is still set. This commit checks if subpixel is set to none and if so, calls set_antialias with CAIRO_ANTIALIAS_GRAY. This mirrors the functionality in Mako's [PR261](https://github.com/emersion/mako/pull/261)
* tray: track SNI callbacksLibravatar Ian Fan2020-03-30
| | | | | | This removes any pending messages once the item is destroyed. Furthermore, this installs SNI event calbacks asynchronously in order to prevent sd-bus from bypassing pending messages.
* tray: tidy codeLibravatar Ian Fan2020-03-30
| | | | This includes some refactoring and fixing a small memory leak.
* tray: allow themes to inherit from multiple themesLibravatar Ian Fan2020-03-30
|
* tray: better errors when parsing index.themeLibravatar Ian Fan2020-03-30
|
* swaybar: fix memory leaksLibravatar Ian Fan2020-03-30
|
* Only destroy swaybar surface via ipc when neededLibravatar Bill Doyle2020-02-27
|
* swaybar: fix i3bar relative coordinates when scaling is usedLibravatar Hristo Venev2020-02-10
| | | | | | | | | | | | 24e8ba048aef4751c6fa1d5982ee634f921e6cf6 did not take scaling into account. The hotspot size used pixel coordinates, the absolute coordinates were logical, and the relative coordinates were completely wrong. This commit makes all coordinates use logical values. If `"float_event_coords":true` is sent in the handshake message, coordinates are sent as floating-point values. The "scale" field is an integer containing the scale value.
* Do not truncate pointer coordinates to int.Libravatar Hristo Venev2020-02-10
| | | | This increases the precision of the clicks when using i3bar.
* Avoid calling strcmp on nullptrLibravatar Till Hofmann2020-02-10
| | | | | | | The function group_handler may get a nullptr as `new_group`. If that's the case, return true, as if `new_group` was the empty string. Also make the conversion to bool explicit when calling `strcmp`.
* swaybar: Fix input device removalLibravatar Andri Yngvason2020-01-05
| | | | | Before swaybar would exit with a protocol error when a pointer or touch device was removed.
* Fix typo in swaybar-protocol.7.scdLibravatar Whemoon Jang2019-12-28
|
* 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.
* Amend typosLibravatar Jason2019-11-23
|
* swaybar: fix typo in the loop over pixmapsLibravatar Konstantin Pospelov2019-10-23
| | | | Fixes #4665.
* swaybar: do not retry search for tray iconsLibravatar Konstantin Pospelov2019-10-21
| | | | | | | | | In case a tray icon cannot be found or does not have a desirable size, swaybar retries the search again and again, which increases load on disk and CPU. This commit solves it by storing target_size for each icon, so that swaybar does not search for an icon of some size if it already tried to. Fixes #3789.
* swaybar: make status block text render in the same way as othersLibravatar xdavidwu2019-09-20
| | | | | | Other components like workspace button, status line (error or plain text) already render text at integer coords. This make status block also render text at integer coords.
* swaybar: complete barconfig_update event handlingLibravatar Brian Ashworth2019-09-04
| | | | | | | | This adds complete support for the barconfig_update ipc event. This also changes the bar command and subcommand handlers to correctly emit the event. This makes it so all bar subcommands other than id and swaybar_command are dynamically changeable at runtime. sway-bar.5 has been updated accordingly
* Add icon_theme_path to find_icon() search if setLibravatar Ben Brown2019-09-04
| | | | find_icon() will search in theme appropriate subdirs.
* Fix memory leaksLibravatar Antonin Décimo2019-08-12
|
* Remove unused variableLibravatar Antonin Décimo2019-08-02
|
* swaybar-protocol.7: fix block border descriptionsLibravatar Brian Ashworth2019-06-28
| | | | | | | This corrects the description of border_{top,bottom,left,right} in the block properties table in swaybar-protocol.7. The values should be an integer denoting the width/height rather than a boolean denoting whether to show them.
* check for empty string before calling strtoul() and check errnoLibravatar Daniel Eklöf2019-06-05
| | | | | | Note: since strtoul() has no real error return code (both 0 and ULONG_MAX may be returned on both success and failure), set errno=0 before calling strtoul().
* swaybar/nag: use xcursor theme defined by XCURSOR_THEME/SIZELibravatar Daniel Eklöf2019-06-05
| | | | | | | | If the XCURSOR_THEME and/or XCURSOR_SIZE environment variables are set, use the theme and size they define. If they're not set, use the same defaults as before (system default theme, size=24).
* Add swaybar protocol documentationLibravatar Brian Ashworth2019-05-30
| | | | | This adds swaybar-protocol.7.scd documenting the swaybar status line protocol including some differences from the i3bar counterpart.
* swaybar: add multiseat supportLibravatar Brian Ashworth2019-04-24
| | | | This just adds multiseat support to swaybar
* swaybar: hide mode visibility improvementsLibravatar Brian Ashworth2019-04-24
| | | | | | | | | | | | This allows swaybar to become visible when the mode changes (to any mode other than the default). swaybar will be hidden again when the modifier is pressed and released or when switching back to the default mode. This also applies the same logic to visible by urgency to hide swaybar when the modifier is pressed and released. These changes are to match i3's behavior.
* Validate icon_struct in read_theme_fileLibravatar Maxime “pep” Buquet2019-04-20
| | | | | | | | | | The read_theme_file function used to return an invalid icon_struct in some cases, for example when an empty index.theme file was read. This makes sure the struct we're returning is always valid as per the Icon Theme specification. Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>