Commit Graph

24880 Commits

Author SHA1 Message Date
Iain Lane
d7d2612218 build: Compile with -ffloat-store on x86 (32 bit)
GCC's manpage says that this flag does the following:

  Do not store floating-point variables in registers, and inhibit other
  options that might change whether a floating-point value is taken from
  a register or memory.

  This option prevents undesirable excess precision on machines such as
  the 68000 where the floating registers (of the 68881) keep more
  precision than a "double" is supposed to have.  Similarly for the x86
  architecture.  For most programs, the excess precision does only good,
  but a few programs rely on the precise definition of IEEE floating
  point.

We rely on this behaviour in our fork of clutter. When performing
floating point computations on x86, we are getting the wrong results
because of this architecture's use of the CPU's extended (x87, non-IEEE
confirming) precision by default. If we enable `-ffloat-store` here,
then we'll get the same results everywhere by storing into variables
instead of registers. This does not remove the need to be correct when
handling floats, but it does mean we don't need to be more correct than
the IEEE spec requires.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/785
2019-09-20 10:06:36 +00:00
Daniel van Vugt
7a0340c57d kms-impl-device: Use portable formatting for 64-bit integers
On 64-bit systems uint64_t is %lu but on 32-bit systems it is %llu.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/778
2019-09-20 11:55:49 +02:00
Daniel van Vugt
0863bd2408 output-kms: Use portable formatting for 64-bit integers
On 64-bit systems uint64_t is %lu but on 32-bit systems it is %llu.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/778
2019-09-20 11:55:42 +02:00
Daniel van Vugt
594cc7c7d6 input-settings: Use portable formatting for 64-bit integers
On 64-bit systems int64_t is %lx but on 32-bit systems it is %llx.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/778
2019-09-20 11:55:35 +02:00
Daniel van Vugt
0b19078b2b clutter/stage-cogl: Use portable formatting for 64-bit integers
On 64-bit systems int64_t is %ld but on 32-bit systems it is %lld.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/778
2019-09-20 11:55:32 +02:00
Daniel van Vugt
7811865e84 clutter/paint-node: Convert safely from pointer to integer
To support 32-bit systems without compiler warnings.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/778
2019-09-20 11:55:25 +02:00
Jonas Ådahl
0e69fe0781 idle-monitor: Reset timeout before firing watch
The watch might be removed during firing, meaning the source is
destroyed after returning. Avoid use-after-free by unsetting the timeout
before firing. Returning G_SOURCE_CONTINUE in that case is harmless, as
source is destroyed.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/796

https://gitlab.gnome.org/GNOME/mutter/merge_requests/799
2019-09-16 18:08:18 +00:00
Jonas Ådahl
26b08d87a8 idle-monitor: Remove redundant type cast
No need to type cast a `MetaIdleMonitorWatch *` to a
`MetaIdleMonitorWatch *`.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/799
2019-09-16 18:08:18 +00:00
Jonas Ådahl
321ab3b367 idle-monitor: Make helper function static
It wasn't used outside the file, so no reason to not have it static.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/799
2019-09-16 18:08:18 +00:00
Michal Lazo
4d0869e206 kms-device: Free path when finalizing
free path in finalize

https://gitlab.gnome.org/GNOME/mutter/merge_requests/775
2019-09-16 16:41:46 +00:00
Michal Lazo
d13cea6ccb kms-device: Handle impl device creation failure
Properly free kms-device in case of invalid initialization

https://gitlab.gnome.org/GNOME/mutter/merge_requests/772
2019-09-16 16:34:39 +00:00
Carlos Garnacho
6922f0e16a x11: Minor refactor of input focus handling code
Instead of open coding the X11 focus management in display.c, expose
it as a single function with similar arguments to its MetaDisplay
counterpart. This just means less X11 specifics in display.c.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/751
2019-09-13 20:55:57 +00:00
Carlos Garnacho
31df06d94e x11: Use the currently focused X window for _NET_ACTIVE_WINDOW
MetaDisplay and MetaX11Display focus windows are slightly decoupled,
we cannot rely here on the MetaDisplay focus to be updated yet. We
however know the X Window that got focused, so lookup the corresponding
MetaWindow (and client X window) from it.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/751
2019-09-13 20:55:56 +00:00
Jonas Ådahl
ecec9a7eaa cogl/egl: Just notify about failure to create high priority context
Warning about it causes test case failures if there are not enough
privileges, which is likely when running the test suite locally.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/797
2019-09-13 09:47:00 +02:00
Jonas Dreßler
ab7af2d0c5 clutter/actor: Remove unused private function
`_clutter_actor_get_transition` is almost identical to
`clutter_actor_get_transition` and isn't used anywhere in the code (we
stopped using it with ee00e37b), remove it!

https://gitlab.gnome.org/GNOME/mutter/merge_requests/791
2019-09-12 21:36:02 +00:00
Jonas Dreßler
f92e0bec0b clutter/actor: Fix a wrong comment
According to the definition of ClutterAnimationInfo in
clutter-actor-private.h, `transitions` is the third variable of the
struct, not the first one.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/791
2019-09-12 21:36:02 +00:00
Georges Basile Stavracas Neto
7a22f6fd3f Fix a few tracing typos
They are missing the closing parenthesis. Add them.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/795
2019-09-12 14:30:44 -03:00
Carlos Garnacho
850ef51879 core: Split x11-display initialization in 2 signals
We have a "setup" phase, used internally to initialize early the x11
side of things like the stack tracker, and an "opened" phase where
other upper parts may hook up to. This latter phase is delayed during
initialization so the upper parts have a change to connect to on
plugin creation.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/771
2019-09-11 22:30:13 +02:00
Jonas Ådahl
ef2e04a613 plugins/default: Get default keymap from localed
When starting standalone mutter and running using the native backend, we
always fall back on using the us pc105 keyboard layout. This can be very
frustrating if one is used to using some other keyboard layout, such as
dvorak, causing keyboard fumbling everytime when doing something with
standalone mutter.

Avoid this involuntary fumbling by having the default plugin query
localed what layout the user has actually configured the machine to
operate using. It doesn't add any keymap selection user interface, so
it'll always use the first one it encounters.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/787
2019-09-10 20:09:40 +00:00
Milo Casagrande
e16b75a0b7 Update Italian translation 2019-09-10 08:57:05 +00:00
Florian Müllner
8cdcf529e9 Bump version to 3.34.0
Update NEWS.
2019-09-09 20:09:35 +02:00
Ryuta Fujii
280167f217 Update Japanese translation 2019-09-09 11:03:10 +00:00
Ryuta Fujii
a72f3fdabb Update Japanese translation 2019-09-09 10:57:26 +00:00
Emin Tufan Çetin
dd6227e3bf Update Turkish translation 2019-09-07 20:09:26 +00:00
Emin Tufan Çetin
1271ce1cab Update Turkish translation 2019-09-07 14:06:24 +00:00
Milo Casagrande
998114791f Update Italian translation 2019-09-06 08:45:55 +00:00
Claude Paroz
8a73324a0f Update French translation 2019-09-06 06:24:54 +00:00
Christian Kirbach
9065edfc95 Update German translation (Launchpad bug 1786977) 2019-09-05 23:43:10 +02:00
Jonas Ådahl
5111e33948 monitor-manager/kms: Get hotplug events from MetaKms
This makes it clearer that MetaMonitorManagerKms keeps updated as
MetaKms updates its state.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/743
2019-09-05 08:03:36 +00:00
Jonas Ådahl
4cf828323d kms/impl-device: Add and remove connectors on hot plug
Connectors may disappear and appear on hot plugs, e.g. when a docking
station is connected, so when processing a hot plug event, make sure we
remove connectors that are now gone, and add new ones that have appeared
since last time.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/728

https://gitlab.gnome.org/GNOME/mutter/merge_requests/743
2019-09-05 08:03:36 +00:00
Jonas Ådahl
35776c5d29 kms: Add assert to check that the main thread is blocked on impl task
This is so that we can have code in impl tasks that pokes at the main
context objects.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/743
2019-09-05 08:03:36 +00:00
Jonas Ådahl
2f27b8d5fa window-actor: Handle changing surface actor on window reparenting
The commit f2f4af0d50 missed one situation
where mutter does things differently, i.e. changes what surface actor is
associated with a given window actor: reparenting a Xwayland window when
changing whether it is decorated.

To summarize, there are three types of window actors:

X11 window actors - directly tied to the backing X11 window. The
corresponding surface actor is directly owned by the window actor and
will never change.

Wayland window actors - gets its surface actor from MetaWaylandSurface
at construction. A single MetaWaylandSurface may create and destroy
multiple window actors over time, but a single window actor will never
change surface actor.

Xwayland window actors - a mix between the above two types; the window
corresponds to the X11 window, and so does the window actor, but the
surface itself comes from the MetaWaylandSurface.

Normally when a X11 window is unmapped, the corresponding MetaWindow is
unmanaged. With Xwayland, this happens indirectly via the destruction of
the wl_surface. The exception to this is windows that are reparented
during changing their decoration state - in this case on plain X11, the
MetaWindow stays alive. With Xwayland however, there is a race
condition; since the MetaWindow is tied to the wl_surface, if we receive
the new surface ID atom before the destruction of the old wl_surface,
we'll try to associate the existing MetaWindow and MetaWindowActor with
the new wl_surface, hitting the assert. If the surface destruction
arrives first, the MetaWindow and MetaWindowActor will be disposed, and
the we wouldn't hit the assert.

To handle this race gracefully, reinstate handling of replacing the
surface actor of an existing window actor, to handle this race, as it
was handled before.

Eventually, it should be reconsidered whether the MetaWindow lifetime is
tied to the wl_surface or if it should be changed to be consistent with
plain X11, as this re-exposes another bug where the X11 client and
mutter will enter a feedback loop where the window is repeatedly
remapped. See https://gitlab.freedesktop.org/xorg/xserver/issues/740.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/709

https://gitlab.gnome.org/GNOME/mutter/merge_requests/773
2019-09-05 07:43:40 +00:00
Olivier Fourdan
be4131b3c4 wayland/xdg-output: Fix xdg-output v3 support
When using xdg-output v3 or later, the Wayland compositor does not send
xdg_output.done events which are deprecated.

Instead, it should send a wl_output.done event for the matching
wl_output.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/771
2019-09-05 07:29:10 +00:00
Gwan-gyeong Mun
854feafa83 Update Korean translation 2019-09-05 06:35:18 +00:00
Rafael Fontenelle
f423736a70 Update Brazilian Portuguese translation 2019-09-05 05:34:42 +00:00
Florian Müllner
fdbac25e0d Bump version to 3.33.92
Update NEWS.
2019-09-04 20:49:07 +02:00
Marek Černocký
bcfac0d6dc Updated Czech translation 2019-09-03 22:35:50 +02:00
Goran Vidović
682d43b5ab Update Croatian translation 2019-09-03 16:01:12 +00:00
Fabio Tomat
cd273e82ad Update Friulian translation 2019-09-03 07:53:58 +00:00
Jonas Ådahl
3c0067dc69 x11: Trace XEvent processing
https://gitlab.gnome.org/GNOME/mutter/merge_requests/765
2019-09-02 17:36:00 +00:00
Jonas Ådahl
a957c2f0c2 wayland: Trace wl_surface.commit
https://gitlab.gnome.org/GNOME/mutter/merge_requests/765
2019-09-02 17:36:00 +00:00
Jonas Ådahl
908203c735 core: Trace various window management actions
https://gitlab.gnome.org/GNOME/mutter/merge_requests/765
2019-09-02 17:36:00 +00:00
Olivier Fourdan
2f072af02b clutter/input-pointer-a11y: Restore pointer a11y on resume
When suspending, the devices are removed and the virtual device
associated with the corresponding core pointer is disposed.

Add the pointer accessibility virtual device to the core pointer
on resume to restore pointer accessibility on resume if enabled.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/761
2019-09-02 17:27:17 +00:00
Olivier Fourdan
de98fb29da wayland/data-device: Restore keyboard focus on drag end
When starting a DnD operation, mutter would remove keyboard focus from
the client, only to restore it on the data offer destroy.

However, if the DnD fail, the keyboard focus is not restored, leaving
the user unable to type in the focused window, even after clicking in
the window.

That issue would show only on first attempt, as further DnD attempts
would destroy the previous data offer which would also restore the
keyboard focus.

Make sure we restore the keyboard focus on drag end as well.

https://gitlab.gnome.org/GNOME/mutter/issues/747
2019-09-02 17:06:06 +00:00
Olivier Fourdan
82c92177ff wayland/data-device: Do not unset focus on drag start
On drag start, `data_device_start_drag()` issues a keyboard grab, which
in turn will unset the current input focus.

There is not need to unset the input focus in `data_device_start_drag()`
as this is redone in `meta_wayland_keyboard_start_grab()`

https://gitlab.gnome.org/GNOME/mutter/issues/747
2019-09-02 17:06:06 +00:00
Daniel van Vugt
14c706e51b clutter: Introduce geometric picking
Currently, Clutter does picking by drawing with Cogl and reading
the pixel that's beneath the given point. Since Cogl has a journal
that records drawing operations, and has optimizations to read a
single pixel from a list of rectangle, it would be expected that
we would hit this fast path and not flush the journal while picking.

However, that's not the case: dithering, clipping with scissors, etc,
can all flush the journal, issuing commands to the GPU and making
picking slow. On NVidia-based systems, this glReadPixels() call is
extremely costly.

Introduce geometric picking, and avoid using the Cogl journal entirely.
Do this by introducing a stack of actors in ClutterStage. This stack
is cached, but for now, don't use the cache as much as possible.

The picking routines are still tied to painting.

When projecting the actor vertexes, do it manually and take the modelview
matrix of the framebuffer into account as well.

CPU usage on an Intel i7-7700, tested with two different GPUs/drivers:

  |         |     Intel | Nvidia |
  | ------: | --------: | -----: |
  | Moving the mouse:            |
  | Before  |       10% |    10% |
  | After   |        6% |     6% |
  | Moving a window:             |
  | Before  |       23% |    81% |
  | After   |       19% |    40% |

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/154,
        https://gitlab.gnome.org/GNOME/mutter/issues/691

Helps significantly with: https://gitlab.gnome.org/GNOME/mutter/issues/283,
                          https://gitlab.gnome.org/GNOME/mutter/issues/590,
                          https://gitlab.gnome.org/GNOME/mutter/issues/700

v2: Fix code style issues
    Simplify quadrilateral checks
    Remove the 0.5f hack
    Differentiate axis-aligned rectangles

https://gitlab.gnome.org/GNOME/mutter/merge_requests/189
2019-09-02 16:41:13 +00:00
Daniel van Vugt
a70823dd1c clutter/point: Add ClutterPoint quarilateral testing API
Add a function to check whether a point is inside a quadrilateral
by checking the cross product of vectors with the quadrilateral
points, and the point being checked.

If the passed quadrilateral is zero-sized, no point is ever reported
to be inside it.

This will be used by the next commit when comparing the transformed
actor vertices.

[feaneron: add a commit message and remove unecessary code]

https://gitlab.gnome.org/GNOME/mutter/merge_requests/189
2019-09-02 16:41:13 +00:00
Rémi Bernon
fdda8adfcf
x11: Add window test before accessing reparents_pending field
https://gitlab.gnome.org/GNOME/mutter/merge_requests/768
2019-09-02 18:27:37 +02:00
Rémi Bernon
8f242f8bf0 core: Fix multiple reparent requests handling
If window decoration is modified within a short period of time, mutter
sometimes starts processing the second request before the first
UnmapNotify event has been received. In this situation, it considers
that the window is not mapped and does not expect another UnmapNotify /
MapNotify event sequence to happen.

This adds a separate counter to keep track of the pending reparents. The
input focus is then restored when MapNotify event is received iff all
the expected pending ReparentNotify events have been received.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>

https://gitlab.gnome.org/GNOME/mutter/merge_requests/657
2019-09-02 15:50:37 +00:00
Mart Raudsepp
36a14e65c2 build: Raise libXi minimum dependency for required deadlock fixes
Older than 1.7.4 have deadlock bugs, see
https://bugzilla.gnome.org/show_bug.cgi?id=738944
2019-09-02 15:26:29 +00:00