Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mouse events & friends for Wayland #1672

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1b479ae
Prepare environment
Caellian Jan 1, 2023
ae5afd5
Add Wayland event listeners for pointer
Caellian Nov 5, 2023
78ea7b6
Merge branch 'feature/wayland-mouse-events' of github.com:Caellian/co…
Caellian Nov 5, 2023
596fa72
Include mouse-events.h in llua.cc
Caellian Nov 5, 2023
9799417
Pass cursor move event to the script
Caellian Nov 5, 2023
51de904
Add support for all previously supported events
Caellian Nov 6, 2023
441d031
Improve Lua table data
Caellian Nov 6, 2023
fd9ea17
Add deprecation error and fix stack management
Caellian Nov 6, 2023
646d5d9
Fix lua stack pops in one of error branches
Caellian Nov 7, 2023
0bfb013
Fix X11 build
Caellian Nov 8, 2023
78cc998
Remove duplicate BUILD_MOUSE_EVENTS includes (again)
Caellian Nov 8, 2023
e595547
Tweaks
Caellian Nov 8, 2023
cc9e2a7
Add <array> import
Caellian Nov 8, 2023
be30bf0
Cleanup includes
Caellian Nov 8, 2023
4b67529
Remove uint to make MacOS happy
Caellian Nov 8, 2023
091efc3
Use SFINAE to collapse numeric pust_table_value impls
Caellian Nov 8, 2023
07b0c81
Cleanup display-x11 includes
Caellian Nov 8, 2023
ed76b16
Debug X11 enter & leave events
Caellian Nov 8, 2023
62a9519
Fix X11 area enter & leave bug
Caellian Nov 9, 2023
670323e
Modify CI and Nix flake
Caellian Nov 9, 2023
8f98f68
Simplify cursor checking
Caellian Nov 10, 2023
d16d977
Cleanup focus handling code on propagation
Caellian Nov 10, 2023
e0d210b
Handle movement through XInput if enabled
Caellian Nov 10, 2023
91b6796
Fix CMake script
Caellian Nov 10, 2023
9d07fc9
Update README.md to trigger CI
Caellian Nov 10, 2023
662cda8
Provide a notice when build options get disabled
Caellian Nov 10, 2023
2aebf68
Fix issues building without BUILD_ARGB flag
Caellian Nov 10, 2023
cc604bc
Fix DependentOptions splitting arguments on spaces
Caellian Nov 10, 2023
71e2860
Fix build & cleanup
Caellian Nov 10, 2023
cebc045
Hide Nvidia on non-linux OSs
Caellian Nov 10, 2023
9d20e72
Prevent infinite loop in DependentOption
Caellian Nov 10, 2023
2ce7796
Use core X11 events when Xinput is enabled
Caellian Nov 13, 2023
8016a0a
Namespace mouse-events.cc/.h
Caellian Nov 13, 2023
cbab03d
Improve speedgraph scale descriptions in docs
elamperti Nov 3, 2023
a2e25f6
Drop graph/linechart from web header
brndnmtthws Nov 8, 2023
347379e
Run npm audit fix
brndnmtthws Nov 8, 2023
5a59001
One more byte for error
brndnmtthws Nov 19, 2023
bbd18f5
Merge branch 'main' into Caellian-feature/wayland-mouse-events
brndnmtthws Nov 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/build-and-test-linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ jobs:
-DBUILD_MYSQL=ON \
-DBUILD_NVIDIA=ON \
-DBUILD_PULSEAUDIO=ON \
-DBUILD_CURL=ON \
-DBUILD_RSS=ON \
-DBUILD_TESTS=ON \
-DBUILD_WLAN=ON \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-and-test-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
libxft \
libxinerama \
libxfixes \
libxi \
lua \
ninja \
pkg-config
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"kamadorueda.alejandra",
"ms-vscode.cmake-tools",
"mkhl.direnv"
"mkhl.direnv",
"xaver.clang-format"
]
}
2 changes: 1 addition & 1 deletion 3rdparty/toluapp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Please note that the package source code is licensed under its own license.

project ( toluapp C )
cmake_minimum_required ( VERSION 3.4 )
cmake_minimum_required ( VERSION 3.15 )
brndnmtthws marked this conversation as resolved.
Show resolved Hide resolved
# Disable dist stuff, we're not installing this as a lib
# include ( cmake/dist.cmake )

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

cmake_minimum_required(VERSION 3.15)
cmake_minimum_required(VERSION 3.17)

project(conky)

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Conky can display more than 300 built-in objects, including support for:

... and much much more.

Conky can display information either as text, or using simple progress
bars and graph widgets, with different fonts and colours.
Conky can display information either as text, or using simple progress bars and
graph widgets, with different fonts and colours, as well as handle [mouse events](https://github.com/brndnmtthws/conky/wiki/Mouse-Events).

## Screenshots

Expand Down
163 changes: 85 additions & 78 deletions cmake/ConkyBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

include(CMakeDependentOption)
include(DependentOption)

if(NOT CMAKE_BUILD_TYPE)
if(MAINTAINER_MODE)
set(
Expand Down Expand Up @@ -97,33 +100,33 @@ set(DEFAULT_TEXT_BUFFER_SIZE "256"
set(MAX_NET_INTERFACES "256" CACHE STRING "Maximum number of network devices")

# Platform specific options Linux only
cmake_dependent_option(BUILD_PORT_MONITORS "Build TCP portmon support" true
"OS_LINUX" false)
cmake_dependent_option(BUILD_IBM "Support for IBM/Lenovo notebooks" true
"OS_LINUX" false)
cmake_dependent_option(BUILD_HDDTEMP "Support for hddtemp" true
"OS_LINUX" false)
cmake_dependent_option(BUILD_IPV6 "Enable if you want IPv6 support" true
"OS_LINUX" false)

if(OS_LINUX)
option(BUILD_PORT_MONITORS "Build TCP portmon support" true)
option(BUILD_IBM "Support for IBM/Lenovo notebooks" true)
option(BUILD_HDDTEMP "Support for hddtemp" true)
option(BUILD_IPV6 "Enable if you want IPv6 support" true)
if(BUILD_X11)
# nvidia may also work on FreeBSD, not sure
option(BUILD_NVIDIA "Enable nvidia support" false)
endif(BUILD_X11)
else(OS_LINUX)
set(BUILD_PORT_MONITORS false)
set(BUILD_IBM false)
set(BUILD_HDDTEMP false)
set(BUILD_NVIDIA false)
set(BUILD_IPV6 false)
# nvidia may also work on FreeBSD, not sure
# NvCtrl requires X11. Should be modified to use NVML directly.
dependent_option(BUILD_NVIDIA "Enable Nvidia NvCtrl variables" false
"BUILD_X11" false
"Nvidia NvCtrl variables require X11")
else()
set(BUILD_NVIDIA false CACHE BOOL "Enable Nvidia NvCtrl variables" FORCE)
endif(OS_LINUX)

# macOS Only
if(OS_DARWIN)
option(
BUILD_IPGFREQ
"Enable cpu freq calculation based on Intel® Power Gadget; otherwise use constant factory value"
false)
endif(OS_DARWIN)
cmake_dependent_option(
BUILD_IPGFREQ
"Enable cpu freq calculation based on Intel® Power Gadget; otherwise use constant factory value"
false
"OS_DARWIN" false)

# Optional features etc
#

option(BUILD_WLAN "Enable wireless support" false)

Expand All @@ -137,53 +140,59 @@ option(BUILD_OLD_CONFIG "Enable support for the old syntax of configurations"
option(BUILD_MATH "Enable math support" true)

option(BUILD_NCURSES "Enable ncurses support" true)
if(BUILD_NCURSES)
option(
LEAKFREE_NCURSES
"Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)"
false)
else(BUILD_NCURSES)
set(
LEAKFREE_NCURSES false
CACHE
BOOL
"Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)"
FORCE)
endif(BUILD_NCURSES)

dependent_option(LEAKFREE_NCURSES
"Enable to hide false ncurses-memleaks in valgrind (works only when ncurses is compiled with --disable-leaks)"
false
"BUILD_NCURSES" false
"LEAKFREE_NCURSES requires ncurses")

option(BUILD_WAYLAND "Build Wayland support" false)

option(BUILD_X11 "Build X11 support" true)
if(BUILD_X11)
option(OWN_WINDOW "Enable own_window support" true)

# Mac Fix
if(OS_DARWIN)
option(BUILD_XDAMAGE "Build Xdamage support" false)
option(BUILD_XFIXES "Build Xfixes support" false)
else(OS_DARWIN)
option(BUILD_XDAMAGE "Build Xdamage support" true)
option(BUILD_XFIXES "Build Xfixes support" true)
endif(OS_DARWIN)

option(BUILD_XINERAMA "Build Xinerama support" true)
option(BUILD_XDBE "Build Xdbe (double-buffer) support" true)
option(BUILD_XFT "Build Xft (freetype fonts) support" true)
option(BUILD_IMLIB2 "Enable Imlib2 support" true)
option(BUILD_XSHAPE "Enable Xshape support" true)
option(BUILD_MOUSE_EVENTS "Enable mouse event support" true)
else(BUILD_X11)
set(OWN_WINDOW false CACHE BOOL "Enable own_window support" FORCE)
set(BUILD_XDAMAGE false CACHE BOOL "Build Xdamage support" FORCE)
set(BUILD_XFIXES false CACHE BOOL "Build Xfixes support" FORCE)
set(BUILD_XINERAMA false CACHE BOOL "Build Xinerama support" FORCE)
set(BUILD_XDBE false CACHE BOOL "Build Xdbe (double-buffer) support" FORCE)
set(BUILD_XFT false CACHE BOOL "Build Xft (freetype fonts) support" FORCE)
set(BUILD_IMLIB2 false CACHE BOOL "Enable Imlib2 support" FORCE)
set(BUILD_XSHAPE false CACHE BOOL "Enable Xshape support" FORCE)
set(BUILD_MOUSE_EVENTS false CACHE BOOL "Enable mouse event support" FORCE)
set(BUILD_NVIDIA false)
endif(BUILD_X11)

dependent_option(OWN_WINDOW "Enable running conky in a dedicated window" true
"BUILD_X11" false
"Dedicated window mode only works on X11")

# On MacOS these cause issues so they're disabled by default
if(OS_DARWIN)
dependent_option(BUILD_XDAMAGE "Build Xdamage support" false
"BUILD_X11" false
"Xdamage support requires X11")
dependent_option(BUILD_XFIXES "Build Xfixes support" false
"BUILD_X11" false
"Xfixes support requires X11")
else()
dependent_option(BUILD_XDAMAGE "Build Xdamage support" true
"BUILD_X11" false
"Xdamage support requires X11")
dependent_option(BUILD_XFIXES "Build Xfixes support" true
"BUILD_X11" false
"Xfixes support requires X11")
endif(OS_DARWIN)

dependent_option(BUILD_ARGB "Build ARGB (real transparency) support" true
"BUILD_X11;OWN_WINDOW" false
"ARGB support requires X11 and OWN_WINDOW enabled, not needed on Wayland")
dependent_option(BUILD_XINERAMA "Build Xinerama support" true
"BUILD_X11" false
"Xinerama support requires X11")
dependent_option(BUILD_XDBE "Build Xdbe (double-buffer) support" true
"BUILD_X11" false
"Xdbe based double-buffering requires X11")
dependent_option(BUILD_XFT "Build Xft (freetype fonts) support" true
"BUILD_X11" false
"Xft (freetype font) support requires X11")
dependent_option(BUILD_IMLIB2 "Enable Imlib2 support" true
"BUILD_X11" false
"Imlib2 support requires X11")
dependent_option(BUILD_XSHAPE "Enable Xshape support" true
"BUILD_X11" false
"Xshape support requires X11")
dependent_option(BUILD_XINPUT "Build Xinput 2 support" true
"BUILD_X11;BUILD_MOUSE_EVENTS" false
"Xinput 2 support requires X11 and BUILD_MOUSE_EVENTS enabled")

# if we build with any GUI support
if(BUILD_X11)
Expand All @@ -193,16 +202,15 @@ if(BUILD_WAYLAND)
set(BUILD_GUI true)
endif(BUILD_WAYLAND)

if(OWN_WINDOW)
option(BUILD_ARGB "Build ARGB (real transparency) support" true)
else(OWN_WINDOW)
set(BUILD_ARGB false
CACHE BOOL "Build ARGB (real transparency) support"
FORCE)
endif(OWN_WINDOW)
dependent_option(BUILD_MOUSE_EVENTS "Enable mouse event support" true
"BUILD_WAYLAND OR OWN_WINDOW" false
"Mouse event support requires Wayland or OWN_WINDOW enabled")

# Lua library options
option(BUILD_LUA_CAIRO "Build cairo bindings for Lua" false)
option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false)
dependent_option(BUILD_LUA_IMLIB2 "Build Imlib2 bindings for Lua" false
"BUILD_X11;BUILD_IMLIB2" false
"Imlib2 Lua bindings require X11 and Imlib2")
option(BUILD_LUA_RSVG "Build rsvg bindings for Lua" false)

option(BUILD_AUDACIOUS "Build audacious (music player) support" false)
Expand All @@ -217,12 +225,9 @@ option(BUILD_XMMS2 "Enable if you want XMMS2 (music player) support" false)

option(BUILD_CURL "Enable if you want Curl support" false)

option(BUILD_RSS "Enable if you want RSS support" false)

if(BUILD_RSS)
# if RSS is enabled, curl is required
set(BUILD_CURL true)
endif(BUILD_RSS)
dependent_option(BUILD_RSS "Enable if you want RSS support" false
"BUILD_CURL" false
"RSS depends on Curl support")

option(BUILD_APCUPSD "Enable APCUPSD support" true)

Expand All @@ -248,6 +253,8 @@ option(BUILD_PULSEAUDIO
option(BUILD_INTEL_BACKLIGHT
"Enable support for Intel backlight" false)

run_dependency_checks()

message(STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS})
message(STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS})

Expand Down
47 changes: 43 additions & 4 deletions cmake/ConkyPlatformChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ set(INCLUDE_SEARCH_PATH /usr/include /usr/local/include)
# Set system vars
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(OS_LINUX true)
else(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(OS_LINUX false)
endif(CMAKE_SYSTEM_NAME MATCHES "Linux")

if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
Expand All @@ -68,33 +70,47 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
if(BUILD_IRC)
set(conky_libs ${conky_libs} -lssl -lcrypto)
endif(BUILD_IRC)
else(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
set(OS_FREEBSD false)
endif(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")

if(CMAKE_SYSTEM_NAME MATCHES "DragonFly")
set(OS_DRAGONFLY true)
set(conky_libs ${conky_libs} -ldevstat)
else(CMAKE_SYSTEM_NAME MATCHES "DragonFly")
set(OS_DRAGONFLY false)
endif(CMAKE_SYSTEM_NAME MATCHES "DragonFly")

if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
set(OS_OPENBSD true)
else(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
set(OS_OPENBSD false)
endif(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")

if(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(OS_SOLARIS true)
set(conky_libs ${conky_libs} -lkstat)
else(CMAKE_SYSTEM_NAME MATCHES "SunOS")
set(OS_SOLARIS false)
endif(CMAKE_SYSTEM_NAME MATCHES "SunOS")

if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set(OS_NETBSD true)
else(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set(OS_NETBSD false)
endif(CMAKE_SYSTEM_NAME MATCHES "NetBSD")

if(CMAKE_SYSTEM_NAME MATCHES "Haiku")
set(OS_HAIKU true)
set(conky_libs ${conky_libs} -lnetwork -lintl)
else(CMAKE_SYSTEM_NAME MATCHES "Haiku")
set(OS_HAIKU false)
endif(CMAKE_SYSTEM_NAME MATCHES "Haiku")

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(OS_DARWIN true)
else(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(OS_DARWIN false)
endif(CMAKE_SYSTEM_NAME MATCHES "Darwin")

if(NOT OS_LINUX
Expand Down Expand Up @@ -402,6 +418,29 @@ if(BUILD_X11)

set(conky_libs ${conky_libs} ${X11_Xfixes_LIB})
endif(BUILD_XFIXES)

# check for Xinput
if(BUILD_XINPUT)
if(NOT X11_Xinput_FOUND)
message(FATAL_ERROR "Unable to find Xinput library")
endif(NOT X11_Xinput_FOUND)

set(conky_libs ${conky_libs} ${X11_Xinput_LIB})
endif(BUILD_XINPUT)


if(X11_xcb_FOUND)
set(HAVE_XCB true)
set(conky_libs ${conky_libs} ${X11_xcb_LIB})
if(X11_xcb_errors_FOUND)
set(HAVE_XCB_ERRORS true)
set(conky_libs ${conky_libs} ${X11_xcb_LIB} ${X11_xcb_errors_LIB})
else(X11_xcb_errors_FOUND)
set(HAVE_XCB_ERRORS false)
endif(X11_xcb_errors_FOUND)
else(X11_xcb_FOUND)
set(HAVE_XCB false)
endif(X11_xcb_FOUND)
else(X11_FOUND)
message(FATAL_ERROR "Unable to find X11 library")
endif(X11_FOUND)
Expand Down Expand Up @@ -451,7 +490,7 @@ set(conky_libs ${conky_libs} ${LUA_LIBRARIES})
set(conky_includes ${conky_includes} ${LUA_INCLUDE_DIR})
include_directories(3rdparty/toluapp/include)

if(BUILD_X11)
if(BUILD_GUI)
# Check for libraries used by Lua bindings
if(BUILD_LUA_CAIRO)
pkg_check_modules(CAIRO REQUIRED cairo>=1.14 cairo-xlib)
Expand All @@ -464,21 +503,21 @@ if(BUILD_X11)
endif(NOT APP_PATCH)
endif(BUILD_LUA_CAIRO)

if(BUILD_LUA_IMLIB2)
if(BUILD_X11 AND BUILD_LUA_IMLIB2)
pkg_search_module(IMLIB2 REQUIRED imlib2 Imlib2)
set(luaimlib2_libs ${IMLIB2_LIBS} ${IMLIB2_LDFLAGS} ${LUA_LIBRARIES})
set(luaimlib2_includes
${IMLIB2_INCLUDE_DIRS}
${LUA_INCLUDE_DIR}
${X11_INCLUDE_DIR})
Caellian marked this conversation as resolved.
Show resolved Hide resolved
endif(BUILD_LUA_IMLIB2)
endif(BUILD_X11 AND BUILD_LUA_IMLIB2)

if(BUILD_LUA_RSVG)
pkg_check_modules(RSVG REQUIRED librsvg-2.0>=2.52)
set(luarsvg_libs ${RSVG_LIBRARIES} ${LUA_LIBRARIES})
set(luarsvg_includes ${RSVG_INCLUDE_DIRS} ${LUA_INCLUDE_DIR})
endif(BUILD_LUA_RSVG)
endif(BUILD_X11)
endif(BUILD_GUI)

if(BUILD_AUDACIOUS)
set(WANT_GLIB true)
Expand Down
Loading