Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
orbea
wayland
Commits
dff2e3c5
Commit
dff2e3c5
authored
Dec 07, 2010
by
Kristian Høgsberg
Browse files
Reduce indentation in notify_button()
parent
ea08115e
Changes
1
Hide whitespace changes
Inline
Side-by-side
compositor/compositor.c
View file @
dff2e3c5
...
...
@@ -875,53 +875,54 @@ notify_button(struct wlsc_input_device *device,
struct
wl_drag
*
drag
=
device
->
drag
;
surface
=
(
struct
wlsc_surface
*
)
device
->
input_device
.
pointer_focus
;
if
(
surface
)
{
if
(
state
&&
device
->
grab
==
WLSC_DEVICE_GRAB_NONE
)
{
wlsc_surface_raise
(
surface
);
wlsc_input_device_start_grab
(
device
,
WLSC_DEVICE_GRAB_MOTION
,
button
,
time
);
wl_input_device_set_keyboard_focus
(
&
device
->
input_device
,
&
surface
->
surface
,
time
);
}
if
(
!
surface
)
return
;
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
);
}
if
(
state
&&
device
->
grab
==
WLSC_DEVICE_GRAB_NONE
)
{
wlsc_surface_raise
(
surface
);
wlsc_compositor_schedule_repaint
(
compositor
);
wlsc_input_device_start_grab
(
device
,
WLSC_DEVICE_GRAB_MOTION
,
button
,
time
);
wl_input_device_set_keyboard_focus
(
&
device
->
input_device
,
&
surface
->
surface
,
time
);
}
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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment