aboutsummaryrefslogtreecommitdiff
path: root/swaybar
AgeCommit message (Collapse)AuthorLines
2018-09-22swaybar, swaylock, & tree/container: Set cairo font options to render text ↵Geoff Greer-2/+13
and lines with subpixel hinting (if available).
2018-09-22swaybar: explicitly check return value of getdelimIan Fan-3/+7
This prevents an signed-to-unsigned conversion error on buffer_index if getdelim fails and returns -1, which caused swaybar to try to search the header for the array and immediately failing
2018-09-21Merge branch 'master' into swaybar-hotplugBrian Ashworth-3/+14
2018-09-21swaybar: log invalid i3bar jsonIan Fan-3/+12
2018-09-21swaybar: reset tokener if json is incompleteIan Fan-0/+1
If the tokener parses incomplete json, it sets its error value to json_tokener_continue. This means that extra json should be provided, but the code was providing the entire object again. In the interest of simplicity, the tokener is reset so that buffer_pos always points to the start of the current object.
2018-09-21swaybar: update buffer_pos when moving object to start of bufferIan Fan-0/+1
2018-09-20swaybar: don't wl_display_roundtrip on each frameemersion-2/+1
This was the source of numerous bugs, from hotplug events not being received to segfaults because wl_display_roundtrip was making the bar process unplug events while blocking in an iteration over all outputs.
2018-09-20swaybar: handle hotpluggingemersion-41/+73
Don't kill and respawn swaybars on hotplug.
2018-09-18swaybar: only free tokener when using i3bar protocolIan Fan-1/+1
2018-09-18swaybar: add debugging statements for handling i3bar jsonIan Fan-0/+16
2018-09-18swaybar: rewrite i3bar protocol handlingIan Fan-100/+122
This now correctly handles an incoming json infinite array by shifting most of the heavy listing to the json-c parser, as well as sending multiple statuses at once. It also removes the struct i3bar_protocol_state and moves its members into the status_line struct, allowing the same buffer to be used for both protocols.
2018-09-18swaybar: rewrite protocol determinationIan Fan-31/+33
This now uses the getline function to receive the header, replacing read_line_buffer, which has been deleted since it is otherwise unused. Furthermore, once the protocol has been determined, the current status is handled immediately to be shown (though this has not been added for the i3bar protocol since it has not yet been rewritten to handle this).
2018-09-18swaybar: rewrite text protocol handlingIan Fan-16/+24
This now uses getline to correctly handle multiple or long statuses. It also removes the struct text_protocol_state and moves its members into the status_line struct.
2018-09-18swaybar: only create i3bar block hotspot if click events are enabledIan Fan-13/+15
2018-09-18swaybar: send trailing comma with click event jsonIan Fan-1/+1
2018-09-18swaybar: fix empty function prototypesIan Fan-2/+2
2018-09-18swaybar: invalidate file descriptors upon closingIan Fan-4/+15
2018-09-18swaybar: remove block links upon exitIan Fan-1/+3
2018-09-17swaybar: use output names instead of output indexesemersion-29/+74
2018-09-14bar: remove i3bar_block_free in favour of i3bar_block_unrefIan Fan-12/+9
2018-09-12i3bar: count references to blocksIan Fan-5/+17
This prevents blocks from being destroyed before their hotspots are destroyed, in case it is used for a pending click event that fires between the bar receiving a new status, which destroys the block, and the bar rendering the new status, which destroys the hotspot; this problem can be easily produced by scrolling on a block that immediately causes a new status to be sent, with multiple outputs
2018-09-08Align titles to baselineRyan Dwyer-7/+7
This does the following: * Adds a baseline argument to get_text_size (the baseline is the distance from the top of the texture to the baseline). * Stores the baseline in the container when calculating the title height. * Takes the baseline into account when calculating the config's max font height. * When rendering, pads the textures according to the baseline so they line up.
2018-09-05Fix swaybar block background fill logicJason-1/+1
Same as #2571 but for 1.0.
2018-09-03Change _XOPEN_SOURCE defines to _POSIX_C_SOURCEsghctoma-1/+1
2018-08-30Fix feature macros for FreeBSDsghctoma-1/+1
On FreeBSD, snprintf and vsnprintf are visible only if _XOPEN_SOURCE >= 600.
2018-07-19swaybar: Fix scroll handling on workspace buttonsminus-10/+19
As well as ignoring scroll events on status elements when click_events is enabled. Previously, using the scroll wheel on a workspace button would switch to that workspace instead of scrolling through them. Clicks and scrolling on status elements would always be processed by swaybar, too. So in case you were using scrolling as volume control on a status item, swaybar would additionally scroll through your workspaces.
2018-07-18Merge pull request #2281 from pvsr/X11_clickemersion-4/+49
Send clicks to swaybar blocks as X11 button ids
2018-07-17remove unnecessary parensPeter Rice-5/+5
2018-07-16send scroll events to swaybar blocksPeter Rice-0/+15
2018-07-16make hotspot callback take an x11 button idPeter Rice-4/+34
2018-07-17swaybar: Read urgent colors from IPCRyan Dwyer-0/+12
2018-07-14swaybar/bg: Fix crash on DPMS offminus-0/+3
When turning off displays via DPMS, swaybar and swaybg still tried to render, but did not get a valid buffer, causing them to crash.
2018-07-09Update for swaywm/wlroots#1126emersion-12/+12
2018-07-06Fix swaybar teardown when workspace buttons hiddenBrian Ashworth-1/+1
2018-07-05Implement mode --pango_markupBrian Ashworth-2/+3
2018-05-09Swaybar: Respect pango_markup configRyan Dwyer-4/+6
Makes swaybar respect the user's pango_markup configuration in the workspace buttons and binding mode indicator.
2018-05-06Revert "Install swaybar and swaybg under /usr/lib/sway"Rostislav Pehlivanov-2/+1
This reverts commit f2c209c299889ad965ac995049704b1c46176c6d.
2018-05-06Revert "Make the LIBDIR path configurable"Rostislav Pehlivanov-1/+1
This reverts commit 1670b46bf6e56d37e69ab0fa32c6799e83397020.
2018-05-06Revert "Meson: Replace option `instlibdir` with `libexecdir`"Rostislav Pehlivanov-1/+1
This reverts commit 830c4ef74c00dbe448da46cdbc576178abc5728e.
2018-05-05Meson: Replace option `instlibdir` with `libexecdir`Nicolas Braud-Santoni-1/+1
Derive a value from it, called `rundir` rather than writing join_paths(libexecdir, 'sway') all over the place.
2018-05-05Make the LIBDIR path configurableNicolas Braud-Santoni-1/+1
2018-05-05Install swaybar and swaybg under /usr/lib/swayNicolas Braud-Santoni-1/+2
2018-04-24Fix a bunch of swaybar memory leaksemersion-23/+34
2018-04-24Work around maybe-uninitialized in bar.cAlex Xu (Hello71)-1/+3
Fixes #1855.
2018-04-22Fix swaybar axis event logicScott Anderson-18/+43
Uses 'visible' instead of 'focused', since we may scroll on a bar which isn't the focused output. We can't use "next_on_output" or "prev_on_output" to implement this, because it only modify the focused output. So scrolling on an unfocused output will affect the incorrect one. We just use the "workspace name" command instead.
2018-04-21Remove void * castsScott Anderson-6/+6
They're pointless.
2018-04-21Remove status command event on errorScott Anderson-1/+5
This prevents very high CPU load when the status command dies, and poll continuously awoken with POLLHUP.
2018-04-21Change remove_event logicScott Anderson-14/+23
We defer the removal of entries until after the poll loop has finished. Otherwise we may end up adjusting the poll array while we're still reading from it, causing us to skip events.
2018-04-21Always send POLLHUP and POLLERR with event loopScott Anderson-1/+4
2018-04-20Fix memory leak on swaybarBruno Pinto-0/+1
Code from @NilsBrause Ref #1820