summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* wayland: Check if state and size changed before calling move_resize()gbsneto/wayland-animationsGeorges Basile Stavracas Neto2018-04-252-2/+26
| | | | | | | | | | | | | | | | | The current implementation of the XdgSurface v6 protocol does not check if the window changed before calling meta_window_wayland_move_resize(). The problem with this approach is that calling this function is a costly operation since we enter the compositor side. In GNOME Shell case, it is in JavaScript, which triggers a GJS trampoline. Calling this function on every mouse movement is naturally as terrible as it could be - and is exactly what happens now. This commit adds the necessary checks to only call move_resize() when the window actually changed, or when it needs to be updated. https://bugzilla.gnome.org/show_bug.cgi?id=780292 Issue: #78
* wayland: Add function to query if window needs move or resizeGeorges Basile Stavracas Neto2018-04-252-0/+8
| | | | | | | | | | | | | | | | | | | | | | | This will be used by the next commit to determine when a window geometry change should be ignored or not. Normally, it would be enough to just check if the position and sizes changed. The position, in this case, is relative to the client buffer, not the global position. But because it is not global, there is one, admitedly unlikely, situation where the window state is updated while the client size and relative positions don't change. One can trigger this by e.g. tiling the window to the half-left of the monitor, then immediately tile it to half-right. In this case, the window didn't change, just it's state, but nonetheless we need to notify the compositor and run the full move/resize routines. When that case happens, though, the MetaWindowWayland is tracking the pending state change or a move. And this is what we need to expose. https://bugzilla.gnome.org/show_bug.cgi?id=780292 Issue: #78
* window: Let implementations finish state changesGeorges Basile Stavracas Neto2018-04-254-7/+23
| | | | | | | | | | | | | | | | | | | | | | | | In the old, synchronous X.org world, we could assume that a state change always meant a synchronizing the window geometry right after. After firing an operation that would change the window state, such as maximizing or tiling the window, With Wayland, however, this is not valid anymore, since Wayland is asynchronous. In this scenario, we call meta_window_move_resize_internal() twice: when the user executes an state-changing operation, and when the server ACKs this operation. This breaks the previous assumptions, and as a consequence, it breaks the GNOME Shell animations in Wayland. The solution is giving the MetaWindow control over the time when the window geometry is synchronized with the compositor. That is done by introducing a new result flag. Wayland asks for a compositor sync after receiving an ACK from the server, while X11 asks for it right away. Fixes #78
* Bump version to 3.29.13.29.1Florian Müllner2018-04-252-2/+24
| | | | Update NEWS.
* native: Restore previous EGL state after blitting onto secondary GPUJonas Ådahl2018-04-254-7/+17
| | | | | | | | Before we just set it to "none", but this was not enough since various calls will depend on not just the context being active, but the main rendering surface. Fixes https://gitlab.gnome.org/GNOME/mutter/issues/21
* cogl: Do not unref a NULL objectMarco Trevisan (Treviño)2018-04-251-1/+5
| | | | Add return-if-fail statement to avoid deferencing NULL object
* monitor-manager: Find active monitor when deriving global scaleJonas Ådahl2018-04-251-4/+17
| | | | | | | | | | | | | | | When deriving the global scale directly from the current hardware state (as done when using the X11 backend) we are inspecting the logical state they had prior to the most recent hot plug. That means that a primary monitor might have been disabled, and a new primary monitor may not have been assigned yet. Stop assuming a primary monitor has an active mode before having reconstructed the logical state by finding some active monitor if the old primary monitor was disabled. This avoids a crash when trying to derive the global scale from a disabled monitor. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/130
* wayland: Let IM events go throughCarlos Garnacho2018-04-241-2/+4
| | | | | | | | | These paths implicitly relied on the forwarded IM key events having a source_device backed by a real HW device. This assumption is no longer held true since commit b5328c977. Explicitly check the INPUT_METHOD flag so they are handled as they should despite not being "real HW" events.
* backend: Don't center the pointers on monitor changesMario Sanchez Prada2018-04-241-16/+7
| | | | | | | | | | | As a follow up to the patch from a95cbd0a, we need to make sure that the pointer is out of the way as well when monitors changed, since that's the event that will prevail in some cases. Besides, this is also consistent with what the code before a95cbd0a was, which initialized the pointer position in the same way both in this case and in the real_post_init() function. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/157
* wayland: Avoid actor updates non actor_surface role wl_surface.commitCarlos Garnacho2018-04-231-3/+4
| | | | | | | We used to maintain an actor for cursors, even though we would possibly use hw overlays or even some other overlay actor for those. This happens no more, so check whether we are dealing with an actor-backed surface role before fiddling with it.
* wayland: Refactor surface actor into MetaWaylandActorSurfaceCarlos Garnacho2018-04-235-106/+103
| | | | | | | All surface roles that do need a backing actor inherit from this class, it makes sense to move actor management there. This also means the MetaWaylandActorSurface is in charge of emitting ::geometry-changed on the MetaWaylandSurface.
* wayland: Notify actively of xwayland window/surface associationsCarlos Garnacho2018-04-236-63/+85
| | | | | | | | | Instead of scheduling a meta_later, keep track of the unassociated windows, and look for matches as soon as the MetaWaylandSurface is created on our side. This will ensure the surface is given the Xwayland role before receiving the first wl_surface.commit.
* wayland: Add MetaWaylandSurface::geometry-changed signalCarlos Garnacho2018-04-233-21/+27
| | | | | Abstract this instead of having callers connect to notify:: signals on the surface actor.
* wayland: Abstract access to the actor corresponding to a wl_surfaceCarlos Garnacho2018-04-237-16/+33
| | | | | The actor itself will be shuffled around, abstract all external access to it behind a function to make that easier later on.
* wayland: Do not reset frame list when merging pending statewip/carlosg/random-fixesCarlos Garnacho2018-04-221-1/+0
| | | | | | | | In the synchronized subsurface case, the destination list may contain other elements from previous wl_surface.commit calls. Resetting the list will leave those dangling frame callbacks that will lead to invalid writes when those get to be destroyed (eg. on client shutdown).
* clutter: Plug minor leakCarlos Garnacho2018-04-221-0/+2
| | | | | clutter_stage_manager_list_stages() returns a copied list, which should be freed.
* clutter: Set slave=master in IM forwarded key eventsCarlos Garnacho2018-04-221-0/+1
| | | | | | | | The fix is twofold. On one hand, it makes sense not to relate IM (nor any other) generated events to a HW device. On the other hand, if we are unfortunate that an IM event is in flight when we are switching to another TTY, it may arrive at a time when the source device is no longer existent.
* theme, frames: Use surface device scale instead of cairo_scaleMarco Trevisan (Treviño)2018-04-202-4/+22
| | | | | | | | | | | Gtk now is caching the themed cairo surfaces, then as per commit gtk@e36b629c the surface device scale is used to figure out the current paint scaling. Without this when using background-image's for window buttons the -gtk-scaled icons isn't properly resized. Fixes #99
* backends: Don't center the pointer on initializationMario Sanchez Prada2018-04-181-1/+12
| | | | | | | | | | | | | | | Centering the pointer at startup causes undesired behaviour if it ends up hovering over reactive elements, that might react to that positioning, causing confusion. This is the case of the login dialog when a list of different users is shown, as centering the pointer at startup in that case will get the user in the center of the screen pre-selected, which is not the expected behaviour (i.e. pre-selecting the first one). Fix this by simply moving the pointer out of the way, close to the bottom-right corner, during initialization. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/157
* clutter/evdev: Don't ignore CAPS lock as modifierOlivier Fourdan2018-04-181-0/+8
| | | | | | | | Mark CAPS lock as a modifier (as it should) so that when using XKB options to change the default behaviour of CAPS lock, the new assigned key can by used as a sticky key as well. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/112
* clutter/evdev: ignore injected events from IMOlivier Fourdan2018-04-181-0/+4
| | | | | | | Input method can inject key events, which leads to multiple reported key press/release events for a single user action. Ignore those events as this confuses keyboard accessibility.
* xwayland: Don't abort if Xwayland crashesRay Strode2018-04-171-5/+12
| | | | | | | | | | | | | | | Right now if Xwayland crashes, we crash, too. On some level that makes sense, since we're supposed to control the lifecycle of Xwayland, and by it crashing we've lost that control. But practically speaking, the knock-on crash adds noise to the logs, bug trackers, and retrace servers that only makes debugging harder. And the crash isn't something mutter can "fix", since it's ultimately from a bug in Xwayland anyway. This commit makes mutter exit instead of crash if Xwayland goes away unexpectedly.
* xwayland: use g_autoptr for GError in xserver_diedRay Strode2018-04-171-2/+1
| | | | | | | | | Right now we explicitly g_clear_error any error we find, but that makes it tricky to return early from the function, which a subsequent commit will want to to do. This commit switches GError to use g_autoptr so the error clearing happens automatically.
* gpu-kms: Return NULL, not FALSEGeorges Basile Stavracas Neto2018-04-161-1/+1
| | | | | | | | Another small mistake spotted while working on #77. This function returns a pointer, thus we should return NULL, not FALSE. Issue: #77
* monitor-manager-kms: Don't add GPU if it failsGeorges Basile Stavracas Neto2018-04-161-0/+1
| | | | | | | | | This is a small mistake spotted while working on a solution for #77. When a GPU fails to initialize, we're adding them anyway, which might have pretty bad consequences when trying to use these NULL GPUs. Issue: #77
* monitor-manager-kms: Use g_autoptr for errorGeorges Basile Stavracas Neto2018-04-161-2/+1
| | | | A minor code cleanup.
* native: Disable the use of KMS modifiers by defaultJonas Ådahl2018-04-163-2/+29
| | | | | Make it re-enable:able by a hidden "experimental feature". To enable, add "kms-modifiers" to the org.gnome.mutter.experimental-features GSettings entry.
* idle-monitor: Add ResetIdletime API, for testing purposeswip/idletime-inhibitorsBastien Nocera2018-04-162-0/+25
| | | | | | | | | | | | | | | | | The ResetIdletime API can be used instead of an "XTest" binary to programmatically reset the idle time, as if the user pressed a button on a keyboard. This is necessary since we stopped using the XSync extension to monitor idletimes, as it didn't consider inhibitors as busy, and mutter's clutter code ignores "Core Events" as generated by XTest. This patch will require minimal changes to gnome-settings-daemon's power test suite so that "key press" idletime resets are triggered through this D-Bus interface rather than through XTest and a roundtrip through the X server. https://bugzilla.gnome.org/show_bug.cgi?id=705942
* backend: Reset idle when lid is opened or resuming from suspendBastien Nocera2018-04-162-74/+77
| | | | | | | | | | There's no particular reason for this code to only ever be triggered on Wayland, and allows removing X11-specific work-arounds from gnome-settings-daemon. See https://bugs.freedesktop.org/show_bug.cgi?id=59576 https://bugzilla.gnome.org/show_bug.cgi?id=705942
* idle-monitor: Take idle inhibition into accountBastien Nocera2018-04-164-2/+129
| | | | | | | | | | | | Take idle inhibitions into account for when to fire idle watches as requested by OS components. This should stop gnome-session and gnome-settings-daemon considering the session idle when they have been inhibited for longer than their timeout, for example to avoid the screensaver activating, or the computer suspending after watching a film. https://bugzilla.gnome.org/show_bug.cgi?id=705942
* x11: Allow XTest and core events to reset idletimeBastien Nocera2018-04-161-0/+102
| | | | | | | | | | | | Now that we've removed the X11 specific backend of the idle monitor, add back a cut-down version of it for the explicit purpose of being told about idle time resets when XTest events are used. XTest events are usually used by test suites and remote display software to inject events into an X11 session. We should consider somebody moving the mouse remotely to be just as "active" as somebody moving it locally. https://bugzilla.gnome.org/show_bug.cgi?id=705942
* backends: Remove X11 idle-monitor backendBastien Nocera2018-04-1614-763/+151
| | | | | | | | And use the old "native" backend for both X11 and Wayland. This will allow us to share fixes between implementations without having to delve into the XSync X11 extension code. https://bugzilla.gnome.org/show_bug.cgi?id=705942
* wayland: Plug surface pending state contents leakCarlos Garnacho2018-04-121-29/+82
| | | | | | | | | | | | | | | | | | | When moving the pending state of an effectively synchronized subsurface so it is applied together with the parent, perform a merge of the source MetaWaylandPendingState into the destination one, instead of simply overwriting the struct. The other approach had 2 kind of leaks, one that would happen everytime a wl_surface.commit happens on a sync subsurface (both surface/buffer damage regions are leaked). The other more unlikely one would apply on the rest of pending state data, happening whenever the compositor gets >1 wl_surface.commit calls on the subsurface before the parent surface gets its own. The function has also been renamed to use the more descriptive "merge" term. Related: gnome-shell#64
* monitor-manager: fix output ids returned by GetResourcesAleksandr Mezin2018-04-111-1/+1
| | | | | | | | Output ID is set equal to 'i' later in the loop. But 'i' was never incremented, so all outputs were getting the same ID (equal to the number of CRTCs, because 'i' was reused from the previous loop). (cherry picked from commit 23c3f8bb18db499d196f1024732ef3234b44f59c)
* Updated Slovenian translationMatej Urbančič2018-04-101-5/+18
|
* screen-cast: Fix compile errorBenjamin Otte2018-04-101-1/+1
| | | | Credit goes to gcc for finding this typo.
* wayland: update enter/leave output after effectsOlivier Fourdan2018-04-091-0/+18
| | | | | | | | | | | Compositor effects change the actor size and position, which can lead to inconsistent output enter/leave notifications, leaving clients' surfaces without any output set. Update output enter/leave notifications after all compositor effects are completed so that we give clients accurate output location. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/104
* window-actor: add new signal "effects-completed"Olivier Fourdan2018-04-092-0/+25
| | | | | | | | | | | | When using plugins, the effects will affect the MetaWindowActor size and position. Add a new signal "effects-completed" wired to the corresponding MetaWindowActor which is emitted when all effects are completed so that derived objects can be notified when all effects are completed and use the actual size and position. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/104
* theme: Scale titlebar spacing when computing xMarco Trevisan (Treviño)2018-04-031-1/+1
| | | | | | | The value is not scaled by default so it needs to be adjusted depending on the window scaling, as it's done in other places. Fixes: #87
* theme: add ".appmenu" class to the appmenu buttonMarco Trevisan (Treviño)2018-04-031-0/+2
| | | | So it does gtk headerbar, so mutter should do.
* renderer-native: Fall back to non-modifier GBM surfacesDaniel Stone2018-04-031-2/+3
| | | | | | | | | If we attempt GBM surface allocation with a set of modifiers but the allocation fails, fall back to non-modifier allocations. This fixes startup on Pineview-based Atom systems, where KMS provides us a set of modifiers but the GBM implementation doesn't support modifier use. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/84
* clutter: Apply input hints/purpose on ClutterTextInputFocus focus inCarlos Garnacho2018-04-031-2/+10
| | | | | | | | | | And make the ClutterText-level properties independent from the input focus, as those properties can be set anytime, not just when the ClutterText actor is focused. https://gitlab.gnome.org/GNOME/mutter/issues/66 Closes: #66
* input-settings: Fix a typo in tap-and-drag settingAlberts Muktupāvels2018-03-291-1/+1
|
* cursor-renderer-native: take rotation into accountOlivier Fourdan2018-03-291-2/+16
| | | | | | | | | Rotating an output would show duplicate cursors when the pointer is located over an area which would be within the output if not rotated. Make sure to swap the width/height of the output when rotated. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/85
* renderer-native: Swap then await earlier flips.Daniel van Vugt2018-03-291-6/+6
| | | | | | | | Rendering the next frame (which mostly happens as part of the flush done in swap buffers) is a task that the GPU can complete independently of the CPU having to wait for previous page flips. So reverse their order to get the GPU started earlier, with the aim of greater GPU-CPU parallelism.
* wayland: Use cursor position in logical monitorOlivier Fourdan2018-03-233-4/+18
| | | | | | | | | | | | | | | | | | When using two monitors size by side with different scales, once the cursor moves from one output to another one, its size changes based on the scale of the given output. Changing the size of the cursor can cause the cursor area to change output again if the hotspot is not exactly at the top left corner of the area, causing the texture of the cursor to change, which will trigger another output change, so on and so forth causing continuous surface enter/leave event which flood the clients and eventually kill them. Change the logic to use only the actual cursor position to determine if its on the given logical monitor, so that it remains immune to scale changes induced by output scale differences. Closes: https://gitlab.gnome.org/GNOME/mutter/issues/83
* clutter: Avoid unnecessary relayouts in ClutterTextYussuf Khalil2018-03-221-16/+27
| | | | | | We can save an unnecessary relayout if the required size to fully draw the text is equal to the currently allocated size after the underlying text buffer or attributes that only affect the PangoLayout have changed.
* window: Fix a small memory leakgbsneto/small-leakGeorges Basile Stavracas Neto2018-03-211-1/+1
|
* mutter: allow building with elogindRasmus Thomsen2018-03-211-1/+16
| | | | | | | | | | This commit allows building mutter with elogind, which is systemd-logind extracted into a standalone package. This allows using mutter with its native-backend ( and consequently wayland ) enabled on distros which use init systems other than systemd. https://gitlab.gnome.org/GNOME/mutter/merge_requests/46
* cogl: Read pixels as per the stored formatCarlos Garnacho2018-03-211-16/+6
| | | | | | | | | | | | | | | | | | By the looks of it, commit 95e9fa10ef was taping over an Intel DRI bug that would make it return post-swizzling pixel data on glReadPixels(). There's been reports over time of that commit resulting in wrong colors on other drivers, and lately Mesa >17.3 started showing the same symptoms on Intel. But texture swizzling works by changing parameters before fragment shaders and reading pixels from an already drawn FBO/texture doesn't involve those. This should thus use pixel_format_to_gl_with_target(), which will result in correctly requesting the same pixel format than the underlying texture, while still considering it BGRA for the upper layers in the swizzling case. https://gitlab.gnome.org/GNOME/mutter/issues/72 Closes: #72