Commit Graph

159 Commits

Author SHA1 Message Date
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
patrick96
9b1afe7369
Cleanup selection of visual for bar window 2022-04-16 00:16:49 +02:00
patrick96
3711e999ba
Use individual wrapper window for each tray client 2022-04-16 00:16:49 +02:00
patrick96
ab7612ea4a
tray: Make m_clients exclusive owner of clients 2022-04-16 00:16:49 +02:00
patrick96
ab2b5f603c
Use bar window depth for tray pixmap 2022-04-16 00:16:49 +02:00
patrick96
6fa85d2ce8
Remove unused parameter 2022-04-16 00:16:48 +02:00
patrick96
7acd4c703c
xcb: Cleanup value packing 2022-04-16 00:16:48 +02:00
patrick96
ba0e478026
Cleanup tray position handling 2022-04-16 00:16:44 +02:00
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
patrick96
49b18fb3b7
Merge branch 'hotfix/3.6.2' 2022-04-03 20:11:19 +02:00
patrick96
ff6ac9fefc Make ewmh_connection act as xcb_ewmh_connection_t*
This way, we don't have to explicitly get the xcb_ewmh_connection_t
pointer from the object and can simply derference the ewmh instance
itself.
2022-03-21 21:37:12 +01:00
patrick96
b8a7b6a605 Cleanup cursor code 2022-03-20 20:18:00 +01:00
patrick96
4556a4a7a8 fix: Support negative struts
Fixed #2642
2022-03-15 00:11:46 +01:00
patrick96
b66f920308 Cleanup xcb stuff 2022-03-06 18:28:26 +01: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
patrick96
74067c52c3 fix: Set WM_SIZE_HINTS to fix position in openbox
When polybar is remapped (either through IPC or something like xdo
show), openbox positions it somewhere on the screen using the same
positioning algorithm as it would for regular windows.

If the position and size is set in the WM_SIZE_HINTS atom, openbox will
respect the position and size declared by the window.

Fixes #2021
2022-02-21 21:40:33 +01:00
Patrick Ziegler
62da14e30d
Use @ for doxygen commands (#2597) 2022-02-20 21:40:48 +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
b9642e4cf3 Move update events to eventloop
We can now completely remove the eventqueue thread
2021-09-21 20:36:23 +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
Jérôme BOULMIER
529843b6ba
Remove undefined behaviors and clean code (#1769)
* fix: avoid memory leaks in case of exceptions.

* fix(fs): remove undefined behavior when removing mounts in m_mounts

* cleanup: remove double checks

* fix: remove memory leaks

* cleanup(xresources): capture exception by reference

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2021-02-15 23:32:56 +01: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
Jérôme BOULMIER
bb5cf0113e fix(x11): Don't include composite when disabled 2020-12-22 00:37:07 +01:00
Nolan Prochnau
0d2838fcd5
feat(xkeyboard): Add variant support to layout label (#2163)
* Add variant support to xkeyboard layout label

Solves #316

* Run style checks, I guess?

* Add comment

* Return nothing if there is no variant

* Update CHANGELOG
2020-12-19 18:22:27 +01:00
patrick96
3655106a14 Adapt the renderer side to always use rgba 2020-11-27 22:08:03 +01:00
patrick96
7658c1b9f1 fix(xworkspaces): Assign desktops to correct viewport
Before the module would just try to evenly distribute desktops
(workspaces) among the viewports.

But since `_NET_DESKTOP_VIEWPORT` actually maps desktops to viewports,
we can use that information to assign workspaces to the right viewport.

Fixes #1849
Fixes #1764
2020-05-01 18:46:02 +02:00
patrick96
ecbe77bbda fix(monitor): Reload when any monitor changes
Before it would only reload if the size changed and even that was
reliable since the method relied on the order of the monitor list.

Now if the monitor list differs in any way (pos, dimension, primary,
output, name) a reload is issued
2020-04-21 23:59:01 +02:00
patrick96
33b68ec7cb fix(randr): Undefined behavior when removing clones
Because of how monitors are removed inside the loop and depending on the
monitor order a cloned monitor may be assigned a width of 0 but is never
actually removed resulting in polybar saying the bar is out of bounds

Fixes #1794
2020-04-21 23:59:01 +02:00
patrick96
cc36350849 xrandr: Allow not to purge cloned monitors 2020-04-21 23:59:01 +02:00
patrick96
b5e7078d93 fix(monitor): Remove realloc from get_monitors
Premature optimization that tried to cache monitors but the cache did
not take into account the parameter values.

The call `get_monitors(..., ..., false, true);` would get all connected
and unconncected monitors a subsequent call
`get_monitors(..., ..., true, false);` would get back the same list of
monitors even though it requested only connected monitors.

Additionally `get_monitors` is never called periodically so the
optimization really didn't help much.
2020-04-21 23:59:01 +02:00
patrick96
a3e2e51ac9 build: remove xdamage extension
Unused

Ref: #1730
2019-06-03 00:46:12 +02:00
patrick96
38af08d29a build: remove xsync extension
Unused

Ref: #1730
2019-06-03 00:46:12 +02:00
patrick96
6ff2b2b37f build: remove xrender extension
Some build recipes (exherbo, sourcemage) for some reason enable this
even though it doesn't do anything any only causes compilation issues.

Ref: #1730
2019-06-03 00:46:12 +02:00
Jérôme BOULMIER
fca4151f36 fix(window): remove useless operator= and add default copy cstr (#1729)
Fixes compilation under GCC 9

The default copy constructor implicit generation is deprecated by C++ standard.

The window& operator=(const xcb_window_t win); operator seems to be useless.

Fixes #1728
Ref jaagr/xpp#16
2019-04-07 17:32:55 +02:00
Jérôme BOULMIER
25ef0299cb fix(tray_client): remove copy ctor & assignment operator (#1675)
tray_client class contains a reference so copy assignment operator is implicitly deleted.
the dtor unembed the window so copying the class could lead to bug so the copy ctor is also deleted.

Fixes #1674
2019-03-06 09:00:11 +01:00