B:BD[
3.3537] → [
3.3537:3614]
∅:D[
5.119] → [
6.985:1023]
B:BD[
3.3614] → [
6.985:1023]
∅:D[
7.752] → [
3.3660:3711]
∅:D[
6.1023] → [
3.3660:3711]
B:BD[
3.3660] → [
3.3660:3711]
∅:D[
8.96] → [
3.3900:3944]
∅:D[
7.886] → [
3.3900:3944]
B:BD[
3.3900] → [
3.3900:3944]
/* Notify the client with pointer focus that a button press has occurred */
/* XXX probably don't want to pass the event if it's handled by the
* compositor at the bottom of this function */
wlr_seat_pointer_notify_button(seat,
event->time_msec, event->button, event->state);
if (event->state == WLR_BUTTON_RELEASED) {
switch (event->state) {
case WLR_BUTTON_PRESSED:;
/* Change focus if the button was _pressed_ over a client */
double sx, sy;
struct wlr_surface *surface;
Client *c = xytoclient(cursor->x, cursor->y, &surface, &sx, &sy);
if (c) {
keyboardfocus(c, surface);
raiseclient(c);
}
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat);
uint32_t mods = wlr_keyboard_get_modifiers(keyboard);
for (int i = 0; i < LENGTH(buttons); i++)
if (event->button == buttons[i].button &&
CLEANMASK(mods) == CLEANMASK(buttons[i].mod) &&
buttons[i].func) {
buttons[i].func(&buttons[i].arg);
return;
}
break;
case WLR_BUTTON_RELEASED: