Skip to content

Commit

Permalink
Add Xinput to CI
Browse files Browse the repository at this point in the history
Signed-off-by: Tin <[email protected]>
  • Loading branch information
Caellian committed Nov 9, 2023
1 parent 62a9519 commit 2e47b22
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
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: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
xorg.libXfixes
xorg.libXft
xorg.libXinerama
xorg.libXi
xorg.libxcb
xorg.xcbutilerrors
]
++ lib.optional stdenv.isDarwin darwin.libobjc;
};
Expand Down
6 changes: 0 additions & 6 deletions src/display-x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,10 @@ bool display_output_x11::main_loop_wait(double t) {
// 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);

//printf("over: %#x w:%#x d:%#x r:%#x\n", query_result, window.window, window.desktop, window.root);

static bool cursor_inside = false;
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) &&
data->root_y >= window.y && data->root_y < (window.y + window.height))) {
//puts("over self");
if (!cursor_inside) {
llua_mouse_hook(mouse_crossing_event(
mouse_event_t::AREA_ENTER,
Expand All @@ -407,15 +404,12 @@ bool display_output_x11::main_loop_wait(double t) {
}
cursor_inside = true;
} else if (cursor_inside) {
//puts("left");
llua_mouse_hook(mouse_crossing_event(
mouse_event_t::AREA_LEAVE,
data->root_x - window.x, data->root_y - window.x,
data->root_x, data->root_y
));
cursor_inside = false;
} else {
//printf("not over self\n");
}
}
XFreeEventData(display, &ev.xcookie);
Expand Down
7 changes: 5 additions & 2 deletions src/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ static void print_version() {
#ifdef BUILD_XFT
<< _(" * Xft\n")
#endif /* BUILD_XFT */
#ifdef BUILD_XINPUT
<< _(" * Xinput\n")
#endif /* BUILD_XINPUT */
#ifdef BUILD_ARGB
<< _(" * ARGB visual\n")
#endif /* BUILD_ARGB */
Expand All @@ -180,13 +183,13 @@ static void print_version() {
#endif
#ifdef BUILD_MOUSE_EVENTS
<< _(" * Mouse events\n")
#endif
#endif /* BUILD_MOUSE_EVENTS */
#endif /* BUILD_X11 */
#ifdef BUILD_WAYLAND
<< _(" Wayland:\n")
#ifdef BUILD_MOUSE_EVENTS
<< _(" * Mouse events\n")
#endif
#endif /* BUILD_MOUSE_EVENTS */
#endif /* BUILD_WAYLAND */
#if defined BUILD_AUDACIOUS || defined BUILD_CMUS || defined BUILD_MPD || \
defined BUILD_MOC || defined BUILD_XMMS2
Expand Down
2 changes: 1 addition & 1 deletion src/x11.cc
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ x11_error_handler(Display *d, XErrorEvent *err) {
code_allocated = true;
}

NORM_ERR(
DBGP(
"X %s Error:\n"
"Display: %lx, XID: %li, Serial: %lu\n"
"%s",
Expand Down

0 comments on commit 2e47b22

Please sign in to comment.