summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the named SINCE_VERSION defines for version checksJasper St. Pierre2014-08-082-3/+3
| | | | To make our code more clear.
* fullscreen-shell: Fix compiler warningsGiulio Camuffo2014-08-081-2/+2
|
* desktop-shell: don't assume there's a pointer when mapping a popupJonny Lamb2014-08-071-1/+2
|
* compositor: Use libwayland to find a good default display for usJasper St. Pierre2014-08-051-29/+38
|
* window: Don't use the frame's geometry when fullscreenJasper St. Pierre2014-08-051-2/+2
| | | | | When fullscreen, we don't actually update the frame's geometry, so we can't query it for there.
* input: Send key-repeatJasper St. Pierre2014-08-051-1/+4
|
* animation: also change stop value when updating a fade targetJonny Lamb2014-07-301-0/+1
| | | | | | | | | | | If we're fading a view with weston_fade_run() and half way through we want to unfade it we can use weston_fade_update() to set a new alpha target. When the animation finishes, reset_alpha() is called which ensures the alpha value of the view is exactly as requested. Although weston_fade_update() was updating the spring target so the animation would look fine, it would then reset to the alpha target given in the first call to weston_fade_run().
* compositor: ignore unmapped sub-surfaces for view_listPekka Paalanen2014-07-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looks like that in the great conversion introducing weston_view, one conditional was forgotten from the code that builds the global flat list of views. Sub-surfaces are added to the view list specially, as they are not governed by their presence in a layer's view list, and therefore need an explicit check for mappedness. The bug, missing the explicit check, caused sub-surfaces to enter the global view_list regardless of their state. This lead to the pointer focus picking code processing them, and as the input region defaults to infinite, picking these unmapped surfaces. Clients then get confused about the wl_pointer.enter events with unexpected wl_surface. To trigger this issue, it is enough to just create one additional wl_surface and make it a sub-surface of a main surface that is or gets mapped. Literally, just a wl_subsomcpositor_get_subsurface() call is enough. At some point later, the unmapped sub-surface will get pointer focus, depending on view stacking order. Fix the issue by adding a is_mapped check when building the view_list. Note, that 95ec0f95aa2df74c2da19e7dda24528fa8f765cc accidentally also prevents this bug from happening, because it adds a test against the transform.masked_boundingbox in weston_compositor_pick_view(). Reported-by: George Kiagiadakis <george.kiagiadakis@collabora.com> Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* Do not assume 64x64 cursor, added support for other sizes (like in AMD ↵Alvaro Fernando García2014-07-291-7/+34
| | | | | | | | | | Kaveri, 128x128). Init cursor size to 64x64 if drmGetCap() fails. Use Mesa GBM_BO_USE_CURSOR define (which removes 64x64 restriction) Signed-off-by: Alvaro Fernando García <alvarofernandogarcia@gmail.com>
* compositor: quick fix for sub-surface mappingPekka Paalanen2014-07-251-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a client does this: 1. create a main window and map it 2. create a wl_surface, and make it a sub-surface of the main window 3. set the sub-surface to desync 4. commit content to the sub-surface to map it Then step 4 should cause the sub-surface to become mapped. However, Weston fails to schedule a repaint in that case, so the sub-surface will not appear until something else causes a repaint on that output, e.g. the main window. A quick and dirty fix is to set the output mask for the surface in Weston, which allows the repaint to be scheduled. This patch implements that, and might only work right on single-output systems. A proper fix would involve rewriting the whole "is surface mapped" mechanism in Weston, to not rely on output assignments but to have a separate flag for "mapped", and figuring out how to schedule repaints for the right outputs. Following is the actual protocol sequence used to trigger the problem: [3224648.125] -> wl_compositor@4.create_surface(new id wl_surface@3) [3224648.206] -> xdg_shell@7.get_xdg_surface(new id xdg_surface@8, wl_surface@3) [3224648.311] -> xdg_surface@8.set_title("simple-shm") [3224648.378] -> wl_surface@3.damage(0, 0, 250, 250) [3224649.888] -> wl_shm@6.create_pool(new id wl_shm_pool@9, fd 6, 250000) [3224650.031] -> wl_shm_pool@9.create_buffer(new id wl_buffer@10, 0, 250, 250, 1000, 1) [3224650.244] -> wl_shm_pool@9.destroy() [3224651.975] -> wl_surface@3.attach(wl_buffer@10, 0, 0) [3224652.100] -> wl_surface@3.damage(20, 20, 210, 210) [3224652.243] -> wl_surface@3.frame(new id wl_callback@11) [3224652.317] -> wl_surface@3.commit() [3228652.535] -> wl_compositor@4.create_surface(new id wl_surface@12) [3228652.610] -> wl_subcompositor@5.get_subsurface(new id wl_subsurface@13, wl_surface@12, wl_surface@3) [3228652.644] -> wl_subsurface@13.set_desync() [3228652.659] -> wl_subsurface@13.set_position(100, 100) [3228654.090] -> wl_shm@6.create_pool(new id wl_shm_pool@14, fd 6, 250000) [3228654.140] -> wl_shm_pool@14.create_buffer(new id wl_buffer@15, 0, 250, 250, 1000, 1) [3228654.180] -> wl_shm_pool@14.destroy() [3228654.408] -> wl_surface@12.attach(wl_buffer@15, 0, 0) [3228654.436] -> wl_surface@12.damage(0, 0, 250, 250) [3228654.462] -> wl_surface@12.commit() Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Cc: George Kiagiadakis <george.kiagiadakis@collabora.com> Cc: Jason Ekstrand <jason.ekstrand@intel.com>
* xwayland: Better handle a race with XJason Ekstrand2014-07-241-0/+6
| | | | | | | If X windows are created and destroyed very fast sometimes the WM window object gets created and destroyed before we get around to handling client messages. Failing to check that the window is still valid can result in a segfault.
* xwayland/window-manager: Rename a variable for clerityJason Ekstrand2014-07-241-3/+3
|
* xwayland: set surface_id to 0 when client resource is foundTyler Veness2014-07-241-5/+8
| | | | | | | | | | | | | | | | | | | | | | When Xwayland requests that a wl_surface be created and the X event is handled before the wayland requests, a surface ID is stored to window->surface_id and the window is added to the unpaired window list. When weston_wm_create_surface is called, the window is removed from the list and window->surface_id is set to zero. If window->surface_id is not zero when weston_wm_window_destroy is called, the window is assumed to be in the unpaired window list and wl_list_remove is called. If weston_wm_window_handle_surface_id is called and the surface has already been created, the window is not added to the unpaired window list, but window->surface_id isn't set to zero. When the window is destroyed, removing the window from the list is attempted anyway and a crash occurs. This patch stores the surface ID in a temporary variable and only assigns it to window->surface_id when the window is added to the unpaired window list. Otherwise window->surface_id is set to zero to maintain its use as a flag variable. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=80273 Signed-off-by: Tyler Veness <calcmogul@gmail.com>
* compositor: add a masking mechanism to weston_layerGiulio Camuffo2014-07-234-5/+70
| | | | | | | this adds a mechanism to mask the views belonging to a layer to an arbitrary rect, in the global space. The parts that don't fit in that rect will be clipped away. Supported by the gl and pixman renderer only for now.
* compositor: keep track of the weston_layer a weston_view is inGiulio Camuffo2014-07-238-92/+127
| | | | | | | | | This introduces a new struct, weston_layer_entry, which is now used in place of wl_list to keep the link for the layer list in weston_view and the head of the list in weston_layer. weston_layer_entry also has a weston_layer*, which points to the layer the view is in or, in the case the entry it's the head of the list, to the layer itself.
* tests: use expect_protocol_error in testsMarek Chalupa2014-07-222-46/+29
| | | | | | Turn FAIL_TESTs to TESTs. FAIL_TESTs are bad... Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* tests: add frame_callback_wait_nofailMarek Chalupa2014-07-222-5/+10
| | | | | | | | | With expect_protocol_error, we need a possibility to wait for a frame without aborting the test when wl_display_dispatch returns -1; This patch adds function frame_callback_wait_nofail that only returns 1 or 0 (instead of aborting on error). Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* tests: add expect_protocol_error functionMarek Chalupa2014-07-222-0/+52
| | | | | | | | | | | | | | | | | This function checks if a particular protocol error came in wire. It's usefull in the cases where we hitherto used FAIL_TEST. The problem with FAIL_TEST is that *any* assert will pass the test, but we want only some asserts to pass the test (i. e. we don't want the test to pass when it, for example, can't connect to display). FAIL_TESTs are good only for sanity testing. The expect_protocol_error allows us to turn all FAIL_TESTs to TESTs as will be introduced in following patches. v2: fixed white-space error and a mistake in comment Reviewed-by: Bryce Harrington <b.harrington@samsung.com> Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* xdg-shell: Fix documentationJasper St. Pierre2014-07-171-2/+2
| | | | request_change_state has been folded into the configure event.
* shell: Replace set_margin with set_window_geometryJasper St. Pierre2014-07-175-89/+93
| | | | | | | | | | | | | | | | | | | Currently, there is a fun flicker when toggling maximization or fullscreen on a window in mutter or more sophisicated compositors and WMs. What happens is that the client want so go maximized, so we calculate the size that we want the window to resize to (640x480), and then add on its margins to find the buffer size (+10 = 660x500), and then send out a configure event for that size. The client renders to that size, realizes that it's maximized, and then says "oh hey, my margins are actually 0 now!", and so the compositor has to send out another configure event. In order to fix this, make the the configure request correspond to the window geometry we'd like the window to be at. At the same time, replace set_margin with set_window_geometry, where we specify a rect rather than a border around the window.
* Interpret the size in the configure event as window geometryJasper St. Pierre2014-07-172-1/+22
| | | | | The size of the configure event has always been specified as in window geometry coordinates, but it was never implemented this way.
* Create a weston_surface_state structure for storing pending surface state ↵Jason Ekstrand2014-07-072-204/+141
| | | | | | | | | | and move the surface commit logic into weston_surface_commit_state This new structure is used for both weston_surface.pending and weston_subsurface.cached. Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* Move weston_frame_callback above weston_surface_createJason Ekstrand2014-07-071-5/+5
| | | | | Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* Move weston_subsurface to after weston_surfaceJason Ekstrand2014-07-071-51/+51
| | | | | | | It makes more sense there. Signed-off-by: Jason Ekstrand <jason.ekstrand@intel.com> Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com>
* cairo-util: Set geometry_dirty in frame_set_titleBoyan Ding2014-07-051-0/+1
| | | | | | | | Title can decide the geometry of a frame because it may affect the existence of titlebar, so setting geometry_dirty in frame_set_title for potential change. Signed-off-by: Boyan Ding <stu_dby@126.com>
* cairo-util: Fix geometry for frames with buttons but without titleBoyan Ding2014-07-051-2/+2
| | | | | | | | | | | | There exist frames which have buttons without title such as a simple X application piped through xwayland which doesn't specify a title. We draw the title bar with buttons, but hide it under the window because geometry thinks a window needs titlebar only if it has title. This patch change the condition, making it titlebar is needed if a frame has title or has button(s), which makes more sense. Signed-off-by: Boyan Ding <stu_dby@126.com>
* Use pixman_region32_clear instead of our own empty_regionJason Ekstrand2014-07-054-33/+10
| | | | | | This requires pixman 0.25.2 Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
* shell: fix segfault in fullscreen bindingBoyan Ding2014-06-251-0/+1
| | | | | | | | | Commit 9aa8ce69 forgot to set shsurf->fullscreen_output in fullscreen_binding(), causing segfault when fullscreening using key bindings. This patch fixes that. https://bugs.freedesktop.org/show_bug.cgi?id=79828 Signed-off-by: Boyan Ding <stu_dby@126.com>
* screen-share: Allow fullscreen shell command to be configuredAndrew Wedgbury2014-06-252-14/+33
| | | | | | | | | | | | | | | | | I've updated this based on comments, simplifying the command handling. Currently the screen-share module uses a hard-coded command to start the fullscreen shell server. This patch causes the module to read the command from the weston config file (from the "command" key in the "screen-share" section). The default value remains the same (i.e. to run weston with the RDP backend and fullscreen shell), but is now located in the weston config file. As well as allowing the arguments to the fullscreen shell server to be changed, this also permits an alternative fullscreen shell server to be used if required, without needing to recompile. Since the command is run as the user running weston, this should not pose any additional security risk. Signed-off-by: Andrew Wedgbury <andrew.wedgbury@realvnc.com>
* data-device: Clean up the logic in start_dragJason Ekstrand2014-06-251-14/+17
| | | | | | | Previoiusly, we had a mess of logic that was repeated with one of the repeats negated. Not only was this unnecisaraly confusing, but it segfaulted and one of the negations was wrong. This cleans the whole mess up and should fix bug #79725.
* Better error message when exec'ing Xwayland failsArnout Engelen2014-06-251-1/+5
|
* Require libinput 0.4.0Peter Hutterer2014-06-252-12/+22
| | | | | | | | | | No functional changes, just adjusting for API changes in libinput: - libinput_destroy() replaced by libinput_unref() - log functions now take a libinput context, userdata is gone - udev seat creation is now libinput_udev_create_context() and libinput_udev_assign_seat() Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
* Change the defacto output transform from flipped-270 to flipped-90Jason Ekstrand2014-06-241-1/+1
| | | | | | | | | | It turns out that flipped-270 is the second-simplest transformation besides normal because it is a direct swapping of the x and y axes. Having that as the default encourages people to use flipped-270 as the default test for "I want to try this with a transform". Unfortunately, because flipped-270 is so simple, it is really easy to have something that works for normal, flipped-270, and nothing else. This encourages people to test with a transform thats actually "hard".
* Fix a commentJason Ekstrand2014-06-241-1/+1
|
* Clients: Fix memleak issues in various clients of westonvivek2014-06-2411-4/+60
| | | | | | | | | In many clients of weston, Display was not being destroyed so added it. Also destroy windows, widgets which were not being destroyed. Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewed-by: Pekka Paalanen <ppaalanen@gmail.com> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
* xdg-shell: Fix a typo in descriptionBoyan Ding2014-06-241-1/+1
| | | | Signed-off-by: Boyan Ding <stu_dby@126.com>
* desktop-shell: Don't assume there is a pointer when resizingEmilio Pozuelo Monfort2014-06-231-1/+2
| | | | | | | Fixes a crash on touch devices without a pointer, when touching the window frame of a client. Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
* weston-build: Fix aclocal error during autogen.shSrivardhan Hebbar2014-06-211-0/+5
| | | | | | | This is a fix to the following bug: https://bugs.freedesktop.org/show_bug.cgi?id=80214 Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
* compositor: update the surface size when there is a size change without a ↵George Kiagiadakis2014-06-192-14/+48
| | | | | | | buffer attach This fixes at least the case where you want to do wl_viewport.set_destination to resize the surface but without attaching new content in it.
* weston: Fix memleak issue in compositor.cSrivardhan Hebbar2014-06-181-6/+17
| | | | | | Based on a previous patch by Hardening <rdp.effort@gmail.com>. Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
* compositor-wayland: Fix compiler warningThierry Reding2014-06-181-1/+1
| | | | | | | | | | | | sizeof returns size_t, for which the correct printf specifier is %zu. Fixes the following warning when building for ARMv7. src/compositor-wayland.c: In function 'wayland_output_get_shm_buffer': src/compositor-wayland.c:260:3: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'unsigned int' [-Wformat=] weston_log("could not zalloc %ld memory for sb: %m\n", sizeof *sb); ^ Signed-off-by: Thierry Reding <treding@nvidia.com>
* build: Silence libtoolize warningsThierry Reding2014-06-182-0/+3
| | | | | | | | | | | | When running the autogen.sh script, libtoolize complains thusly: libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree. libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am. Silence the warnings by following libtoolize's advice. Signed-off-by: Thierry Reding <treding@nvidia.com>
* desktop-shell: make background applications less darkJonny Lamb2014-06-181-3/+3
|
* animation: ensure repaints are always scheduled during animationsJonny Lamb2014-06-182-0/+16
| | | | | | | | | | | | | | | | | Animations are run off the repaint cycle so if there's nothing to repaint, an animation will stop running. This is usually not a problem as each frame function of an animation causes something to change and therefore a repaint to happen. This patch helps detect when the animation isn't in said case and triggers a repaint to keep the animation running. This problem was found by using weston_move_scale_run() to move a view onscreen from completely off. The very first time the animation frame function was called the progress wasn't enough to move it into view. The compositor saw there was nothing to repaint and stopped doing anything else. When something else (like a pointer move) forced a redraw, the view's position was very much onscreen and jumped into view in an ugly way.
* exposay: fix crash when navigating with the keyboardEmilio Pozuelo Monfort2014-06-181-1/+3
| | | | | | | | | Commit a7592019 introduced an optimization that caused some exposay struct members to not be properly initialized, particularly cur_output, leading to crashes in some circumstances (e.g. pressing the down arrow key after going to exposay). Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
* animation: fix move scale animationJonny Lamb2014-06-181-1/+3
| | | | | | | | | | | Both weston_move_scale_run() and weston_slide_run() were broken in commit 3a869019. Commit a4a6f161 fixed and explained the problem for weston_slide_run() but weston_move_scale_run() remained broken. To fix weston_move_scale_run(), weston_view_animation_run() is also required. It was removed when _run() was split into two functions _create() and _run() in commit f5cc2b56, but _run() was not added in this commit.
* compositor: unmap subsurface views before destroying the subsurfacesGeorge Kiagiadakis2014-06-181-2/+6
| | | | | | | | | This is to avoid recursing into weston_compositor_build_view_list() and therefore fix crashing when destroying a stack of visible subsurfaces due to weston_compositor_build_view_list() being called recursively and corrupting the lists it works on. https://bugs.freedesktop.org/show_bug.cgi?id=79684
* Add a simple client for testing compositor damage handlingJason Ekstrand2014-06-183-0/+893
| | | | | | | | | | This allows for easily testing a compositor's damage tracking in all currently available configurations including wl_surface.buffer_transform, wl_surface.buffer_scale, and wl_viewport. It also includes a --rotating-damage that flag instructs the client to change the wl_surface.buffer_transform on every commit. This tests the compositor for proper handling of texture uploads even when the transform has changed but the buffer size hasn't.
* libinput: Use floating point instead of fixed point numbersJonas Ådahl2014-06-092-10/+19
| | | | | | | Also update configure.ac to require libinput 0.3 when enabled, as it is the version where double replaced li_fixed_t. Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
* compositor: raise errors when bad scale or transform values are usedJonny Lamb2014-06-031-0/+18
|