mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 16:10:06 +01:00
evdev: use last output from compositor to get the screen geometries
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
This commit is contained in:
parent
76dc338535
commit
b5b8c0e807
1 changed files with 6 additions and 5 deletions
|
|
@ -87,11 +87,12 @@ evdev_process_key(struct evdev_input_device *device,
|
||||||
static inline void
|
static inline void
|
||||||
evdev_process_absolute_motion(struct evdev_input_device *device,
|
evdev_process_absolute_motion(struct evdev_input_device *device,
|
||||||
struct input_event *e, int value, int *x, int *y,
|
struct input_event *e, int value, int *x, int *y,
|
||||||
int *absolute_event)
|
int *absolute_event, struct wlsc_compositor *ec)
|
||||||
{
|
{
|
||||||
/* FIXME: Obviously we need to not hardcode these here, but
|
const int screen_width = container_of(ec->output_list.prev,
|
||||||
* instead get the values from the output it's associated with. */
|
struct wlsc_output, link)->current->width;
|
||||||
const int screen_width = 1024, screen_height = 600;
|
const int screen_height = container_of(ec->output_list.prev,
|
||||||
|
struct wlsc_output, link)->current->height;
|
||||||
|
|
||||||
switch (e->code) {
|
switch (e->code) {
|
||||||
case ABS_X:
|
case ABS_X:
|
||||||
|
|
@ -197,7 +198,7 @@ evdev_input_device_data(int fd, uint32_t mask, void *data)
|
||||||
e, value, &dx, &dy);
|
e, value, &dx, &dy);
|
||||||
else
|
else
|
||||||
evdev_process_absolute_motion(device, e, value,
|
evdev_process_absolute_motion(device, e, value,
|
||||||
&x, &y, &absolute_event);
|
&x, &y, &absolute_event, ec);
|
||||||
break;
|
break;
|
||||||
case EV_KEY:
|
case EV_KEY:
|
||||||
if (value == 2)
|
if (value == 2)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue