mirror of
https://github.com/Llewellynvdm/conky.git
synced 2025-01-12 11:04:10 +00:00
Modify CI and Nix flake
Code tweaks Signed-off-by: Tin <tin.svagelj@live.com>
This commit is contained in:
parent
a4ac632db7
commit
a591228b71
1
.github/workflows/build-and-test-macos.yaml
vendored
1
.github/workflows/build-and-test-macos.yaml
vendored
@ -37,6 +37,7 @@ jobs:
|
|||||||
libxft \
|
libxft \
|
||||||
libxinerama \
|
libxinerama \
|
||||||
libxfixes \
|
libxfixes \
|
||||||
|
libxi \
|
||||||
lua \
|
lua \
|
||||||
ninja \
|
ninja \
|
||||||
pkg-config
|
pkg-config
|
||||||
|
@ -77,6 +77,9 @@
|
|||||||
xorg.libXfixes
|
xorg.libXfixes
|
||||||
xorg.libXft
|
xorg.libXft
|
||||||
xorg.libXinerama
|
xorg.libXinerama
|
||||||
|
xorg.libXi
|
||||||
|
xorg.libxcb
|
||||||
|
xorg.xcbutilerrors
|
||||||
]
|
]
|
||||||
++ lib.optional stdenv.isDarwin darwin.libobjc;
|
++ lib.optional stdenv.isDarwin darwin.libobjc;
|
||||||
};
|
};
|
||||||
|
@ -391,13 +391,10 @@ bool display_output_x11::main_loop_wait(double t) {
|
|||||||
// XQueryPointer returns wrong results because conky is a weird window
|
// XQueryPointer returns wrong results because conky is a weird window
|
||||||
Window query_result = query_x11_window_at_pos(display, data->root_x, data->root_y);
|
Window query_result = query_x11_window_at_pos(display, data->root_x, data->root_y);
|
||||||
|
|
||||||
//printf("over: %#x w:%#x d:%#x r:%#x\n", query_result, window.window, window.desktop, window.root);
|
|
||||||
|
|
||||||
static bool cursor_inside = false;
|
static bool cursor_inside = false;
|
||||||
if ((query_result != 0 && query_result == window.window) ||
|
if ((query_result != 0 && query_result == window.window) ||
|
||||||
((query_result == window.desktop || query_result == window.root || query_result == 0) && data->root_x >= window.x && data->root_x < (window.x + window.width) &&
|
((query_result == window.desktop || query_result == window.root || query_result == 0) && data->root_x >= window.x && data->root_x < (window.x + window.width) &&
|
||||||
data->root_y >= window.y && data->root_y < (window.y + window.height))) {
|
data->root_y >= window.y && data->root_y < (window.y + window.height))) {
|
||||||
//puts("over self");
|
|
||||||
if (!cursor_inside) {
|
if (!cursor_inside) {
|
||||||
llua_mouse_hook(mouse_crossing_event(
|
llua_mouse_hook(mouse_crossing_event(
|
||||||
mouse_event_t::AREA_ENTER,
|
mouse_event_t::AREA_ENTER,
|
||||||
@ -407,15 +404,12 @@ bool display_output_x11::main_loop_wait(double t) {
|
|||||||
}
|
}
|
||||||
cursor_inside = true;
|
cursor_inside = true;
|
||||||
} else if (cursor_inside) {
|
} else if (cursor_inside) {
|
||||||
//puts("left");
|
|
||||||
llua_mouse_hook(mouse_crossing_event(
|
llua_mouse_hook(mouse_crossing_event(
|
||||||
mouse_event_t::AREA_LEAVE,
|
mouse_event_t::AREA_LEAVE,
|
||||||
data->root_x - window.x, data->root_y - window.x,
|
data->root_x - window.x, data->root_y - window.x,
|
||||||
data->root_x, data->root_y
|
data->root_x, data->root_y
|
||||||
));
|
));
|
||||||
cursor_inside = false;
|
cursor_inside = false;
|
||||||
} else {
|
|
||||||
//printf("not over self\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XFreeEventData(display, &ev.xcookie);
|
XFreeEventData(display, &ev.xcookie);
|
||||||
|
@ -172,6 +172,9 @@ static void print_version() {
|
|||||||
#ifdef BUILD_XFT
|
#ifdef BUILD_XFT
|
||||||
<< _(" * Xft\n")
|
<< _(" * Xft\n")
|
||||||
#endif /* BUILD_XFT */
|
#endif /* BUILD_XFT */
|
||||||
|
#ifdef BUILD_XINPUT
|
||||||
|
<< _(" * Xinput\n")
|
||||||
|
#endif /* BUILD_XINPUT */
|
||||||
#ifdef BUILD_ARGB
|
#ifdef BUILD_ARGB
|
||||||
<< _(" * ARGB visual\n")
|
<< _(" * ARGB visual\n")
|
||||||
#endif /* BUILD_ARGB */
|
#endif /* BUILD_ARGB */
|
||||||
@ -180,13 +183,13 @@ static void print_version() {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef BUILD_MOUSE_EVENTS
|
#ifdef BUILD_MOUSE_EVENTS
|
||||||
<< _(" * Mouse events\n")
|
<< _(" * Mouse events\n")
|
||||||
#endif
|
#endif /* BUILD_MOUSE_EVENTS */
|
||||||
#endif /* BUILD_X11 */
|
#endif /* BUILD_X11 */
|
||||||
#ifdef BUILD_WAYLAND
|
#ifdef BUILD_WAYLAND
|
||||||
<< _(" Wayland:\n")
|
<< _(" Wayland:\n")
|
||||||
#ifdef BUILD_MOUSE_EVENTS
|
#ifdef BUILD_MOUSE_EVENTS
|
||||||
<< _(" * Mouse events\n")
|
<< _(" * Mouse events\n")
|
||||||
#endif
|
#endif /* BUILD_MOUSE_EVENTS */
|
||||||
#endif /* BUILD_WAYLAND */
|
#endif /* BUILD_WAYLAND */
|
||||||
#if defined BUILD_AUDACIOUS || defined BUILD_CMUS || defined BUILD_MPD || \
|
#if defined BUILD_AUDACIOUS || defined BUILD_CMUS || defined BUILD_MPD || \
|
||||||
defined BUILD_MOC || defined BUILD_XMMS2
|
defined BUILD_MOC || defined BUILD_XMMS2
|
||||||
|
22
src/x11.cc
22
src/x11.cc
@ -38,8 +38,9 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <string>
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
|
#include <string>
|
||||||
|
#include <array>
|
||||||
|
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
#pragma GCC diagnostic ignored "-Wvariadic-macros"
|
#pragma GCC diagnostic ignored "-Wvariadic-macros"
|
||||||
@ -250,8 +251,9 @@ x11_error_handler(Display *d, XErrorEvent *err) {
|
|||||||
const char *extension;
|
const char *extension;
|
||||||
const char *base_name = xcb_errors_get_name_for_error(xcb_errors_ctx, err->error_code, &extension);
|
const char *base_name = xcb_errors_get_name_for_error(xcb_errors_ctx, err->error_code, &extension);
|
||||||
if (extension != nullptr) {
|
if (extension != nullptr) {
|
||||||
error_name = new char(strlen(base_name) + strlen(extension) + 4);
|
const size_t size = strlen(base_name) + strlen(extension) + 4;
|
||||||
sprintf(error_name, "%s (%s)", base_name, extension);
|
error_name = new char(size);
|
||||||
|
snprintf(error_name, size, "%s (%s)", base_name, extension);
|
||||||
name_allocated = true;
|
name_allocated = true;
|
||||||
} else {
|
} else {
|
||||||
error_name = const_cast<char*>(base_name);
|
error_name = const_cast<char*>(base_name);
|
||||||
@ -260,8 +262,9 @@ x11_error_handler(Display *d, XErrorEvent *err) {
|
|||||||
const char *major = xcb_errors_get_name_for_major_code(xcb_errors_ctx, err->request_code);
|
const char *major = xcb_errors_get_name_for_major_code(xcb_errors_ctx, err->request_code);
|
||||||
const char *minor = xcb_errors_get_name_for_minor_code(xcb_errors_ctx, err->request_code, err->minor_code);
|
const char *minor = xcb_errors_get_name_for_minor_code(xcb_errors_ctx, err->request_code, err->minor_code);
|
||||||
if (minor != nullptr) {
|
if (minor != nullptr) {
|
||||||
code_description = new char(strlen(base_name) + strlen(extension) + 4);
|
const size_t size = strlen(base_name) + strlen(extension) + 4;
|
||||||
sprintf(code_description, "%s - %s", major, minor);
|
code_description = new char(size);
|
||||||
|
snprintf(code_description, size, "%s - %s", major, minor);
|
||||||
code_allocated = true;
|
code_allocated = true;
|
||||||
} else {
|
} else {
|
||||||
code_description = const_cast<char*>(major);
|
code_description = const_cast<char*>(major);
|
||||||
@ -280,16 +283,17 @@ x11_error_handler(Display *d, XErrorEvent *err) {
|
|||||||
} else {
|
} else {
|
||||||
static char code_name_buffer[3];
|
static char code_name_buffer[3];
|
||||||
error_name = reinterpret_cast<char*>(&code_name_buffer);
|
error_name = reinterpret_cast<char*>(&code_name_buffer);
|
||||||
sprintf(error_name, "%d", err->error_code);
|
snprintf(error_name, 3, "%d", err->error_code);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (code_description == nullptr) {
|
if (code_description == nullptr) {
|
||||||
code_description = new char(30 + 6 + 1);
|
const size_t size = 37;
|
||||||
sprintf(code_description, "error code: [major: %i, minor: %i]", err->request_code, err->minor_code);
|
code_description = new char(size);
|
||||||
|
snprintf(code_description, size, "error code: [major: %i, minor: %i]", err->request_code, err->minor_code);
|
||||||
code_allocated = true;
|
code_allocated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
NORM_ERR(
|
DBGP(
|
||||||
"X %s Error:\n"
|
"X %s Error:\n"
|
||||||
"Display: %lx, XID: %li, Serial: %lu\n"
|
"Display: %lx, XID: %li, Serial: %lu\n"
|
||||||
"%s",
|
"%s",
|
||||||
|
Loading…
Reference in New Issue
Block a user