When the compositor is destroyed we should cleanup the list of window actors we
created and destroy them.
Since all the actors are added to the window_group or top_window_group we can
just destroy these containers (together with the feedback_group), and simply
free the windows list.
This is particularly needed under X11 because before we destroy the display, we
might do some cleanups as detaching the surface pixmaps and freeing the damages
and if this happens at later point (for example when triggered by garbage
collector in gnome-shell), we might crash because the x11 dpy reference is
already gone.
Destroying the window actors instead, ensures we avoid any further call to X11
related functions and that we release the actors XServer resources.
Fixes https://gitlab.gnome.org/GNOME/mutter/issues/576
Clutter does the nicety of connecting just created PangoContexts to
ClutterBackend signals in order to update it on resolution/font changes.
However the way the signals are disconnected (automatically via
g_signal_connect_object() auto-disconnect feature) may incur into
performance issues with a high enough number of ClutterActors with a
PangoContext (eg. ClutterText) as the lookup by closure is linear across
all signals and handlers.
Keep the handler IDs around, and disconnect them specifically on dispose
so it is more O(1)-ish.
Related: https://gitlab.gnome.org/GNOME/mutter/issues/556
When an application stops responding, the shell darkens its windows.
If a window from a not-responding application gets unmanaged
then the shell will currently throw an exception trying to retrieve
the now-dissociated window actor.
That leads to a "stuck window" ghost on screen and a traceback
in the log.
This commit addresses the problem by making sure the effect is cleaned
up before the actor is disocciated from its window.
https://gitlab.gnome.org/GNOME/mutter/issues/575
Make sure our keyboard accessibility settings structure is all zero
initialized, to avoid potential padding issues on some platform when
comparing settings.
Reported by Daniel van Vugt on IRC.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/552
The clutter/evdev implementation of mousekeys is designed after the
current implementation in X11, and works when the setting is enabled
regardless of the status of NumLock.
The GNOME documentation on accessibility features states however that
mousekeys work only when NumLock is OFF:
https://help.gnome.org/users/gnome-help/stable/mouse-mousekeys.html
Change the clutter/evdev implementation to match the documentation, i.e.
disable mousekeys when NumLock in ON so that switching NumLock ON
restores the numeric keypad behaviour.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/530
This reverts a change introduced in edfe5cc3 to use `paint_clipped_rectangle()`
instead of `cogl_framebuffer_draw_rectangle()` for full paints as it
contained logic necessary for viewport src-rects. This is not longer the case.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/504
This brings the viewport src-rect code in line with how we handle
transforms, by applying a `CoglMatrix` to the pipeline instead of
changing the paint logic.
It also fixes not-y-inverted textures in combination with
transforms.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/504
We already effectively require GLSL, because there's no fixed-function
backend anymore. OpenGL 2.0 drivers don't really exist in the wild, so
just go ahead and require 2.1 or better. 2.1 implies GLSL 1.20 or
better, so simplify that as well.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/489
This is effectively a revert of:
commit 6cfc93f26f
Author: Robert Bragg <robert@linux.intel.com>
Date: Tue Oct 2 11:44:00 2012 +0100
clip-stack: workaround intel gen6 viewport clip bug
It's been over six years, if this bug is still present we should just
fix Mesa already.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/481
When focus stealing prevention kicks in, mutter would set the demand
attention flag on the window.
Focus stealing prevention would also prevent the window from being
raised and focused, which is expected as its precisely its purpose.
Yet, when that occurs, the user expects the window which has just been
prevented from being focused to be the next one in the MRU list, so
that pressing [Alt]-[Tab] would raise and give focus to that window.
This works fine when the window is placed on the primary monitor, but
not when placed on another monitor, in which case the window which has
been denied focus is placed ahead of the MRU list and pressing
[Alt]-[Tab] would leave the focus on the current window.
This is because of a mechanism in `meta_display_get_tab_list()` which
forces the windows with the demand attention flag set to be placed first
in the MRU list when they're placed on a workspace different from the
current one.
But because workspaces apply only to the primary monitor (by default),
the windows placed on other outputs have their workspace set to `NULL`
which forces them ahead of the MRU list by mistake.
Fix this by using the appropriate `meta_window_located_on_workspace()
function to check if the window is on another workspace.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/523
The sequences may stay completed in the list (eg. pending a focus request),
it's then confusing to show the "wait" cursor icon until they are really
gone.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/541
Calculations were being done at places accounting on usec precision,
however those are still treated as having msec precision at places. Let's
consolidate for the latter since it requires less changes across the board
and usec precision doesn't buy us anything here.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/541
mutter would randomly crash in `send_xdg_output_events()` when changing
the fractional scaling:
wl_resource_post_event ()
zxdg_output_v1_send_logical_size ()
send_xdg_output_events ()
wayland_output_update_for_output ()
meta_wayland_compositor_update_outputs ()
on_monitors_changed ()
g_closure_invoke ()
signal_emit_unlocked_R ()
g_signal_emit_valist ()
_signal_emit ()
meta_monitor_manager_notify_monitors_changed ()
meta_monitor_manager_rebuild ()
This is because the xdg-output resource got freed but wasn't removed
from the list of resources.
Fix this by setting the user data of the xdg-output resource to the
corresponding `MetaWaylandOutput` so that the xdg-output resource
destructor can remove it from the list of resources.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/538
We use the combination of pressing Super and clicking+moving the mouse
to drag windows around and we also support pressing Super and using the
touchscreen to drag windows.
Since we don't want to show the overview when the Super key was used to
initiate a window drag, prevent showing the overview in case a
TOUCH_BEGIN or TOUCH_END event happened during the key was pressed.
Fixes https://gitlab.gnome.org/GNOME/mutter/issues/228https://gitlab.gnome.org/GNOME/mutter/merge_requests/495
If a second `set_{sync,complete}_pending` was queued before the idle
handler had flushed the first then one of them would be forgotten.
It would stay queued forever and never emitted as a notification.
This could happen repeatedly causing a slow leak. But worse still,
`clutter-stage-cogl` would then have `pending_swaps` permanently stuck
above zero preventing the presentation timing logic from being used.
The problem is that a boolean can only count to one, but in some cases
(triple buffering, whether intentional or accidental #334) we need it to
count to two. So just change booleans to integers and count properly.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/216
The keyboard accessibility setting "enable" is actually even more
misleading that initially anticipated, as it does not control the
entire keyboard accessibility feature, but just the "enable by
keyboard" feature, i.e. being able to enable or disable stickykeys
or slowkeys using various keyboard actions.
Yet the accessibility features should still work even if the "enable"
setting is unset, those can be controlled by the accessibility menu in
GNOME Shell for example.
Change the clutter/evdev implementation to match that behavior as found
in the x11 backend, so both backends are now consistent.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/531
Since "renderer/native: make EGL initialization failure not fatal" it is
possible, under specific failure conditions, to end up with a primary GPU whose
EGL initialization failed. That cannot work.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/521
The failure to initialize EGL does not necessarily mean the KMS device cannot
be used. The device could still be used as a "secondary GPU" with the CPU copy
mode.
If meta_renderer_native_create_renderer_gpu_data () fails,
meta_renderer_native_get_gpu_data () will return NULL, which may cause crashes.
This patch removes most of the failures, but does not fix the NULL dereferences
that will still happen if creating gpu data fails.
This patch reorders create_renderer_gpu_data_gbm () so that it fails hard only
if GBM device cannot be created, and otherwise always returns an initialized
gpu data structure. Users of the gpu data structure are responsible for
checking egl_display validity.
The GBM device creation failure is a hard failure because presumably GBM is
necessary for cursors.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/542https://gitlab.gnome.org/GNOME/mutter/merge_requests/521