Commit Graph

2258 Commits

Author SHA1 Message Date
Andrew Tran
c747599ef5
fix(tray): check for visibility when docking (#2973)
Fixes #2968
2023-06-13 11:25:36 +02:00
Vincent Bernat
2cd0809a46
fix(randr): avoid querying hardware to get current configuration (#2470)
When using `get_screen_resources`, XRandR will query the hardware to
detect any change. This takes some time.
`get_screen_resources_current` uses the cached information and is
pretty fast.

In my case, the information is always already present in cache because
it was set by the program that did configure the screens (autorandr in
my case, but this applies to most frontends). As polybar is not used
to configure stuff, I think this is fine. There should be something
configuring the screen before polybar is able to use it.

However, maybe some people are using `polybar --list-monitors` just
after plugging a screen. It won't display the new screen in this case.
So, maybe this is not a good idea. It makes polybar starts
faster (500ms faster in my case when there are 3 screens plugged).
Also, I did this change because running `polybar --list-monitor` in
parallel with starting `polybar` (in a for loop for example), I get
some curious bug where my screens disappear and reappear. I don't need
this change as this was easy to fix by avoiding the parallel access to
XRandR properties, but maybe this would avoid other people running
into the same problem.

Your take!
2023-05-18 11:29:30 +02:00
dvermd
06a3de0b89
Refactor config::dereference* (#2963)
* Refactor config::dereference*

* move config::deprecated* implementation to cpp file

* config: move more functions implementation to cpp file
2023-05-18 09:47:45 +02:00
patrick96
ea3eb6eaa4 ci: Update ubuntu version 2023-05-15 14:44:50 +02:00
patrick96
4d1bba2c4e Add changelog 2023-05-15 14:44:50 +02:00
patrick96
2c23f7a87f restack: Make bspwm first try ewmh strategy 2023-05-15 14:44:50 +02: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
patrick96
b11a2ff653 restack: Add bottom restacking strategy
For now this is the same as the generic one
2023-05-15 14:44:50 +02:00
patrick96
59acb4150b Clean up restacking code
Restacking algorithms now only need to provide the sibling window and
stacking mode.
2023-05-15 14:44:50 +02:00
patrick96
76c7ee3bf6 Introduce restacking utilities
Aim is to clean up restacking logic and remove some duplicated code
2023-05-15 14:44:50 +02:00
patrick96
f78ec80df3 Add changelog entry 2023-05-10 17:06:00 +02:00
patrick96
425d4dc338 Cleanup 2023-05-10 17:06:00 +02:00
patrick96
32c78aa63a Cleanup ucs4_to_utf8 2023-05-10 17:06:00 +02:00
patrick96
40bc8c7955 Test utf8_to_ucs4 error correction 2023-05-10 17:06:00 +02:00
patrick96
5b1fae4fc1 Make utf8_to_ucs4 take a string reference 2023-05-10 17:06:00 +02:00
patrick96
5e5a0a7c4d Make unicode_charlist a vector 2023-05-10 17:06:00 +02:00
patrick96
c86519f077 test: utf8_to_ucs4 with invalid strings 2023-05-10 17:06:00 +02:00
patrick96
3a27e891d2 fix(renderer): Drop strings with invalid UTF8 2023-05-10 17:06:00 +02:00
patrick96
63443f82d5 Refactor utf8_to_ucs4 2023-05-10 17:06:00 +02:00
patrick96
270c0a340c Add tests for utf8_to_ucs4 2023-05-10 17:06:00 +02:00
patrick96
71c65447f8 Move utf8 conversion code to string utils 2023-05-10 17:06:00 +02:00
patrick96
6e716296ff Formatting 2023-05-10 17:06:00 +02:00
patrick96
d74a4fab77 i3: Better error reporting when connection fails
Prints the output and exit code of 'i3 --get-socketpath' if it fails and
prints the socket path if the connection fails.

Ref polybar/i3ipcpp#13
Ref #2942
2023-05-10 09:42:05 +02:00
dvermd
f5169abde2
Remove unsupported.hpp (#2956)
* Remove unsupported.hpp

* Rename names.hpp to types.hpp

* Replace macro by function

* Add missing cassert include in controller.cpp
2023-05-08 19:36:12 +02:00
Patrick Ziegler
031a29332a
doc: Use readthedocs config file (#2957)
This is the recommended way to configure the project instead of using
the website.

It should also help fix readthedocs/readthedocs.org#10290
2023-05-08 19:13:02 +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
61f0e9dd5d fix(tray): Vertically center in inner bar area
The tray should be vertically centered in the inner area of the bar.
Unequal top and bottom borders should not affect the alignment relative
to other text.

Fixes #2950
2023-04-29 14:45:01 +02:00
patrick96
7bc673b8f2 fix(doc): %s in extlinks caption before sphinx 4.0
There is no way to support extlinks with a custom caption in both sphinx
< 4 and >= 4 at the same time without implementing different behavior
per version.
2023-04-20 01:24:02 +02:00
patrick96
89ca0255f1 doc: Fix extlinks %s substitution in caption
Substitutions in the caption are only supported in version 4 of
sphinx.
However, RTD uses sphinx 1.8.6

Just letting it append the value seems to work in both 1.8.6 and newer
versions.
2023-04-18 15:48:38 +02:00
patrick96
cf802ad431 doc: Mention errors and warnings in migration guide 2023-04-18 15:48:38 +02:00
patrick96
dbac7d8ae8 doc: Finish tray migration guide 2023-04-18 15:48:38 +02:00
patrick96
fcef90be24 doc: Start tray migration guide 2023-04-18 15:48:38 +02:00
patrick96
6148bb7f14 doc: Add empty migration page 2023-04-18 15:48:38 +02:00
patrick96
30bb1584fc doc: Add page about default config 2023-04-18 15:48:38 +02:00
patrick96
f3c911991c doc: Document custom directive in python script 2023-04-18 15:48:38 +02:00
patrick96
44b5f87884 doc: Use issue directive to link to issue 2023-04-18 15:48:38 +02:00
patrick96
006e971dad doc: Add module links 2023-04-18 15:48:38 +02:00
patrick96
6e0cff97ff doc(tray): Add type at the beginning 2023-04-18 15:48:38 +02:00
patrick96
fc422b1107 doc: Style external links in RTD theme 2023-04-18 15:48:38 +02:00
patrick96
81684a6c9d doc: Show version in alabaster theme (local builds) 2023-04-18 15:48:38 +02:00
patrick96
0032f27686 doc: Use extlinks for linking to issues and PRs 2023-04-18 15:48:38 +02:00
patrick96
234e606b41 doc: Replace custom domain with add_object_type
Less overhead and doesn't require a new dependency
2023-04-18 15:48:38 +02:00
patrick96
c48aa1998c fix(doc): Setup function not always running
If the sphinx version was below 1.8.5, no setup function was defined at
all.
2023-04-18 15:48:38 +02:00
patrick96
98d58b6f27 doc: Reformat conf.py 2023-04-18 15:48:38 +02:00
patrick96
c6eb3f88ea doc(tray): Initial experiments 2023-04-18 15:48:38 +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
4e66b1f4b8 tray: Remove tray-scale module setting 2023-04-01 21:04:58 +02:00
patrick96
921e2d0670
Merge remote-tracking branch 'upstream/master' into tray-child-window 2023-03-25 22:04:21 +01:00