summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-01-07Unconditionally add linux-dmabuf’s protocol to BUILT_SOURCESHEADmasterEmmanuel Gil Peyrot1-3/+3
This was preventing weston-info from building if both weston-simple-dmabuf-drm and weston-simple-dmabuf-v4l2 were disabled at build-time. Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> Reported-by: Cedric Sodhi <manday@openmail.cc> Tested-by: Cedric Sodhi <manday@openmail.cc> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-12-19configure: fix sys/sysmacros.h checkPekka Paalanen1-0/+4
This patch is a copy of https://cgit.freedesktop.org/mesa/drm/commit/?id=7040fea0280bad527ed4b3d5eee7d7bfbf303efc by Adam Jackson. Commit 43c5a65b034a243700cf9c5bfbe6bcefb15f1161 "configure.ac: use AC_HEADER_MAJOR to detect major()/minor()" started using AC_HEADER_MAJOR to detect the header where major() is defined. This caused a regression on systems where glibc is still providing a deprecated definition of major() through sys/types.h, leading to a bunch of compiler warnings: /home/pq/git/weston/libweston/launcher-logind.c: In function ‘launcher_logind_open’: /home/pq/git/weston/libweston/launcher-logind.c:182:13: warning: In the GNU C Library, "major" is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use "major", include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro "major", you should undefine it after including <sys/types.h>. fd = launcher_logind_take_device(wl, major(st.st_rdev), The issue has been discussed earlier on https://lists.gnu.org/archive/html/autoconf/2016-09/msg00013.html Work around the issue by causing the warning to trigger a build failure inside AC_HEADER_MAJOR test, so that we get MAJOR_IN_SYSMACROS defined. Cc: Adam Jackson <ajax@redhat.com> Cc: Emil Velikov <emil.l.velikov@gmail.com> Cc: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-12-18weston: add --drm-device option for DRM-backendPekka Paalanen2-0/+9
Developers with testing rigs having multiple graphics cards plugged in often want to test things on a specific card. We have ways to choose a card through seat assignments, but configuring that run by run is awkward. Add a command line option for opening a specific DRM device. v2: call it --drm-device instead of --device Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-18compositor-drm: add specific_device configuration optionPekka Paalanen2-1/+35
Developers with testing rigs having multiple graphics cards plugged in often want to test things on a specific card. We have ways to choose a card through seat assignments, but configuring that run by run is awkward. Add a new DRM backend option to try to open a specific device, and quit if it fails. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-18tests: Add test for pointer axis eventsAlexandros Frantzis5-3/+73
Add test to verify the server correctly emits pointer axis events. This requires updating the weston-test protocol with a new request for pointer axis events. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-18tests: Add test for touch event timestampsAlexandros Frantzis6-5/+114
Add test to verify that the server correctly sets the timestamps of touch events. This requires updating the weston-test protocol with a new request for touch events. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-18tests: Add test for keyboard key event timestampsAlexandros Frantzis5-16/+55
Add test to verify that the server correctly sets the timestamps of keyboard key events. This requires updating the weston-test protocol to support passing key event timestamps. simple_keyboard_test now uses the create_client_with_keyboard_focus() helper function which changes the initial state of the surface to be focused. This leads to one additional iteration of the test loop when starting, during which the surface is deactivated, i.e., loses focus. After this initial iteration the test continues as before. Furthermore, simple_keyboard_test now uses the send_key() helper function which performs a roundtrip internally. To account for this, the client_roundtrip() function is now directly called in the loop only when it is still required, i.e., when deactivating the surface. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-18tests: Add checks for pointer motion and button event timestampsAlexandros Frantzis7-16/+53
Enhance the existing pointer motion and button event tests to additionally verify the event timestamps. This requires updating the weston-test protocol to support passing motion and button event timestamps. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-18shared: Add timespec_to_proto helper functionAlexandros Frantzis3-4/+58
Add helper function to convert from struct timespec values to tv_sec_hi, tv_sec_lo, tv_nsec triplets used for sending high-resolution timestamp data over the wayland protocol. Replace existing conversion code with the helper function. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-18shared: Add timespec_from_proto helper functionAlexandros Frantzis4-16/+34
Add helper function to convert tv_sec_hi, tv_sec_lo, tv_nsec triplets, used for sending high-resolution timestamp data over the wayland protocol, to struct timespec values. Replace existing conversion code with the helper function. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-18rdp compositor: add a man page and add links to that pageDavid Fort3-0/+110
2017-12-12tests: Use separate test cases for pointer motion and button testsAlexandros Frantzis1-11/+25
Split pointer motion and pointer button tests so that each test case is more focused and self-contained. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-12tests: Move wl_pointer tests to their own fileAlexandros Frantzis4-321/+322
Move wl_pointer tests from event-test.c to their own pointer-test.c file. This move makes the test organization clearer and more consistent, and will make addition of further pointer tests easier. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-12-11libweston: drop return type from ::query_dmabuf_{formats, modifiers}Emil Velikov2-12/+12
Nobody checks for the bool returned by these functions. At the same time: a) the functions set the respective num_foo to zero on error and b) callers honour that variable. Just drop the return type - it's useless. Note: this is an ABI break. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-11gl-renderer: use correct pixel shader for NV12 format uploaded to RG textureArnaud Vrac1-1/+2
Signed-off-by: Arnaud Vrac <rawoul@gmail.com> Fixes: 00a03d2f724 ("gl-renderer: add support of WL_SHM_FORMAT_NV12") Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-11gl-renderer: fix pixel format used in texture uploads when using R/RG texturesArnaud Vrac1-3/+15
In glTexImage2D / glTexSubImage2D calls, the only pixel formats allowed for the GL_R8 and GL_RG internal formats are respectively GL_RED and GL_RG [1]. Make sure we match this requirement, as some drivers will fail with the current code. [1] https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml, Table 2 Signed-off-by: Arnaud Vrac <rawoul@gmail.com> Fixes: 00a03d2f724 ("gl-renderer: add support of WL_SHM_FORMAT_NV12") Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-11libweston-desktop/xwayland: Make sure racy surfaces are properly mappedQuentin Glidic1-0/+10
This fixes a race between Xwayland committing the surface content via the wl_surface, and the XWM setting the role of the surface. We now keep track of the (first) content commit on the surface and forward it to the shell when we finally get the role. There is no need to track later changes, as the only way for Xwayland to unmap a surface is to destroy it. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Daniel Stone <daniels@collabora.com>
2017-12-11configure.ac: drop spurious bracketGuido Günther1-1/+1
Otherwise configure output looks like checking for library containing pam_open_session... -lpam ./configure: line 18064: ]: command not found checking for COLORD... yes Signed-off-by: Guido Günther <agx@sigxcpu.org> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-08libweston-desktop: add signal for title/app-id changesMatt Hoosier2-4/+21
As discussed on https://lists.freedesktop.org/archives/wayland-devel/2017-August/034720.html, it's useful for the shell implementation to know when these change, for example to relay the information on to taskbars or similar. To avoid ABI changes or the need to make the weston_desktop_surface definition public, new functions are introduced for attaching listeners to these signals. Signed-off-by: Matt Hoosier <matt.hoosier@gmail.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-12-05xwm: Use Pango to draw title string if availableLouis-Francis Ratté-Boulianne3-5/+60
If Weston is built with Pango, use it to render the title for X11 applications and Weston toy toolkit clients. It allows us to ellipsize the title when there isn't enough space to show the whole string. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-05xwm: Deal with title in a smarter way when there isn't enough spaceLouis-Francis Ratté-Boulianne3-14/+26
The title in X11 windows and Wayland application using Weston toy toolkit were placing the title in a very naive fashion. It was only try to center the string in the title bar. This patch: * Makes sure the title isn't renderer underneath buttons; * Move the title to the left if the titlebar isn't large enough; * Clip the end of the title if needed. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-05xwm: Maximize windows when double-clicking on title barLouis-Francis Ratté-Boulianne1-2/+24
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-05xwm: Only send configure a window if the new size is differentLouis-Francis Ratté-Boulianne1-4/+11
If we configure a window with the same size and wait for the sync alarm to go off, the resizing is gonna block. The event is only handled is the size actually changed. Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-05xwm: Handle third data entry in client messagesIlia Bozhinov1-5/+9
A single client message can be used to modify two properties at once. That's why when processing such messages we have to check both the second and the third data entry for states that we must handle. Signed-off-by: Ilia Bozhinov <iliyabo@hotmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04desktop-shell: Handle the fullscreen to maximized case safelyDerek Foreman1-0/+2
When a client transitions from maximized to fullscreen to maximized (run weston-terminal, maximize it, hit f11 twice) we're sending size 0,0 for the unfullscreen configure, which still has maximized set. This results in clients correctly picking any size they like, and weston disconnecting them for it. Instead, pass the correct maximized size. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04desktop-shell: refactor maximized size calculation into its own functionDerek Foreman1-7/+14
We need to calculate maximized size to resolve a bug with unsetting fullscreen, might as well share the code. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04tests: add a create_test_surface functionEmilio Pozuelo Monfort2-9/+23
This doesn't attach a buffer to the surface. This is needed for the next commit, where we have a test case with a surface that doesn't have a buffer attached. Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04input: Do not override keyboard focus on restoreQuentin Glidic1-11/+15
If we start a special (grabbing) client when Weston is unfocused, it would lose focus when coming back to Weston. Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04compositor-x11: Implement mode switchingArmin Krezović1-8/+129
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04clients: simple-egl: Restore window size when un-maximizedTomohiro Komagata1-3/+7
The window position was correct but the window size was wrong when simple-egl returns from maximized window to un-maximized. Its size should be restored to original size. Signed-off-by: Tomohiro Komagata <tomohiro.komagata.aj@gmail.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04configure.ac: use AC_HEADER_MAJOR to detect major()/minor()Sergei Trofimovich5-4/+32
This change slightly updates c4d7f66c12853b9575366dd9f4a7960ec5694934 which added <sys/sysmacros.h> inclusion. Autoconf has AC_HEADER_MAJOR to find out which header defines reqiured macros: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Particular-Headers.html This change should increase portability across other libcs. Bug: https://bugs.gentoo.org/610652 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04option-parser: replace int/0/1 with bool/false/trueEric Engestrom1-19/+20
These are already used as bools by all callers, let's make that official. Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04config-parser: fix `short_name` typeEric Engestrom1-1/+1
This field is populated with chars, compared to chars and printed as a char. It should probably be a char. Signed-off-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04weston-resizor: Don't add new frame callbacks every clickDerek Foreman1-0/+5
The frame callback added on button click re-adds itself when done, so adding a new one every click resulted in an ever increasing number of callbacks. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Acked-by: Daniel Stone <daniels@collabora.com>
2017-12-04gl-renderer: remove unneeded castEmil Velikov1-2/+1
The variable num is of EGLint type. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04compositor-drm: fix z-order inversion in plane assignmentMatt Hoosier1-2/+12
As discussed in the following thread: https://lists.freedesktop.org/archives/wayland-devel/2017-August/034755.html the existing plane assignment in the DRM backend is vulnerable to accidental masking of the intended fullscreen surface. This change adds a simple stateful memory to the plane assignment algorithm to prevent that. Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04weston: added missing header time.hValery Kartel1-0/+1
without it I can't built weston on alpinelinux Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04tests: Fix integer overflows on 32-bit systemsAlexandros Frantzis1-2/+2
Ensure that the integer type used in expressions involving multiplication with NSEC_PER_SEC is large enough to avoid overflows on 32-bit systems. In the expressions fixed by this patch a 64-bit type (long long) is required. Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04dnd: Abort with an error message if compositor doesn't support drag and dropDerek Foreman1-0/+4
This test isn't particularly useful when the compositor doesn't support drag and drop - so bail if we fail to create a data source. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-04clients: Don't crash when compositor doesn't support drag and dropDerek Foreman2-0/+6
display_create_data_source() can return NULL when there's no data device manager present. Instead of carrying on blindly, test its return value. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-01weston-info: Add support for zwp_linux_dmabuf_v1Emmanuel Gil Peyrot2-1/+95
This now prints each (format, modifier) tuple, to show which ones the compositor sends to its clients. It is only implemented for version 3+, since I didn’t have any compositor implementing previous versions, and the old `format` event is deprecated anyway. Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-01tests: Mark tests as used so they don’t get removed at link timeEmmanuel Gil Peyrot2-3/+3
Without this attribute, the test macros were making Weston fail to build with LTO enabled. Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de> Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Tested-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-01tests: Add one more indentation level to some macrosEmmanuel Gil Peyrot1-22/+22
This is a preparatory patch for the next one. Signed-off-by: Emmanuel Gil Peyrot <emmanuel.peyrot@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2017-12-01gl-renderer: Set pitch correctly for subsampled texturesDaniel Stone1-4/+8
zwp_linux_dmabuf_v1 allows clients to pass an explicit pitch for each plane, but wl_shm only takes a single pitch parameter; the pitch for secondary planes must be inferred. Multi-plane sub-sampled textures have partial width/height, e.g. YUV420/I420 has a full-size Y plane, followed by a half-width/height U plane, and a half-width/height V plane. GStreamer's waylandsink - the only user of wl_shm YUV formats - expects the implementation to follow the example of Xv and implicitly divide the pitch for secondary planes by the subsampling factor. gl-renderer was not doing this, and instead just using the (larger) stride provided by the client for all planes in the buffer. Fix gl-renderer to divide pitch by the subsampling factor when uploading from subsampled SHM buffers into GL textures, also dividing co-ordinates when doing offset partial uploads. Tested with: $ gst-launch-1.0 videotestsrc ! waylandsink Signed-off-by: Daniel Stone <daniels@collabora.com> Reported-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> Tested-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> Reviewed-by: Arnaud Vrac <avrac@freebox.fr> Acked-by: Vincent ABRIOU <vincent.abriou@st.com> Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Fixes: fdeefe42418 ("gl-renderer: add support of WL_SHM_FORMAT_YUV420") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103063
2017-11-30clients/editor: Toggle panel visibility on clickJoshua Watt1-2/+11
If the --click-to-show option is specified, clicking an input field will toggle the input panel visiblity Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Tested-by: Silvan Jegen <s.jegen@gmail.com> Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
2017-11-30text-backend: Allow client hiding of input panelJoshua Watt1-10/+12
Previously, the hide_input_panel and show_input_panel messages for the text input protocol were limited to specific cases, such as showing the panel on activation, or making the panel visible after activation. Now, clients are allowed to toggle the panel visiblity at will as long as they are the currently active client Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Tested-by: Silvan Jegen <s.jegen@gmail.com> Reviewed-by: Jan Arne Petersen <janarne@gmail.com>
2017-11-28man: mention logind for launchingPekka Paalanen1-3/+6
Logind has been long supported as means to launch Weston without weston-launch. It's good to note it in the manual. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-11-28compositor-drm, compositor-fbdev: stop suggesting rootPekka Paalanen2-4/+6
Stop suggesting to run Weston as root, it is only meant for debugging. Instead, mention the two supported ways to run Weston on DRM and fbdev: weston-launch helper and logind service. Cc: "Ucan, Emre (ADITG/ESB)" <eucan@de.adit-jv.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net> [Pekka: added forgotten "using" word.]
2017-11-28weston-launch: improve help text for -u and -tPekka Paalanen1-2/+4
Explain that -u requires root and -t requires -u. Most importantly, document in what format does -t expect the tty to be given. It has been confusing, because Weston's --tty option takes an integer, weston-launch takes a full device path. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2017-11-28weston-launch: fix -t option parsingPekka Paalanen1-1/+1
Fix an issue introduced in: commit ab4999492ce630e6bb1c93215fc052c2c29913bd Author: Kristian Høgsberg <krh@bitplanet.net> Date: Fri Jul 19 21:26:24 2013 -0700 weston-launch: Drop sleep_fork option where the option string accidentally became "t::". That causes $ weston-lauch -t /dev/tty4 to be parsed incorrectly, as if -t option had no argument and the tty path gets passed to weston which errors out because of it. This patch fixes the above to work as expected. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Acked-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>