Commit graph

70 commits

Author SHA1 Message Date
Ian Fan d093c3ac55 swaybar: handle SNI signals better
This fixes a crash caused by callbacks not matching the right sender,
and frees old values later, before they are re-assigned.
2019-01-08 12:18:59 +00:00
Ian Fan 9e31f5d79c swaybar: use KDE's SNI IconThemePath property 2018-12-31 20:40:18 +00:00
Ian Fan f33b5c5223 swaybar: do not create tray if hidden 2018-12-31 20:40:18 +00:00
Ian Fan 2fd41fe9c8 swaybar: set bar dirty on SNI event 2018-12-31 20:40:18 +00:00
Ian Fan 6becde0246 swaybar: implement mouse events for tray 2018-12-31 20:40:18 +00:00
Ian Fan fa2c5282c1 swaybar: implement tray rendering 2018-12-31 20:40:18 +00:00
Ian Fan 6b03c68775 swaybar: implement tray config 2018-12-31 20:40:18 +00:00
Ian Fan 74655f835a swaybar: add StatusNotifierItem to tray 2018-12-31 20:40:18 +00:00
Ian Fan e6cb55e2f8 swaybar: add StatusNotifierHost to tray 2018-12-31 20:40:18 +00:00
Ian Fan 746600e6ed swaybar: implement icon themes and lookup for tray 2018-12-31 20:40:18 +00:00
Ian Fan 02df3f67aa swaybar: add StatusNotifierWatcher to tray 2018-12-31 20:40:18 +00:00
Ian Fan 5f65f33989 swaybar: add tray interface 2018-12-31 20:40:18 +00:00
Ian Fan 598e950296 swaybar: remove old tray implementation 2018-12-31 20:40:18 +00:00
Brian Ashworth 35a82a8693 swaybar: fix cursor scale
This fixes a few issues with swaybar's cursor scaling:
1. The cursor scale is now changed when the output scale changes
2. The cursor scale is no longer bound by the max output scale when
swaybar is launched
3. Related to the previous item, the cursor is no longer tiny on low
scale outputs after the max output scale has changed

This also bumps up `wl_compositor` to version 4 to allow usage of
`wl_surface_damage_buffer`.
2018-12-15 09:26:50 +01:00
Hristo Venev 24e8ba048a Add relative coordinates in JSON for i3bar click events
Compatibility with i3 commit 161db6f17d734ac9deb0a20e81b78d4b2a92ce68.
2018-12-04 12:49:21 +02:00
Brian Ashworth 1bd8463481 Implement bar gaps
Adds the bar subcommand `gaps <amount>|<horizontal> <vertical>|<top>
<right> <bottom> <left>` to set gaps for swaybar. Due to restrictions on
margins for a layer_surface, only the sides that are anchored to an edge
of the screen can have gaps. Since there is support for per-side outer
gaps for workspaces, those should be able to be used instead for the
last side.
2018-11-28 11:24:14 -05:00
Connor E 4bd46fb079 Implement strip_workspace_name. 2018-11-17 16:11:28 +00:00
Ian Fan 499150a91b swaybar: separate input code to new file 2018-10-18 14:19:00 +01:00
Ryan Dwyer c6f153d8f9 Event loop: Fix memmove and remove extraneous declaration 2018-10-15 00:26:27 +10:00
Ryan Dwyer 6921fdc6d6 Remove timerfd from loop implementation
timerfd doesn't work on the BSDs, so this replaces it with a timespec
for the expiry and uses a poll timeout to check the timers when needed.
2018-10-15 00:26:27 +10:00
Ryan Dwyer 4056c09e13 Move swaybar's event loop to common directory and refactor
* The loop functions are now prefixed with `loop_`.
* It is now easy to add timers to the loop.
* Timers are implemented using pollfd and timerfd, rather than manually
checking them when any other event happens to arrive.
2018-10-15 00:26:27 +10:00
Ian Fan a29ee77411 swaybar: send signal to status when hiding or showing bar 2018-10-14 13:33:12 +01:00
Ian Fan f6f72cb949 swaybar: show hidden bar on urgency 2018-10-14 13:33:12 +01:00
Ian Fan 2f1fd80726 swaybar: show hidden bar on key event
Since wayland does not currently allow swaybar to create global
keybinds, this is handled within sway and sent to the bar using a custom
event, so as not to pollute existing events, called bar_state_update.
2018-10-14 13:33:12 +01:00
Ian Fan bcc61e5147 swaybar: handle mode/hidden_state changes
As well as adding the hidden_state property to the bar config struct,
this commit handles barconfig_update events when the mode or
hidden_state changes, and uses a new function determine_bar_visibility
to hide or show the bar as required, using, respectively,
destroy_layer_surface, which is also newly added, and add_layer_surface,
which has been changed to allow dynamically adding the surface.
2018-10-14 13:33:12 +01:00
Ian Fan fed11d1c7b swaybar: move mode & mode_pango_markup to bar struct
This distinguishes the binding mode from the distinct config mode, as
well as removing mode_pango_markup from the config struct where it
should not be present.
2018-10-14 13:33:12 +01:00
Ian Fan 19f0bf3864 swaybar: add free_hotspots helper function 2018-10-14 13:33:12 +01:00
Ian Fan 18eaf45224 swaybar: annotate wl_list properties in definitions 2018-10-14 13:33:12 +01:00
Ian Fan d0b54e932b swaybar: save id upon startup
This adds an id property to the bar, which will be used to filter
barconfig_update events
2018-10-14 13:33:12 +01:00
Brian Ashworth 1c969e86f5 Implement bar bindsym 2018-10-09 08:12:46 -04:00
Ian Fan 65593f49bc swaybar: add leading comma to click event JSON 2018-10-02 14:05:51 +01:00
Arkadiusz Hiler 1e70f7b19e Turn funcs() into funcs(void)
If they really do not take undefined number of arguments.
2018-09-30 14:09:05 +03:00
Arkadiusz Hiler d8200012fb Remove declarations that do no have definitions
There is a couple of leftover header files/declarations, which were
fronting implementations that are long gone.

Let's get rid of them.
2018-09-30 14:09:05 +03:00
Ian Fan 02dfeea54c swaybar: synchronize rendering to output frames 2018-09-30 10:07:33 +01:00
Ian Fan 751bb4a376 swaybar: move i3bar definitions into separate file 2018-09-28 13:54:58 +01:00
Ian Fan bcd2a8fe12 swaybar: remove unused focused_output property 2018-09-28 13:54:58 +01:00
Ian Fan 312d009f65 swaybar: fail if bar id is invalid 2018-09-28 13:48:59 +01:00
Geoff Greer c495164f60 swaybar, swaylock, & tree/container: Set cairo font options to render text and lines with subpixel hinting (if available). 2018-09-22 11:34:21 -07:00
Ian Fan 7882ac66ef swaybar: rewrite i3bar protocol handling
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-18 11:36:33 +01:00
Ian Fan 70245c2cd5 swaybar: rewrite text protocol handling
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-18 11:36:33 +01:00
Ian Fan 9932c6a1f1 swaybar: fix empty function prototypes 2018-09-18 11:36:33 +01:00
emersion 012df55be5 swaybar: use output names instead of output indexes 2018-09-17 16:04:09 +02:00
Ian Fan 2eaef80206 i3bar: count references to blocks
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-12 08:28:28 +01:00
minus bfcfabee2b swaybar: Fix scroll handling on workspace buttons
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-19 21:15:01 +02:00
Peter Rice 79a998849b make hotspot callback take an x11 button id 2018-07-16 18:55:04 -04:00
emersion aa36899d8a
Fix a bunch of swaybar memory leaks 2018-04-24 22:28:55 +01:00
Drew DeVault f242362e7e Handle output removal on swaybar 2018-04-05 16:04:30 -04:00
Drew DeVault 2605950769 Add hidpi support to swaybar 2018-04-03 21:06:28 -04:00
Drew DeVault 0cbd2a4f49 Send click events for i3bar blocks 2018-04-02 11:09:23 -04:00
Drew DeVault 333dbcbe72 Render i3bar blocks 2018-04-02 11:09:23 -04:00