Fix some bugs with clicks and images

This commit is contained in:
speedie 2023-06-19 21:28:45 +02:00
parent ebd625ba1e
commit 62b15fab28
4 changed files with 16 additions and 2 deletions

View file

@ -281,6 +281,13 @@ void buttonpress_wl(uint32_t button, double ex, double ey) {
y += h;
#if USEIMAGE
if (!hideimage && longestedge != 0) {
x += MAX((imagegaps * 2) + imagewidth, indentitems ? promptw : 0);
ex += MAX((imagegaps * 2) + imagewidth, indentitems ? promptw : 0);
}
#endif
// ClickSelItem, called function doesn't matter
if (ey >= y && ey <= (y + h) && ex + (powerlineitems ? plw : 0) >= x + (powerlineitems ? plw : 0) && ex + (powerlineitems ? plw : 0) <= (x + w / columns) + (powerlineitems ? plw : 0)) {
for (i = 0; i < LENGTH(wl_buttons); i++) {

View file

@ -66,6 +66,13 @@ void buttonpress_x11(XEvent *e) {
y += h;
#if USEIMAGE
if (!hideimage && longestedge != 0) {
x += MAX((imagegaps * 2) + imagewidth, indentitems ? promptw : 0);
ev->x += MAX((imagegaps * 2) + imagewidth, indentitems ? promptw : 0);
}
#endif
// ClickSelItem, called function doesn't matter
if (ev->y >= y && ev->y <= (y + h) && ev->x + (powerlineitems ? plw : 0) >= x + (powerlineitems ? plw : 0) && ev->x + (powerlineitems ? plw : 0) <= (x + w / columns) + (powerlineitems ? plw : 0)) {
for (i = 0; i < LENGTH(buttons); i++) {

View file

@ -1,5 +1,5 @@
'\" t
.\" Automatically generated by Pandoc 3.1.1
.\" Automatically generated by Pandoc 3.1.2
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.

View file

@ -1,4 +1,4 @@
.\" Automatically generated by Pandoc 3.1.1
.\" Automatically generated by Pandoc 3.1.2
.\"
.\" Define V font for inline verbatim, using C font in formats
.\" that render this, and otherwise B font.