Commit Graph

973 Commits

Author SHA1 Message Date
ed6a0e90fb fix code in order to support cmake unity builds 2022-10-29 15:09:03 +02:00
291a4844bc fix(ipc): Crash when sending to multiple instances
In polybar-msg, the connection handle was captured as a reference to a
shared_ptr, but the shared_ptr went out of scope right after.

This probably always caused UB, but was only noticeable for two or more
instances.
2022-10-23 14:19:26 +02:00
30e1cc2595 feat(ipc): <label> support (#2841)
* Label = %output% working

* build fix

* Output as deprecated, Label as default

* Corrections

 * Corrections Simplified

* Changelog updated
2022-10-23 10:47:22 +02:00
cbfb417dce option to turn off struts 2022-10-22 13:06:06 +02:00
31bdacb3d7 Remove never used systray module
Not the same as the new tray module
2022-10-16 21:25:48 +02:00
3561fd3ad1 Templatify module factory
Saves us a lot of code duplication by generating module type-indexed map
and factory functions from the module class names.
2022-10-16 21:25:48 +02:00
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
54b75f23ab feat(ipc). Per hook format (#2810)
* Added format-x support for ipc_module, tested with demo config

* Certain cases not working

* Certain cases not working, build

* Changed label to output tag, Mixing of default formats wont work

* created changelog
2022-10-09 18:42:36 +02:00
303015244e feat: longest match ws-icon fuzzy matching (#2831)
* better fuzzy matching

Improved fuzzy matching so that it finds the longest matching icon instead of the first possible match

* Update CHANGELOG.md

* removed debug output

* added tests and improved fuzzy finder

- added return statements to the fuzzy finder
- added tests to check whether the fuzzy finder works.

* minor style changes

* minor change to iconset.cpp

* Delete tasks.json
2022-10-05 23:05:44 +02:00
5719d130fd feat(xwindow): %instance%, %class% from WM_CLASS 2022-10-02 20:57:29 +02:00
3da2662022 xwindow: Also listen for WM_NAME changes 2022-09-19 22:54:41 +02:00
1d4e30c4be fix: Handle X events before polling for IO (#2820)
* Use m_connection.poll_for_event

* fix: Handle X events before polling for IO

Polling the XCB file descriptor for X events doesn't detect events that
are already in XCB's event queue but not yet handled.

If this happens, the eventloop polls for IO and the queued events wait
until another event arrives, causing some desyncs in the bar.

This can easily happen if something (e.g. a click event) triggers some
xcb calls, which as a consequence buffer some incoming events.

We "fix" this by adding a libuv prepare handle (which runs right before
polling for IO) that processes pending X events.
2022-09-13 14:21:36 +02:00
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
d817080ee8 fix(renderer): Small gaps when rendering emojis (#2802)
If any rendered text uses a non-integer number of pixels (often emojis),
rendering of subsequent text blocks will start between pixels which
results in small gaps in the background and over/underline colors caused
by cairo only rendering at fractional-intensity in the beginning and end
pixel.

Simply rounding up text width can solve this.

Fixes #2785
2022-08-25 00:55:16 +02:00
7838241a77 feat(tokens): Negative minimum length adds right padding (#2801)
* negative minimum length adds right padding

* missing else statement

* updated changelog
2022-08-25 00:36:38 +02:00
6ccecbfca2 feat(temperature): Add zone-type setting (#2752)
Signed-off-by: xphoniex <dj.2dixx@gmail.com>

Signed-off-by: xphoniex <dj.2dixx@gmail.com>
2022-08-21 19:25:42 +02:00
f4d0ba9186 config_parser: Pass barname as argument to parse() (#2765)
Doesn't need to be a class field
2022-07-09 13:12:37 +02:00
98d584c8fe Also monitor include-files for changes when --reload is set (#2759)
* fixes #675

* feat(configwatcher): method to create config monitor handler

* cleanup

Co-authored-by: patrick96 <p.ziegler96@gmail.com>
2022-07-09 12:24:21 +02:00
b2c5d8e0e2 tray: implement hiding functionality (#2723)
* tray hiding works

* clang-format

* Implemented suggestions
2022-06-16 12:53:49 +02:00
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
0331a5fda4 fix: error reporting for deprecated config values (#2725) 2022-06-12 16:31:11 +02:00
7a1824a9b9 Merge remote-tracking branch 'origin/hotfix/3.6.3' 2022-05-04 11:08:12 +02:00
f653c3a738 fix(pulse): Hanging during connection setup (#2709)
If context_state_callback is called before we call
pa_threaded_mainloop_wait in the main thread, the signal is lost and we
wait forever.

Fixes #2707
Ref #2699
Ref #2697
2022-05-04 08:58:53 +02:00
6a2d7b5dde feat(backlight): Add scroll-interval (#2700)
Closes #2696

* Added `scroll-interval` option to `internal/backlight`

* Added PR to CHANGELOG.md

* Fixed indentation
2022-04-27 19:53:06 +02:00
b5292791ef fix: check if double click action associated (#2695)
When a module is clicked, only wait for the double click interval if a
double click action is associated with that module. Otherwise trigger
the click right away.

Fixes: #2663
2022-04-25 12:59:40 +02:00
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
ab206a5f8e fix: No overlines/underlines being drawn when using offsets (#2685) 2022-04-11 21:30:24 +02:00
146c1ac1d7 fix(ipc): Fallback folder not being user-specific (#2684)
If two users start a bar with IPC and don't have XDG_RUNTIME_DIR set,
polybar will create the fallback directory `/tmp/polybar`.
However, that directory is only accessible by the user that created it
and so polybar running under the second user will fail to open its
socket there.

We add the UID to the fallback directory to prevent this.

Fixes #2683
2022-04-07 15:33:56 +02:00
973b1fa3d3 feat(text): Add standard format with label
Closes #1331
Closes #1342
Fixes #2673
2022-04-04 12:01:06 +02:00
49b18fb3b7 Merge branch 'hotfix/3.6.2' 2022-04-03 20:11:19 +02:00
41d41ca8df fix(script): output timing inconsistencies (#2667)
Fixes #2650
2022-04-03 13:11:13 +02:00
a2c1392c12 feat(pulseaudio): define reverse-scroll option (#2664)
* pulseaudio: define reverse-scroll option

When we enable natural scrolling option in libinput,
it sends scroll down event when we swipe up on the touchpad.
This makes the pulseaudio module feel weird.
This option fixes that.

* Update CHANGELOG.md

Co-authored-by: Patrick Ziegler <p.ziegler96@gmail.com>
2022-04-02 23:45:54 +02:00
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
d018adcf91 Move current cursor value to bar class
It doesn't really belong to bar_settings
2022-03-20 20:18:00 +01:00
b8a7b6a605 Cleanup cursor code 2022-03-20 20:18:00 +01:00
3f89d73374 fix mouseover error when only one cursor is defined
If only cursor-click or cursor-scroll is defined, but not the other, the
bar could try to set the cursor to the empty string which resulted in an
error.
2022-03-20 20:18:00 +01:00
cea9949be1 Warning when cursor is defined without xcursor support 2022-03-20 20:18:00 +01:00
8173eaf90a fix: Positioning in awesomeWM
Since polybar sets WM_NORMAL_HINTS, awesomeWM for some reason no longer
respect the position set by polybar before mapping.

reconfiguring the window position once again after mapping the window,
again positions it correctly.
2022-03-15 22:09:36 +01:00
4556a4a7a8 fix: Support negative struts
Fixed #2642
2022-03-15 00:11:46 +01:00
11a644548b builder: Use unordered_set for attribute activations 2022-03-14 22:58:01 +01:00
e904b408d1 fix(builder): ignored offsets
The builder::offset function returned immediately if a valid extent was
passed instead of when an invalid one was passed.
2022-03-14 22:58:01 +01:00
6fdc3114f3 builder: Never enable over/underline without color
You cannot make polybar emit only the %{+o} tag without a color so that
codepath was unused.
2022-03-14 22:58:01 +01:00
325ef4c3b3 Cleanup builder
Removes unused methods and fields
2022-03-14 22:58:01 +01:00
5b2de60353 feat(script): add repeat interval for script failure and exec-if 2022-03-07 15:44:55 +01:00
50eac859fd Cleanup use of pointers in util code 2022-03-06 18:28:26 +01:00
8ddf9d2cdf Stop using unique_ptr for on_exit 2022-03-06 18:28:26 +01:00
b66f920308 Cleanup xcb stuff 2022-03-06 18:28:26 +01:00
1a4ad828c6 Merge branch 'hotfix/3.6.1' 2022-03-05 14:30:38 +01:00
fdaecdb113 tests: Use fake renderer for dispatch test 2022-03-05 13:37:28 +01:00
0b24080336 fix: Allow negative values for tray and bar offset 2022-03-03 22:44:35 +01:00