summaryrefslogtreecommitdiff
path: root/swaybar
AgeCommit message (Collapse)AuthorLines
2020-01-03swaybar: Fix input device removalFurkan Sahin-8/+10
Before swaybar would exit with a protocol error when a pointer or touch device was removed.
2019-12-29Fix typo in swaybar-protocol.7.scdFurkan Sahin-0/+1
2019-12-27parse_color: return success + drop fallback colorFurkan Sahin-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 typosFurkan Sahin-1/+1
2019-10-23swaybar: fix typo in the loop over pixmapsFurkan Sahin-1/+1
Fixes #4665.
2019-06-08swaybar: do not retry search for tray iconsFurkan Sahin-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-09swaybar: make status block text render in the same way as othersFurkan Sahin-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-02swaybar: complete barconfig_update event handlingFurkan Sahin-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-02Add icon_theme_path to find_icon() search if setFurkan Sahin-1/+7
find_icon() will search in theme appropriate subdirs.
2019-08-07Fix memory leaksFurkan Sahin-0/+1
2019-08-02Remove unused variableFurkan Sahin-3/+0
2019-06-28swaybar-protocol.7: fix block border descriptionsFurkan Sahin-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 errnoFurkan Sahin-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/SIZEFurkan Sahin-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 documentationFurkan Sahin-0/+269
This adds swaybar-protocol.7.scd documenting the swaybar status line protocol including some differences from the i3bar counterpart.
2019-04-23swaybar: add multiseat supportFurkan Sahin-53/+118
This just adds multiseat support to swaybar
2019-04-24swaybar: hide mode visibility improvementsFurkan Sahin-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_fileFurkan Sahin-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-01Add margin to short_text handling.Furkan Sahin-2/+2
Add a 3xscale margin matching other spacing in swaybar as part of short text width calculations
2019-04-01Ensure predicted position for short text handling doesn't overflow.Furkan Sahin-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-03-22Implement handling of short_text field of i3 input protocol.Furkan Sahin-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 readableFurkan Sahin-0/+3
2019-03-13swaybar: fix loading of malformed icon themeFurkan Sahin-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_themesFurkan Sahin-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-01-17stringop.c: remove unused functionsFurkan Sahin-9/+38
The only use of `join_list` in swaybar/tray/icon.c has been rewritten.
2019-02-28tray: fix pixmap colorsFurkan Sahin-1/+7
by converting from network byte order to host byte order
2019-02-23swaybar: add overlay mode (fix #1620)Furkan Sahin-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-17swaybar: cycle workspaces on touch dragFurkan Sahin-37/+56
2019-02-17swaybar: process hotspots on touch tapFurkan Sahin-15/+124
2019-02-16tray: fix memory leaksFurkan Sahin-3/+7
2019-02-16tray: when a service is lost, remove all matching itemsFurkan Sahin-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 floatingFurkan Sahin-3/+3
Counter-intuitively, `sd_bus_slot_set_floating` expects 0 to set it to floating.
2019-02-14swaybar: prevent signal handler from firing during terminationFurkan Sahin-12/+8
This prevents a heap-use-after-free crash when sway terminates.
2019-02-03Merge pull request #3551 from c-edw/RevertDoubleFrees1.0-rc1Furkan Sahin-3/+0
Revert double frees.
2019-02-01Fix #3445: swaybar tray inerited thems not processedFurkan Sahin-1/+1
2019-02-01Revert "More frees."Furkan Sahin-2/+0
This reverts commit 99b819f3d7f5b0a387a2c68548cafaf882f323f3.
2019-02-01Revert "Add some missing frees."Furkan Sahin-1/+0
This reverts commit 55bd791aff05c961aa508606a00f1b8c6302dd4b.
2019-01-31Rebase #1636 against current masterFurkan Sahin-1/+8
2019-01-23Make json-c include respect pkg-config --cflagsFurkan Sahin-3/+3
json-c.pc contains `Cflags: -I${includedir}/json-c`, so `<json-c/json.h>` won't be found unless the parent directory is searched by default.
2019-01-23Merge pull request #3500 from progandy/validate_pixmapsFurkan Sahin-7/+18
swaybar: fix crash with some tray icon pixmaps
2019-01-23Fix tray icon updatesFurkan Sahin-0/+3
Apparently, IconThemePath needs to be reread on NewIcon signal. This fixes tray icon updates in electron apps with libappindicator-gtk3.
2019-01-22swaybar: fix crash with some tray icon pixmapsFurkan Sahin-7/+18
Discard pixmaps for icons where width and height are 0 or not equal. Fixes #3487
2019-01-22swaybar: fix command malloc in workspace commandFurkan Sahin-1/+1
This fixes a typo on the malloc line in ipc_send_workspace_command. The plus one to the size for the null-terminator was outside of the malloc call, which was causing the incorrect pointer to be freed later in the function.
2019-01-22swaybar: fix workspace commandFurkan Sahin-4/+21
Escape quotes and backslashes, allowing switching to workspace names like "1" (including quotes) and \
2019-01-22Fix dead stores found by scan-buildFurkan Sahin-1/+1
In addition to removing unused code, two minor problems are fixed: (1) `resize set` and `resize adjust` did not error when given too many arguments. (2) `orientation` was incorrectly overridden to be 'U' for scroll events in the swaybar tray `handle_click` function.
2019-01-22util.c: remove numlen functionFurkan Sahin-5/+6
Its uses have been replaced by snprintf, which is more in line with its usage.
2019-01-21Removed unused wlroots dependency for sway(bg|bar|msg|nag)Furkan Sahin-2/+1
Also remove direct libm dependency where unused.
2019-01-21swaybar: fix setting floating watcher slotsFurkan Sahin-2/+2
2019-01-20Replace wlr_log with sway_logFurkan Sahin-91/+88
This commit mostly duplicates the wlr_log functions, although with a sway_* prefix. (This is very similar to PR #2009.) However, the logging function no longer needs to be replaceable, so sway_log_init's second argument is used to set the exit callback for sway_abort. wlr_log_init is still invoked in sway/main.c This commit makes it easier to remove the wlroots dependency for the helper programs swaymsg, swaybg, swaybar, and swaynag.
2019-01-18Fix memory leaks in swaybarFurkan Sahin-1/+8