mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-19 06:59:51 -05:00
Reduce indentation in notify_button()
This commit is contained in:
parent
ea08115ee3
commit
dff2e3c550
1 changed files with 45 additions and 44 deletions
|
|
@ -875,53 +875,54 @@ notify_button(struct wlsc_input_device *device,
|
||||||
struct wl_drag *drag = device->drag;
|
struct wl_drag *drag = device->drag;
|
||||||
|
|
||||||
surface = (struct wlsc_surface *) device->input_device.pointer_focus;
|
surface = (struct wlsc_surface *) device->input_device.pointer_focus;
|
||||||
if (surface) {
|
if (!surface)
|
||||||
if (state && device->grab == WLSC_DEVICE_GRAB_NONE) {
|
return;
|
||||||
wlsc_surface_raise(surface);
|
|
||||||
|
|
||||||
wlsc_input_device_start_grab(device,
|
if (state && device->grab == WLSC_DEVICE_GRAB_NONE) {
|
||||||
WLSC_DEVICE_GRAB_MOTION,
|
wlsc_surface_raise(surface);
|
||||||
button, time);
|
|
||||||
wl_input_device_set_keyboard_focus(&device->input_device,
|
|
||||||
&surface->surface,
|
|
||||||
time);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (state && button == BTN_LEFT &&
|
wlsc_input_device_start_grab(device,
|
||||||
device->grab == WLSC_DEVICE_GRAB_MOTION &&
|
WLSC_DEVICE_GRAB_MOTION,
|
||||||
(device->modifier_state & MODIFIER_SUPER))
|
button, time);
|
||||||
shell_move(NULL,
|
wl_input_device_set_keyboard_focus(&device->input_device,
|
||||||
(struct wl_shell *) &compositor->shell,
|
&surface->surface,
|
||||||
&surface->surface,
|
time);
|
||||||
&device->input_device, time);
|
|
||||||
else if (state && button == BTN_MIDDLE &&
|
|
||||||
device->grab == WLSC_DEVICE_GRAB_MOTION &&
|
|
||||||
(device->modifier_state & MODIFIER_SUPER))
|
|
||||||
shell_resize(NULL,
|
|
||||||
(struct wl_shell *) &compositor->shell,
|
|
||||||
&surface->surface,
|
|
||||||
&device->input_device, time,
|
|
||||||
WLSC_DEVICE_GRAB_RESIZE_BOTTOM_RIGHT);
|
|
||||||
else if (device->grab == WLSC_DEVICE_GRAB_NONE ||
|
|
||||||
device->grab == WLSC_DEVICE_GRAB_MOTION)
|
|
||||||
wl_client_post_event(surface->surface.client,
|
|
||||||
&device->input_device.object,
|
|
||||||
WL_INPUT_DEVICE_BUTTON,
|
|
||||||
time, button, state);
|
|
||||||
|
|
||||||
if (!state &&
|
|
||||||
device->grab != WLSC_DEVICE_GRAB_NONE &&
|
|
||||||
device->grab_button == button) {
|
|
||||||
drag = device->drag;
|
|
||||||
if (drag && drag->target)
|
|
||||||
wl_client_post_event(drag->target,
|
|
||||||
&drag->drag_offer.object,
|
|
||||||
WL_DRAG_OFFER_DROP);
|
|
||||||
wlsc_input_device_end_grab(device, time);
|
|
||||||
}
|
|
||||||
|
|
||||||
wlsc_compositor_schedule_repaint(compositor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (state && button == BTN_LEFT &&
|
||||||
|
device->grab == WLSC_DEVICE_GRAB_MOTION &&
|
||||||
|
(device->modifier_state & MODIFIER_SUPER))
|
||||||
|
shell_move(NULL,
|
||||||
|
(struct wl_shell *) &compositor->shell,
|
||||||
|
&surface->surface,
|
||||||
|
&device->input_device, time);
|
||||||
|
else if (state && button == BTN_MIDDLE &&
|
||||||
|
device->grab == WLSC_DEVICE_GRAB_MOTION &&
|
||||||
|
(device->modifier_state & MODIFIER_SUPER))
|
||||||
|
shell_resize(NULL,
|
||||||
|
(struct wl_shell *) &compositor->shell,
|
||||||
|
&surface->surface,
|
||||||
|
&device->input_device, time,
|
||||||
|
WLSC_DEVICE_GRAB_RESIZE_BOTTOM_RIGHT);
|
||||||
|
else if (device->grab == WLSC_DEVICE_GRAB_NONE ||
|
||||||
|
device->grab == WLSC_DEVICE_GRAB_MOTION)
|
||||||
|
wl_client_post_event(surface->surface.client,
|
||||||
|
&device->input_device.object,
|
||||||
|
WL_INPUT_DEVICE_BUTTON,
|
||||||
|
time, button, state);
|
||||||
|
|
||||||
|
if (!state &&
|
||||||
|
device->grab != WLSC_DEVICE_GRAB_NONE &&
|
||||||
|
device->grab_button == button) {
|
||||||
|
drag = device->drag;
|
||||||
|
if (drag && drag->target)
|
||||||
|
wl_client_post_event(drag->target,
|
||||||
|
&drag->drag_offer.object,
|
||||||
|
WL_DRAG_OFFER_DROP);
|
||||||
|
wlsc_input_device_end_grab(device, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
wlsc_compositor_schedule_repaint(compositor);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue