Commit Graph

24626 Commits

Author SHA1 Message Date
Carlos Garnacho
829d9c863c clutter: Move scattered x11 keymap code into ClutterKeymapX11
https://gitlab.gnome.org/GNOME/mutter/merge_requests/672
2019-08-24 08:59:07 +00:00
Carlos Garnacho
f304fa4869 Drop xinput2 version checks
We always request XInput >= 2.3 and fail otherwise, we don't need to
check for lower versions for touch events.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/672
2019-08-24 08:59:07 +00:00
Carlos Garnacho
a32559e5ae clutter: Remove "has_xinput" x11 API
We always must have xinput, this is moot now.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/672
2019-08-24 08:59:07 +00:00
Olivier Fourdan
8e13292d62 keybindings: Code cleanup
The boolean `handled` is not needed, remove it.

https://gitlab.gnome.org/GNOME/mutter/issues/734
2019-08-23 14:54:20 +00:00
Olivier Fourdan
29ea5306eb keybindings: Restore inhibit shortcut for overlay key
After the introduction of locate-pointer (commit 851b7d063 -
 “keybindings: Trigger locate-pointer on key modifier”), inhibiting
shortcuts would no longer forward the overlay key to the client.

Restore the code that was inadvertently removed so that inhibiting
shortcuts works on the overlay key again.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/734
2019-08-23 14:54:20 +00:00
Georges Basile Stavracas Neto
fb9e8768a3 window-actor: Handle geometry scale
Geometry scale is applied to each surface individually, using
Clutter scales, and not only this breaks subsurfaces, it also
pollutes the toolkit and makes the actor tree slightly too
fragile. If GNOME Shell mistakenly tries to set the actor scale
of any of these surfaces, for example, various artifacts might
happen.

Move geometry scale handling to MetaWindowActor. It is applied
as a child transform operation, so that the Clutter-managed
scale properties are left untouched.

In the future where the entirety of the window is managed by a
ClutterContent itself, the geometry scale will be applied
directly into the transform matrix of MetaWindowActor. However,
doing that now would break the various ClutterClones used by
GNOME Shell, so the child transform is an acceptable compromise
during this transition.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
c747be84d9 wayland: Don't scale input and opaque regions
Leave them at surface coordinates and let MetaSurfaceActor
and MetaShapedTexture handle the interactions between buffer
and geometry scale.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
2d7adb90c8 wayland/tablet-tool: Use meta_wayland_surface_get_relative_coordinates()
Instead of directly calling into clutter_actor_transform_stage_point().

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
6b35a4901e shaped-texture: Move private function to private header
meta_shaped_texture_update_area() is a private function that
is exposed in the public headers. It is not used anywhere
outside Mutter, and should really be in the private header.

Move it to the private header.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
4c1fde9deb shaped-texture: Move MetaCullable helpers to MetaSurfaceActor
Now that MetaShapedTexture is not a ClutterActor anymore, it does
not make sense to make it a MetaCullable semi-implementation. This
is, naturally, a responsibility of MetaSurfaceActor, since now
MetaShapedTexture is a ClutterContent and as such, it only cares
about what to draw.

Move the MetaCullable implementation of MetaShapedTexture to
MetaSurfaceActor.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
425e65049b shaped-texture: Draw pipeline relative to alloc
By implementing ClutterContent, it is expected that
MetaShapedTexture can draw on any actor. However,
right now this is not possible, since it assumes
that the drawing coordinates and sizes of the actor
are synchronized with its own reported width and
height.

It mistakenly draws, for example, when setting an
actor's content to it. There is no way to trigger
this wrong behavior right now, but it will become
a problem in the future where we can collect the
paint nodes of MetaShapedTexture as part of other
ClutterContent implementations.

Use the allocation box passed by the actor to draw
the pipelines of MetaShapedTexture.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
d3f30d9ece wayland/actor-surface: Set geometry scale in surface actor
Now that MetaShapedTexture is a ClutterContent implemetation that
is aware of its own buffer scale, it is possible to simplify the
event translation routines.

Set the geometry scale in MetaSurfaceActor, and stop adjusting the
surface scale when translating points. Also remove the now obsoleted
meta_wayland_actor_surface_calculate_scale() function.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
75cffd0ec4 shaped-texture: Implement ClutterContent
MetaWindowActor is the compositor-side representative of a
MetaWindow. Specifically it represents the geometry of the
window under Clutter scene graph. MetaWindowActors are backed
by MetaSurfaceActors, that represent the windowing system's
surfaces themselves. Naturally, these surfaces have textures
with the pixel content of the clients associated with them.
These textures are represented by MetaShapedTexture.

MetaShapedTextures are currently implemented as ClutterActor
subclasses that override the paint function to paint the
textures it holds.

Conceptually, however, Clutter has an abstraction layer for
contents of actors: ClutterContent. Which MetaShapedTexture
fits nicely, in fact.

Make MetaShapedTexture a ClutterContent implementation. This
forces a few changes in the stack:

 * MetaShapedTexture now handles buffer scale.

 * We now paint into ClutterPaintNode instead of the direct
   framebuffer.

 * Various pieces of Wayland code now use MetaSurfaceActor
   instead of MetaShapedTexture.

 * MetaSurfaceActorWayland doesn't override size negotiation
   vfuncs anymore

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Georges Basile Stavracas Neto
e33d6b2908 clutter/paint-node: Expose clutter_paint_node_get_framebuffer()
Mutter needs to know which framebuffer the paint nodes will be
drawn into, and using cogl_get_draw_framebuffer() directly is
not an option since ClutterRootNode only pushes the draw fb
at draw time.

Expose clutter_paint_node_get_framebuffer().

https://gitlab.gnome.org/GNOME/mutter/merge_requests/409
2019-08-23 13:23:07 +00:00
Марко Костић
a50907513a Update Serbian translation 2019-08-22 17:57:39 +00:00
Piotr Drąg
c0130ca8f7 Update Polish translation 2019-08-22 18:01:17 +02:00
Florian Müllner
9d4e4e2bd4 ci: Don't build gnome-shell's man pages
One of the man pages is now generated using asciidoc, which is missing
from the CI image. But given that this doesn't depend on mutter in any
way, just disable man pages in the gnome-shell build instead of updating
the Dockerfile.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/740
2019-08-21 22:46:41 +02:00
Florian Müllner
bdc7cc8ab9 Bump version to 3.33.91
Update NEWS.
2019-08-21 19:16:03 +00:00
Olivier Fourdan
13deb22223 wayland/xdg-output: Add xdg-output v3 support
xdg-output v3 marks `xdg_output.done` as deprecated, avoid sending that
event for clients using xdg-output v3.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/704
2019-08-21 15:47:14 +00:00
Florian Müllner
220e4caf36 ci: Add gnome-autoar to Dockerfile
It is a dependency of the newly added gnome-extensions tool.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/738
2019-08-21 15:10:44 +00:00
Daniel van Vugt
5c617ac286 clutter/stage: Only queue compressible events
Incompressible events already pass through unmodified, so queuing them
just wasted time and memory.

We would however like to keep the ordering of events so we can only
apply this optimization if the queue is empty.

This reduces the input latency of incompressible events like touchpad
scrolling or drawing tablets by up to one frame. It also means the same
series of events now arrives at the client more smoothly and not in
bursts.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/711
2019-08-20 23:52:49 +00:00
Daniel van Vugt
bc08ad2fbb clutter/device-manager-evdev: Update device modifiers before queuing
Until now we would:

  1. Enqueue modifier key event on the stage.
  2. Update device modifier state.
  3. Dequeue and process modifier key event with NEW device modifier state.

But if we consider optimizing out the queuing in some cases then there
will become a problem:

  1. Process modifier key event with OLD device modifier state.
  2. Update device modifier state.

To correct the above we now do:

  1. Update device modifier state.
  2. Queue/process modifier key event with NEW device modifier state.

It appears commit dd940a71 which introduced the old behaviour was correct
in the need to update the device modifier state, but is at least no longer
correct (if it ever was) that it should be done after queuing the event.
If queuing is working, as it is right now, then it makes no difference
whether the device modifier state is updated before or after. Because both
cases will come before the dequeing and processing.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/711
2019-08-20 23:52:49 +00:00
Jonas Dreßler
0947bc37d3 clutter/main: Move grabbing functions to clutter-input-device.c
Thanks to the now removed global/context grabs, we can move pointer and
keyboard grabs back home to where they belong.

While at it, also add handling of CLUTTER_TABLET_DEVICE devices to
`on_grab_actor_destroy` and `clutter_input_device_get_grabbed_actor`.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/536
2019-08-20 14:11:38 +02:00
Jonas Dreßler
959eb98090 clutter/main: Remove global/context grabs
Those are deprecated in favour of per device grabs.

Also switch to ClutterInputDevice grabs for the grab test.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/536
2019-08-20 14:08:44 +02:00
Jonas Dreßler
32dcf77a8f clutter/text: Switch to input device grabs
The old global/context grabs are being removed in favour of input device
grabs.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/536
2019-08-20 14:08:44 +02:00
Daniel Mustieles
75349f8cde Updated Spanish translation 2019-08-20 12:46:46 +02:00
Olivier Fourdan
eac227a203 xwayland: Add local user to xhost
With the addition of xauth support (commit a8984a81c), Xwayland would
rely only on the provided cookies for authentication.

As a result, running an Xclient from another VT (hence without the
XAUTHORITY environment variable set) would result in an access denied.

The same on X11 is granted because the local user is automatically
granted access to Xserver by the startup scripts.

Add the local user to xhost at startup on Xwayland so that the user can
still run a client by setting the DISPLAY as long as it's the same user
on the same host.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/735
2019-08-19 17:14:40 +02:00
Olivier Fourdan
bc166aa6b4 xwayland: Use given X11 display for DnD setup
Use the provided X11 display instead of poking into GDK to get the X11
display.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/735
2019-08-19 17:14:40 +02:00
Olivier Fourdan
5fa8b24b2b xwayland: pass the X11 display
Pass the X11 display to `meta_xwayland_complete_init()` so that it can
be used without poking into GDK.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/735
2019-08-19 17:14:40 +02:00
Niels De Graef
9d65eab549 clutter: Use va_marshaller for Actor signals
If possible, GLib will try to use the va_marshaller to pass the signal
arguments, rather than unboxing into and out of a `GValue`. This is much
more performant and especially good for often-thrown signals.

The original bug even mentions Clutter performance issues as a drive to
implement the va_marshaller in GLib (see
https://bugzilla.gnome.org/show_bug.cgi?id=661140).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/700
2019-08-19 13:09:56 +00:00
Niels De Graef
c4a9117ef8 clutter: Remove marshallers that are available in GLib
Some of the marshallers we generate in `clutter-marshal.list` are also
available in GLib, so we don't need to generate them ourselves. Even
more, by passing NULL to `g_signal_new` in these cases will actually
internally optimize this even more by also setting the valist
marshaller, which is a little bit faster than the regular marshalling
using `GValue` and libffi.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/700
2019-08-19 13:09:56 +00:00
Jonas Ådahl
0db38c4999 compositor: Let MetaDisplay choose the correct compositor type
A base type shouldn't know about sub types, so let MetaDisplay make
the correct choice of what type of MetaCompositor it should create. No
other semantical changes introduced.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/727
2019-08-19 08:44:58 +00:00
Jonas Ådahl
8ee00cee60 compositor/x11: Move stage input region setting to MetaX11Display
It doesn't use anything specific to MetaCompositor, and
MetaCompositorX11 isn't exposed, so move it to MetaX11Display.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/727
2019-08-19 08:44:58 +00:00
Jonas Ådahl
984aad4b86 compositor: Move out X11 compositing code into sub type
Introduce MetaCompositorX11, dealing with being a X11 compositor, and
MetaCompositorServer, being a compositor while also being the display
server itself, e.g. a Wayland display server.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/727
2019-08-19 08:44:58 +00:00
Jonas Ådahl
9af90bf9c1 compositor: Fix indentation mistake
https://gitlab.gnome.org/GNOME/mutter/merge_requests/727
2019-08-19 08:44:58 +00:00
Jonas Ådahl
12ea2fcb51 compositor: Make type derivable
This is so that we can split it up properly into X11 compositor and
display server compositor sub types.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/727
2019-08-19 08:44:58 +00:00
Jonas Ådahl
55cd110c63 compositor: Use meta_window_actor_from_window() throughout
Instead of explicitly using meta_compositor_get_window_private() and
casting it to MetaWindowActor * each time.

With minor bonus style cleanups.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/727
2019-08-19 08:44:58 +00:00
Olivier Fourdan
f37a172dc7 events: No UI frame button press events for Wayland
When double clicking to un-maximize an X11 window under Wayland, there
is a race between X11 and Wayland protocols and the X11 XConfigureWindow
may be processed by Xwayland before the button press event is forwarded
via the Wayland protocol.

As a result, the second click may reach another X11 window placed right
underneath in the X11 stack.

Make sure we do not forward the button press event to Wayland if it was
handled by the frame UI.

https://gitlab.gnome.org/GNOME/mutter/issues/88
2019-08-19 09:16:04 +02:00
Olivier Fourdan
ad62a659eb window: Move UI frame event handler to a separate function
In order to tell whether an event has been handled by the frame UI, move
the UI frame handler to a specific helper function.

https://gitlab.gnome.org/GNOME/mutter/issues/88
2019-08-19 09:16:04 +02:00
Aurimas Černius
15c9458e92 Updated Lithuanian translation 2019-08-18 22:30:12 +03:00
Florentina Mușat
a3baf14e72 Update Romanian translation 2019-08-18 12:24:20 +00:00
Daniel van Vugt
f57ce7254d clutter/stage-cogl: Remove pending_swaps counter
As a protection against duplicate/early update times, it has already
been replaced by commit 35aa2781 and commit 4faeb127.

Removing it also prevents a common cause of frame skips:

  clutter_stage_cogl_schedule_update()
  clutter_stage_cogl_get_update_time() == -1

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1411

https://gitlab.gnome.org/GNOME/mutter/merge_requests/719
2019-08-16 16:44:27 +00:00
Albert Vaca Cintora
4d8190972d cursor-renderer/native: Fix compilation warning
Previous initialization triggered Wmissing-braces in Clang.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/731
2019-08-16 14:54:48 +02:00
Adam Jackson
b7ef8796b2 cogl: Remove unused cogl_{begin,end}_gl API
Any GL calls we want to make should be inside cogl already.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/500
2019-08-16 06:35:35 +00:00
Adam Jackson
7e8a864992 cogl: Remove unused cogl-gles2 API
This was introduced in:

    commit 010d16f647
    Author: Robert Bragg <robert@linux.intel.com>
    Date:   Tue Mar 6 03:21:30 2012 +0000

        Adds initial GLES2 integration support

        This makes it possible to integrate existing GLES2 code with
        applications using Cogl as the rendering api.

That's maybe a reasonable thing for a standalone cogl to want, but our
cogl has only one consumer. So if we want additional rendering out of
our cogl layer, it makes more sense to just add that to cogl rather than
support clutter or mutter or the javascript bindings creating their own
GLES contexts.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/500
2019-08-16 06:35:35 +00:00
Hans de Goede
f3660dc60e kms: Deal with GPUs being unplugged
Add meta-kms and meta-monitor-manager-kms listener for the udev
device-removed signal and on this signal update the device state /
re-enumerate the monitors, so that the monitors properly get updated
to disconnected state on GPU removal.

We really should also have meta-backend-native remove the GPU itself
from our list of GPU objects. But that is more involved, see:
https://gitlab.gnome.org/GNOME/mutter/issues/710

This commit at least gets us to a point where we properly update the
list of monitors when a GPU gets unplugged; and where we no longer
crash the first time the user changes the monitor configuration after
a GPU was unplugged.

Specifically before this commit we would hit the first g_error () in
meta_renderer_native_create_view () as soon as some monitor
(re)configuration is done after a GPU was unplugged.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/713
2019-08-15 20:38:28 +00:00
Hans de Goede
0eb355e29d kms: Fix drm_connector mem-leak in meta_kms_connector_update_state
https://gitlab.gnome.org/GNOME/mutter/merge_requests/713
2019-08-15 20:38:28 +00:00
Hans de Goede
3ccb7cf4b2 kms: drmModeGetConnector may fail
drmModeGetConnector may fail and return NULL, this may happen when
a connector is removed underneath us (which can happen with e.g.
DP MST or GPU hot unplug).

Deal with this by skipping the connector when enumerating and by
assuming it is disconnected when checking its connection state.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/713
2019-08-15 20:38:28 +00:00
Hans de Goede
578ff22464 kms: drmModeGetCrtc may fail
drmModeGetCrtc may fail and return NULL. This will trigger when
meta_kms_crtc_update_state gets called from meta_kms_update_states_sync
after a GPU has been unplugged leading to a NULL pointer deref causing
a crash.

This commit fixes this by checking for NULL and clearing the current_state
when NULL is returned.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/713
2019-08-15 20:38:28 +00:00
Hans de Goede
73db35c53c kms: Fix meta_kms_crtc_read_state gamma table memory leak
Before this commit meta_kms_crtc_read_state was overwriting the
entire MetaKmsCrtcState struct stored in crtc->current_state including
the gamma (sub)struct.

This effectively zero-s the gamma struct each time before calling
read_gamma_state, setting the pointers where the previous gamma values
were stored to NULL without freeing the memory. Luckily this zero-ing
also sets gamma.size to 0, causing read_gamma_state to re-alloc the
arrays on each meta_kms_crtc_update_state call. But this does mean that
were leaking the old gamma arrays on each meta_kms_crtc_update_state call.

This commit fixes this by making meta_kms_crtc_read_state only overwrite
the other values in the MetaKmsCrtcState struct and leaving the gamma
sub-struct alone, this will make read_gamma_state correctly re-use the
gamma tables if the gamma table size is unchanged; or re-alloc them
(freeing the old ones) if the size has changed, fixing the memory leak.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/713
2019-08-15 20:38:28 +00:00