aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar
Commit message (Collapse)AuthorAge
* 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>
* Add margin to short_text handling.Libravatar Dmitri Kourennyi2019-04-04
| | | | | Add a 3xscale margin matching other spacing in swaybar as part of short text width calculations
* Ensure predicted position for short text handling doesn't overflow.Libravatar Dmitri Kourennyi2019-04-04
| | | | | | - Predicted status line can be negative, so corresponding variables should not be unsigned. Changed to double as position is actually calculated as double.
* Implement handling of short_text field of i3 input protocol.Libravatar Dmitri Kourennyi2019-04-04
| | | | | Matches i3bar behavior of setting all blocks to use the short_text if the full text width does not fit.
* Fix a crash in swaybar when an icon dir is not readableLibravatar Alex Maese2019-03-30
|
* swaybar: fix loading of malformed icon themeLibravatar Stephan Hilb2019-03-13
| | | | | | | If the icon index.theme contained a key-value pair without a preceding group header, entry_handler() would be called with a zero pointer and lead to a segfault. Set the error flag and break on such malformed files.
* Fix size_t temporary underflow in log_loaded_themesLibravatar emersion2019-03-11
| | | | | | | `len` will underflow but will overflow right after, so it's not as bad as it may appear. Still better not to under/overflow at all. Fixes https://github.com/swaywm/sway/issues/3862
* stringop.c: remove unused functionsLibravatar Ian Fan2019-03-11
| | | | The only use of `join_list` in swaybar/tray/icon.c has been rewritten.
* tray: fix pixmap colorsLibravatar Ian Fan2019-02-28
| | | | by converting from network byte order to host byte order
* swaybar: add overlay mode (fix #1620)Libravatar Milkey Mouse2019-02-24
| | | | | Overlay mode puts the bar above normal windows and passes through/ignores any touch/mouse/keyboard events that would be sent to it.
* swaybar: cycle workspaces on touch dragLibravatar Drew DeVault2019-02-23
|
* swaybar: process hotspots on touch tapLibravatar Drew DeVault2019-02-23
|
* tray: fix memory leaksLibravatar Ian Fan2019-02-16
|
* tray: when a service is lost, remove all matching itemsLibravatar Ian Fan2019-02-16
| | | | | Before, only the first matching item would be removed, which could leave stale items.
* tray: use correct parameter to set bus slot to floatingLibravatar Ian Fan2019-02-15
| | | | | Counter-intuitively, `sd_bus_slot_set_floating` expects 0 to set it to floating.
* swaybar: prevent signal handler from firing during terminationLibravatar Ian Fan2019-02-15
| | | | This prevents a heap-use-after-free crash when sway terminates.
* Merge pull request #3551 from c-edw/RevertDoubleFrees1.0-rc1Libravatar Drew DeVault2019-02-03
|\ | | | | Revert double frees.
| * Revert "More frees."Libravatar Connor E2019-02-01
| | | | | | | | This reverts commit eda1bf769f239a9e8d5a9907255a330e3113a649.
| * Revert "Add some missing frees."Libravatar Connor E2019-02-01
| | | | | | | | This reverts commit b5d95f264d5b08f6228e05be680ee36fc06ca6d6.