Commit graph

74 commits

Author SHA1 Message Date
Ian Fan 4dba7c084a swaybar: when hiding bar, save old height to be restored upon reshow
Previously, when the bar was hidden, the height would be set to 0.
This meant that if the bar was empty upon reshow, it would not render
since the height was still 0, which made it seem there was a problem.
Now, the height is not reset, but the width is, to indicate upon reshow
that the layer surface needed reconfiguring.
2018-10-14 13:33:12 +01:00
Ian Fan a29ee77411 swaybar: send signal to status when hiding or showing bar 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 a388ffa127 swaybar: only send initial workspace request if workspace buttons are enabled 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 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 d3f0e52784 bar-bindsym: address ianyfan's comments 2018-10-09 08:12:46 -04:00
Brian Ashworth 1c969e86f5 Implement bar bindsym 2018-10-09 08:12:46 -04:00
Ryan Dwyer 41bfd8c790 swaybar: allow null status_command
Sway sets a default status_command which runs date every second. This
patch removes this behaviour so the user can have a NULL status bar if
desired.

I had to swap swaybar's event_loop_poll and wl_display_flush so that it
would map the initial surface.
2018-10-08 22:23:55 +10:00
emersion d50f54fa42 swaybar: fix binding to wl_pointer multiple times 2018-10-06 19:13:44 +02: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 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
emersion 8a5ff5a4db swaybar: don't wl_display_roundtrip on each frame
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-20 19:31:03 +02:00
emersion 82f1393cbb swaybar: handle hotplugging
Don't kill and respawn swaybars on hotplug.
2018-09-20 18:37:51 +02:00
emersion 012df55be5 swaybar: use output names instead of output indexes 2018-09-17 16:04:09 +02: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 14511da75d send scroll events to swaybar blocks 2018-07-16 18:55:11 -04:00
Peter Rice 79a998849b make hotspot callback take an x11 button id 2018-07-16 18:55:04 -04:00
emersion 63b4bf5000
Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
emersion aa36899d8a
Fix a bunch of swaybar memory leaks 2018-04-24 22:28:55 +01:00
Alex Xu (Hello71) 63267240bf Work around maybe-uninitialized in bar.c
Fixes #1855.
2018-04-24 12:29:11 -04:00
Scott Anderson 4dfbc3160c Fix swaybar axis event logic
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-22 17:25:15 +12:00
Scott Anderson c63554885e Remove void * casts
They're pointless.
2018-04-21 14:45:34 +12:00
Scott Anderson 2ebb6073b7 Remove status command event on error
This prevents very high CPU load when the status command dies,
and poll continuously awoken with POLLHUP.
2018-04-21 14:39:46 +12:00
Ryan Dwyer c38de16722 Fix swaybar output config. 2018-04-10 13:38:15 +10:00
Drew DeVault f242362e7e Handle output removal on swaybar 2018-04-05 16:04:30 -04:00
Drew DeVault 38bdd4bdeb Address review feedback 2018-04-03 22:52:40 -04:00
Drew DeVault d48e7036aa Don't use asserts with side-effects 2018-04-03 21:29:43 -04:00
Drew DeVault 2605950769 Add hidpi support to swaybar 2018-04-03 21:06:28 -04:00
Drew DeVault 333dbcbe72 Render i3bar blocks 2018-04-02 11:09:23 -04:00
Drew DeVault 2a5108a278 Implement workspace switch on click 2018-03-30 22:44:08 -04:00
Drew DeVault ae14dfc7ae Implement scroll wheel workspace switching 2018-03-30 22:44:08 -04:00
Drew DeVault 8d1425bde9 Initialize seat pointer in swaybar 2018-03-30 22:44:08 -04:00
Drew DeVault 095ac31921 Use render_all_frames from bar_setup 2018-03-29 22:32:17 -04:00
Drew DeVault 6fe66d0e6c Fix layer_surface_closed 2018-03-29 22:25:25 -04:00
Drew DeVault da6e48520b Tear down bar when display exits 2018-03-29 22:11:08 -04:00
Drew DeVault 0464a9910d Clean up status line on exit 2018-03-29 22:11:08 -04:00
Drew DeVault 0d0ab7c5ce Implement status line
Does not yet support i3bar json protocol
2018-03-29 22:11:08 -04:00
Drew DeVault 86ba0fc15d Re-render bar on IPC updates 2018-03-29 22:11:08 -04:00
Drew DeVault 3399ad9840 Round up workspaces on each output 2018-03-29 22:11:08 -04:00
Drew DeVault e5e8094dc3 Only utilize the configured outputs 2018-03-29 22:11:08 -04:00
Drew DeVault 5c9ad035db Wire up basic IPC support 2018-03-29 22:11:08 -04:00
Drew DeVault cab1352801 Start port of swaybar to layer shell
This starts up the event loop and wayland display and shims out the
basic top level rendering concepts. Also includes some changes to
incorporate pango into the 1.x codebase properly.
2018-03-29 22:11:08 -04:00
Johannes Lundberg 44e72573cb Fix include path to input-event-codes.h for FreeBSD. 2017-10-15 10:54:47 +02:00
John Axel Eriksson feb8bb96ee
swaybar protocol: handle button 4 and 5
i3 bar handles scroll events as button 4 and 5. An example use
case would be volume up/down.
2017-09-23 15:22:40 +02:00
akokshar@redhat.com 39df3aed82 styling fixes 2017-08-29 17:33:06 +02:00
akokshar@redhat.com 65022e1cbf click_events as documented at https://i3wm.org/docs/i3bar-protocol.html 2017-08-29 11:19:43 +02:00