1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-01-30 18:49:31 +00:00

49 Commits

Author SHA1 Message Date
Tin Švagelj
7b44b2a27b
Update DPI when changed in resource manager (#1878)
* Update xft_dpi on property change
  * Added fallback calculation when Xft is disabled.
* Removed display_width/height and replaced it with workarea for
  consistency.
* Make DPI work on X11 when Xft is disabled
* Make find_subwindow more specific, rename it

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-05-01 14:55:05 +00:00
Tin Švagelj
e1f301354b
Remove dpi scaling of maximum width (#1877)
* Fix dpi scaling maximum_width setting
* Set workspace dimensions from WL output_geometry
* Append script parent dir to lua package.path
* Fix issues with dpi_scale function selection
* Re-implement rounding through `type_traits` generically

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-04-30 20:21:39 +00:00
Tin Švagelj
c5ee70177c
set_struts improvements (#1849)
Simplify and speed up strut code

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-04-24 13:56:28 +00:00
Tin Švagelj
6adf6b9dd4
Cleanup build flags, global namespace and includes (#1841)
- Separated displays so they don't have to all be included in build even when the features are disabled.
- Removed weird linker magic for display init and replaced it with straightforward (and faster) template functions that behave the same.
  - Replaced `disabled_display_output` classes with log messages.
- Add explicit compiler errors when feature dependent headers get included where they shouldn't (wl, x11).
- Switch BUILD_MOUSE_EVENTS dependency from OWN_WINDOW to BUILD_X11.
- Other minor improvements to some existing code which shouldn't affect behavior.
- Improve documentation.
- Remove X11 from unrelated headers.
  - This reaches 0% unneeded X11 polution in the sources.
  - Reenabled parts of window_type which would work in Wayland.
  - Remove unneeded guards.
- Display files are now no longer compiled if their features are disabled.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-04-23 21:15:37 +00:00
Tin Švagelj
f4b3229fc3
Exclusive XInput event handling (#1821)
- This commit changes mouse events to use XInput exclusively if it's not disabled.
- Added support for changing valuator properties through device configuration (see wiki for details).
- Fixed and cleaned up a lot of previously added code.
2024-04-17 02:04:14 +00:00
Tin Švagelj
c2dfa29f33
Refactor x11 event handling (#1819)
Move event handling code into separate functions.
2024-04-12 14:46:39 +00:00
Tin Švagelj
9424ab8ca5
Fix event propagation on Openbox
Events now get correctly propagated to a window (or root if none) behind conky.
This was a necessary change to handle cases such as MATE+caja where caja
is used between conky and background to show icons and desktop menu.

* Don't change input focus on propagation

Could cause input focus flickering, so I'm leaving it up to WMs to manage focus.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-04-09 12:28:26 +00:00
Tin Švagelj
407769d03d
Skip propagation of non-input events
Fixes #1771

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-04-04 11:51:48 +00:00
Tin Švagelj
bfe39a8fd2
Handle external PropertyNotify events
Fixes #1792

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-04-04 11:51:01 +00:00
Brenden Matthews
8efb3f0e0e Fix naming conflict for Imlib2.h 2024-03-11 16:08:32 -04:00
Brenden Matthews
5dd632c991 Don't call FcFini()
Fontconfig has a bug in FcFini() where it calls assert when it probably
shouldn't. This looks to be fixed in
6f6b397802,
which is in libfontconfig >=2.13.93.

Removing this seems to be safe, it will cause valgrind to show mem
leaks, but it doesn't look to be a problem in practice.
2024-02-26 08:40:02 -05:00
Tin Švagelj
27d64fe834 Fix buffer overflow on X11 error bug
Skip descendant checking if cursor over desktop in query_x11_window_at_pos.
Simplify and correct check for whether cursor is over conky.

Signed-off-by: Tin Švagelj <tin.svagelj@live.com>
2024-02-25 08:13:45 -05:00
Brenden Matthews
35357e437c Update copyright 2024-02-22 08:53:35 -05:00
Suyooo
aa6e61be2e X11: Fix infinite loop from Expose events being returned 2024-02-19 08:37:45 -05:00
Tin
b9e7fa0574
Namespace mouse-events.cc/.h
Cleanup number namespaces so they use cstdint types instead of stdint.h
types. Latter could've caused some issues in the future.

Simplify valuator mask checking expression.

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:34 -05:00
Tin
1b45d95e26
Use core X11 events when Xinput is enabled
There was no way to propagate move events otherwise

Also, clang-format decided to kick in and reformat Xinput related
code...

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:33 -05:00
Tin
4936c7492c
Provide a notice when build options get disabled
Reformat files and hope it invalidates CI cache :)

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:33 -05:00
Tin
7a3020fad5
Fix CMake script
Cleanup debug statements

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:33 -05:00
Tin
916be9812b
Handle movement through XInput if enabled
Cleanup modifiers
- This is preparation so that once Wayland adds support for these
  they're not an alien X11 bitset.
- Removed ones that aren't actual modifiers.

Tidy up code

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:33 -05:00
Tin
965d7dc0a4
Simplify cursor checking
Additional tweaks and docs improvements

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:33 -05:00
Tin
a591228b71
Modify CI and Nix flake
Code tweaks

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:32 -05:00
Tin
a4ac632db7
Fix X11 area enter & leave bug
Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:32 -05:00
Tin
bf900545c0
Debug X11 enter & leave events
Fix import derps

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:32 -05:00
Tin
5d5e235467
Cleanup display-x11 includes
Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:32 -05:00
Tin
f6a08f79b4
Tweaks
Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:32 -05:00
Tin
b1b7ae8b2c
Fix X11 build
Fix most issues with X11 event propagation.
Remove X11 code from mouse-events.cc/.h completely.

CMake:
Update toluapp cmake_minimum_required to stop it complaining during build.
Fix ConkyPlatformCheck.cmake not providing access to cairo, imlib2 and rsvg to Wayland.
Move BUILD_MOUSE_EVENTS includes under BUILD_GUI so they're not duplicated.

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:32 -05:00
Tin
958bd1c525
Pass cursor move event to the script
Set initial window scale to 0 because wayland freezes the process when it's not >0.
Provide more information from `llua_mouse_hook` about why the callback is failing.
Prevent call to `llua_init` when provided lua_load script doesn't exist.
- This caused me a headache and now lua_L won't be initialized if the
  script doesn't exist. This prevents a missing file from causing later
  issues which might be harder to catch.
Feature gated X11 in mouse-events.h/.cc files.

Signed-off-by: Tin <tin.svagelj@live.com>
2023-11-19 14:16:31 -05:00
François Revol
c781b42f66 X11: Fix segfault on SIGINT
deinit_x11() was called too late, and it seems some libs like xinerama
and xcb-render add cleanup hooks but forget to remove them when they get
unloaded.
2023-08-12 10:04:24 -04:00
François Revol
2bd267da31 Fix build without X11
On Haiku it complained about missing X11 header.
2023-08-08 08:40:51 -04:00
bi4k8
faba25d197 logging: define CRIT_ERR_FREE and simplify CRIT_ERR
it's surprising to pass 2 nullptr arguments at most of the callsites of a logging function, so instead let callers explicitly state whether they have auxiliary data to free
2023-05-09 02:26:29 +00:00
bi4k8
dab87c5246
Fix memory leaks in X11 display backend (#1483)
* display-x11: fix memory leaks

FcFini() was never being called, which meant FontConfig did not clean up its internal storage.

furthermore, restore a commented-out call to XftFontClose()

9acf0bb4c commented this call out, but it does not seem to cause any problems now on reload now

* feat: Move docs to website, rearrange bits (#1475)

* build(deps): bump actions/stale from 7 to 8 (#1472)

Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add fontconfig platform checks

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: bi4k8 <bi4k8@github>
Co-authored-by: Brenden Matthews <brenden@brndn.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brenden Matthews <github@brenden.brndn.io>
2023-03-31 12:54:20 -04:00
Brenden Matthews
a39015b7bd
Apply clang-format. 2023-02-24 08:43:15 -05:00
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
a72902fa35 add Colour type and use it pervasively 2023-02-06 10:15:34 -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
76b0f049bc
Apply clang-format. 2022-12-24 09:44:03 -05:00
bi4k8
6b0c194515
x11: do not treat init failure as fatal with Wayland 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
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
Brenden Matthews
4622c0e336 Change assert in set_font to check w/ debug.
This resolves #1292.
2022-12-24 09:35:30 -05:00
Gene Carlson
fc8d778435 Replace atoi and atol with strtol (most files). 2022-09-25 18:24:03 -04:00
François Revol
7cf80d5948 Work around linker missing objects when building tests
Since we rely on a global object ctor to add a display output to the
list, it is not referenced from anywhere else, so does not get linked in
when building tests since most objects are pulled from a static library.

Another option would be to use --whole-archive to link to it.
2022-09-10 20:39:11 +02:00
François Revol
5b22723a3b Fix warnings
unused paramaters and (un)signed comparison mostly.
2022-09-10 20:39:11 +02:00
François Revol
e721119f04 Update copyright, authors.
Backported from 308f2cb8eac1f3165a6ab6170b3e63675c02dde0
2022-09-10 20:39:11 +02:00
François Revol
9a710fe17f display: fix logging 2022-09-10 20:39:11 +02:00
François Revol
568de329ef Move X11 font stuff to display-x11 2022-09-10 20:39:11 +02:00
François Revol
281097a2a5 move X11 stuff from conky.cc to display-x11
Still some things to sort out, but seems to work.

A lot of variables and calls had to be made non-static.
2022-09-10 20:39:11 +02:00
François Revol
fd683ee8ce display-*: Fix copyright 2022-09-10 20:39:11 +02:00
François Revol
17ceb82079 Initial stubbing of display backends
Hopefully this will lead the way to adding support for things like
Wayland and Haiku graphics, cf. #56.

We define a display_output_base class that display backends
can derive from to implement display-specific calls.
2022-09-10 20:39:11 +02:00