summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* window: Really force update monitor on hot plugscherry-pick-8eabfaaaOlivier Fourdan2018-11-132-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | Commit 8d3e05305 ("window: Force update monitor on hot plugs") added the flag `META_WINDOW_UPDATE_MONITOR_FLAGS_FORCE` passed to `update_monitor()` from `update_for_monitors_changed()`. However, `update_for_monitors_changed()` may choose to call another code path to `move_between_rects()` and `meta_window_move_resize_internal()` eventually. As `meta_window_move_resize_internal()` does not use the "force" flag, we may still end up in case where the window->monitor is left unchanged. To avoid that problem, add a new `MetaMoveResizeFlags` that `update_for_monitors_changed()` can use to force the monitor update from `meta_window_move_resize_internal()`. Fixes: 8d3e05305 ("window: Force update monitor on hot plugs") Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189 (cherry picked from commit fa495286a1037d610051ab49f0aa1e8b20e38066) (cherry picked from commit 8eabfaaa8b9469c5bdb1d8ca44b465384e8eaa9d)
* renderer/native: Also wrap flip closures for EGLStreamsJonas Ådahl2018-10-233-14/+44
| | | | | | | | | | | | When using the EGLStream backend, the MetaRendererNative passed a GClosure to KMS when using EGLStreams, but KMS flip callback event handler in meta-gpu-kms.c expected a closure wrapped in a closure container, meaning it'd instead crash when using EGLStreams. Make the flip handler get what it expects also when using EGLStreams by wrapping the flip closure in the container before handing it over to EGL. https://bugzilla.gnome.org/show_bug.cgi?id=790316 (cherry picked from commit 8ee14a7cb7e8f072d2731d59c7dc735f83a9bb0b)
* wayland/gtk-shell: Handle requests after toplevel was unmanagedJonas Ådahl2018-10-041-10/+19
| | | | | | | | | | | As with xdg-toplevel, a gtk-surface can be unmanaged by the compositor without the client knowing about it, meaning the client may still send updates and make requests. Handle this gracefully by ignoring them. The client needs to reset all the state anyway, if it wants to remap the same surface. https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit ca5b27baf517f00354ff8811ba204fd90f1ddb38)
* wayland/legacy-xdg-shell: Handle requests after toplevel was unmanagedJonas Ådahl2018-10-041-14/+79
| | | | | | | | | | | | As with xdg-toplevel proper, a legacy xdg-toplevel can be unmanaged by the compositor without the client knowing about it, meaning the client may still send updates and make requests. Handle this gracefully by ignoring them. The client needs to reassign the surface the legacy xdg-toplevel role again, if it wants to remap the same surface, meaning all state would be reset anyway. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit 64df6276881c5f42c6d2054d556d8cd391f7ee70)
* wayland/legacy-xdg-shell: Cache frame callbacks if toplevel is unmanagedJonas Ådahl2018-10-041-1/+8
| | | | | | | | | | | | A toplevel window can be unmanaged without the client knowing it (e.g. a modal dialog being unmapped together with its parent. When this has happened, take frame callbacks queued on a commit and cache them on the generic surface queue. If the toplevel is to be remapped because the surface was reassigned the toplevel role, the cached frame callbacks will be queued on the surface actor and dispatched accordingly. https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit a740f50cd7d05582a251c23a7025999e55e4aba1)
* wayland/xdg-shell: Handle requests after toplevel was unmanagedJonas Ådahl2018-10-041-13/+68
| | | | | | | | | | | | | | | | A window can be unmanaged without asking the client to do it, for example as a side effect of a parent window being unmanaged, if the child window was a attached dialog. This means that the client might still make requests post updates to it after that it was unmapped. Handle this gracefully by NULL-checking the surface's MetaWindow pointer. We're not loosing any state due to this, as if the client wants to map the same surface again, it needs to either reassign it the toplevel role, or reset the xdg-toplevel, both resulting in all state being lost anyway. https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit 5fd0f62a62a194ffd8e64d177f389912a582f8e1)
* wayland/xdg-shell: Cache frame callbacks if toplevel is unmanagedJonas Ådahl2018-10-041-1/+7
| | | | | | | | | | | | | A toplevel window can be unmanaged without the client knowing it (e.g. a modal dialog being unmapped together with its parent. When this has happened, take frame callbacks queued on a commit and cache them on the generic surface queue. If the toplevel is to be remapped, either because the surface was reassigned the toplevel role, or if it was reset and remapped, the cached frame callbacks will be queued on the surface actor and dispatched accordingly. https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit 80d420ff430e8e9495fd29d68084cb050600b26f)
* wayland/xdg-shell: Cache pending frame callbacks on popup resetJonas Ådahl2018-10-041-0/+1
| | | | | | | | | | | | | | | | A popup can be reset, and when that happens, window and actor are destroyed, and won't be created again unless it is reassigned the popup role. If a client queued frame callbacks when resetting a popup, the frame callbacks would be left in the pending state, as they were not queued on the actor, meaning we'd hit an assert about the frame callbacks not being handled. Fix this by caching them on the MetaWaylandSurface, so that they either are cleaned up on destruction, or queued on the actor would the surface be re-assigned the popup role. https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit 407d62943c1c0bbb34df5943b6b2d91c5723b6c4)
* wayland/surface: Add API to cache frame callbacksJonas Ådahl2018-10-042-7/+13
| | | | | | | | | | | Sometimes it may be useful for roles to put callbacks in the generic surface frame callback queue. The surface frame callback queue will either eventually be processed on the next surface role assignment that places the frame callbacks in a role specific queue, processed at some other point in time by a role, or cleaned up on surface destruction. https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit 0ace58d05f3e50f4fdcf4971baab163e6ae5a1e9)
* wayland/xdg-shell: Queue frame callbacks on new actor after resettingJonas Ådahl2018-10-043-4/+16
| | | | | | | | | | | | | | When a xdg-toplevel is reset, the window and actor are recreated, and all state is cleared. When this happened, we earlied out from the xdg-toplevel commit handler, which would mean that if the client had queued frame callbacks when resetting, they'd be left in the pending commit state, later hitting an assert as they were not handled. Fix this by queuing the frame callbacks no the new actor, so that they are emitted whenever the actor is eventually painted. https://gitlab.gnome.org/GNOME/mutter/issues/240 (cherry picked from commit d791710197205028be40750d6ee4119f2b7f0e26)
* window/wayland: Don't recursive indefinitely when updating monitorJonas Ådahl2018-10-031-1/+1
| | | | | | | | | | | | When we update the main monitor, there is a rule that makes it so that popup windows use the same main monitor as their parent. In the commit f4d07caa38e51d09ee73bab20334a6b5c28952d6 the call that updates and fetches the main monitor of the toplevel accidentally changed to update from itself, causing a indefinite recursion eventually resulting in a crash. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/279 (cherry picked from commit e191c21e04cfaa560f8dd51f4f91013af98ccf4e)
* wayland: No xdg-output events without a logical monitorOlivier Fourdan2018-09-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | To avoid a known race condition in the wl_output protocol documented in https://phabricator.freedesktop.org/T7722, mutter delays the `wl_output` destruction but nullify the `logical_monitor` associated with the `wl_output` and the binding routine `bind_output()` makes sure not to send wl_output events if the `logical_monitor` is `NULL` (see commit 1923db97). The binding routine for `xdg_output` however does not check for such a condition, hence if the output configuration changes while a client is binding to xdg-output (typically Xwayland at startup), mutter would crash while trying to access the `logical_monitor` which was nullified by the change in configuration. Just like `bind_output()` does for wl_output, do not send xdg-output events if there is no `logical_monitor` yet. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/194 (cherry picked from commit 68ec9ac017157def9b7c25dd8141dc0e93d9f918)
* core: Preserve focus across decoration changesCarlos Garnacho2018-09-244-0/+24
| | | | | | | | | | | | | Changes in window decoration result in the window being reparented in and out its frame. This in turn causes unmap/map events, and XI_FocusOut if the window happened to be focused. In order to preserve the focused window across the decoration change, add a flag so that the focus may be restored on MapNotify. Closes: #273 (cherry picked from commit 8dcac664faf03ac2ea382e44d587d1f7dc92f7a3)
* compositor: Skip windows not visible to the compositorOlivier Fourdan2018-09-241-0/+4
| | | | | | | | | | | | | | | | | | | | | The compositor will automatically unredirect the top most window which is fully visible on screen. When unredirecting windows, it also shapes the compositor overlay window (COW) so that other redirected windows still shows correctly. The function `get_top_visible_window_actor()` however will simply walks down the window list, so if a window is placed on a layer above and unredirected, then iconified by the client, it will still be picked up by `get_top_visible_window_actor()` and he compositor will reckon it's still unredirected while not in a visible state anymore, thus leaving a black area on screen. Make sure we skip the windows not known to the compositor while picking the top visible window actor to avoid this issue. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/306 (cherry picked from commit 2fb3db7659caa3627a473fefabc4d6a87f688cee)
* actor: Also recompute paint volume if we recently dropped effectsSam Spilsbury2018-09-191-2/+13
| | | | | | | Otherwise we'll be stuck with the same paint volume on the last frame of the given effect, which could be wrong. (cherry picked from commit a8a3c1017fd8604f4f7db272a867ae17b0214cf7)
* actor: Always use get_paint_volume override for active effectsSam Spilsbury2018-09-193-1/+42
| | | | | | | | | | | | | | | | | | | If an effect is active and it overrides the paint volume, we should always recompute the paint volume when requested and not use the cache, since the paint volume override can change from call to call depending on what phase of painting we are in. For instance, if we are part way through painting effects and request the paint volume, the paint volume should only go up to the current effect, but in a later call to compute repaint regions, the paint volume needs to expand to accomadate the effect. This still involves a lot of recomputation in the case of effects - in a later clutter version it would be worth adding an API to allow effects to explicitly recompute and return a new the paint volume up to the current effect as opposed to recomputing the cached one. (cherry picked from commit 5d19aee23a55a642517ec43b116e4452ab0c6cf1)
* actor: Fix logic error in determining terminal effect for paint volumeSam Spilsbury2018-09-191-1/+1
| | | | | | | | | | | | | Previously we were checking l->data != NULL || (l->data != NULL && l->data != priv->current_effect). This would continue the loop even if l->data == priv->current_effect, since l->data != NULL, which was not the intention of that loop. We also don't need to check that l->data != NULL before checking if it does not match the current_effect, since we already checked that current_effect was non-NULL before entering the loop. (cherry picked from commit 4270eef16ecbc5447c9869596567f2866c9265d7)
* window: unmanage dialog when clearing transient_forOlivier Fourdan2018-09-191-0/+8
| | | | | | | | | | | | | | | | On Wayland, xdg-foreign would leave a modal dialog managed even after the imported surface is destroyed. This is sub-optimal and this breaks the atomic relationship one would expect between the parent and its modal dialog. Make sure we unmanage the dialog if transient_for is unset even for Wayland native windows. Related: https://gitlab.gnome.org/GNOME/mutter/issues/174 Related: https://gitlab.gnome.org/GNOME/mutter/issues/221 (cherry picked from commit b443bd42ac738092817addf48e0b363d140cad26)
* shaped-texture: Disable mipmapping during animationDaniel van Vugt2018-09-021-6/+82
| | | | | | | | | | | This avoids overwhelming the GPU with trying to update mipmaps at a high rate. Because doing so could easily cause a reduction in the compositor frame rate and thus actually reduce visual quality. In the case of a window that is constantly animating in the overview, this reduces mutter's render time by around 20%-30%. (cherry picked from commit c9c32835409046556148d850796210c605ad9998)
* clutter/actor: Inherit clone branch depth from parentDaniel van Vugt2018-09-021-8/+21
| | | | | | | | | Children added to a parent after that parent (or its ancestors) have already been cloned now inherit the clone branch depth of the parent. Otherwise `clutter_actor_is_in_clone_paint` on the child could return FALSE when it should have been returning TRUE. (cherry picked from commit b393f3d54018b85137078664d548c0c661001ff1)
* compositor: Do not optimize obscured areas away in paint volumesCarlos Garnacho2018-09-021-36/+1
| | | | | | | | | | This optimization was presumably added before Clutter was able to invalidate selected regions of an actor. Paint volumes are supposed to be invariable as long as the actor conditions don't change. Stacking of other actors shouldn't affect the paint volume, so it's actually wrong to optimize those areas away here. (cherry picked from commit ec8138773a417976a260619099a1649306a0a495)
* clutter: Plug minor leakCarlos Garnacho2018-08-311-0/+2
| | | | | | | clutter_stage_manager_list_stages() returns a copied list, which should be freed. (cherry picked from commit 8cf42cd06caab4118082e28b80fc6691e14cc524)
* idle-monitor: Don't try to auto-start SessionManagerFlorian Müllner2018-08-311-1/+2
| | | | | | | | The interface is provided by gnome-session and not activatable. https://gitlab.gnome.org/GNOME/mutter/issues/134 (cherry picked from commit 2319cd9c4014fcc0c2487d7c02e67857f940687e)
* core: Hide close dialog before destroyingCarlos Garnacho2018-08-311-0/+3
| | | | | | | | | | | | The MetaCloseDialog implementation object may stay artifically alive for a longer period. This was usually fine till gnome-shell commit b03bcc85aad, as the check_alive() timeout will keep running even though the window went unmanaged/destroyed, leading to crashes. In order to fix this, forcibly hide the dialog if it is visible and the window is being unmanaged, so the timeout is stopped in time. (cherry picked from commit 6abe4703c7b4e24dbdd59631fe1eed637b84d12c)
* clutter-actor: Fix uninitialized matrix multiplyDaniel van Vugt2018-08-311-1/+1
| | | | | | | | | | `modelview` is uninitialized and the `apply` function just multiplies it. What we really want is to initialize `modelview` so replace `apply` with `get`. Who knows what bugs this may have caused... (cherry picked from commit 62c67be4c832b8787907581e90db0cde19423b16)
* idle-monitor: NULL check cached InhibitedActions property variantJonas Ådahl2018-08-311-2/+5
| | | | | | | | | We might not have a cached "InhibitedActions" property available for us, so do as elsewhere in this file and NULL check before processing it. https://gitlab.gnome.org/GNOME/mutter/merge_requests/130 (cherry picked from commit a3269dde952974554155b751db54603cedad9a76)
* wayland: Always realize buffers at surface commit timeMiguel A. Vico2018-08-313-12/+15
| | | | | | | | | | | | | Clients using EGLStream-backed buffers will expect the stream to be functional after wl_surface::attach(). That means the compositor-side stream must be created and a consumer attached to it. To resolve the above, this change realizes buffers even when the attach operation is deferred (e.g. synchronized subsurfaces). https://bugzilla.gnome.org/show_bug.cgi?id=782575 (cherry picked from commit 22723ca37173955d8ef4c6981795e91a85f4feb9)
* wayland-buffer: Create EGLStream texture at buffer_realize timeMiguel A. Vico2018-08-311-12/+10
| | | | | | | | | | | | | | | | | | | | When dealing with synchronized subsurfaces, we defer buffer attachments until the parent surface state is applied. That causes interaction issues with EGLStream backed buffers, as the client expects the compositor-side stream to be functional after it requests a wl_surface::attach. By allowing the compositor to realize buffers without attaching them, we could resolve the issue above if we define a realized EGLStream buffer as a functional EGLStream (EGLStream + attached consumer). This change moves the texture consumer creation part from the attach function to the realize one. https://bugzilla.gnome.org/show_bug.cgi?id=782575 (cherry picked from commit edd3634bb52a8efc687c612152fda5c996e94d26)
* renderer/native: Choose first EGL config for non-GBM backendsMiguel A. Vico2018-08-311-17/+48
| | | | | | | | | | | | | | | Commit 712ec30cd9be1f180c3789e7e6a042c5f7b5781d added the logic to only choose EGL configs that match the GBM_FORMAT_XRGB8888 pixel format. However, there won't be any EGL config satisfying such criteria for non-GBM backends, such as EGLDevice. This change will let us choose the first EGL config for the EGLDevice backend, while still forcing GBM_FORMAT_XRGB8888 configs for the GBM one. Related to: https://gitlab.gnome.org/GNOME/mutter/issues/2 (cherry picked from commit 1bf2eb95b502ed0419b0fe8979c022cacaf79e84)
* wayland: Realize dmabuf buffers before trying to attach themMiguel A. Vico2018-08-311-0/+1
| | | | | | | | | | | | | | | | | Commit 22723ca37 moved buffer realization to meta_wayland_surface_commit() so that it wouldn't be part of meta_wayland_buffer_attach(). However, creation of dmabuf buffers would call into meta_wayland_buffer_attach() directly without realizing the buffer first. attach() would then fail and mutter would effectively shut down any clients using the zwp_linux_dmabuf protocol (note that if such client was Xwayland, mutter itself would shut down as well). Add the missing bit in order to make zwp_linux_dmabuf protocol work again. (cherry picked from commit 54709c16b56a308d2254c56a35d042bf8b8e124f)
* ClutterActor: Preserve valid paint volumes till the next relayout/repaintCarlos Garnacho2018-08-311-1/+17
| | | | | | | | | Cuts down approximately all paint volume calculations when there's windows that redraw frequently, but don't move. https://bugzilla.gnome.org/show_bug.cgi?id=782344 (cherry picked from commit 161d2540e659fa8ed5efc74f350a741b2430417d)
* compositor: Add get_paint_volume() implementation to MetaSurfaceActorCarlos Garnacho2018-08-311-0/+8
| | | | | | | | | | The special ::pick implementation there makes clutter fall into paths that do require a get_paint_volume() implementation, or an infinite area will be used. Providing a paint volume here is easier on the invalidation mechanism. (cherry picked from commit 94f400988220eae76a1fb30390a62104da8f7b8f)
* monitor-manager: Cache the last known value of "lid-is-closed"Bastien Nocera2018-08-312-1/+9
| | | | | | | | | | | Restarting UPower will make every property of UpClient emit a "notify" signal (as a GDBusProxy would). Avoid mutter reconfiguring the displays when upower restarts by caching the last known value of "lid-is-closed" and only reconfiguring the displays if it actually changed. This fixes a black out of the screen when UPower restarts. (cherry picked from commit 49b23c749044a855fb3661a0351521f337946c41)
* monitor-manager: Don't throw an error if UPower isn't runningBastien Nocera2018-08-311-2/+5
| | | | | | | Don't try to connect to a UpClient signal if creating the client failed, because UPower isn't running for example. (cherry picked from commit 644a618fb15d90056107bc4e1fbd7397f17219a8)
* wayland: Nullify monitor resources when updating outputsOlivier Fourdan2018-08-311-21/+31
| | | | | | | | | | | | | If a client asks for xdg-output before we have set the output's logical monitor, we would end up crashing with a NULL pointer dereference. Make sure we clear the resource's user data when marking an output as inert on monitor change so that we don't end up with a Wayland output without a logical monitor. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/194 (cherry picked from commit 48eaa36d41bb88d4831e40e9c3ef3c7afda195bc)
* window: Return -1 if meta_window_get_monitor is called on an unmanaged windowSam Spilsbury2018-08-311-1/+5
| | | | | | | | | As opposed to crashing. In this case, letting the caller deal with it is the best policy, since this is public API. https://bugzilla.gnome.org/show_bug.cgi?id=788834 (cherry picked from commit 8626c69c2ffa806f854041a3738340c6fb20c112)
* backends/x11: Only free cursor if it was created successfullySebastian Keller2018-08-291-1/+3
| | | | | | | | | | XcursorLibraryLoadCursor can return 'None' if the current cursor theme is missing the requested icon. If XFreeCursor is then called on this cursor, it generates a BadCursor error causing gnome-shell to crash. Fixes https://gitlab.gnome.org/GNOME/mutter/issues/254 (cherry picked from commit 1bfa20929b36d06cc23667d1122175149615b56d)
* virtual-input/evdev: Translate from button internal codes to evdevJonas Ådahl2018-08-291-6/+29
| | | | | | | | | | | | | Sending button events to a ClutterVirtualInputDevice, the API expects button codes to be of the internal clutter type. The evdev implementation incorrectly assumed it was already prepared evdev event codes, which was not the case. Fix the evdev implementation to translate from the internal representation to evdev before passing it along to ClutterSeatEvdev. https://gitlab.gnome.org/GNOME/mutter/merge_requests/190 (cherry picked from commit 24aef44baf5d9dddf0e459e0a38cfb67d8457a88)
* window: Force update monitor on hot plugsJonas Ådahl2018-08-293-3/+4
| | | | | | | | | | | | | | | | | | | | | | | Commit a3da4b8d5bd217c0262fd9361036877d155a300f changed updating of window monitors to always use take affect when it was done from a non-user operation. This could cause feed back loops when a non-user driven operation would trigger the changing of a monitor, which itself would trigger changing of the monitor again due to a window scale change. The reason for the change, was that when the window monitor changed due to a hot plug, if it didn't actually change, eventually the window monitor pointer would be pointing to freed memory. Instead of force updating the monitor on all non-user operations, just do it on hot plugs. This allows for the feedback loop preventing logic to still do what its supposed to do, without risking dangling pointers on hot plugs. Related: https://gitlab.gnome.org/GNOME/mutter/issues/189 Closes: https://gitlab.gnome.org/GNOME/mutter/issues/192 (cherry picked from commit 8d3e053059cd202e740076caedfc8e3ac149066a)
* window: Pass flag to meta_window_update_monitor() instead of boolJonas Ådahl2018-08-295-20/+34
| | | | | | | | | | | The bool determines whether the call was directly from a user operation or not. To add more state into the call without having to add more boolenas, change the boolean to a flag (so far with 'none' and 'user-op' as possible values). No functional changes were made. https://gitlab.gnome.org/GNOME/mutter/issues/192 (cherry picked from commit f4d07caa38e51d09ee73bab20334a6b5c28952d6)
* clutter/x11: Implement keycode lookup from keysyms on virtual key devicesCarlos Garnacho2018-08-293-4/+204
| | | | | | | | | | | | | | | | Unfortunately XKeysymToKeycode() falls short in that it coalesces keysyms into keycodes pertaining to the first level (i.e. lowercase). Add a ClutterKeymapX11 method (much alike its GdkKeymap counterpart) to look up all matches for the given keysym. Two other helper methods have been added so the virtual device can fetch the current keyboard group, and latch modifiers for key emission. Combining all this, the virtual device is now able to handle keycodes in further levels. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/135 (cherry picked from commit 85284acb000ddc70afcf716b6c198b4b5bf5741e)
* monitor-manager-kms: Check if GPUs can have outputsIain Lane2018-08-303-0/+30
| | | | | | | | | | | We need a way for mutter to exit if no available GPUs are going to work. For example if gdm starts gnome-shell and we're using a DRM driver that doesn't work with KMS then we should exit so that GDM can try with Xorg, rather than operating in headless mode. Related: https://gitlab.gnome.org/GNOME/mutter/issues/223 (cherry picked from commit deb541ef5ac2cc07d0259c259bff8d1523388d47)
* gpu-kms: Handle drmModeGetResources() failingIain Lane2018-08-301-5/+31
| | | | | | | | | Avoid dereferencing the NULL return value if it fails. We still create the MetaGpu, but we treat it as if it has no outputs. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/223 (cherry picked from commit 29cc526e2eab65d856d1fd0a652f22dcdb5d72dd)
* clutter-text: Avoid clipping the wrong framebufferDaniel van Vugt2018-08-301-8/+2
| | | | | | | | | | | | | | `ClutterText` painting for editable single_line_mode actors like `StEntry` is always clipped by: `cogl_framebuffer_push_rectangle_clip (fb, 0, 0, alloc_width, alloc_height)` So it's difficult to get the rectangle wrong. However in cases where the target framebuffer has changed (`cogl_push_framebuffer`) such as when updating `ClutterOffscreenEffect` we had the wrong old value of `fb`. And so would be clipping the wrong framebuffer, effectively not clipping at all. (cherry picked from commit b8340f1355bb1949511effb7868aa2ef7e3731dd)
* renderer/native: Check calculated transform when creating viewJonas Ådahl2018-08-212-4/+13
| | | | | | | | | | | | | The "backends: Move MetaOutput::crtc field into private struct" accidentally changed the view transform calculation code to assume that "MetaCrtc::transform" corresponds to the transform of the CRTC; so is not the case yet; one must calculate the transform from the logical monitor, and check whether it is supported by the CRTC using meta_monitor_manager_is_transform_handled(). This commit restores the old behaviour that doesn't use MetaCrtc::transform when calculating the view transform. Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/216
* wayland/keyboard: Create a separate keymap shm file per resourceJonas Ådahl2018-08-172-83/+56
| | | | | | | | | | | | | | | | | | | | By using the shm file when sending the keymap to all clients, we effectively allows any client to change the keymap, as any client has the ability to change the content of the file. Sending a read-only file descriptor, or making the file itself read-only before unlinking, can be worked around by the client by using chmod(2) and open(2) on /proc/<pid>/<fd>. Using memfd could potentially solve this issue, but as the usage of mmap with MAP_SHARED is wide spread among clients, such a change can not be introduced without causing wide spread compatibility issues. So, to avoid allowing clients to interfere with each other, create a separate shm file for each wl_keyboard resource when sending the keymap. We could eventually do this per client, but in most cases, there will only be one wl_keyboard resource per client anyway. https://bugzilla.gnome.org/show_bug.cgi?id=784206
* wayland/keyboard: Indentation fixJonas Ådahl2018-08-171-1/+1
|
* backends/x11: Improve grab-device clock updatesJeff Smith2018-08-141-2/+3
| | | | | | | | | | | | meta_backend_x11_grab_device is performing X server clock comparison using the MAX macro, which comes down to a simple greater-than. Use XSERVER_TIME_IS_BEFORE, which is a better macro for X server clock comparisons, as it accounts for 32-bit wrap-around. https://gitlab.gnome.org/GNOME/mutter/merge_requests/174 (cherry picked from commit 1bfa20929b36d06cc23667d1122175149615b56d)
* renderer/native: Fallback to non-planar API if gbm_bo_get_handle_for_plane failsAlex Villacís Lasso2018-08-131-5/+16
| | | | | | | | | | | | | | | | | | | | | Commit c0d9b08ef9bf2be865aad9bf1bc74ba24c655d9f replaced the old GBM API calls with the multi-plane GBM API. However, the call to gbm_bo_get_handle_for_plane fails for some DRI drivers (in particular i915). Due to missing error checks, the subsequent call to drmModeAddFB[2] fails and the screen output locks up. This commit adds the missing error checks and falls back to the old GBM API (non-planar) if necessary. v5: test success of gbm_bo_get_handle_for_plane instead of errno This commit adopts solution proposed by Daniel van Vugt to check the return value of gbm_bo_get_handle_for_plane on plane 0 and fall back to old non-planar method if the call fails. This removes the errno check (for ENOSYS) that could abort if mesa ever sets a different value. Related to: https://gitlab.gnome.org/GNOME/mutter/issues/127 (cherry picked from commit f7af32a3eaefabbea3ebbda3a93eff98dd105ab9)
* wayland: Clean up xwayland grabs even if surface is goneOlivier Fourdan2018-08-061-7/+7
| | | | | | | | | | | If the surface is gone before `meta_xwayland_keyboard_grab_end()` is called, we would bail out early leaving an empty grab, which will cause a segfault as soon as a key is pressed later on. Make sure we clean up the keyboard grab even if the surface is gone. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/255 (cherry picked from commit 252dd524390dcdbdd89534c0014d22a796957f55)