summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* backend/native: Use high priority contexts for secondary GPUswip/carlosg/drop-capsCarlos Garnacho2019-11-132-10/+5
| | | | | | | Ensure the context requests EGL_CONTEXT_PRIORITY_HIGH_IMG, and that we use cogl_egl_create_context() to ensure that is honored. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
* backends: Drop rt-scheduler configuration keyCarlos Garnacho2019-11-133-8/+1
| | | | | | | | This is no longer an experimental feature. Even if we wanted to, GSettings spawns threads, which we want to avoid until we drop capabilities. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
* core: Drop all capabilities on initializationCarlos Garnacho2019-11-136-1/+25
| | | | | | | | | Add an optional dependency on libcap-ng, if the library is detected drop all capabilities by default, in order to allow packagers/users to do "setcap CAP_SYS_NICE=+ep `which gnome-shell`" and let it set higher sched/egl priorities without preserving the capability forever. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
* core: Set up EGL context creation thread before dropping capabilitiesCarlos Garnacho2019-11-131-1/+4
| | | | | | | | We do intend this thread to preserve the necessary capabilities to create high priority EGL contexts. Set this thread up before we drop these. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
* core: Set SCHED_RR by default on Wayland sessionsCarlos Garnacho2019-11-132-15/+21
| | | | | | | | | | | This still may fail if the executable is missing the right capability. This can no longer depend on a setting as we want this to happen before capabilities are dropped (and before other threads are spawned). The necessary bits (eg. "setcap CAP_SYS_NICE=+ep `which gnome-shell`") are still left up to users/distributors. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
* core: Move unix signal handler later in the processCarlos Garnacho2019-11-131-2/+2
| | | | | | This does spawn a thread, so better to leave for late(r) initialization. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
* cogl: Defer EGLContext creation to a separate threadCarlos Garnacho2019-11-132-8/+233
| | | | | | | | This is rather pointless and complex at the moment, but will pay off as we can then spawn this thread early enough that it keeps capabilities to create high priority contexts. https://gitlab.gnome.org/GNOME/mutter/merge_requests/923
* cursor-renderer/native: Fix cursor drawing in combination with ↵Hans de Goede2019-11-131-0/+1
| | | | | | | | | | | panel_orientation_transform Properly take the panel_orientation_transform into account in update_monitor_crtc_cursor. This fixes us sometimes drawing the cursor on two monitors at the same time as we did not properly swap the crtc width/height when a panel_orientation_transform is active. https://gitlab.gnome.org/GNOME/mutter/merge_requests/927
* output-kms: Fix "panel orientation" kms-prop being ignored on native outputsHans de Goede2019-11-131-3/+3
| | | | | | | Actually store the panel_orientation_transform in the meta_output, so that it gets honored by the core code. https://gitlab.gnome.org/GNOME/mutter/merge_requests/927
* clutter: return correct enum typeThomas Hindoe Paaboel Andersen2019-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clutter_event_get_scroll_finish_flags() should return a ClutterScrollFinishFlags but due to what looks like a bad copy/paste it instead returns a ClutterScrollSource on asserts. The definitions of the enums are these: typedef enum { CLUTTER_SCROLL_SOURCE_UNKNOWN, CLUTTER_SCROLL_SOURCE_WHEEL, CLUTTER_SCROLL_SOURCE_FINGER, CLUTTER_SCROLL_SOURCE_CONTINUOUS } ClutterScrollSource; typedef enum { CLUTTER_SCROLL_FINISHED_NONE = 0, CLUTTER_SCROLL_FINISHED_HORIZONTAL = 1 << 0, CLUTTER_SCROLL_FINISHED_VERTICAL = 1 << 1 } ClutterScrollFinishFlags; The asserts would only return CLUTTER_SCROLL_SOURCE_UNKNOWN. This is equal to CLUTTER_SCROLL_FINISHED_NONE which this patch uses instead. Thus no functional change is intended. This only fixes a compile warning. https://gitlab.gnome.org/GNOME/mutter/merge_requests/931
* clutter/actor: Draw paint volumes using paint nodesGeorges Basile Stavracas Neto2019-11-111-39/+78
| | | | | | | | | | | Clutter has a draw debug mode that allows for painting paint volumes. Right now, this debug mode uses the old immediate paint mode. Switch the painting of paint volumes to use paint nodes, and sneak a few minor style cleanups. https://gitlab.gnome.org/GNOME/mutter/merge_requests/890
* clutter/actor: Move paint flag to ClutterActorNodeGeorges Basile Stavracas Neto2019-11-112-8/+14
| | | | | | | | | Now that we unconditionally use ClutterActorNode to paint ClutterActors, move the PAINT private flag to the ClutterActorNode. This way, we can run the paint on the actor anywhere inside the paint tree. https://gitlab.gnome.org/GNOME/mutter/merge_requests/890
* compositor: Guard against untimely callsJonas Ådahl2019-11-111-15/+40
| | | | | | | | | | | | | It seems that sometimes these functions are called by Javascript in GNOME Shell during tear down. This causes segfaults and crash reports, but without any backtraces other than the entry and exit points into gjs. In order to get more useful information about where these calls come from, validate the input passed gracefully, by complaining in the log and returning NULL values. https://gitlab.gnome.org/GNOME/mutter/merge_requests/926
* input-settings/x11: Add missing clutter_x11_trap_x_errors around XIGetPropertyHans de Goede2019-11-101-0/+3
| | | | | | | | | | | | | | | | | Add missing clutter_x11_[un]trap_x_errors around the XIGetProperty call in meta-input-settings-x11.c's get_property helper function. This fixes mutter crashing with the following error if the XInput device goes away at an unconvenient time: X Error of failed request: XI_BadDevice (invalid Device parameter) Major opcode of failed request: 131 (XInputExtension) Minor opcode of failed request: 59 () Device id in failed request: 0x200011 Serial number of failed request: 454 Current serial number in output stream: 454 https://gitlab.gnome.org/GNOME/mutter/merge_requests/928
* plugin-manager: Kill window effects on destroyRobert Mader2019-11-081-0/+2
| | | | | | | | | We do so for all other window effects already. Why this was left out is unknown (9b3a0d1ad8f), but we will need it for a fix in GS. Related: https://gitlab.gnome.org/GNOME/mutter/issues/655 https://gitlab.gnome.org/GNOME/mutter/merge_requests/924
* plugins/default: Handle skipped animationsFlorian Müllner2019-11-081-16/+27
| | | | | | | | | | | | | | We currently assume that the actor_animate() helper function returns a timeline. However Clutter may skip implicit animations and simple set properties directly, for example when the actor is hidden. The returned timeline will be NULL in that case, and we abort when using it as instance parameter to g_signal_connect(). Fix this by only setting up a completed handler when we are actually animating, and complete the effect directly otherwise. https://gitlab.gnome.org/GNOME/mutter/merge_requests/925
* cogl: glBlendFuncSeparate is always availableAdam Jackson2019-11-082-15/+4
| | | | | | So we don't need glBlendFunc. https://gitlab.gnome.org/GNOME/mutter/merge_requests/903
* cogl: glBlendEquationSeparate is always availableAdam Jackson2019-11-083-20/+2
| | | | | | So we don't need glBlendEquation. https://gitlab.gnome.org/GNOME/mutter/merge_requests/903
* window-props: Read WM_TRANSIENT_FOR for override-redirect windowsMarco Trevisan (Treviño)2019-11-072-7/+43
| | | | | | | | | | | | | | As per the Extended Window Manager Hints standard version 1.3 [1] an override-redirect window can set a transient-for window per compositing and app-matching purposes. So just read the WM_TRASIENT_FOR property also for such windows, adapting the error in case they are transient for another O-R window and adding a test to check such case. [1] https://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472512128 https://gitlab.gnome.org/GNOME/mutter/merge_requests/920
* wayland/surface: Don't double scale when getting absolute coordinatesXiang Fan2019-11-071-2/+2
| | | | | | | | | | | | | | The actor is already in surface coordinate space, so we should not scale with the buffer scale to transform surface coordinates to stage coordinates. This bug causes input method using wayland text-input protocol to receive wrong cursor location. Reproduced in ibus (when candidate window is open) with scaling factor other than 1. This commit also fixes pointer confinement. https://gitlab.gnome.org/GNOME/mutter/merge_requests/915
* window-props: Don't set override redirect windows as top-level parentMarco Trevisan (Treviño)2019-11-073-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Java applications might use override-redirect windows as parent windows for top-level windows, although this is not following the standard [1]. In such case, the first non-override-redirect child window that is created was marked as being on_all_workspaces since the call to should_be_on_all_workspaces() returns TRUE for its parent, and this even though the on_all_workspaces_requested bit is unset. When a further child of this window was added, it was set as not having a workspace and not being on_all_workspaces, since the call to should_be_on_all_workspaces() for its parent would return FALSE (unless if it is in a different monitor, and the multiple-monitors workspaces are disabled). Since per commit 09bab98b we don't recompute the workspace if the on_all_workspaces bit is unset, we could end up in a case where a window can be nor in all the workspaces or in a specific workspace. So let's just ignore the transient_for bit for a window if that points to an override-redirect, using the x11 root window instead. Add a stacking test to verify this scenario (was failing before of this commit). Fixes https://gitlab.gnome.org/GNOME/mutter/issues/885 https://gitlab.gnome.org/GNOME/mutter/merge_requests/895 [1] https://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472512128
* window-props: Don't look for parent multiple timesMarco Trevisan (Treviño)2019-11-071-13/+20
| | | | | | | | Once we set the transient_for, we look for parent MetaWindow, so instead of overwriting this value for loops check, just use another function and avoid to look for the xwindow again when setting the MetaWindow parent. https://gitlab.gnome.org/GNOME/mutter/merge_requests/895
* window: Assert we only set a NULL workspace when unmanagingMarco Trevisan (Treviño)2019-11-071-2/+5
| | | | | | | | | | | | There might be cases in which a window might be marked as both not in all workspaces and with NULL workspace. So to avoid this to happen, let's just assert early instead of doing this at later point where the context might not be clear. Related to https://gitlab.gnome.org/GNOME/mutter/issues/885 https://gitlab.gnome.org/GNOME/mutter/merge_requests/895
* window: Warn if O-R window workspace state is usedMarco Trevisan (Treviño)2019-11-071-0/+1
| | | | | | | | Override-redirect windows have no workspace by default, and can't be parent of a top-level window, so we must check that the parent window is not an O-R one when setting the workspace state. https://gitlab.gnome.org/GNOME/mutter/merge_requests/895
* wayland/actor-surface: Always store away frame callbacks on commitJonas Ådahl2019-11-071-2/+20
| | | | | | | | | | | We're expected by MetaWaylandSurface to always pick the frame callbacks out from the pending state when committing (applying) so that no frame callbacks are unaccounted for. We failed to do this if our actor for some reason (e.g. associated window was unmanaged) was destroyed. To handle this situation better, store away the frame callbacks until we some later point in time need to pass them on forward. https://gitlab.gnome.org/GNOME/mutter/merge_requests/893
* cogl: Remove cogl_texture_2d_gl_new_from_foreignAdam Jackson2019-11-0722-507/+20
| | | | | | | | As noted in <cogl-texture-2d-gl.h> (now also removed), this is for allowing external GL callers to promote one of their textures to a CoglTexture. We aren't doing that and don't want to start. https://gitlab.gnome.org/GNOME/mutter/merge_requests/883
* test: Remove unreferenced test-texture-rectangleAdam Jackson2019-11-071-276/+0
| | | | | | | This isn't even built, and it's testing GL_TEXTURE_RECTANGLE_ARB, which is not even a code path we support anymore since we require real NPOT. https://gitlab.gnome.org/GNOME/mutter/merge_requests/883
* cogl: Remove unused stuff from cogl-material-compat.[ch]Adam Jackson2019-11-072-769/+0
| | | | | | | You could probably move (most of) what's left into a static-inline kind of header that only gets consumed by the tests. https://gitlab.gnome.org/GNOME/mutter/merge_requests/922
* ci: Fix checkout out gnome-shell on stable branchesFlorian Müllner2019-11-071-3/+1
| | | | | | | | | | | For stable branches, we currently only check out the correct shell branch for merge requests. For the regular pipeline, our code to determine the current mutter branch fails because CI runs on a temporary "pipeline/12345" branch that doesn't exist for gnome-shell. Switching to the correct gitlab environment variable fixes that. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/811
* x11-display: Get next serial just before using itMarco Trevisan (Treviño)2019-11-061-1/+1
| | | | | | | | | We ask XLib the next request serial number before performing other actions triggered by meta_x11_display_set_input_focus_internal() that doesn't use the request serial anyways. So, just request it before updating the focus window as that's the operation that needs it. https://gitlab.gnome.org/GNOME/mutter/merge_requests/909
* x11-display: Don't unset the X11 focused window after setting oneMarco Trevisan (Treviño)2019-11-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | When using DesktopIcons extension and clicking in an icon, gnome-shell starts an infinite loop caused by the first focus change that may trigger on X11 a focus in/out event that leads to stage activation/deactivation which never ends. This happens because as part of meta_x11_display_set_input_focus_xwindow() to focus the X11 stage window, we unset the display focus, but this also causes to request the X11 display to unset the focus since we convolute by calling meta_x11_display_set_input_focus() with no window, that leads to focusing the no_focus_window and then a focus-in / focus-out dance that the shell amplifies in order to give back the focus to the stage. In order to fix this, mimic what meta_display_set_input_focus() does, but without updating the X11 display, and so without implicitly calling meta_x11_display_set_input_focus(), stopping the said convolution and properly focusing the requested xwindow. Also ensure that we're not doing this when using an older timestamp, since this check isn't performed anymore. Fixes https://gitlab.gnome.org/GNOME/mutter/issues/896 Fixes https://gitlab.gnome.org/GNOME/mutter/issues/899 https://gitlab.gnome.org/GNOME/mutter/merge_requests/909
* wayland: Check focus surface client in wl_data_device.set_selection()Carlos Garnacho2019-11-061-0/+5
| | | | | | | Similar to our handling in set_primary(), ignore set_selection() requests that come from unfocused clients. https://gitlab.gnome.org/GNOME/mutter/issues/878
* wayland: Clean up meta_wayland_data_device_set_primary()Carlos Garnacho2019-11-061-10/+7
| | | | | | | | | | | | This function is already checking for the focus surface client matching the requestor. The type check was slightly bogus though as it'd be an screwup in our code, make it an assert instead. Also, move the check for the client having the focus into the upper call, so this and wl_data_device.set_selection code can get more in line. https://gitlab.gnome.org/GNOME/mutter/issues/878
* wayland: Flatten data source object hierarchyCarlos Garnacho2019-11-062-113/+92
| | | | | | | | | | We have an abstract MetaWaylandDataSource and 2 subclasses for clipboard/primary data sources. Since the abstraction provided by the additional sublevel is arguable, push the wl_resource field up, and leave us with just 2 objects to think about, all of them containing a wl_resource. https://gitlab.gnome.org/GNOME/mutter/issues/878
* wayland: use correct enum type for tablet padThomas Hindoe Paaboel Andersen2019-11-051-2/+2
| | | | | | | Fixes a compile warning. The two enums are identical, so no functional change intended. https://gitlab.gnome.org/GNOME/mutter/merge_requests/863
* tests/monitor-unit-tests: Add another tiling window hot plug testJonas Ådahl2019-11-051-0/+23
| | | | | | | Checks that we handle hot plugs of a untiled window, that was previously tiled. https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* window: Reset tile monitor number when untilingJonas Ådahl2019-11-051-1/+4
| | | | | | | | | | | | | | | | | | | | Otherwise we'll end up trying to access the out of date state later. Fixes the following test failure backtrace: #0 _g_log_abort () #1 g_logv () #2 g_log () #3 meta_monitor_manager_get_logical_monitor_from_number () #4 meta_window_get_work_area_for_monitor () #5 meta_window_get_tile_area () #6 constrain_maximization () #7 do_all_constraints () #8 meta_window_constrain () #9 meta_window_move_resize_internal () #10 meta_window_tile () https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* tests/monitor-unit-tests: Add window tiling hot plug testJonas Ådahl2019-11-052-0/+104
| | | | | | | This test that we handle hot plugs correctly together with tiled windows. https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* tests/runner: Move window shown synchronization to helperJonas Ådahl2019-11-053-45/+55
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* tests/monitor-unit-tests: Move test client sanity check into helperJonas Ådahl2019-11-051-5/+12
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* window: Always update tile monitor number on hot plugJonas Ådahl2019-11-051-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we'll end up crashing if we had two connected monitors, unplugged both, then replugged in a single one. Avoids the following error: #0 _g_log_abort () #1 g_logv () #2 g_log () #3 meta_monitor_manager_get_logical_monitor_from_number () #4 meta_window_get_work_area_for_monitor () #5 meta_window_get_tile_area () #6 constrain_maximization () #7 do_all_constraints () #8 meta_window_constrain () #9 meta_window_move_resize_internal () #10 meta_window_move_resize_frame () #11 meta_window_move_resize_now () #12 idle_move_resize () #13 call_idle_later () https://bugzilla.redhat.com/show_bug.cgi?id=1767703 https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* plugins/default: Clean up tile preview when closing displayJonas Ådahl2019-11-051-5/+15
| | | | | | | On finalize, the preview actor will have been destroyed behind our back; avoid that by cleaning up before it's too late. https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* plugin/default: Init quark before usingJonas Ådahl2019-11-051-4/+9
| | | | | | Cut lines in pieces, and remove useless "optimizations" while at it https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* display: Add 'closing' signalJonas Ådahl2019-11-051-0/+9
| | | | | | | Emitted when the MetaDisplay is closing. Meant for clean up that depends on things that will be torn down during closing. https://gitlab.gnome.org/GNOME/mutter/merge_requests/912
* surface-actor-wayland: Do not send frame callbacks if the actor is obscuredRobert Mader2019-11-041-1/+2
| | | | | | | | | `meta_surface_actor_is_obscured` implies that the actor got successfully culled out and nothing of it will get painted. This includes that there are no clones, no effects etc. In this cases we don't want to send frame callbacks, thus avoiding unnecessary client work. https://gitlab.gnome.org/GNOME/mutter/merge_requests/918
* clutter/actor: Unref the root node if set as childMarco Trevisan (Treviño)2019-11-041-0/+2
| | | | | | | | | | | When setting the root node as child of a clip or transform node, we add a new reference to it, without removing the one that we've previously added when getting it from the actor node (and that won't ever be unset by the auto-pointer since the root_node is re-associated). So, once we add the root node as child and re-define it, unref it. Fixes https://gitlab.gnome.org/GNOME/mutter/issues/908
* renderer-native: Separate offscreen and shadowfbOlivier Fourdan2019-11-041-5/+24
| | | | | | | | | | | | | | Create the intermediate shadow framebuffer for use exclusively when a shadowfb is required. Keep the previous offscreen framebuffer is as an intermediate framebuffer for transformations only. This way, we can apply transformations between in-memory framebuffers prior to blit the result to screen, and achieve acceptable performance even with software rendering on discrete GPU. https://gitlab.gnome.org/GNOME/mutter/merge_requests/877
* clutter/stage-view: Separate offscreen and shadowfbOlivier Fourdan2019-11-043-42/+130
| | | | | | | | | | | | | Previously, we would use a single offscreen framebuffer for both transformations and when a shadow framebuffer should be used, but that can be dreadfully slow when using software rendering with a discrete GPU due to bandwidth limitations. Keep the offscreen framebuffer for transformations only and add another intermediate shadow framebuffer used as a copy of the onscreen framebuffer. https://gitlab.gnome.org/GNOME/mutter/merge_requests/877
* cogl: Remove some unused framebuffer APIAdam Jackson2019-11-013-112/+0
| | | | https://gitlab.gnome.org/GNOME/mutter/merge_requests/913
* clutter: Drop the no-clear stage hintCarlos Garnacho2019-11-013-124/+0
| | | | | | | | | | | | A compositor is notably opaque (usually has nothing to be painted on!). gnome-shell sets this hint, but there's no reason why we wouldn't want it by default. Also, the color buffer being cleared messes with stencil clips, as the clear operation by definition ignores the stencil buffer. We want to use these more extensively in the future, so just drop this API. https://gitlab.gnome.org/GNOME/mutter/merge_requests/911