mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
wibox button: Fix the x/y position in button events
The coordinates as used by X11 place (0, 0) at the top-left corner of the window, including its border. However, this code wants the position relative to the drawin's content, thus we also need to substract the border width. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
7d1a963352
commit
6a39fa46c1
1 changed files with 2 additions and 2 deletions
4
event.c
4
event.c
|
@ -216,8 +216,8 @@ event_handle_button(xcb_button_press_event_t *ev)
|
|||
* relative to root window */
|
||||
if(drawin->window == ev->child)
|
||||
{
|
||||
ev->event_x -= drawin->geometry.x;
|
||||
ev->event_y -= drawin->geometry.y;
|
||||
ev->event_x -= drawin->geometry.x + drawin->border_width;
|
||||
ev->event_y -= drawin->geometry.y + drawin->border_width;
|
||||
}
|
||||
|
||||
/* Push the drawable */
|
||||
|
|
Loading…
Reference in a new issue