Commit Graph

28 Commits

Author SHA1 Message Date
patrick96
3244b10ce3
Make tray window a bar subwindow
Currently requires a dirty workaround to prevent tray icons with
different depths from crashing
2022-04-16 00:13:53 +02:00
patrick96
18485d00c2
Cleanup tray code 2022-04-16 00:00:30 +02:00
raffael0
4961a7dcfc
feat(tray): Position using a module (#2595)
Closes: #1526
Closes: #314

* debug log

* semi-working prototype. works on the left and the center but not on the right

* fixes formatting

* fixes tests

* - fixed tray_width_change signal
- implements suggestions

* - fixes error with tray positioning

* - tries to fix tests. Does not work

* - fixes tests

* - implemented suggestions

* reverted formatting in comake and doc

* - changed unique_ptr to const reference

* - fixed formatting errors in code

* - actually fixed formatting(ran clang-format)

* - implemented suggestions

* - Added CHANGELOG.md entry(not sure about wording)

* - removed bar_settings from tray_manager::setup

* - fixed issue from rebase

* - fixed issue with tests from rebase

* implemented suggestions

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2022-04-15 23:50:04 +02:00
Nicholas-Baron
2322493ac8 Fix a Clang 13 warning
`-Wdeprecated-copy` found this copy-assignment operator, which it
complains about. Since it is just `= default`, we should be able to
remove both it and the default constructor, making the struct just its
data members.
2022-03-02 10:48:14 +01:00
Jeremy Fleischman
f488a889bc
Add support for a tray-foreground setting. (#2552)
This adds a new `tray-foreground` config option, and uses it instead of
the `tray-background` setting to build up the `_NET_SYSTEM_TRAY_COLORS`
property. I'm pretty sure that the previous behavior was a mistake (this
was introduced in 94298741b6 which is a
pretty large diff).  For me and some other people, this results in a
black icon being drawn on top of a black background, which is pretty
useless! I would say that this diff fixes
https://github.com/polybar/polybar/issues/2235. Note: the old code dealt
with `unsigned int` and maxed values out at 0xff. The new code deals
with `uint16_t` and maxes values out at 0xffff. I haven't found the
relevant documentation to justify this change, but from manually
testing, I'm pretty confident this is the right change.

This all matches pretty closely with this code from i3:
[`i3bar/src/xcb.c::init_tray_colors`
code](43e805a00d/i3bar/src/xcb.c (L1490-L1522)),
which you can see also uses the bar's foreground color and maxes values
out at 0xffff, not 0xff.

If you merge this up, I think we should also update
https://github.com/polybar/polybar/wiki/Configuration#bar-settings to
mention the new settings.

Fixes #2235
2021-11-17 11:41:40 +01:00
patrick96
c922a94b67 Remove unused spin_lock 2021-09-21 21:43:27 +02:00
patrick96
2512123a6c
Merge remote-tracking branch 'origin/hotfix/3.5.7' 2021-09-21 18:22:57 +02:00
patrick96
6136c08d42 tray: Properly handle missing _XEMBED_INFO
The icon not supporting XEMBED is not fatal, we just treat is as always
mapped.

Fixes #2479
Fixes #2442
2021-09-13 00:12:33 +02:00
Patrick Ziegler
d5be8cad97
Add compiler warning for missing override specifier (#2341)
* build: Add -Wsuggest-override

We should always use the override specifier when overriding virtual
functions. This helps prevent errors when a subclass tries to create a
function with the same name as a virtual function in a super-class but
with a different purpose.

* clang-format

* Upload logs on failure

* Add override to unsupported.hpp

* cmake: Make -Wsuggest-override flag conditional
2021-01-04 10:38:43 +01:00
patrick96
3655106a14 Adapt the renderer side to always use rgba 2020-11-27 22:08:03 +01:00
Benno Fünfstück
7256366112 fix(tray): correctly handle transparency when using offset (#1571)
This patch adds support for observing multiple slices of the desktop background.
This is used for the tray so that it doesn't have to rely on the bar's rect to
get the desktop background. In particular, it now handles the case where the
tray is not contained fully within the bar's outer rect (for example, when using tray-offset-{x,y})

Co-Authored-By: bennofs <benno.fuenfstueck@gmail.com>
2019-01-05 01:08:18 +01:00
Benno Fünfstück
35aca5b368 fix(tray): correctly compute background for tray if bar pos != (0,0)
We need to use positions relative to the position of the bar for indexing into
the background image slice, but the code used absolute ones.

This worked fine as long as absolute positions are the same as relative
positions (this is the case for a bar located at (0,0), so if bottom = false).
But for bottom bars (where the bar position is not (0,0)) this was wrong which
caused the tray background to be black (out of bounds for the background slice).
2018-10-04 15:52:03 +02:00
Benno Fünfstück
3de914abca feat(render): support pseudo-transparency
This adds pseudo-transparency for the background of the bar and the
background of the systray.
2018-10-04 15:52:03 +02:00
Michael Carlberg
09808e99f9 refactor(tray): Cleanup 2017-01-25 23:37:16 +01:00
Michael Carlberg
6692b4a8da refactor(x11): Cleanup 2017-01-24 10:49:14 +01:00
Michael Carlberg
452afcdc68 refactor: Integral types 2017-01-24 07:11:14 +01:00
Michael Carlberg
e0688307f3 wip(systray): Add module base 2017-01-01 21:28:28 +01:00
Michael Carlberg
debb3534c7 concurrency_ytil: Thread id 2016-12-23 05:18:58 +01:00
Michael Carlberg
a89c4ef2dd refactor: Move all event handling to the controller 2016-12-20 05:16:04 +01:00
Michael Carlberg
697638db2b fix(tray): Follow window fade 2016-12-16 07:10:45 +01:00
Michael Carlberg
faab627771 fix(tray): Ignore restack state 2016-12-15 21:00:17 +01:00
Michael Carlberg
a0d485f79d refactor: Initialize data 2016-12-15 09:30:31 +01:00
Michael Carlberg
f9062d031c refactor(clang-tidy): Apply fixes 2016-12-15 03:30:41 +01:00
Michael Carlberg
b11a662d81 fix(tray): Re-activation 2016-12-14 11:34:09 +01:00
Michael Carlberg
18597f8e1d fix(tray): Uninitialized value 2016-12-14 11:01:44 +01:00
Michael Carlberg
4fca0c89b4 refactor: Object construction 2016-12-14 11:01:44 +01:00
Michael Carlberg
1a2a6e5fab refactor: Construction methods 2016-12-14 11:01:44 +01:00
Michael Carlberg
08be86fbe1 wip(refactor): Improve signal and event handling 2016-12-14 11:01:44 +01:00