1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 18:15:17 +00:00
Commit Graph

2735 Commits

Author SHA1 Message Date
bi4k8
4a7bec5ba6
Premultiply background colors for X11 (#1421)
* initialize XColor/XftColor

this does not change behavior, but avoids passing uninitialized data to X/Xft functions

* gui, x11: move have_argb_visual to x11 files

this variable only has meaning with respect to X11

* x11: clear have_argb_visual if the setting changes to false

otherwise, we may try to use colors with alpha when we no longer requested a 32-bit visual

* x11: premultiply alpha of background colors

* x11: clean up set_foreground_color a bit

---------

Co-authored-by: bi4k8 <bi4k8@github>
2023-02-24 08:13:48 -05:00
bi4k8
5e98c49c4c
use new Colour type for specials and gradients (#1418)
* gradient, colours: use 24-bit colour depth internally on Wayland

our Colour type assumes this anyway; lower colour depth should be handled by display backends

* core: restore gradient color computation

this was mistakenly disabled when moving to a unified Colour representation

* core, gradient: use Colour type

* tests: gradient: always test hsv/hcl

colour computations no longer depend on the display backends we compile with, so these can be tested unconditionally now

* gradients, specials: use Color type

this makes specials now accept color names as well as hex codes, and removes all notions of color depth from gradient calculations

---------

Co-authored-by: bi4k8 <bi4k8@github>
2023-02-24 08:13:19 -05:00
Brenden Matthews
f3b7b1f189
Unbreak Xinerama config loading. (#1408)
This resolves #1364 and #1372.
2023-02-18 09:34:53 -05:00
Brenden Matthews
06f000d9da
Enable GCC 12 in actions, fix warning. (#1407)
* Enable GCC 12 in actions, fix warning.

This resolves #1406.
2023-02-18 08:33:11 -05:00
tranquillity-codes
4b8d5eb34a
Add an above-all overlay mode for own_window_type, utility (#1402)
* Add libXdamage to flake.nix

* Add TYPE_UTILITY as above-all alternative to TYPE_OVERRIDE

* Click-through for TYPE_UTILITY

* Added libxfixes to MacOS CI workflow

* Disable building of XFIXES on MacOS

* Fix build for xinerama/xfixes on macos.

* Update Lua version check.

* Tidy this up.

* Fix BUILD_XFIXES on Linux

* Sigh, fix this.

---------

Co-authored-by: tranquillity-codes <dev@itycodes.org>
Co-authored-by: Brenden Matthews <brenden@brndn.io>
2023-02-16 22:03:14 -05:00
Brenden Matthews
4807d3c68d Fix a couple security nits from codeql
See:
- https://github.com/brndnmtthws/conky/security/code-scanning/1
- https://github.com/brndnmtthws/conky/security/code-scanning/2
- https://github.com/brndnmtthws/conky/security/code-scanning/3
2023-02-14 21:43:45 -05:00
bi4k8
fe27753929 move color settings to their own file
these settings are used for GUI builds as well as ncurses builds, and if we support colors in console and HTTP output, will be used there too

colors really are essential to what Conky does, even if some outputs don't support them, so it makes sense to build support for them unconditionally
2023-02-06 10:15:34 -05:00
bi4k8
9b2706fc49 build x11-color.cc for any GUI, not just wayland
we should actually build this for ncurses and html backends too, not just GUI ones
2023-02-06 10:15:34 -05:00
bi4k8
9ab51edf9f ncurses: allocate custom colors
color0-9 will now use their configured RGB values exactly
2023-02-06 10:15:34 -05:00
bi4k8
d51bf688ba ncurses: call init_pair immediately before using colors
this allows using color0, etc. in ncurses; the nearest available ncurses color will be used
2023-02-06 10:15:34 -05:00
bi4k8
9cc4b083fc core: avoid argb32 roundtrips when calling set_current_text_color 2023-02-06 10:15:34 -05:00
bi4k8
ec24079a3a remove x11 dependency for color parsing
this means we can use the same, portable color-parsing code
everywhere, including ncurses
2023-02-06 10:15:34 -05:00
bi4k8
a72902fa35 add Colour type and use it pervasively 2023-02-06 10:15:34 -05:00
bi4k8
d3e9bcbe71 wayland: use arithmetic instead of wrong-endian memcpy
this fixes corruption of parsed colors in Wayland-only builds
2023-01-04 07:59:33 -05:00
bi4k8
31b4c27abc use ARGB, not RGBA, for Wayland color values
this impacts only colors from which we compute Cairo colors, not the
rendered pixel buffers themselves, which were already and remain
ARGB32.

this makes Wayland and (24-bit) X11 use the same representation of
colors, fixing bugs when both backends were enabled.

we should still eventually switch to a backend-independent color
representation, because there are no guarantees of which pixel format
X11 will use (it isn't alway ARGB32) and backends like ncurses have
their own color representation; in most code we just hope the
unsigned long will be interpreted by the same backend as wrote it.
2023-01-03 08:35:23 -05:00
bi4k8
1c95c6d577 wayland: trigger window resize when scale changes
scale changes are applied by window_resize, so we need to make
sure it gets called when the scale has changed.
2023-01-03 08:34:35 -05:00
Tin Švagelj
7fbdfbd4d4
Added mouse events to conky (#955)
* Add mouse events.

Signed-off-by: Tin Svagelj <tin.svagelj@live.com>

* Rename MOUSE_EVENTS flag to BUILD_MOUSE_EVENTS.

Signed-off-by: Tin Svagelj <tin.svagelj@live.com>

* Update NORM_ERR func argument from std::string to char*

Because func was previously char* I forgot to update NORM_ERR function
argument to `func.c_str()` not that it's std::string.

Previously func was pointing to std::string memory that was freed at
assignment.

Signed-off-by: Tin Svagelj <tin.svagelj@live.com>

Signed-off-by: Tin Svagelj <tin.svagelj@live.com>
2023-01-01 12:39:57 -05:00
Brenden Matthews
0e61013ac9 Fix these warns. 2022-12-27 09:15:29 -05:00
Brenden Matthews
3e827ba82f Fix this def. 2022-12-27 09:15:29 -05:00
Brenden Matthews
00a16a776c Adjust these buffer sizes. 2022-12-27 09:15:29 -05:00
Brenden Matthews
61e8550615 Fix string dest length. 2022-12-27 09:15:29 -05:00
Brenden Matthews
9bf55cfbfd Drop this message. 2022-12-26 13:21:40 -05:00
Brenden Matthews
ffd34a4fc0 Fix missing settings fail. 2022-12-26 13:21:40 -05:00
Brenden Matthews
c28ad36c4c This is superfluous. 2022-12-26 13:21:40 -05:00
Brenden Matthews
59513b4c65 Add this back. 2022-12-26 13:21:40 -05:00
Brenden Matthews
c48df06359 Fix (some) wayland/x11 init ordering issues. 2022-12-26 13:21:40 -05:00
Brenden Matthews
15aa99836b Add missing unistd include. 2022-12-25 07:52:05 -05:00
Brenden Matthews
dd07a838c4 Build fixes for newly introduced Wayland support. 2022-12-24 11:29:19 -05:00
Brenden Matthews
7247a4c1e6 Fix some include ordering/build stuff. 2022-12-24 10:36:31 -05:00
Brenden Matthews
76b0f049bc
Apply clang-format. 2022-12-24 09:44:03 -05:00
bi4k8
a585e36d93
wayland: permit unused parameters
the Wayland callbacks have many params that we don't use; it isn't worthwhile to individually annotate these
2022-12-24 09:42:04 -05:00
bi4k8
a6c52ee73f
wayland: clamp text width 2022-12-24 09:42:03 -05:00
bi4k8
6b0c194515
x11: do not treat init failure as fatal with Wayland 2022-12-24 09:42:03 -05:00
bi4k8
b556f17648
x11: early-return from use_xdbe_setting::set_up if X11 not initialized 2022-12-24 09:42:03 -05:00
bi4k8
1eb88aeb43
x11, imlib2: early-exit in some X functions if X is not available at runtime 2022-12-24 09:42:03 -05:00
bi4k8
a30cc64a98
x11: update x11.cc for functionality moved into gui.cc 2022-12-24 09:42:03 -05:00
bi4k8
8973b58299
gui: remove background_color from gui.cc and window_type/window_hints from gui.h 2022-12-24 09:42:03 -05:00
bi4k8
2a4f5216c1
x11, gui: update display-x11.cc to account for some code moved into gui.h/gui.cc 2022-12-24 09:42:03 -05:00
bi4k8
5859d76741
core: fix misbehavior in specials handling that fails badly with Wayland backend 2022-12-24 09:42:03 -05:00
bi4k8
d183ad3f6f
core: fix segfault when no display outputs are enabled 2022-12-24 09:42:02 -05:00
bi4k8
d856e397d7
core: fix right-alignment with wayland
I'm not sure why this is necessary (or what it might break), but it seems to work
2022-12-24 09:42:02 -05:00
bi4k8
343f4545cd
wayland: rework window destruction/resizing 2022-12-24 09:42:02 -05:00
bi4k8
0b00ff487f
wayland: respond to xdg_wm_base.ping 2022-12-24 09:42:02 -05:00
bi4k8
03d9c25491
wayland: fix crash after 5 minutes 2022-12-24 09:42:02 -05:00
bi4k8
65f4d4f7eb
colours: define manually_get_x11_color for usage outside X11 2022-12-24 09:42:02 -05:00
bi4k8
e914128c32
colours: parse X11 colors under Wayland 2022-12-24 09:42:02 -05:00
bi4k8
35b874de65
wayland: switch to zwlr_layer_shell_v1 and implement proper window placement
this vendors the wlr-layer-shell-unstable-v1 protocol XML file
2022-12-24 09:42:02 -05:00
bi4k8
4c71e4527b
wayland: implement buffer scaling 2022-12-24 09:42:01 -05:00
bi4k8
9ce6ffbb87
wl: declare desktop/monitor info functions as weak symbols
these are implemented on both Wayland and X11, as stubs on the former. we need
to properly dispatch these based on the backend, but for now this resolves the
conflict
2022-12-24 09:42:01 -05:00
bi4k8
d11742ae18
build, colours, core, gui, wayland, wl, x11: implement wayland display backend 2022-12-24 09:42:01 -05:00