Commit graph

231 commits

Author SHA1 Message Date
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 c4e92c81f5 Adjust height calculation, naming 2018-04-03 21:57:47 -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 f366ef373e Fix #1709 2018-04-03 11:17:34 -04:00
Drew DeVault ef50d84be1 Render blocks the correct order 2018-04-02 13:53:40 -04:00
Drew DeVault c507727ad2 Fix use-after-free with block hotspots 2018-04-02 11:53:56 -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
Drew DeVault ee85c91831 Demarcate i3bar JSON into individual updates 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 2a90d26ebe Fix issues with swaybar on DRM 2018-03-30 00:30:38 -04:00
Drew DeVault d8104db8f1 Early return from render functions if necessary 2018-03-29 23:35:49 -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 f3fbf19312 Do some small cleanup
- Fix workspace events (security config isn't in use so it wasn't being
  sent)
- Kill status bar process when swaybar exits
- Don't rearrange windows on every layer surface commit
2018-03-29 22:11:08 -04:00
Drew DeVault b72825441b Fixed laggy focused output boolean 2018-03-29 22:11:08 -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 718502c815 Iterate over workspaces backwards 2018-03-29 22:11:08 -04:00
Drew DeVault 531c175d3e Respect user bar height preference
This is an i3-gaps feature we support
2018-03-29 22:11:08 -04:00
Drew DeVault 1e8faeec02 Pixel-perfect rendering 2018-03-29 22:11:08 -04:00
Drew DeVault 37b61eff2d Add binding mode indicator 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 3a458cd7b5 Implement workspace button rendering 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
Tony Crisci d071ff08ae remove the rest of cmake 2017-12-01 05:21:03 -05:00
Joona Romppanen 675e4b7de7 Removed trailing comma from swaybar click event json 2017-10-28 17:35:48 +03:00
Johannes Lundberg 44e72573cb Fix include path to input-event-codes.h for FreeBSD. 2017-10-15 10:54:47 +02:00
Johannes Lundberg 5a63f0f57b Fix build on FreeBSD adjusting/removing _XOPEN_SOURCE declaration. 2017-10-14 20:38:33 +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 2b927685ca styling fixes 2017-08-30 08:16:17 +02:00
akokshar@redhat.com 39df3aed82 styling fixes 2017-08-29 17:33:06 +02:00
akokshar@redhat.com d873d09f23 style fixes 2017-08-29 15:55:30 +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
Calvin Lee ba6224f4e5 Prevent crash if DBus connection is NULL
Fixes #1307
2017-08-12 12:52:31 +02:00
Tobias Blass 8976a47f62 [swaybar] fix non-dbus build
Swaybar's CMakeLists.txt uses the enable-tray option directly to decide whether to build the tray. This leads to a compilation error if dbus is not installed.
This patch uses the ENABLE_TRAY variable instead, which is only true if the user enabled the tray *and* dbus is available.
2017-07-20 23:03:16 +02:00
Calvin Lee e8f589c3dc Fix memory leaks in swaybar tray 2017-07-16 19:06:24 -07:00
Calvin Lee 5ceb52962e Fix name validation in sni_watcher.c
This commit also fixes a memory leak that occurs on failure.
2017-07-13 20:57:23 -07:00
Calvin Lee 62223e8fbb Don't trust SNI names, fixes #1274
If an item doesn't have a well-formed name, it will not be added to the
tray.
2017-07-13 07:47:21 -07:00
Johannes Lundberg 6a525b23dd Adjust _XOPEN_SOURCE value for build on FreeBSD and fix pointer comparison error. 2017-07-08 08:31:10 +02:00
Drew DeVault 387eca1b29 Revert "swaybar: Group child processes for signalling"
This reverts commit 8f4bc0a374.
2017-06-29 13:22:54 -04:00
Drew DeVault 5f915a9d03 Fix #1252 2017-06-26 16:59:19 -04:00
Mykyta Holubakha ed8f56ba38
Handle getline failure in icon theme parsing 2017-06-23 19:23:44 +03:00
Drew DeVault 0fc9628f03 Merge branch 'master' into tray 2017-06-14 18:14:22 -04:00
Calvin Lee 33fdae2001 Remove Xembed Support
Xembed support is premature in sway and should be postponed. This commit
only removes swaybar starting xembedsniproxy, if users would like, they
can still start xembedsniproxy manually, however there will be no
official support.
2017-06-13 12:42:11 -07:00
Yury Krivopalov 8f4bc0a374 swaybar: Group child processes for signalling
Fixes child proccess killing, when status_command is a complex command
like "i3status | wrapper.sh".

Set the process group id of the child process by calling `setpgid` after
forking and before calling `exec`.

The process group ID will be set to the process ID of the forked
process. Processes spawned by this child process will also have this
group ID.

Send signals to the process group with `killpg`. This will send the
signal to all of the process group.
2017-06-12 23:12:31 +03:00
Calvin Lee 0a71aa6e97 Fix Catching NewIcon Signal
The unique name was not copied out of the wire marshalled DBus message
data so `sni_uniq_cmp` would always match against junk data.
2017-06-08 08:24:35 -07:00
Calvin Lee 1451ee8fd1 Reorganize Tray Code
Remove tray code from bar.c and render.c
2017-06-07 21:32:48 -07:00
Drew DeVault 790887ce76 Fix cairo blending on tray icons 2017-06-07 22:45:33 -04:00
Calvin Lee 843ad38b3c Implement Tray Icons
This commit implements the StatusNotifierItem protocol, and enables
swaybar to show tray icons. It also uses `xembedsniproxy` in order to
communicate with xembed applications.
The tray is completely optional, and can be disabled on compile time
with the `enable-tray` option. Or on runtime with the bar config option
`tray_output none`.

Overview of changes:
In swaybar very little is changed outside the tray subfolder except
that all events are now polled in `event_loop.c`, this creates no
functional difference.

Six bar configuration options were added, these are detailed in
sway-bar(5)

The tray subfolder is where all protocol implementation takes place and
is organised as follows:

tray/sni_watcher.c:
	This file contains the StatusNotifierWatcher. It keeps track of
	items and hosts and reports when they come or go.
tray/tray.c
	This file contains the StatusNotifierHost. It keeps track of
	sway's version of the items and represents the tray itself.
tray/sni.c
	This file contains the StatusNotifierItem struct and all
	communication with individual items.
tray/icon.c
	This file implements the icon theme protocol. It allows for
	finding icons by name, rather than by pixmap.
tray/dbus.c
	This file allows for asynchronous DBus communication.

See #986 #343
2017-06-07 17:49:16 -07:00
Sebastian Noack 173b338567 Add -DVERSION flag for release version numbers 2017-04-26 15:56:46 +02:00
Drew DeVault 9aed9d9359 UnGNUify the codebase 2017-03-10 23:41:24 -05:00
Drew DeVault 9ad1e6b40f Handle malloc failure in ipc_recv_response 2016-12-15 19:01:40 -05:00
D.B ad4d21d60b add bar colours for focused_(workspace|statusline|separator)
If these aren't defined in config, color settings without 'focused_'
prefix are used as a fallback.
2016-11-02 18:58:33 +01:00
Mykyta Holubakha 2a24772c4b config: set pango_markup default to false 2016-10-20 16:43:38 +03:00
Drew DeVault c0916f6138 Use CAIRO_OPERATOR_SOURCE for swaybar 2016-10-12 23:44:19 -04:00
D.B 6f2c39610e parse pango markup in workspace names (and bugfix)
This change allows using numeric character references in workspace names
- for example æ which stands for sharp s. A fix was necessary in
get_pango_layout, since markup and parsed markup had different width.
2016-10-07 11:27:06 +02:00
D.B fe89d7fba3 Correctly scale swaybar
Fixes #910. There were some missing multiplications with window->scale.
2016-09-29 14:31:35 +02:00
Ryan Dwyer e4cb4d1b5c Fix swaybar when running on named outputs.
When using a bar on a named output, load_swaybars() requires the
output to be active (ie. in the root container), but this is not the case if
the bar is added to the last output. To fix this, load_swaybars() is now
called after the output has been added to the root container.

After fixing that, swaybar would segfault due to using the wrong index
variable when loading outputs and config.
2016-09-17 17:25:45 +10:00
D.B c239f228c2 swaybar sends workspace name in quotes
fixes #894
2016-09-12 06:58:53 +02:00
Drew DeVault af44154119 Fix constant scale factor in font code 2016-09-05 11:52:52 -04:00
Drew DeVault b2226ac655 Add client support for HiDPI
This adds HiDPI support to swaybar, swaybg, and swaylock.
2016-09-05 11:36:48 -04:00
Drew DeVault 61184e3208 Initial testing on hidpi clients 2016-09-05 10:32:21 -04:00
Drew DeVault 416417a54c Reorganize includes 2016-09-01 08:18:37 -04:00
Zandr Martin 98aa59fdda
implement solid color rendering for swaybg 2016-07-30 18:50:13 -05:00
Hummer12007 06f46955c0 Fix a warning 2016-07-18 00:57:49 +03:00
Drew DeVault 3bb880bf20 Implement configurable wrapping on bar ws scroll 2016-07-17 11:26:38 -04:00
Drew DeVault 147a88260a Fix #753 2016-07-16 09:09:22 -04:00
David Eklov e38d6b94b8 Change workspace when mouse wheel is scrolled while hovering over the bar 2016-07-15 19:14:31 -05:00
David Eklov 250ddc66c6 Rename pointer_input::notify to indicate that is called on button clicks 2016-07-15 19:14:31 -05:00
David Eklov 8a232c8cfd Send command to sway to change workspace when workspace button is clicked 2016-07-14 17:18:01 -05:00
David Eklov a0c8799c80 Compute what workspace button is clicked
This commit does not do anything with this information other than logging it.
2016-07-14 17:18:01 -05:00
David Eklov c805e42635 Extract workspace size computation from render_workspace_button()
Also remove some unnecessary strtup()s and rename a few variables and functions.
2016-07-14 17:18:01 -05:00
David Eklov 103954dd2b Setup to receive mouse click events and log them 2016-07-14 17:18:01 -05:00
David Eklov d3752b4140 swaybar: Make swaybar a shell surface 2016-07-04 21:59:47 -05:00
Drew DeVault c55ae9956b Fix another -Wunused-result 2016-04-29 11:04:21 -04:00
Tomáš Čech 468ddfb34d Fix missing include paths
When headers were installed in more sofisticated places (but package
config knows it right), it revealed missing paths in CMake
configuration. Lets fix it.
2016-04-28 20:08:41 +02:00
Mykyta Holubakha 0f1cfdec61 Renamed to pango_markup 2016-04-24 20:35:21 +03:00
Mykyta Holubakha ee4e245f16 Fix line length calculation 2016-04-24 20:20:07 +03:00
Mykyta Holubakha 2e6c43e62b Added plaintext_markup to swaybar IPC 2016-04-24 20:14:02 +03:00
Mykyta Holubakha 53b53dd8c2 Added plaintext markup configuration 2016-04-24 19:57:35 +03:00
Drew DeVault a796ce4f66 Merge pull request #598 from Hummer12007/pango_fix
Passing missing argument to get_text_size
2016-04-24 08:52:36 -04:00
Mikkel Oscar Lyderik 11f0b4539d Use i3bar format for markup field.
In the i3bar protocol the value of the markup field is a string: "pango"
or "none" rather than a bool. This patch makes swaybar compatible with
that.

http://i3wm.org/docs/i3bar-protocol.html
2016-04-24 10:26:55 +02:00
Mykyta Holubakha a25c35f859 Passing missing argument to get_text_size 2016-04-24 10:39:42 +03:00
Drew DeVault 84fae94ab9 Flesh out pango markup implementation 2016-04-17 11:36:03 -04:00
crondog 9c42557b66 Stop swaybar crashing without args 2016-03-31 20:56:14 +11:00
Mikkel Oscar Lyderik d80466068a Handle swaybar using sway font 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik cefcce48aa Make client/pango.h not depend on client/window.h 2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik af7a251806 Poll before wl_display_dispatch 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik e4c1176b72 Differentiate between all or no outputs 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik 6d57f03028 Make single bar handle multiple outputs 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik 5e253fdd9a Correctly exit sway on errors.
Calling `exit` in sway_terminate prevents sway from correctly shutting
down (freeing data, cleanly terminating the ipc server, etc.).

A better way is to exit straight away if the failure occurs before
`wlc_run` and use sway_abort as usual if it occur when wlc is running.
2016-02-26 09:42:21 +01:00