Commit graph

170 commits

Author SHA1 Message Date
Jonathan Rouleau
54444e7587 swaybar: correctly render min_width for strings
fixes #1635
2018-03-27 06:56:09 +00:00
David McKinney
4d5fae4567 Merge remote-tracking branch 'remotes/origin/bugfix/iconsnotfound' into 0.15 2018-03-24 19:05:12 -04:00
David McKinney
8d95d2f924
Fixed missing icons bug in index.theme parsing and a path concatenation bug in find_inherits() 2018-03-24 12:49:15 -04:00
Calvin Lee
a83bca6db5 Handle swaybar status line errors
The event loop API was redesigned to avoid race conditions as well.
Fixes #1583
2018-02-04 12:31:07 -07:00
Peter Rice
efe5a6fc0a Calculate positions of empty blocks in swaybar 2018-01-12 23:12:23 -05:00
Peter Rice
e2d54d36d2 Handle forward/back mouse buttons in swaybar 2018-01-07 19:27:34 -05:00
gnidorah
4d34bc393e Keep tray separate 2017-12-29 12:11:51 -07:00
gnidorah
87a55dfe5c Fix icon updating on secondary outputs 2017-12-29 12:11:51 -07:00
gnidorah
cbd0c49a8c Allow correct item to get icon updates for both kde and gtk implementation 2017-12-29 12:11:51 -07:00
Calvin Lee
13b81f9fb9 Fix get_icon
Property reply functions are now notified if there was an error with the
property instead of silent failure. Also issues in `get_item` were
resolved.
2017-12-29 12:11:51 -07:00
Calvin Lee
87035380e3 Add dbus_get_prop_async utility
This drastically reduces the amount of boilerplate needed to get a
property from a bus object.
2017-12-29 12:11:51 -07:00
Calvin Lee
b9f36716b5 Plug memory dbus_message_iter_get_signature leak 2017-12-29 12:11:51 -07:00
Calvin Lee
5c8dc9cb73 Correct context menu placement if bar is bottom
Originally the context menu would draw at the top of the screen, which
is incorrect.
2017-12-29 12:11:51 -07:00
gnidorah
2f1eb30c38 Reply in case of object path item 2017-12-29 12:11:51 -07:00
Calvin Lee
3137f32711 Allow correct item to get icon updates 2017-12-29 12:11:51 -07:00
Calvin Lee
210e5bb893 Improve Icon Theme Implimentation 2017-12-29 12:11:51 -07:00
Calvin Lee
5bc46f458c Prevent segfault in get_items()
One segfault resulted from an incorrect dbus call in sni_watcher. The
other from duplicate items in the sni host.
2017-12-29 12:11:51 -07:00
Calvin Lee
4231061e4d Allow multiple object paths for each connection 2017-12-29 12:11:51 -07:00
gnidorah
bd121999ca Allow paths to icons in iconName property 2017-12-29 12:11:51 -07:00
Calvin Lee
ad99d9dff8 Allow registering StatusNotifierItems by obj path
This commit impliments a KDE hidden feature where a SNI could be
registered by object path instead of well-known name. This should allow
libappindicator programs to work correctly under sway.

See #1372
2017-12-29 12:11:51 -07:00
Björn Esser
c08c805ecd Adaptions for API change in json-c v0.13
Lift restriction on json-c <= 0.12.1

ipc-server: Acquire ownership of referenced json_object properly

When adding a referenced json_object with an unknown lifetime to
another json_object, it must be done with a wrapped call to
json_object_get() to acquire the ownership of that json_object.
2017-12-17 15:53:22 -05:00
Drew DeVault
d0bd0ed598 Revert "Merge remote-tracking branch 'besser82/bugfix/json-c' into 0.15"
This reverts commit 1c4a086e75, reversing
changes made to 1263ea6497.
2017-12-17 15:52:34 -05:00
Björn Esser
02da9c4e7c
Adaptions for API change in json-c v0.13 2017-12-14 18:47:24 +01: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