We must be educated to X11 clients (which usually parse the timestamp from
the DESKTOP_STARTUP_ID, and request focus with it) to make focus stealing
prevention work across the board.
To wayland clients the startup ID should be as opaque and meaningless as
it was before.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/540
And replace with our own XClientMessageEvent handling. It has the advantage
that we can mix Wayland and X11 startup notifications without always going
through X11 so that libstartup-notification is able to get the full picture.
This will fare much better on no/intermittent X11 availability.
A second advantage is the removed dependency, and that it seems to result
in less code (yay abstractions!).
https://gitlab.gnome.org/GNOME/mutter/merge_requests/540
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
We're currently always waiting for unfinished page flips before flipping
again. This is awkward when we are in an asynchronous retry-page-flip
loop, as we can synchronously wait for any KMS page flip event.
To avoid ending up with such situations, just freeze the frame clock
while we're retrying, then thaw it when we succeded.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
We rely on the frame clock to compress input events, thus if the frame
clock stops, input events are not dispatched. At the same time, there
is no reason to redraw at a full frame rate, as nothing will be
presented anyway, so slow down to 10Hz (compared to the most common
60Hz). Note that we'll only actually reach 10Hz if there is an active
animation being displayed, which won't happen e.g. if there is a screen
shield in the way.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
When we're in a page-flip retry loop due to the FIFO being full
(drmModePageFlip() failing with EBUSY), we should not continue to try
when starting to power save, as that means we're blocking new frames,
which itself blocks input events due to them being compressed using the
frame clock.
We'd also hit an assert assuming we only try to page flip when not power
saving.
Thus, fake we flipped if we ended up reaching a power saving state while
retrying.
Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/509https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
It tried to add a (implicitly casted) float to a uint64_t, and due to
floating point precision issues resulted in timestamps intended to be
in the future to actually be in the past. Fix this by first casting the
delay to an uint64_t, then add it to the time stamp.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
DPMS is configured from a bit all over the place: via D-Bus, via X11 and
when reading the current KMS state. Each of these places did it slightly
differently, directly poking at the field in MetaMonitorManager.
To make things a bit more managable, move the field into a new
MetaMonitorManagerPrivate, and add helpers to get and set the current
value. Prior to this, there were for example situations where the DPMS
setting was changed, but without signal listeners being notified about
it.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
Prefixes use an abbreviated form of the module or section being changed.
For example, changes to MetaBackend/meta-backend.c are prefixed with
`backend:` and generic changes to src/x11/ are prefixed `x11:`.
This extra nit picking check is meant to avoid using non-abbreviated
prefixes, e.g. `MetaBackend:`, or `meta-backend:`, other prefixes are
Currently consisting of only a "blacklist".
https://gitlab.gnome.org/GNOME/mutter/merge_requests/519
The 'underscan' property is a drm connector property, not a CRTC
property, so we would never find it. We also didn't advertise support
for the feature, meaning even if it was on the CRTC, Settings wouldn't
know about it.
Fix this by moving the property to where it belongs: in MetaOutputKms,
and properly advertise support for it if the property is found.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/507
In a multi-monitor setup there is a separate paint run for each monitor.
If an actor doesn't intersect the first monitor painted then it is culled
out for that monitor to save time. Unfortunately this would mean
`clutter_actor_paint` was setting `is_dirty = FALSE` before the actor had
yet been painted on any monitor.
This meant that effects like `ClutterOffscreenEffect` were not receiving
the flag `CLUTTER_EFFECT_PAINT_ACTOR_DIRTY` when they should have, and
so would rightfully think they don't need to do a full internal
invalidation. So `ClutterOffscreenEffect`, and probably other effects,
did not repaint correctly unless on the first monitor in the list.
The fix is to simply avoid setting `is_dirty = FALSE` on those paint
runs where the actor has been culled out (`clutter_actor_continue_paint`
wasn't called). It is only safe to clear the flag after
`clutter_actor_continue_paint` has been called at least once per stage
paint.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1049https://gitlab.gnome.org/GNOME/mutter/merge_requests/511
Commit 8e9184b6 added filtering to avoid image jaggies when downscaling
but used `LINEAR_MIPMAP_NEAREST`. In some situations this could lead to
GL choosing a single lower resolution mipmap and then upscaling it, hence
slightly blurry.
We don't want to revert that change since it avoids aliasing jaggies, so
let's use `LINEAR_MIPMAP_LINEAR` instead. This provides the highest quality
filtering that GL can do and avoids the situation of GL using a single
mipmap that's lower resolution than the screen. Now it will blend that one
with the next mipmap which is higher resolution than the screen. This still
avoids jaggies but also maintains 1px resolution.
Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1105https://gitlab.gnome.org/GNOME/mutter/merge_requests/505
clutter_input_device_get_physical_size was just used for device mapping
heuristics in MetaInputMapper. It now started using the info from udev
on for both backends, so this means this clutter API is no longer
necessary.
https://gitlab.gnome.org/GNOME/mutter/issues/514
Use the ID_INPUT_WIDTH_MM/ID_INPUT_HEIGHT_MM udev properties to figure out
absolute input devices' physical size. This works across both backends, and
requires less moving pieces to have it get the right results.
Concretely, fixes size detection on X11/libinput, which makes touchscreen
mapping go wrong.
https://gitlab.gnome.org/GNOME/mutter/issues/514
Enabling keyboard accessibility features on Wayland from the keyboard
was wrongly assumed to be controlled by the "togglekeys" setting,
whereas it should be simply controlled by the "enable" setting.
As "togglekeys" is off by default and doesn't have a UI option to
enable, that would prevent turning on or off the keyboard accessibility
features using the keyboard.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/501
Meson 0.50.0 made passing an absolute path to install_headers()'
subdir keyword a fatal error. This means we have to track both
relative (to includedir) paths for header subdirs and absolute
paths for generated headers now :-(
https://gitlab.gnome.org/GNOME/mutter/merge_requests/492
If an intersection is empty, the (x, y) coordinates are undefined, so
just use the work area and in-progress constrained window rect when
sliding according to the SLIDE_X or SLIDE_Y custom placement rule.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
When check_only is TRUE, the constraint should not be applied, just
checked. We failed to comply here when a placed transient window was
to be moved together with its parent, updating the window position
directly even if check_only was TRUE.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
If a client maps a persistent popup with a placement rule, then resizes
the parent window so that the popup ends up outside of the parent,
unmanage the popup and log a warning about the client being buggy.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
When a parent window is moved, attached windows (attached modal dialogs
or popups) is moved with it. This is problematic when such a window
hasn't been shown yet (e.g. a popup that has been configured but not
shown), as it'll mean we try to constrain an empty window. Avoid this
issue by not trying to auto-move empty windows.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/496
Currently, it is assumed that if querying the EGL_TEXTURE_FORMAT of a
Wayland buffer succeeds it is an EGLImage. However, this assumption will no
longer hold on upcoming versions of the NVIDIA EGL Wayland driver which
will include support for querying this attribute for EGLStream buffers as
well. Hence, we need to check if buffers are EGLStreams first.
Fixes#488https://gitlab.gnome.org/GNOME/mutter/merge_requests/477