aboutsummaryrefslogtreecommitdiff
path: root/swaybar
AgeCommit message (Collapse)AuthorLines
2020-04-30Fix typo in swaybar-protocol.7.scdJames Mills-2/+2
2020-04-28swaybar: Fix scrolling with precise trackpadsMartin Dørum-12/+80
2020-04-20interpret "subpixel none" as CAIRO_ANTIALIAS_GRAYIan Huang-2/+7
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)
2020-03-30tray: track SNI callbacksIan Fan-28/+37
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.
2020-03-30tray: tidy codeIan Fan-20/+10
This includes some refactoring and fixing a small memory leak.
2020-03-30tray: allow themes to inherit from multiple themesIan Fan-4/+9
2020-03-30tray: better errors when parsing index.themeIan Fan-60/+90
2020-03-30swaybar: fix memory leaksIan Fan-1/+4
2020-02-27Only destroy swaybar surface via ipc when neededBill Doyle-1/+3
2020-02-10swaybar: fix i3bar relative coordinates when scaling is usedHristo Venev-35/+47
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.
2020-02-10Do not truncate pointer coordinates to int.Hristo Venev-2/+2
This increases the precision of the clicks when using i3bar.
2020-02-10Avoid calling strcmp on nullptrTill Hofmann-1/+4
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`.
2020-01-05swaybar: Fix input device removalAndri Yngvason-8/+10
Before swaybar would exit with a protocol error when a pointer or touch device was removed.
2019-12-28Fix typo in swaybar-protocol.7.scdWhemoon Jang-0/+1
2019-12-28parse_color: return success + drop fallback colorBrian Ashworth-119/+50
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.
2019-11-23Amend typosJason-1/+1
2019-10-23swaybar: fix typo in the loop over pixmapsKonstantin Pospelov-1/+1
Fixes #4665.
2019-10-21swaybar: do not retry search for tray iconsKonstantin Pospelov-52/+61
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.
2019-09-20swaybar: make status block text render in the same way as othersxdavidwu-2/+4
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.
2019-09-04swaybar: complete barconfig_update event handlingBrian Ashworth-172/+237
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
2019-09-04Add icon_theme_path to find_icon() search if setBen Brown-1/+7
find_icon() will search in theme appropriate subdirs.
2019-08-12Fix memory leaksAntonin Décimo-0/+1
2019-08-02Remove unused variableAntonin Décimo-3/+0
2019-06-28swaybar-protocol.7: fix block border descriptionsBrian Ashworth-5/+4
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.
2019-06-05check for empty string before calling strtoul() and check errnoDaniel Eklöf-2/+3
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().
2019-06-05swaybar/nag: use xcursor theme defined by XCURSOR_THEME/SIZEDaniel Eklöf-2/+12
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).
2019-05-30Add swaybar protocol documentationBrian Ashworth-0/+269
This adds swaybar-protocol.7.scd documenting the swaybar status line protocol including some differences from the i3bar counterpart.
2019-04-24swaybar: add multiseat supportBrian Ashworth-53/+118
This just adds multiseat support to swaybar
2019-04-24swaybar: hide mode visibility improvementsBrian Ashworth-1/+11
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.
2019-04-20Validate icon_struct in read_theme_fileMaxime “pep” Buquet-2/+6
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>
2019-04-04Add margin to short_text handling.Dmitri Kourennyi-2/+2
Add a 3xscale margin matching other spacing in swaybar as part of short text width calculations
2019-04-04Ensure predicted position for short text handling doesn't overflow.Dmitri Kourennyi-2/+3
- Predicted status line can be negative, so corresponding variables should not be unsigned. Changed to double as position is actually calculated as double.
2019-04-04Implement handling of short_text field of i3 input protocol.Dmitri Kourennyi-4/+170
Matches i3bar behavior of setting all blocks to use the short_text if the full text width does not fit.
2019-03-30Fix a crash in swaybar when an icon dir is not readableAlex Maese-0/+3
2019-03-13swaybar: fix loading of malformed icon themeStephan Hilb-0/+4
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.
2019-03-11Fix size_t temporary underflow in log_loaded_themesemersion-3/+3
`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
2019-03-11stringop.c: remove unused functionsIan Fan-9/+38
The only use of `join_list` in swaybar/tray/icon.c has been rewritten.
2019-02-28tray: fix pixmap colorsIan Fan-1/+7
by converting from network byte order to host byte order
2019-02-24swaybar: add overlay mode (fix #1620)Milkey Mouse-2/+14
Overlay mode puts the bar above normal windows and passes through/ignores any touch/mouse/keyboard events that would be sent to it.
2019-02-23swaybar: cycle workspaces on touch dragDrew DeVault-37/+56
2019-02-23swaybar: process hotspots on touch tapDrew DeVault-15/+124
2019-02-16tray: fix memory leaksIan Fan-3/+7
2019-02-16tray: when a service is lost, remove all matching itemsIan Fan-13/+14
Before, only the first matching item would be removed, which could leave stale items.
2019-02-15tray: use correct parameter to set bus slot to floatingIan Fan-3/+3
Counter-intuitively, `sd_bus_slot_set_floating` expects 0 to set it to floating.
2019-02-15swaybar: prevent signal handler from firing during terminationIan Fan-12/+8
This prevents a heap-use-after-free crash when sway terminates.
2019-02-03Merge pull request #3551 from c-edw/RevertDoubleFrees1.0-rc1Drew DeVault-3/+0
Revert double frees.
2019-02-01Fix #3445: swaybar tray inerited thems not processedStefan Schick-1/+1
2019-02-01Revert "More frees."Connor E-2/+0
This reverts commit eda1bf769f239a9e8d5a9907255a330e3113a649.
2019-02-01Revert "Add some missing frees."Connor E-1/+0
This reverts commit b5d95f264d5b08f6228e05be680ee36fc06ca6d6.
2019-01-31Rebase #1636 against current masterv44r-1/+8