Commit Graph

20 Commits

Author SHA1 Message Date
Simon Ser 5cde35923c Simplify globals implementation by removing destructors
Some globals are static and it doesn't make sense to destroy them before
the wl_display. For instance, wl_compositor should be created before the
display is started and shouldn't be destroyed.

For these globals, we can simplify the code by removing the destructor
and stop keeping track of wl_resources (these will be destroyed with the
wl_display by libwayland).
2019-11-25 09:01:46 -05:00
Simon Ser ca45f4490c Remove all wayland-server.h includes
The documentation for wayland-server.h says:

> Use of this header file is discouraged. Prefer including
> wayland-server-core.h instead, which does not include the server protocol
> header and as such only defines the library PI, excluding the deprecated API
> below.

Replacing wayland-server.h with wayland-server-core.h allows us to drop the
WL_HIDE_DEPRECATED declaration.
2019-07-27 15:49:32 -04:00
emersion 7defb30781
relative-pointer-v1: time is in usec, not msec 2019-01-30 21:25:42 +01:00
emersion 5de26ad8ed
pointer: add a frame event
Frame events group logically connected pointer events. It makes sense to make
the backend responsible for sending frame events, since once the events are
split (ie. once the frame events are stripped) it's not easy to figure out
which events belongs to which frame again.

This is also how Weston handles frame events.

Fixes https://github.com/swaywm/wlroots/issues/1468
2019-01-26 11:04:05 +01:00
Ilya Trukhanov c4ce3d0a49 Check if client understands wl_pointer::frame
Fixes a crash in SDL2 applications when using locked pointer.

SDL2 expects a wl_pointer v1 interface and doesn't provide a handler for
the wl_pointer::frame event. This results in a "listener function for
opcode 5 of wl_pointer is NULL" abort in wayland-client.

Tested on Xonotic v0.8.2 with libSDL2 v2.0.9. Xonotic needs to be ran
with "SDL_VIDEODRIVER=wayland xonotic-sdl" for SDL2 to use the wayland
backend.
2019-01-22 19:50:01 +02:00
Ilya Trukhanov 268cc450b6 Fix segfault in get_relative_pointer
Occurs on subsequent calls to
relative_pointer_manager_v1_handle_get_relative_pointer()

Steps to reproduce:
- run rootston
- run examples/relative-pointer
- switch to relative pointer more than once

Note: if done fast enough it may take more than two switches to crash.
2019-01-18 22:53:32 +02:00
emersion f71cf15aad
relative-pointer-v1: move pointer iteration in wlroots
This makes sure we always send events to the right client.
2019-01-06 12:17:31 +01:00
Alex Maese b8460f448c Rename some variables for clarity 2018-12-23 06:50:39 -06:00
Alex Maese 5999d0322b Add a listener for when the pointer gets destroyed 2018-12-21 12:20:48 -06:00
Alex Maese 12d9edc0c9 Address more of @emersion's comments 2018-12-21 12:20:48 -06:00
Alex Maese a803a007fb Address @emersion's comments 2018-12-21 12:20:48 -06:00
Alex Maese f5ea393bca Remove pointer resource from relative pointer 2018-12-21 12:20:48 -06:00
Alex Maese 09bdbf24f4 Removed relative pointers from wlr_seat 2018-12-21 12:20:48 -06:00
Alex Maese f4cf3c0886 Remove wl_client from wlr_relative_pointer_v1 2018-12-21 12:20:48 -06:00
random human 68137dca3f relative_pointer: implementation and code fixes
In particular, modified public creator and destructor function names,
added a display destroy listener, safely extract user data from
resources, send correct time (in usecs) in rootston, etc.
2018-12-21 12:20:48 -06:00
random human fb44ce9fa8 relative_pointer: send frame event to pointer for Xwayland 2018-12-21 12:20:48 -06:00
random human 6fa1777f94 relative_pointer: code formatting fixes 2018-12-21 12:20:48 -06:00
random human d020344675 relative_pointer: implement protocol events
Implement zwp_relative_pointer_v1.relative_motion event, along with some
glue code in wlr_seat_pointer and rootston.
2018-12-21 12:20:48 -06:00
random human ba5b1676df relative_pointer: implement protocol requests
Flesh out the details of the structs, signals, callback functions, and
so on. weston-resizer silently works at this point (no events sent).
2018-12-21 12:20:48 -06:00
random human 3a3d1b6617 relative_pointer: create skeleton and build
Add protocol, header and type files to build. Create skeleton structs,
creator and destroyer, and define implementations.
2018-12-21 12:20:47 -06:00