Commit Graph

197 Commits

Author SHA1 Message Date
patrick96
8566051336 fix(tray): Allow module to disappear for empty tray
Modules that don't produce any output are hidden by the controller
(don't have margins or separators).
The tray module should also do that for `format = <tray>` when there are
no icons.

This required the visibility handling to be tied to the module
visibility instead of being handled by the renderer.
Otherwise, the renderer would hide the tray (because the %{Pt} tag was
never sent) and the tray would not unhide when new icons appeared; it
can't differentiate between hidden because empty and hidden because the
module is hidden by the user (the latter is the reason the renderer does
hiding at all).

Fixes #3036
2023-11-11 04:01:26 +01:00
patrick96
4f9f07eefd restack: Add ewmh restacking strategy
Positions the bar window above the _NET_SUPPORTING_WM_CHECK window

The generic restacking strategy now first tries the ewmh strategy, the
the bottom strategy.
2023-05-15 14:44:50 +02:00
dvermd
0caa30683c
Remove config singleton (#2951)
* Remove unused function

* Refactor deprecation warning

* Modules take config as parameter instead of using the singleton

* Bar take config as parameter instead of using the singleton

* Renderer take config as parameter instead of using the singleton

* Legacy Tray Manager take config as parameter instead of using the singleton

* Screen take config as parameter instead of using the singleton

* Controller take config as parameter instead of using the singleton

* Remove the config singleton

* Apply review suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

* Apply style suggestion

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>

---------

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2023-05-01 14:58:52 +02:00
patrick96
df32703a22 tray: Rework tray spacing
tray-padding determines space added before and after each icon
tray-spacing determines space added between icons (but not at the edge)

Both are an extent value and accept both pixel and point values.
2023-04-01 21:04:58 +02:00
patrick96
7fbd2d175c tray: Cleanup position calculation 2023-04-01 21:04:58 +02:00
patrick96
b5f8466117 tray: Replace tray-maxsize module setting with tray-size
The size accepts a percentage with offset relative to the bar height and
determines the width and height of tray icons.

Defaults to 66%

Does not affect spacing
2023-04-01 21:04:58 +02:00
patrick96
11746455ee
tray: Cleanup & documentation 2023-03-25 20:17:02 +01:00
patrick96
f3ce047c52
tray: Remove delayed notifications
Unclear why it is needed, neither i3bar, nor stalonetray do delayed
notifications
2023-03-25 19:28:43 +01:00
patrick96
58e0911ac6
tray: Disable pseudo-transparency for opaque bgs 2023-03-23 23:03:45 +01:00
patrick96
89f29fa12e
tray: documentation 2023-03-23 22:41:40 +01:00
patrick96
f6172e1459
Remove tray client gc
Not actually used anywhere
2023-03-23 22:27:43 +01:00
patrick96
1aeac226a6
Delete tray client pixmap and gc in destructor 2023-03-23 22:27:11 +01:00
patrick96
65279883c3
Replace wait_for_response with handle callback
The poll-loop could in theory swallow events which would not be seen by
the main eventloop
2022-11-30 15:06:17 +01:00
patrick96
aadd4ce1c8
Remove screen realloc argument
Replaced with explicit reset function
2022-11-30 13:41:25 +01:00
patrick96
f5d16891dd
tray: Cleanup 2022-10-31 23:21:00 +01:00
patrick96
ca25b5685c
tray: Add back legacy tray implementation
Is used for trays defined through tray-position and nothing else.
2022-10-31 23:05:23 +01:00
patrick96
6d74ae51e7
Merge remote-tracking branch 'upstream/master' into tray-child-window 2022-10-16 21:31:07 +02:00
patrick96
31bdacb3d7 Remove never used systray module
Not the same as the new tray module
2022-10-16 21:25:48 +02:00
Patrick Ziegler
56779a5902
Make the event loop return shared_ptrs (#2842)
* Return shared_ptr from eventloop

* Add -Wdeprecated-copy-dtor warning

Produces a warning if classes don't have explicit copy operations if
they have a user-defined constructor.
This helps us stick to the rule of 5 (kinda, no warnings for missing
move operators).

* Clean up eventloop

* Fix compiler warnings

* Fix fs_event_handle_t name
2022-10-15 23:21:40 +02:00
patrick96
d6997659fa
cleanup 2022-10-12 23:34:38 +02:00
patrick96
0096fea839
Merge remote-tracking branch 'upstream/master' into tray-child-window 2022-10-05 23:02:18 +02:00
patrick96
5719d130fd feat(xwindow): %instance%, %class% from WM_CLASS 2022-10-02 20:57:29 +02:00
patrick96
463ef963a1
Add pseudo transparency back to tray icons 2022-10-01 22:24:23 +02:00
patrick96
def2682b8c
tray: Set _NET_SYSTEM_TRAY_VISUAL 2022-09-26 21:39:10 +02:00
patrick96
5c38d5cb17
tray: Store clients in unique_ptr 2022-09-24 13:20:02 +02:00
patrick96
3da2662022 xwindow: Also listen for WM_NAME changes 2022-09-19 22:54:41 +02:00
patrick96
627d43dad2
tray: Set _NET_SYSTEM_TRAY_ORIENTATION 2022-09-19 21:23:22 +02:00
patrick96
63c6b13cbf
tray: Cleanup client state handling 2022-09-15 19:38:45 +02:00
patrick96
5fd62edfca
tray: Cleanup logging 2022-09-14 21:53:02 +02:00
patrick96
60173e5042
tray: Better lifecycle handling 2022-09-11 21:51:08 +02:00
patrick96
ea5ffdd6b1
Merge remote-tracking branch 'upstream/master' into tray-child-window 2022-09-11 19:32:29 +02:00
Patrick Ziegler
053a7eb2d8
fix: Crash on root pixmap and window depth mismatch (#2813)
The background_manager used the root window depth for creating its
pixmaps, but when the root pixmap has a different depth, this causes the
copy_area_checked call to fail and crash the bar.

We now load the root pixmap before finding the visual and creating the
slice pixmaps.

Fixes #2798
2022-09-05 09:58:12 +02:00
patrick96
901183a60a
tray: Fix tray not updating after (un)map_notify
The issue was that the event was for the wrapper window and that the
tray_client's move constructors didn't correctly copy over all data and
so when the m_clients vector grew, it corrupted the state of all
existing clients.
2022-09-03 22:34:00 +02:00
patrick96
1127792ccf
tray: Update module using callback 2022-09-03 21:33:22 +02:00
patrick96
b72458a6b0
tray: Load settings from module section 2022-09-03 20:56:32 +02:00
patrick96
03a2e6bb17
tray: Read width directly from tray_manager 2022-08-28 15:29:36 +02:00
patrick96
1dcff9396a
tray: Stop listening to ui::visibility_change
If the bar window (un)maps, the tray icons are automatically (un)mapped
2022-08-28 15:05:22 +02:00
patrick96
de560fe810
tray: Remove mutex 2022-08-28 14:56:56 +02:00
patrick96
d658c07177
tray: Cleanup tray settings 2022-08-28 14:49:09 +02:00
patrick96
ef06472a6d
tray: Remove tray window
Each tray client is directly reparented to the bar window. This saves us
the hassle of having to configure a basically useless tray window and
keeping its background pixmap in sync.

The only disadvantages are having to (un)map each client window
individually and calculating its position relative to the bar window
(which changes all the time) instead of relative to the tray window
(which only changes when clients are added/removed).
2022-08-27 23:02:34 +02:00
patrick96
dca9e15339
tray: Store position relative to inner area 2022-07-26 21:33:28 +02:00
patrick96
9c759549c6
tray: Remove background_manager
The tray window uses the pixmap of the bar window and clears window
content on every update.
2022-07-26 00:01:21 +02:00
patrick96
4bbb28baaf
Merge remote-tracking branch 'upstream/master' into tray-child-window 2022-07-25 23:40:45 +02:00
raffael0
b2c5d8e0e2
tray: implement hiding functionality (#2723)
* tray hiding works

* clang-format

* Implemented suggestions
2022-06-16 12:53:49 +02:00
raffael0
86f2baa550
tray: remove tray-position = adaptive (#2726)
The tray is automatically started if there is a tray module. In addition, `tray-position` and the tray module conflict.

Ref #2689
2022-06-15 11:09:13 +02:00
patrick96
d743a22817 --wip-- [skip ci] 2022-04-16 00:20:00 +02:00
patrick96
9ad73da05f
tray: Remove calculate_client_x 2022-04-16 00:16:50 +02:00
patrick96
81d1f74b7b
Move client configuration into tray_client 2022-04-16 00:16:50 +02:00
patrick96
b5c742a63e
Use connection.root() to get root window 2022-04-16 00:16:50 +02:00
patrick96
6043f856b6
controller: Keep only eventloop in try-catch
If an exception is thrown earlier, stopping the eventloop produces an
error.
2022-04-16 00:16:49 +02:00