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
ab1862d6
Commit
ab1862d6
authored
Dec 09, 2010
by
Kristian Høgsberg
Browse files
Move code around to keep input device interface and init function close
parent
67f367f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
compositor/compositor.c
View file @
ab1862d6
...
...
@@ -1064,37 +1064,6 @@ notify_key(struct wl_input_device *device,
WL_INPUT_DEVICE_KEY
,
time
,
key
,
state
);
}
static
void
input_device_attach
(
struct
wl_client
*
client
,
struct
wl_input_device
*
device_base
,
uint32_t
time
,
struct
wl_buffer
*
buffer
,
int32_t
x
,
int32_t
y
)
{
struct
wlsc_input_device
*
device
=
(
struct
wlsc_input_device
*
)
device_base
;
if
(
time
<
device
->
input_device
.
pointer_focus_time
)
return
;
if
(
device
->
input_device
.
pointer_focus
==
NULL
)
return
;
if
(
device
->
input_device
.
pointer_focus
->
client
!=
client
)
return
;
if
(
buffer
==
NULL
)
{
wlsc_input_device_set_pointer_image
(
device
,
WLSC_POINTER_LEFT_PTR
);
return
;
}
wlsc_input_device_attach
(
device
,
buffer
,
x
,
y
);
}
const
static
struct
wl_input_device_interface
input_device_interface
=
{
input_device_attach
,
};
static
void
wl_drag_set_pointer_focus
(
struct
wl_drag
*
drag
,
struct
wl_surface
*
surface
,
uint32_t
time
,
...
...
@@ -1291,6 +1260,36 @@ static const struct wl_drag_interface drag_interface = {
drag_destroy
,
};
static
void
input_device_attach
(
struct
wl_client
*
client
,
struct
wl_input_device
*
device_base
,
uint32_t
time
,
struct
wl_buffer
*
buffer
,
int32_t
x
,
int32_t
y
)
{
struct
wlsc_input_device
*
device
=
(
struct
wlsc_input_device
*
)
device_base
;
if
(
time
<
device
->
input_device
.
pointer_focus_time
)
return
;
if
(
device
->
input_device
.
pointer_focus
==
NULL
)
return
;
if
(
device
->
input_device
.
pointer_focus
->
client
!=
client
)
return
;
if
(
buffer
==
NULL
)
{
wlsc_input_device_set_pointer_image
(
device
,
WLSC_POINTER_LEFT_PTR
);
return
;
}
wlsc_input_device_attach
(
device
,
buffer
,
x
,
y
);
}
const
static
struct
wl_input_device_interface
input_device_interface
=
{
input_device_attach
,
};
void
wlsc_input_device_init
(
struct
wlsc_input_device
*
device
,
struct
wlsc_compositor
*
ec
)
...
...
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