Re: [PATCH_v2] virtual-keyboard: Add new virtual keyboard protocol
On Thu, May 24, 2018 at 08:27:29PM +0200, Dorota Czaplejewicz wrote: > Provides the ability to emulate keyboards by applications. Complementary to > input-method protocol. > > The interface is a mirror copy of wl_keyboard, with removed serials, and > added seat binding. > --- > This is the slightly improved version of the virtual-keyboard-v1 protocol > from Purism. > > Changes done: > - fixed typos > - enum arguments don't have the "enum" key in them, in order not to trip up > wayland-scanner > - added errors > > The test client is at > https://code.puri.sm/Librem5/weston/src/virtual_keyboard - please use the > weston-keyboard program: > > ./configure --enable-clients > ./weston-keyboard > > A working wlroots implementation is available here: > > https://github.com/swaywm/wlroots/pull/999 > > Thanks for feedback, > Dorota Czaplejewicz just one nitpick over Simon's comments, the copyright list starting at 2008 seems excessive. However, I wonder what you're really trying to achieve here. For virtual keyboards the mapping to a normal keyboard's physical buttons, then mapped to the glyph elsewhere seems strange and limiting. On a virtual keyboard, I'm not hitting KEY_A, I'm clicking on the button currently labelled with 'A'. There's a million things we could do to virtual keyboard that make the assumption of virtual keyboard == physical keyboards go boom quite quickly. e.g. on my phone once the emoticons are selected I don't get the normal qwerty layout anymore but just a row/column arrangement of smileys. I read your v1 email about splitting input-method and virtual-keyboard but it's still not quite clear to me, sorry. Cheers, Peter > Makefile.am| 1 + > unstable/virtual-keyboard/README | 2 + > .../virtual-keyboard-unstable-v1.xml | 113 > + > 3 files changed, 116 insertions(+) > create mode 100644 unstable/virtual-keyboard/README > create mode 100644 unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > > diff --git a/Makefile.am b/Makefile.am > index 4b9a901..fcd4572 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -17,6 +17,7 @@ unstable_protocols = > \ > > unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml > \ > unstable/xdg-output/xdg-output-unstable-v1.xml > \ > unstable/input-timestamps/input-timestamps-unstable-v1.xml \ > + unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml \ > $(NULL) > > stable_protocols = > \ > diff --git a/unstable/virtual-keyboard/README > b/unstable/virtual-keyboard/README > new file mode 100644 > index 000..a2c646d > --- /dev/null > +++ b/unstable/virtual-keyboard/README > @@ -0,0 +1,2 @@ > +Virtual keyboard protocol > + > diff --git a/unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > b/unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > new file mode 100644 > index 000..df4d01c > --- /dev/null > +++ b/unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > @@ -0,0 +1,113 @@ > + > + > + > +Copyright © 2008-2011 Kristian Høgsberg > +Copyright © 2010-2013 Intel Corporation > +Copyright © 2012-2013 Collabora, Ltd. > +Copyright © 2018 Purism SPC > + > +Permission is hereby granted, free of charge, to any person obtaining a > +copy of this software and associated documentation files (the > "Software"), > +to deal in the Software without restriction, including without limitation > +the rights to use, copy, modify, merge, publish, distribute, sublicense, > +and/or sell copies of the Software, and to permit persons to whom the > +Software is furnished to do so, subject to the following conditions: > + > +The above copyright notice and this permission notice (including the next > +paragraph) shall be included in all copies or substantial portions of the > +Software. > + > +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS > OR > +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR > OTHER > +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > +DEALINGS IN THE SOFTWARE. > + > + > + > + > + The virtual keyboard provides an application with requests which > emulate > + the behaviour of a physical keyboard. > + > + This interface can be used by clients on its own to provide raw input > + events, or it can accompany the input method protocol. > + > + > + > + > +Provide a file
Re: [PATCH weston v2 10/12] weston: add touchscreen_calibrator option
On Mon, Apr 30, 2018 at 04:03:32PM +0300, Pekka Paalanen wrote: > From: Louis-Francis Ratté-Boulianne > > Add an option to enable the touchscreen calibrator interface. This is a > global on/off toggle, in lack of more fine-grained access restrictions. > > As Weston should not hardcode system specifics, the actual permanent > saving of a new calibration is left for a user supplied script or a > program. Usually this script would write an appropriate udev rule to set > LIBINPUT_CALIBRATION_MATRIX for the touch device. > > Co-developed by Louis-Francis and Pekka. > > v2: > - use syspath instead of devpath > > Signed-off-by: Louis-Francis Ratté-Boulianne > Signed-off-by: Pekka Paalanen > v1 Tested-by: Matt Hoosier > --- > compositor/main.c | 68 > ++ > man/weston.ini.man | 39 +++ > 2 files changed, 107 insertions(+) > > diff --git a/compositor/main.c b/compositor/main.c > index d1bc8062..aa833e5c 100644 > --- a/compositor/main.c > +++ b/compositor/main.c > @@ -763,6 +763,64 @@ load_modules(struct weston_compositor *ec, const char > *modules, > return 0; > } > > +static int > +save_touch_device_calibration(struct weston_compositor *compositor, > + struct weston_touch_device *device, > + const struct weston_touch_device_matrix > *calibration) > +{ > + struct weston_config_section *s; > + struct weston_config *config = wet_get_config(compositor); > + char *helper = NULL; > + char *helper_cmd = NULL; > + int ret = -1; > + int status; > + const float *m = calibration->m; > + > + s = weston_config_get_section(config, > + "libinput", NULL, NULL); > + > + weston_config_section_get_string(s, "calibration_helper", > + , NULL); > + > + if (!helper || strlen(helper) == 0) { > + ret = 0; > + goto out; > + } > + > + if (asprintf(_cmd, "\"%s\" '%s' %f %f %f %f %f %f", > + helper, device->syspath, > + m[0], m[1], m[2], > + m[3], m[4], m[5]) < 0) > + goto out; > + > + status = system(helper_cmd); > + free(helper_cmd); > + > + if (status < 0) { > + weston_log("Error: failed to run calibration helper '%s'.\n", > +helper); > + goto out; > + } > + > + if (!WIFEXITED(status)) { > + weston_log("Error: calibration helper '%s' possibly killed.\n", > +helper); > + goto out; > + } > + > + if (WEXITSTATUS(status) == 0) { > + ret = 0; > + } else { > + weston_log("Calibration helper '%s' exited with status %d.\n", > +helper, WEXITSTATUS(status)); > + } > + > +out: > + free(helper); > + > + return ret; > +} > + > static int > weston_compositor_init_config(struct weston_compositor *ec, > struct weston_config *config) > @@ -771,7 +829,9 @@ weston_compositor_init_config(struct weston_compositor > *ec, > struct weston_config_section *s; > int repaint_msec; > int vt_switching; > + int cal; > > + /* weston.ini [keyboard] */ > s = weston_config_get_section(config, "keyboard", NULL, NULL); > weston_config_section_get_string(s, "keymap_rules", >(char **) _names.rules, NULL); > @@ -796,6 +856,7 @@ weston_compositor_init_config(struct weston_compositor > *ec, > _switching, true); > ec->vt_switching = vt_switching; > > + /* weston.ini [core] */ > s = weston_config_get_section(config, "core", NULL, NULL); > weston_config_section_get_int(s, "repaint-window", _msec, > ec->repaint_msec); > @@ -808,6 +869,13 @@ weston_compositor_init_config(struct weston_compositor > *ec, > weston_log("Output repaint window is %d ms maximum.\n", > ec->repaint_msec); > > + /* weston.ini [libinput] */ > + s = weston_config_get_section(config, "libinput", NULL, NULL); > + weston_config_section_get_bool(s, "touchscreen_calibrator", , 0); > + if (cal) > + weston_compositor_enable_touch_calibrator(ec, > + save_touch_device_calibration); > + > return 0; > } > > diff --git a/man/weston.ini.man b/man/weston.ini.man > index f237fd60..b5668b5a 100644 > --- a/man/weston.ini.man > +++ b/man/weston.ini.man > @@ -200,8 +200,47 @@ Available configuration are: > .TP 7 > .BI "enable_tap=" true > enables tap to click on touchpad devices > +.TP 7 > +.BI "touchscreen_calibrator=" true > +Advertise the touchscreen calibrator interface to all clients. This is a > +potential denial-of-service attack vector, so it should only be enabled on >
[ANNOUNCE] libinput 1.10.902
The second RC for libinput 1.11 is now available. Please give this a test, I expect 1.11 to ship next week. A few fixes to make the test suite more reliable. A side-effect of that is that we now support more than 3 internal keyboards for both the lid switch and disable-while-typing touchpad-keyboard pairings. This doesn't really happen unless you run the test suite and we'll still warn about it, it's just that now we'll just pair with all those keyboards instead of ignoring them. Martin has expanded the libinput measure trackpoint-range tool to provide better data for estimating the range. Together with the updated firmware detection code and an added hwdb entry the new ALPS SS5 trackpoints are now usable. Finally, the thumb threshold, previously hardcoded, is now a udev hwdb entry. The current entry captures the Lenovo Thinkpads, any other device will not have thumb detection until the required entries are added. One more reason for you to test this RC and quickly file the required bugs. As usual, the git shortlog is below. Martin Wilck (3): libinput-measure-trackpoint-range: fix typo libinput-measure-trackpoint-range: minimum delta measurement udev: support firmware detection for pointing sticks Peter Hutterer (11): udev: fix entry for Lenovo X280, missing dmi: prefix test: fix udev rule for the gpio keys test device test: fix udev prop test for apple touchpads udev: default to a trackpoint range of 160 for the new ALPS trackpoints tablet: increase the proximity timeout during test runs fallback: make the paired keyboard list a struct list touchpad: make the dwt paired keyboard list a struct list doc: update the touchpad pointer acceleration graphs Restore the old trackpoint pointer accel picture touchpad: replace the hardcoded thumb threshold with a udev prop libinput 1.10.902 git tag: 1.10.902 https://www.freedesktop.org/software/libinput/libinput-1.10.902.tar.xz MD5: f052d72c3bb0066e57c5c91d14d7622e libinput-1.10.902.tar.xz SHA1: 853debe453741ff6738a079635b1f382c12d321a libinput-1.10.902.tar.xz SHA256: 8547987d3bb273fcb0a4c25a0354c5422536425406b6339706b151100dc6137d libinput-1.10.902.tar.xz SHA512: c7c3da905852312e0b522b9356bf03ba5cb424020e0caf41cbd36fc22a6d337c2faebb878c01f958e7c078c9608f311b00190e8690b242000c6197a91d05e9a2 libinput-1.10.902.tar.xz PGP: https://www.freedesktop.org/software/libinput/libinput-1.10.902.tar.xz.sig signature.asc Description: PGP signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Orientation inside ivi-shell
Hi all, I’m currently looking into a bug that I'm facing with ivi-shell and I’m having some doubts about how ivi-shell manages the orientation of the surfaces. The bug is when the transform of the output inside Weston.ini is either 90 or 270, the mouse pointer doesn’t appear on the screen. The pointer only appears when an application is run on top of the shell and disappears once the application stops running. I’ve been able to isolate the reason for the mouse pointer not appearing to the bounding box checks failing for the blank view. This check happens inside compositor.c and no view is returned which causes the mouse pointer to not appear on the screen. I think the offending file is ivi-layout.c and the function calc_surface_to_global_matrix_and_mask_to_weston_surface and I’m trying to understand how the ivi-shell takes care of transformations and orientations. Could you perhaps guide me on how ivi-shell goes about with applying transformations to the blank view when no app is running (thereby when there’s no surface)? Thanks -Sruthik ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH_v2] virtual-keyboard: Add new virtual keyboard protocol
On May 24, 2018 7:27 PM, Dorota Czaplejewicz wrote: > Provides the ability to emulate keyboards by applications. Complementary to > input-method protocol. > > The interface is a mirror copy of wl_keyboard, with removed serials, and > added seat binding. > --- > This is the slightly improved version of the virtual-keyboard-v1 protocol > from Purism. > > Changes done: > - fixed typos > - enum arguments don't have the "enum" key in them, in order not to trip up > wayland-scanner > - added errors > > The test client is at > https://code.puri.sm/Librem5/weston/src/virtual_keyboard - please use the > weston-keyboard program: > > ./configure --enable-clients > ./weston-keyboard > > A working wlroots implementation is available here: > > https://github.com/swaywm/wlroots/pull/999 > > Thanks for feedback, > Dorota Czaplejewicz > > > Makefile.am| 1 + > unstable/virtual-keyboard/README | 2 + > .../virtual-keyboard-unstable-v1.xml | 113 > + > 3 files changed, 116 insertions(+) > create mode 100644 unstable/virtual-keyboard/README > create mode 100644 unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > > diff --git a/Makefile.am b/Makefile.am > index 4b9a901..fcd4572 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -17,6 +17,7 @@ unstable_protocols = > \ > > unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml > \ > unstable/xdg-output/xdg-output-unstable-v1.xml > \ > unstable/input-timestamps/input-timestamps-unstable-v1.xml \ > + unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml \ > $(NULL) > > stable_protocols = > \ > diff --git a/unstable/virtual-keyboard/README > b/unstable/virtual-keyboard/README > new file mode 100644 > index 000..a2c646d > --- /dev/null > +++ b/unstable/virtual-keyboard/README > @@ -0,0 +1,2 @@ > +Virtual keyboard protocol > + > diff --git a/unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > b/unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > new file mode 100644 > index 000..df4d01c > --- /dev/null > +++ b/unstable/virtual-keyboard/virtual-keyboard-unstable-v1.xml > @@ -0,0 +1,113 @@ > + > + > + > +Copyright © 2008-2011 Kristian Høgsberg > +Copyright © 2010-2013 Intel Corporation > +Copyright © 2012-2013 Collabora, Ltd. > +Copyright © 2018 Purism SPC > + > +Permission is hereby granted, free of charge, to any person obtaining a > +copy of this software and associated documentation files (the > "Software"), > +to deal in the Software without restriction, including without limitation > +the rights to use, copy, modify, merge, publish, distribute, sublicense, > +and/or sell copies of the Software, and to permit persons to whom the > +Software is furnished to do so, subject to the following conditions: > + > +The above copyright notice and this permission notice (including the next > +paragraph) shall be included in all copies or substantial portions of the > +Software. > + > +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS > OR > +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR > OTHER > +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER > +DEALINGS IN THE SOFTWARE. > + > + > + > + > + The virtual keyboard provides an application with requests which > emulate > + the behaviour of a physical keyboard. > + > + This interface can be used by clients on its own to provide raw input > + events, or it can accompany the input method protocol. > + > + > + > + > +Provide a file descriptor to the compositor which can be > +memory-mapped to provide a keyboard mapping description. > + > +Format carries a value from the keymap_format enumeration. Is it possible to specify the interface name too, to make it easier to find the enum? ("wl_keyboard.keymap_format") Anyway, it doesn't matter a lot, because a fix for references to foreign enums will be merged soon (hopefully). > + > + > + > + > + > + > + > + > + > + > + > + > +A key was pressed or released. > +The time argument is a timestamp with millisecond granularity, with > an > +undefined base. All requests regarding a single object must share the > +same clock. > + > +Keymap must be set before issuing this request. > + > +State carries a value
Re: Migrating Wayland & Weston to GitLab
Hi Pekka, Thanks for the reply! On 29 May 2018 at 11:20, Pekka Paalanen wrote: > On Tue, 29 May 2018 10:59:52 +0100 > Daniel Stone wrote: >> But even once those are done, we need to clean up the bugs we're >> importing. The plan is to only import open bugs: closed bugs will stay >> in Bugzilla/Phabricator forever as a read-only archive, and GitLab >> will only have new active issues. I think a sensible transition plan >> would be for us to aim to do the import at the end of June, which >> means sweeping through all our open bugs before then, closing them if >> they're no longer useful or just cleaning up titles/etc to be helpful >> in future. > > The sweep is to reduce the work you need to do in the migration, right? > Aside from the obvious maintenance work we should have been doing all > these years but didn't. Partly. The migration does involve some manual legwork: I do an import into a local test instance first, check it to make sure the bugs haven't been completely mangled, and only then do the real import. There are also some random issues with Bugzilla's export API affecting some but not all bugs[0]; fewer bugs, fewer chances to hit those. Probably most important is the spam issue: the bugs get closed on Bugzilla with a link to the newly-opened GitLab issue. Sending people a Bugzilla mail saying their bug has been moved, followed later by a GitLab mail saying it's been closed after triage, isn't going to make us popular at all. But yeah, it's also a good moment for us to clear out and actually have a usable issue tracker again. :) Trying to figure out a good workflow with things like labels, milestones, todos, assignments, etc, is far easier when we're starting with a clean(ish) slate of (mostly) relevant issues, rather than five years of irrelevant garbage. Cheers, Daniel [0]: https://gitlab.gnome.org/World/bztogl/issues/26#note_84840 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH v3 0/2] Add tablet_v2 suport to weston-info
On Mon, 30 Apr 2018 11:35:48 +0200 w...@ongy.net wrote: > From: Markus Ongyerth > > Changes since v2: > * Incorporated style changes as requested by Peter > > Exception: Single line multi declaration. > > Cheers, > ongy > > Markus Ongyerth (2): > weston-info: Add support for tablet-unstable-v2 > weston-info: destroy wl_keyboard > > Makefile.am | 14 +- > clients/weston-info.c | 855 +- > 2 files changed, 860 insertions(+), 9 deletions(-) > Hi, pushed these two: e0dc5d47..995bf51b master -> master Thanks, pq pgpiwi822cznb.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston] Fix a crash when unlocking or unconfining a pointer
On Thu, 10 May 2018 00:53:38 -0700 Dima Ryazanov wrote: > In GNOME (but not in Weston), if a window loses focus, the client first > receives > the focus event, then the unlock/unconfine event. This causes toytoolkit to > dereference a NULL window when unlocking or unconfining the pointer. > > To repro: > - Run weston-confine > - Click the window > - Alt-Tab away from it > > Result: > > [1606837.869] wl_keyboard@19.modifiers(63944, 524352, 0, 0, 0) > [1606837.926] wl_keyboard@19.leave(63945, wl_surface@15) > [1606837.945] wl_pointer@18.leave(63946, wl_surface@15) > [1606837.956] wl_pointer@18.frame() > [1606837.961] zwp_confined_pointer_v1@26.unconfined() > Segmentation fault (core dumped) > > To fix this, get the input from the window instead of the other way around. > > Signed-off-by: Dima Ryazanov > --- > clients/window.c | 23 +-- > 1 file changed, 13 insertions(+), 10 deletions(-) > Hi Dima, thank you for the patch, and sorry, I know you have some very old patches still waiting for reviews. > diff --git a/clients/window.c b/clients/window.c > index bcf2b017..dee4455f 100644 > --- a/clients/window.c > +++ b/clients/window.c > @@ -286,6 +286,7 @@ struct window { > confined_pointer_unconfined_handler_t pointer_unconfined_handler; > > struct zwp_confined_pointer_v1 *confined_pointer; > + struct input *confined_input; > struct widget *confined_widget; > bool confined; > > @@ -4788,8 +4789,8 @@ static void > locked_pointer_locked(void *data, > struct zwp_locked_pointer_v1 *locked_pointer) > { > - struct input *input = data; > - struct window *window = input->pointer_focus; > + struct window *window = data; > + struct input *input = window->locked_input; > > window->pointer_locked = true; > > @@ -4804,8 +4805,8 @@ static void > locked_pointer_unlocked(void *data, > struct zwp_locked_pointer_v1 *locked_pointer) > { > - struct input *input = data; > - struct window *window = input->pointer_focus; > + struct window *window = data; > + struct input *input = window->locked_input; > > window_unlock_pointer(window); > > @@ -4860,7 +4861,7 @@ window_lock_pointer(struct window *window, struct input > *input) > > ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT); > zwp_locked_pointer_v1_add_listener(locked_pointer, > _pointer_listener, > -input); > +window); Now that this object will have a pointer to window, how do we safeguard against window_destroy() getting called before we dispatch a locked or unlocked event? Wouldn't that be necessary? > > window->locked_input = input; > window->locked_pointer = locked_pointer; > @@ -4902,8 +4903,8 @@ static void > confined_pointer_confined(void *data, > struct zwp_confined_pointer_v1 *confined_pointer) > { > - struct input *input = data; > - struct window *window = input->pointer_focus; > + struct window *window = data; > + struct input *input = window->confined_input; > > window->confined = true; > > @@ -4918,8 +4919,8 @@ static void > confined_pointer_unconfined(void *data, > struct zwp_confined_pointer_v1 *confined_pointer) > { > - struct input *input = data; > - struct window *window = input->pointer_focus; > + struct window *window = data; > + struct input *input = window->confined_input; > > window_unconfine_pointer(window); > > @@ -4984,8 +4985,9 @@ window_confine_pointer_to_rectangles(struct window > *window, > > zwp_confined_pointer_v1_add_listener(confined_pointer, >_pointer_listener, > - input); > + window); The same safeguard question here. > > + window->confined_input = input; I was also wondering about what would clean up this field when 'input' gets destroyed, but I suppose a proper event sequence will clean things up before 'input' is destroyed. > window->confined_pointer = confined_pointer; > window->confined_widget = NULL; > > @@ -5046,6 +5048,7 @@ window_unconfine_pointer(struct window *window) > zwp_confined_pointer_v1_destroy(window->confined_pointer); > window->confined_pointer = NULL; > window->confined = false; > + window->confined_input = NULL; > } > > static void However, I do think this is better than not, so pushed: da188835..e0dc5d47 master -> master I also filed a spec bug: https://bugs.freedesktop.org/show_bug.cgi?id=106704 Thanks, pq pgphkhEieXH_1.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org
Re: Migrating Wayland & Weston to GitLab
On Tue, 29 May 2018 10:59:52 +0100 Daniel Stone wrote: > Hi, > > On 7 May 2018 at 16:59, Daniel Stone wrote: > > Repository migration > > > > > > [admin hat still on] > > > > The first thing to happen is to migrate the central Git push point to > > GitLab. anongit.fd.o and cgit will still work as read-only mirrors, > > but you will not be able to push to git.fd.o. This would happen for > > all of wayland, wayland-protocols, weston and wayland-web. libinput we > > could move separately, wayland-build-tools is open to discussion (does > > it still work?), and wayland-java appears to be completely abandoned. > > > > All this would require is for everyone with push rights to set up > > their GitLab account with SSH keys as per the instructions at [0]. On > > a designated flag day, the push URL would become a GitLab one, and > > direct pushes to git.fd.o would be rejected. Users would be able to > > view and fork the repository at gitlab.fd.o, though not necessarily > > able to do any more than that. Since this is easy and low-impact, I'd > > propose to do this at the end of this week or early next week, if > > there are no objections. > > I intend to migrate the wayland/wayland-protocols/wayland-web/weston > repository hosting only (issues disabled, MR submission disabled) this > evening. Anyone trying to push to git.fd.o will get an error message > pointing them to the wiki page telling them how to configure their > remotes and set up their accounts. Anyone having trouble with this is > welcome to contact me and I can help figure it out. > > This leaves the wayland-build-tools and wayland-java repositories > orphaned in cgit; both have been inactive for quite some time. > > I would like to get the issues migrated as well. In order to do that > though, we need some more fixes to the 'bztogl' migration tool we've > been using to push issues from Bugzilla to GitLab, as well as do > migrations for some other projects which requested to migrate their > issues a while ago. It also needs a fair few changes in order to fix > support for Phabricator task import as well. > > But even once those are done, we need to clean up the bugs we're > importing. The plan is to only import open bugs: closed bugs will stay > in Bugzilla/Phabricator forever as a read-only archive, and GitLab > will only have new active issues. I think a sensible transition plan > would be for us to aim to do the import at the end of June, which > means sweeping through all our open bugs before then, closing them if > they're no longer useful or just cleaning up titles/etc to be helpful > in future. The sweep is to reduce the work you need to do in the migration, right? Aside from the obvious maintenance work we should have been doing all these years but didn't. > Does anyone have any opinions on this? Fine by me! Thanks, pq pgpCeatgoJji7.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 2/2 v5] clients/simple-egl-lease: A demo client for DRM leases
Heavily inspired by kmscube and simple-egl. Uses legacy page-flipping and triangle shaders from simple-egl. Signed-off-by: Marius Vlad --- Makefile.am| 11 + clients/simple-egl-lease.c | 887 + clients/simple-egl-lease.h | 99 + configure.ac | 17 + 4 files changed, 1014 insertions(+) create mode 100644 clients/simple-egl-lease.c create mode 100644 clients/simple-egl-lease.h diff --git a/Makefile.am b/Makefile.am index 00a49d9..abde6f2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -649,6 +649,17 @@ weston_simple_dmabuf_v4l_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_V4L_CLIENT_CFLAGS weston_simple_dmabuf_v4l_LDADD = $(SIMPLE_DMABUF_V4L_CLIENT_LIBS) libshared.la endif +if BUILD_SIMPLE_EGL_LEASE_CLIENTS +demo_clients += weston-simple-egl-lease +weston_simple_egl_lease_SOURCES = clients/simple-egl-lease.c +nodist_weston_simple_egl_lease_SOURCES = protocol/drm-lease-unstable-v1-protocol.c \ + protocol/drm-lease-unstable-v1-client-protocol.h +weston_simple_egl_lease_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_LEASE_CLIENT_CFLAGS) \ +$(LIBDRM_CFLAGS) +weston_simple_egl_lease_LDADD = $(SIMPLE_EGL_LEASE_CLIENT_LIBS) $(LIBDRM_LIBS) \ + $(GBM_LIBS) -lm +endif + noinst_LTLIBRARIES += libtoytoolkit.la libtoytoolkit_la_SOURCES = \ diff --git a/clients/simple-egl-lease.c b/clients/simple-egl-lease.c new file mode 100644 index 000..8922e57 --- /dev/null +++ b/clients/simple-egl-lease.c @@ -0,0 +1,887 @@ +/* + * Copyright 2018 NXP + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Adapted from kmscube and simple-egl. No atomic support atm. + * + */ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include + +#include "drm-lease-unstable-v1-client-protocol.h" + +#include +#include + +#include +#include + +#include "simple-egl-lease.h" + +static volatile uint8_t sig_recv = 0; + +static const GLfloat verts[3][2] = { + { -0.5, -0.5 }, + { 0.5, -0.5 }, + { 0,0.5 } +}; + +static const GLfloat colors[3][3] = { + { 1, 0, 0 }, + { 0, 1, 0 }, + { 0, 0, 1 } +}; + +GLfloat rotation[4][4] = { + { 1, 0, 0, 0 }, + { 0, 1, 0, 0 }, + { 0, 0, 1, 0 }, + { 0, 0, 0, 1 } +}; + +static const char *vertex_shader_source = + "uniform mat4 rotation;\n" + "attribute vec4 pos;\n" + "attribute vec4 color;\n" + "varying vec4 v_color;\n" + "void main() {\n" + " gl_Position = rotation * pos;\n" + " v_color = color;\n" + "}\n"; + +static const char *fragment_shader_source = + "precision mediump float;\n" + "varying vec4 v_color;\n" + "void main() {\n" + " gl_FragColor = v_color;\n" + "}\n"; + +static struct gbm * +init_gbm(int drm_fd, int w, int h) +{ + struct gbm *gbm = calloc(1, sizeof(*gbm)); + + gbm->dev = gbm_create_device(drm_fd); + + gbm->surface = gbm_surface_create(gbm->dev, w, h, GBM_FORMAT_XRGB, + GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); + if (!gbm->surface) { + printf("failed to create gbm surface\n"); + return NULL; + } + + gbm->width = w; + gbm->height = h; + + return gbm; +} + +static int +init_egl(struct egl *egl, const struct gbm *gbm) +{ + EGLint major, minor, n; + + static const EGLint context_attribs[] = { + EGL_CONTEXT_CLIENT_VERSION, 2, + EGL_NONE + }; + + static const EGLint config_attribs[] = { + EGL_SURFACE_TYPE, EGL_WINDOW_BIT, + EGL_RED_SIZE, 1, +
[PATCH weston 0/2 v5] DRM lease support
Functional no change since last version, just rebased to take into account clone series. Patch series that adds support for DRM leases. DRM leases is a method developed by Keith Packard to allow other application manage the output of a display/VR, while a DRM master is already owning the outputs resources. A more thorough explanation and terminology can be found at [1]. libdrm [2] and kernel [3] have already gained support. Protocol support can be found at [4]. Initially this was a single patch but decided to split into series to accommodate a demo client as well. Changes since v4: - rebased in order to get connector id from from drm_head Changes since v3: - rename lease with leasable to avoid confusion (Philipp Zabel) - added client protocol headers / protocol to BUILD_SOURCES otherwise the client example can't be built due to missing client headers Changes since v2: - rebased as drm_output_disable() has been changed due to atomic changes - deferring the lease when the output can't be disabled due to a pending flip - client blocks until it receives a 'created'/'failed' event when deferring the lease. - fix a potential NULL pointer if failing to get an encoder in the client - provide correct link to protocol - use lessee_id instead of lease_id as per libdrm/kernel terminology Changes since v1: - accommodate changes due to protocol changes - use enable/disabled for the output instead of destroy/update_outputs (Daniel Stone) - split into a series, added a client example - forcing a repaint when giving the lease and not doing a modeset if the output has been leased avoids blank switching between the lesor and lessee [1] https://keithp.com/blogs/DRM-lease/ [2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v4.15-rc9=62884cd386b876638720ef88374b31a84ca7ee5f [3] https://cgit.freedesktop.org/mesa/drm/commit/?id=c4171535389d72e9135c9615cecd07b346fd6d7e [4] https://lists.freedesktop.org/archives/wayland-devel/2018-February/036947.html Marius Vlad (2): compositor-drm: Add support for DRM lease clients/simple-egl-lease: A demo client for DRM leases Makefile.am| 19 +- clients/simple-egl-lease.c | 887 + clients/simple-egl-lease.h | 99 + compositor/main.c | 6 + configure.ac | 21 ++ libweston/compositor-drm.c | 279 +- libweston/compositor.c | 1 + libweston/compositor.h | 1 + 8 files changed, 1310 insertions(+), 3 deletions(-) create mode 100644 clients/simple-egl-lease.c create mode 100644 clients/simple-egl-lease.h -- 2.9.3 ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH weston 1/2 v5] compositor-drm: Add support for DRM lease
Signed-off-by: Marius Vlad --- Makefile.am| 8 +- compositor/main.c | 6 + configure.ac | 4 + libweston/compositor-drm.c | 279 - libweston/compositor.c | 1 + libweston/compositor.h | 1 + 6 files changed, 296 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index 69ca6cb..00a49d9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -168,7 +168,9 @@ nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES = \ protocol/pointer-constraints-unstable-v1-protocol.c \ protocol/pointer-constraints-unstable-v1-server-protocol.h \ protocol/input-timestamps-unstable-v1-protocol.c\ - protocol/input-timestamps-unstable-v1-server-protocol.h + protocol/input-timestamps-unstable-v1-server-protocol.h \ + protocol/drm-lease-unstable-v1-protocol.c \ + protocol/drm-lease-unstable-v1-server-protocol.h BUILT_SOURCES += $(nodist_libweston_@LIBWESTON_MAJOR@_la_SOURCES) @@ -889,7 +891,9 @@ BUILT_SOURCES +=\ protocol/linux-dmabuf-unstable-v1-protocol.c\ protocol/linux-dmabuf-unstable-v1-client-protocol.h \ protocol/input-timestamps-unstable-v1-protocol.c\ - protocol/input-timestamps-unstable-v1-client-protocol.h + protocol/input-timestamps-unstable-v1-client-protocol.h \ + protocol/drm-lease-unstable-v1-protocol.c \ + protocol/drm-lease-unstable-v1-client-protocol.h westondatadir = $(datadir)/weston dist_westondata_DATA = \ diff --git a/compositor/main.c b/compositor/main.c index 1092204..8fda259 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -1234,6 +1234,7 @@ drm_backend_output_configure(struct weston_output *output) char *modeline = NULL; char *gbm_format = NULL; char *seat = NULL; + char *lease = NULL; if (!api) { weston_log("Cannot use weston_drm_output_api.\n"); @@ -1276,6 +1277,11 @@ drm_backend_output_configure(struct weston_output *output) api->set_seat(output, seat); free(seat); + weston_config_section_get_string(section, "lease", , "off"); + if (!strncmp(lease, "on", 2)) + output->leasable = true; + free(lease); + return 0; } diff --git a/configure.ac b/configure.ac index da3f734..a81b137 100644 --- a/configure.ac +++ b/configure.ac @@ -212,6 +212,10 @@ if test x$enable_drm_compositor = xyes; then PKG_CHECK_MODULES(DRM_COMPOSITOR_GBM, [gbm >= 10.2], [AC_DEFINE([HAVE_GBM_FD_IMPORT], 1, [gbm supports dmabuf import])], [AC_MSG_WARN([gbm does not support dmabuf import, will omit that capability])]) + PKG_CHECK_MODULES(DRM_LEASE, [libdrm >= 2.4.89], + [AC_DEFINE([HAVE_DRM_LEASE], 1, [libdrm support lease capability])], + [AC_MSG_WARN([libdrm doesn't have leases support, will omit that capability])]) + fi diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index 8b1ea66..4b7b470 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -64,6 +64,7 @@ #include "presentation-time-server-protocol.h" #include "linux-dmabuf.h" #include "linux-dmabuf-unstable-v1-server-protocol.h" +#include "drm-lease-unstable-v1-server-protocol.h" #ifndef DRM_CAP_TIMESTAMP_MONOTONIC #define DRM_CAP_TIMESTAMP_MONOTONIC 0x6 @@ -273,6 +274,21 @@ struct drm_backend { uint32_t pageflip_timeout; bool shutting_down; + struct wl_list leases; +}; + +struct lease { + int leased_fd; + uint32_t lessee_id; + + int nobjects; + int tnobjects; + uint32_t *objects; + + struct drm_output *leased_output; + struct wl_resource *lease_resource; + struct drm_backend *drm_backend; + struct wl_list link; }; struct drm_mode { @@ -436,6 +452,7 @@ struct drm_output { int destroy_pending; int disable_pending; int dpms_off_pending; + int lease_pending; struct drm_fb *gbm_cursor_fb[2]; struct drm_plane *cursor_plane; @@ -463,6 +480,7 @@ struct drm_output { struct wl_listener recorder_frame_listener; struct wl_event_source *pageflip_timer; + struct lease *lease; }; static struct gl_renderer_interface *gl_renderer; @@ -1392,6 +1410,38 @@ drm_pending_state_get_output(struct drm_pending_state *pending_state, static int drm_pending_state_apply_sync(struct drm_pending_state *state); +#ifdef HAVE_DRM_LEASE +static void +drm_lease_clear_objects(struct lease *lease) +{ + memset(lease->objects, 0, sizeof(uint32_t) * lease->tnobjects); + lease->tnobjects = 0; +} + +static void +drm_output_send_lease(struct drm_output *output) +{ +
Re: Migrating Wayland & Weston to GitLab
Hi, On 7 May 2018 at 16:59, Daniel Stone wrote: > Repository migration > > > [admin hat still on] > > The first thing to happen is to migrate the central Git push point to > GitLab. anongit.fd.o and cgit will still work as read-only mirrors, > but you will not be able to push to git.fd.o. This would happen for > all of wayland, wayland-protocols, weston and wayland-web. libinput we > could move separately, wayland-build-tools is open to discussion (does > it still work?), and wayland-java appears to be completely abandoned. > > All this would require is for everyone with push rights to set up > their GitLab account with SSH keys as per the instructions at [0]. On > a designated flag day, the push URL would become a GitLab one, and > direct pushes to git.fd.o would be rejected. Users would be able to > view and fork the repository at gitlab.fd.o, though not necessarily > able to do any more than that. Since this is easy and low-impact, I'd > propose to do this at the end of this week or early next week, if > there are no objections. I intend to migrate the wayland/wayland-protocols/wayland-web/weston repository hosting only (issues disabled, MR submission disabled) this evening. Anyone trying to push to git.fd.o will get an error message pointing them to the wiki page telling them how to configure their remotes and set up their accounts. Anyone having trouble with this is welcome to contact me and I can help figure it out. This leaves the wayland-build-tools and wayland-java repositories orphaned in cgit; both have been inactive for quite some time. I would like to get the issues migrated as well. In order to do that though, we need some more fixes to the 'bztogl' migration tool we've been using to push issues from Bugzilla to GitLab, as well as do migrations for some other projects which requested to migrate their issues a while ago. It also needs a fair few changes in order to fix support for Phabricator task import as well. But even once those are done, we need to clean up the bugs we're importing. The plan is to only import open bugs: closed bugs will stay in Bugzilla/Phabricator forever as a read-only archive, and GitLab will only have new active issues. I think a sensible transition plan would be for us to aim to do the import at the end of June, which means sweeping through all our open bugs before then, closing them if they're no longer useful or just cleaning up titles/etc to be helpful in future. Does anyone have any opinions on this? Cheers, Daniel ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston v2 1/1] simple-dmabuf-drm: support DRM_FORMAT_LINEAR for NV12 as well
Hi, On Tue, May 29, 2018 at 11:44:36AM +0300, Pekka Paalanen wrote: > On Mon, 28 May 2018 17:41:57 +0200 > Guido Günther wrote: > > > This makes --import-format=NV12 testable on e.g. intel > > > > We only set nv12_format_found to true if we found that format and at > > least one understood modifier. Store modifier verbatim instead of using > > a boolean flag. Last advertised and supported modifier currently wins. > > > > The NV12 DRM_FORMAT_LINEAR image should be green in the upper left > > corner and white in the lower right. > > > > Signed-off-by: Guido Günther > > --- > > clients/simple-dmabuf-drm.c | 55 + > > 1 file changed, 38 insertions(+), 17 deletions(-) > > > > Pushed: >74742e05..da188835 master -> master Thanks for handling this! -- Guido ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH] scanner: allow referencing foreign enums
On Sat, 26 May 2018 09:51:18 +0200 Silvan Jegen wrote: > Hi > > On Fri, May 25, 2018 at 05:24:41PM -0400, Simon Ser wrote: > > It's already possible to reference foreign interfaces, so it > > should also be possible to reference foreign enums. > > > > Signed-off-by: Simon Ser > > --- > > src/scanner.c | 7 +-- > > 1 file changed, 1 insertion(+), 6 deletions(-) > > It looks good to me and I can confirm that this works as intended. If > no solution allowing for the passing of reference protocols is desired, > this should be applied. > > Reviewed-by: Silvan Jegen Reviewed-by: Pekka Paalanen If no-one objects, I will push this next week. Do ping me if I forget. Thanks, pq > > > > diff --git a/src/scanner.c b/src/scanner.c > > index 1737911..205c28a 100644 > > --- a/src/scanner.c > > +++ b/src/scanner.c > > @@ -894,14 +894,9 @@ verify_arguments(struct parse_context *ctx, > > e = find_enumeration(ctx->protocol, interface, > > a->enumeration_name); > > > > - if (e == NULL) > > - fail(>loc, > > -"could not find enumeration %s", > > -a->enumeration_name); > > - > > switch (a->type) { > > case INT: > > - if (e->bitfield) > > + if (e && e->bitfield) > > fail(>loc, > > "bitfield-style enum must only be > > referenced by uint"); > > break; > > -- > > 2.17.0 > > > > > > ___ > > wayland-devel mailing list > > wayland-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/wayland-devel > ___ > wayland-devel mailing list > wayland-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/wayland-devel pgp6Cyc9CD4GL.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: [PATCH weston v2 1/1] simple-dmabuf-drm: support DRM_FORMAT_LINEAR for NV12 as well
On Mon, 28 May 2018 17:41:57 +0200 Guido Günther wrote: > This makes --import-format=NV12 testable on e.g. intel > > We only set nv12_format_found to true if we found that format and at > least one understood modifier. Store modifier verbatim instead of using > a boolean flag. Last advertised and supported modifier currently wins. > > The NV12 DRM_FORMAT_LINEAR image should be green in the upper left > corner and white in the lower right. > > Signed-off-by: Guido Günther > --- > clients/simple-dmabuf-drm.c | 55 + > 1 file changed, 38 insertions(+), 17 deletions(-) > Pushed: 74742e05..da188835 master -> master Thanks, pq pgprpyrSBmgw0.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
[PATCH libinput] evdev: enable button scrolling on the VirtualBox USB Tablet
It's a generic tablet that maps whatever device actually interacts with VirtualBox into evdev events. Since we can't rely on the host system to have this feature we might as well make the guest slightly more usable. So we need to at least make sure that button scrolling is available. https://bugs.freedesktop.org/show_bug.cgi?id=106674 Signed-off-by: Peter Hutterer --- meson.build| 1 + src/evdev-fallback.c | 3 ++ src/evdev.c| 1 + src/evdev.h| 1 + test/litest-device-virtualbox-tablet.c | 95 ++ test/litest.h | 1 + test/test-device.c | 12 + test/test-pointer.c| 5 ++ udev/90-libinput-model-quirks.hwdb | 6 +++ 9 files changed, 125 insertions(+) create mode 100644 test/litest-device-virtualbox-tablet.c diff --git a/meson.build b/meson.build index bb8af141..f76a7a8b 100644 --- a/meson.build +++ b/meson.build @@ -684,6 +684,7 @@ if get_option('tests') 'test/litest-device-xen-virtual-pointer.c', 'test/litest-device-vmware-virtual-usb-mouse.c', 'test/litest-device-yubikey.c', + 'test/litest-device-virtualbox-tablet.c', 'test/litest.c' ] diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c index fa01faa4..c41a42cd 100644 --- a/src/evdev-fallback.c +++ b/src/evdev-fallback.c @@ -1480,6 +1480,9 @@ fallback_dispatch_create(struct libinput_device *libinput_device) evdev_init_left_handed(device, fallback_change_to_left_handed); + if (device->model_flags & EVDEV_MODEL_VIRTUALBOX_USB_TABLET) + device->scroll.want_button = 1; + if (device->scroll.want_button) evdev_init_button_scroll(device, fallback_change_scroll_method); diff --git a/src/evdev.c b/src/evdev.c index 2a7743e4..789daf9d 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -1269,6 +1269,7 @@ evdev_read_model_flags(struct evdev_device *device) MODEL(JUMPING_SEMI_MT), MODEL(BOUNCING_KEYS), MODEL(CYBORG_RAT), + MODEL(VIRTUALBOX_USB_TABLET), MODEL(HP_STREAM11_TOUCHPAD), MODEL(LENOVO_T450_TOUCHPAD), MODEL(TOUCHPAD_VISIBLE_MARKER), diff --git a/src/evdev.h b/src/evdev.h index 0a7de392..1c0ce129 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -115,6 +115,7 @@ enum evdev_device_model { EVDEV_MODEL_LENOVO_X220_TOUCHPAD_FW81 = (1 << 12), EVDEV_MODEL_LENOVO_CARBON_X1_6TH = (1 << 13), EVDEV_MODEL_CYBORG_RAT = (1 << 14), + EVDEV_MODEL_VIRTUALBOX_USB_TABLET = (1 << 15), EVDEV_MODEL_HP_STREAM11_TOUCHPAD = (1 << 16), EVDEV_MODEL_LENOVO_T450_TOUCHPAD= (1 << 17), EVDEV_MODEL_TOUCHPAD_VISIBLE_MARKER = (1 << 18), diff --git a/test/litest-device-virtualbox-tablet.c b/test/litest-device-virtualbox-tablet.c new file mode 100644 index ..6bf4993e --- /dev/null +++ b/test/litest-device-virtualbox-tablet.c @@ -0,0 +1,95 @@ +/* + * Copyright © 2018 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "config.h" + +#include "litest.h" +#include "litest-int.h" +#include + +static void touch_down(struct litest_device *d, unsigned int slot, + double x, double y) +{ + assert(slot == 0); + + litest_event(d, EV_ABS, ABS_X, litest_scale(d, ABS_X, x)); + litest_event(d, EV_ABS, ABS_Y, litest_scale(d, ABS_Y, y)); + litest_event(d, EV_SYN, SYN_REPORT, 0); +} + +static void touch_move(struct litest_device *d, unsigned int slot, + double x, double y) +{ + assert(slot == 0); + + litest_event(d, EV_ABS, ABS_X,