summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* clutter/stage: Replace _cogl_util_get_eye_planes_for_screen_poly()gbsneto/graphene-frustrumGeorges Basile Stavracas Neto2020-10-131-134/+36
| | | | | | | | | | | | | | | | | | | _cogl_util_get_eye_planes_for_screen_poly() is quite a complicated beast. Ever since Clutter became a compositor toolkit, and specially after we switched to graphene_frustum_t on paint volumes, we can brutally simplify this function. The new code assumes camera is at (0, 0, 0) at world coordinates (i.e. before applying the projection). We also consider that the redraw clip are at stage coordinates. That means that converting the clip rectangle to world rectangle is simply a matter of projecting the corresponding vertices using the "view" matrix. Furthermore, we only need to project the top-left, and bottom-right vertices, since top-right and bottom-left can be derived from those two. The frustum setup still uses triplets of vertices to setup the planes, except now the first vertex is always the camera (hardcoded to 0, 0, 0), and the other two vertices are the projected clip rectangle vertices. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Simplify frustum setup functionGeorges Basile Stavracas Neto2020-10-131-10/+2
| | | | | | | | | We guarantee to never pass NULL clips anymore, so there's no need to check for such case. Remove the check for NULL clip, and remove all related variables. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/actor: Remove region cullingGeorges Basile Stavracas Neto2020-10-131-38/+0
| | | | | | We can trust the clip frusta array to encode this information now. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Use multiple frusta depending on the redraw clipGeorges Basile Stavracas Neto2020-10-134-28/+69
| | | | | | | | | | | The redraw clip region may contain multiple clip rectangles. We currently only use the extents of this region, but having multiple frusta for each rectangle is a better alternative, and will allow us to remove the extra projection we currently do. Make the clip frustum an array, with multiple frusta. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Move pick cache invalidation out of setupGeorges Basile Stavracas Neto2020-10-131-6/+7
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Remove outdated commentGeorges Basile Stavracas Neto2020-10-131-5/+0
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Move clip frustum to ClutterPaintContextGeorges Basile Stavracas Neto2020-10-135-27/+35
| | | | | | | | | | The clip planes / frustum are contextual to painting. In the past, for the lack of a better place, it was added to ClutterStage, but now we have an appropriate home for such data: ClutterPaintContext. Move the frustum to the paint context. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Don't setup view on pickGeorges Basile Stavracas Neto2020-10-131-5/+5
| | | | | | | | | | | | | | While refactoring the clipping planes / frustum code, it became more and more evident that we do not need to update them while picking. Picking nowadays goes through a completely different code path, that does not rely on paint volume culling. While it might be interesting to eventually also cull out based on paint volumes, it certainly won't go through the painting code anymore. Remove setting up the view when picking, and rename functions appropriatedly. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter: Remove CLUTTER_CULL_RESULT_PARTIALGeorges Basile Stavracas Neto2020-10-132-5/+1
| | | | | | | | | | Culling paint volumes don't give this level of detail anymore, and in fact knowing whether it was partially or fully in was only being used in a debug path. For the purposes of culling, it doesn't matter if a given actor is partially or completely inside the frustum; either way, it must be painted. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/actor: Use switch instead of if/elseGeorges Basile Stavracas Neto2020-10-131-6/+13
| | | | | | To improve legibility of the code. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Use graphene_frustum_t for clippingGeorges Basile Stavracas Neto2020-10-135-41/+40
| | | | | | | | | | | | Instead of 4 planes, use a graphene_frustum_t to store the clipping planes. The cautious reviewer might noticed that we are now setting up 6 planes: the 4 planes we were doing before, plus 2 extra planes in the Z axis. These extra planes simulate an "infinite" Z far, and an "on-camera" Z near. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter: Remove ClutterPlaneGeorges Basile Stavracas Neto2020-10-131-6/+0
| | | | | | It is unused now. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/actor: Trivial code shufflingGeorges Basile Stavracas Neto2020-10-131-3/+3
| | | | | | | Retrieving the stage from the actor is almost free, but this is a hot path anyway and we can bail out before that. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/actor: Remove unnecessary checkGeorges Basile Stavracas Neto2020-10-131-7/+0
| | | | | | | The stage clip is *never* NULL - it is a structure field of ClutterStage itself. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Use graphene_plane_t for clipping planesGeorges Basile Stavracas Neto2020-10-135-32/+19
| | | | | | | It allows us to remove quite a bunch of code, and not deal with part of the mind-melting maths behind it. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/stage: Simplify view setupGeorges Basile Stavracas Neto2020-10-131-20/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ClutterStage defines the 8 vertices of a frustum: 4 ----------------------------- 5 | \ / | | \ / | | 0 --------------------- 1 | | | | | | | | | | 3 --------------------- 2 | | / \ | | / \ | 7 ----------------------------- 6 Then, it uses triplets of vertices to create each clipping plane. It only sets up 4 planes (it doesn't clip based on depth), defined by the following vertices: * 0 - 4 - 5 * 1 - 5 - 6 * 2 - 6 - 7 * 0 - 7 - 4 The first 3 triplets are selected using the for-loop. However, the last triplet is different, and is done out of the loop. It could have been made simpler by using the "3 - 7 - 4" triplet. Simplify the current code by using the suggested triplet, calculated inside the for-loop. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter: Use graphene_matrix_inverse()Georges Basile Stavracas Neto2020-10-135-58/+6
| | | | | | | | Instead of our own implementation that upscales, then downscales back, use graphene_matrix_inverse() directly. This is possible after switching to a z-near value that doesn't have problems with float precision. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* cluter/stage: Use 1.0 for z-nearGeorges Basile Stavracas Neto2020-10-131-1/+1
| | | | | | | | It doesn't actually matter, since we don't really have cases where we cross this value, but it's enough to prevent catastrophic cancellation due to very small float numbers. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/actor: Round to 256ths when projecting for pickingGeorges Basile Stavracas Neto2020-10-131-0/+3
| | | | | | | | | | | Picking is specially sensitive for float precision, and tests can easily fail when something changes, even if ever so slightly. A simple way to workaround this is by adjusting the projected points using the same procedure described at 67cc60cbda. Round projected points for picking to 256ths. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/util: Generalize ROUND_TO_256THSGeorges Basile Stavracas Neto2020-10-132-10/+16
| | | | | | | It'll be reused in other bits of the Clutter codebase. Move it to an inline function in clutter-private.h https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1489
* clutter/frame-clock: Skip the ClutterFrameListenerIface from the introspectionCorentin Noël2020-10-131-0/+3
| | | | | | This can't possibly be used by introspected languages as it is a raw struct. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1413
* compositor: Make sure _NET_WM_FRAME_DRAWN timestamp has the right scopeJonas Ådahl2020-10-126-42/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The timestamp sent with _NET_WM_FRAME_DRAWN should be in "high resolution X server timestamps", meaning they should have the same scope as the built in X11 32 bit unsigned integer timestamps, i.e. overflow at the same time. This was not done correctly when mutter had determined the X server used the monotonic clock, where it'd just forward the monotonic clock, confusing any client using _NET_WM_FRAME_DRAWN and friends. Fix this by 1) splitting the timestamp conversiot into an X11 case and a display server case, where the display server case simply clamps the monotonic clock, as it is assumed Xwayland is always usign the monotonic clock, and 2) if we're a X11 compositing manager, if the X server is using the monotonic clock, apply the same semantics as the display server case and always just clamp, or if not, calculate the offset every 10 seconds, and offset the monotonic clock timestamp with the calculated X server timestamp offset. This fixes an issue that would occur if mutter (or rather GNOME Shell) would have been started before a X11 timestamp overflow, after the overflow happened. In this case, GTK3 clients would get unclamped timestamps, and get very confused, resulting in frames queued several weeks into the future. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1494
* clutter/private: Make all time unit conversions int64_tJonas Ådahl2020-10-121-11/+11
| | | | | | | This way there is less risk of ending up with would-be negative unsigned values. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1494
* wayland: Don't send proximity_in for new resourcesJulius Lehmann2020-10-121-19/+0
| | | | | | | | | | | | | | | | | | | Mutter sends a proximity-in event before the required tablet tool resource is properly allocated on the client. This is violating the Wayland protocol. Because libwayland ignores events for objects it doesn't know yet, this is not noticeable in most applications. However, if https://gitlab.freedesktop.org/wayland/wayland/-/issues/176 gets fixed, these applications would likely crash immediately. Therefore this PR removes the responsible code which, again, shouldn't have any effect on client applications as they ignore this event anyway. Relevant part of the spec: This event can be received when the tool has moved from one surface to another, or when the tool has come back into proximity above the surface. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1427
* gschema/wayland: Do not disable the X Security extensionOlivier Fourdan2020-10-091-1/+1
| | | | | | | If Xwayland was built with the X Security extension enabled, it should be safe to use, there is no need to disable it by default from mutter. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1485
* Update Portuguese translationJuliano de Souza Camargo2020-10-091-120/+49
| | | | (cherry picked from commit 103d798775de27bce10fc8827b2b7b5f79fb2ff7)
* gschema: really use line breaks in schemaOlivier Fourdan2020-10-081-3/+3
| | | | | | | | The newline character `\n` in the schema does not produce a new line. Use a newline instead. fixes: dbe44f3a83e6a6bdc611bb298e3781a0aebbbd7b https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1483
* Remove misplaced line break in g_* logging functionsJonas Ådahl2020-10-0816-30/+30
| | | | | | They resulted in empty lines in the log. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
* wayland: Don't include newline in client error eventsJonas Ådahl2020-10-081-2/+2
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
* Make meta_* logging utilities not require line breakJonas Ådahl2020-10-0850-579/+596
| | | | | | | | Unlike g_* logging utilities, the meta_* counterparts behave like odd printf() functions. Lets change that so they fit better into how logging is done everywhere else. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1466
* gschema: Force one bullet point per lineBjörn Daase2020-10-081-0/+3
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
* gschema: list experimental dma-buf-screen-sharing featureBjörn Daase2020-10-081-0/+4
| | | | | | | The key was added in https://gitlab.gnome.org/GNOME/mutter/-/commit/af9df1e5b62b253e5f1d5f6eff89e45e3bed81b3 but not added to the list due to the string freeze. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
* gschema: Make "Requires a restart." strings consistentBjörn Daase2020-10-071-1/+1
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1481
* window/wayland: Offset position with size mismatch when resizingJonas Ådahl2020-10-071-0/+23
| | | | | | | | | | | | | | | | | | | When we resize a window we send it configure requests with size suggestion. Some clients, e.g. gnome-terminal will limit its size to a discrete set given the font size resulting in the size often not being respected completely, but used as a hint to find a size as large as possible but not larger than the configured size. When doing an interactive resize dragging the right or top side of a window, this caused issues with the configured window size not matching the one used by the client, as the configured position wouldn't be correct for the actual size. Fix this by offsetting the position given the size mismatch offset, making the position again in sync with the size. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1447 https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1477
* clutter/offscreen-effect: Remove clutter_offscreen_effect_get_target_rectGeorges Basile Stavracas Neto2020-10-072-73/+1
| | | | | | | | | | | | | Keeping track of the projected position is costly, and adds quite some complexity to ClutterOffscreenEffect.pre_paint(). As far as research goes, there's not a single consumer of this function that uses the position for anything - only size is used. Remove clutter_offscreen_effect_get_target_rect(), and drop the annoying position field from ClutterOffscreenEffect as well. This allows us to stop projecting the position on pre-paint, and simplify things. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter/deform-effect: Use clutter_offscreen_effect_get_target_size()Georges Basile Stavracas Neto2020-10-071-7/+1
| | | | | | We don't read the x/y position anyway. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter/offscreen-effect: Undeprecate clutter_offscreen_effect_get_target_size()Georges Basile Stavracas Neto2020-10-072-3/+1
| | | | | | clutter_offscreen_effect_get_target_rect() is going away soon. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter/offscreen-effect: Remove CoglMaterial from public APIGeorges Basile Stavracas Neto2020-10-074-19/+17
| | | | | | | Rename clutter_offscreen_effect_get_material() to get_pipeline() and make it return (actually, stop casting to) a CoglMaterial. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter/paint-nodes: Don't skip pipeline node constructorGeorges Basile Stavracas Neto2020-10-071-1/+1
| | | | | | | | ClutterPipelineNode will be used by GNOME Shell in the future. Fortunately for us, CoglPipeline is already usable from GJS, so we don't need to skip the constructor for the pipeline node. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter/offscreen-effect: Simplify paintGeorges Basile Stavracas Neto2020-10-071-8/+3
| | | | | | | Simply chain up to get the pre and post paint methods, instead of reimplementing ClutterEffect.paint() https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter/offscreen-effect: Unref framebuffer on pre_paintGeorges Basile Stavracas Neto2020-10-071-5/+7
| | | | | | | | Move unreffing the framebuffer to ClutterOffscreenEffect.pre_paint(). This will allow us to properly chain up ClutterOffscreenEffect.paint() and not reimplement exactly what ClutterEffect does by default. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter/effect: Don't expose pre and post paint helpersGeorges Basile Stavracas Neto2020-10-072-24/+3
| | | | | | They're not used outside ClutterEffect. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1474
* clutter: Do not special case allocated eventswip/carlosg/small-api-cleanupsCarlos Garnacho2020-10-061-98/+32
| | | | | | | All events should be allocated, stack allocation is avoided and should be avoided in the future, probably by making ClutterEvent structs opaque. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1475
* clutter: Drop clutter_event_peek()Carlos Garnacho2020-10-062-28/+0
| | | | | | | Peeking doesn't seem such a good idea when we switch to async queues. Luckily nobody seems to be using this. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1475
* backends: Use graphene_point_t on meta_cursor_tracker_get_pointer()Carlos Garnacho2020-10-068-34/+36
| | | | | | It's nicer to propagate along. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1475
* backend: Don't pull generated headers (indirectly)Carlos Garnacho2020-10-062-4/+4
| | | | | | | | | | | Use a typedef for MetaRemoteDesktop, so tests poking MetaBackend don't indirectly depend upon generated headers. This is arguably a code fix for a build system bug. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1470 Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1449 (or something...)
* util: Remove now unused debug functionsJonas Ådahl2020-10-062-21/+0
| | | | | | They have been replaced with using debug string parsing and topics. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
* main: Parse MUTTER_DEBUG as debug stringJonas Ådahl2020-10-062-5/+38
| | | | | | | | | | | This makes it possible to run e.g. env MUTTER_DEBUG=input:geometry gnome-shell which will enable the 'META_DEBUG_INPUT' and 'META_DEBUG_GEOMETRY' topics. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
* util: Remove unused meta_debug_spew()Jonas Ådahl2020-10-062-34/+0
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465
* util: Remove a bunch of unused debug topicsJonas Ådahl2020-10-062-33/+17
| | | | https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1465