Commit Graph

6614 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
3d23ecc456
clutter: Drop g_object_newv from ClutterScriptParser
Build an additional set of (GStrv, GValue[]) and pass it
to the non-deprecated g_object_new_with_properties().
2018-11-08 16:20:19 -02:00
Georges Basile Stavracas Neto
cbf6e74915 tests: Remove deprecated ATK functions 2018-11-08 18:08:57 +00:00
Georges Basile Stavracas Neto
b5c4437287 tests: Remove extra const 2018-11-08 18:08:57 +00:00
Georges Basile Stavracas Neto
426d7f3bdf tests: Enumerate all possible events 2018-11-08 18:08:57 +00:00
Georges Basile Stavracas Neto
3483be8566 tests: Remove unused variables 2018-11-08 18:08:57 +00:00
Daniel van Vugt
f31cf0c3ef clutter-offscreen-effect: Disable if no texture
If texture allocation fails (e.g. on an old GPU with size limit 2048)
then `update_fbo` would return `FALSE` but leaves `priv->offscreen`
as non-NULL. So the next paint will try to use the offscreen with a
`NULL` texture and crashes. The solution is simply to ensure that
`priv->offscreen` is NULL if there is no `priv->texture`, so the default
(non-offscreen) paint path gets used instead.

Bug reported and fix provided by Gert van de Kraats.

https://launchpad.net/bugs/1795774
2018-11-08 10:18:25 +00:00
Jonas Ådahl
b86d87453d build: Fix include and lib paths in autotools .pc files
Some hadn't been updated after lib/mutter/ changed to lib/mutter-N/.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/382
2018-11-07 14:29:30 +01:00
Jonas Ådahl
cf7c39e2c1 build: Add soversion to shared libraries
It's easier to add it now, then adding it later would so be needed.
2018-11-07 13:00:47 +00:00
Jonas Ådahl
c03a401f4c clutter: Install x11 related header files when using autotools again
clutter-x11.h and x11/clutter-x11-texture-pixmap.h were not installed
any longer. Fix that.
2018-11-07 12:54:41 +00:00
Jonas Ådahl
fc5b94e077 clutter: Install cally headers again when using autotools
The install step was accidentally removed.
2018-11-07 12:54:41 +00:00
Jonas Ådahl
ef85d1a643 Add meson build support
This commit adds meson build support to mutter. It takes a step away
from the three separate code bases with three different autotools setups
into a single meson build system. There are still places that can be
unified better, for example by removing various "config.h" style files
from cogl and clutter, centralizing debug C flags and other configurable
macros, and similar artifacts that are there only because they were once
separate code bases.

There are some differences between the autotools setup and the new
meson. Here are a few:

The meson setup doesn't generate wrapper scripts for various cogl and
clutter test cases. What these tests did was more or less generate a
tiny script that called an executable with a test name as the argument.
To run particular tests, just run the test executable with the name of
the test as the argument.

The meson setup doesn't install test files anymore. The autotools test
suite was designed towards working with installed tests, but it didn't
really still, and now with meson, it doesn't install anything at all,
but instead makes sure that everything runs with the uninstalled input
files, binaries and libraries when running the test suite. Installable
tests may come later.

Tests from cogl, clutter and mutter are run on 'meson test'. In
autotools, only cogl and clutter tests were run on 'make check'.
2018-11-06 18:51:44 +01:00
Jonas Ådahl
d48d56f831 autotools: Make install directories paths more consistent
Install include files in
$prefix/include/mutter-$apiversion/[clutter,cogl,...,meta]/, and
datafiles in /usr/share/mutter-$apiversion/.... We still would conflict
e.g. given that our gettext name is "mutter", and how keybindings are
installed, but it's a step in the right direction.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
e0727aba5f clutter/tests/micro-bench: Don't define unused macro
TESTS_DATA_DIR was not used by any of the tests, so no use defining it.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
14be04a630 clutter/tests: Unconditionally include tests using gdk-pixbuf
We already have gdk-pixbuf as a dependency, so there is no reason to
make it conditional here.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
0067f78155 clutter: Unconditionalize a few X11 extensions
We now require xcomposite, xkb, xi 2.2, at least at compile time.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
3e03d1e38e clutter/configure.ac: Remove left-over gbm and drm dependencies
The gbm and drm facing code has since long been moved into mutter.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
fe7a67f0e7 clutter/configure.ac: Remove unused gdk dependency 2018-11-06 17:17:36 +01:00
Jonas Ådahl
db77e2e187 clutter: Assume compiler supports visibility flag and attributes
Unconditionally pass -fvisibility=hidden to compiler and define
_CLUTTER_EXTERN to __attribute__((visibility("default"))) extern.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
e3c6e3b84d clutter: Fix a couple of guard macros
Use #ifdef instead of #if in a couple of places.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
0d9391e282 clutter: Remove examples
Running clutter apps standalone using mutters fork is not something
worth supporting.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
1e2610e4f4 clutter: Remove useless OS_LINUX macro
It was unconditionally set to 1.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
0095c2e340 clutter: Require full relative path when including 2018-11-06 17:17:36 +01:00
Jonas Ådahl
c90e63a91d clutter: Stop defining some unused macros 2018-11-06 17:17:36 +01:00
Jonas Ådahl
8c0e13ca7a clutter: Remove clutter specific version
Use the mutter version when something is still needed.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
11f8b12a9d clutter: Unconditionally include clutter-build-config.h 2018-11-06 17:17:36 +01:00
Jonas Ådahl
97004e6114 cogl: Remove ARBfp pipeline support
As with fixed pipelines, we require the use of the GLSL pipeline in
mutter, and no point in supporting ARBfp anyway.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
98af9bb251 cogl: Remove notion of a "cogl" version
Mutters copy of cogl isn't a separate library with its own version, so
remove the old version macros.
2018-11-06 17:17:36 +01:00
Jonas Ådahl
00a5523667 cogl: Remove some left over KMS backend stuff 2018-11-06 17:17:36 +01:00
Carlos Garnacho
df94a18791 clutter: Add clutter_input_method_forward_key() method.
This allows input methods to inject key events with specific keyval/keycode,
those events will be flagged with CLUTTER_EVENT_FLAG_INPUT_METHOD so they
won't be processed by the IM again.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/531
2018-10-08 16:30:04 +00:00
Carlos Garnacho
67aab7c138 clutter: Do not latch modifiers on modifier keys
If the user maps eg. Alt+F2 to a pad button, the MetaInputSettings will
send the full Alt press, F2 press, F2 release, Alt release sequence.
However the keycode corresponding to Alt is found in level 1, so the
Shift modifier gets unintendedly latched in addition to the Alt key
press/release pair.

We could probably improve keycode lookup heuristics so level=0 (and
no modifier latching) is preferred, but we can do without it altogether
for modifier keys.
2018-10-08 16:24:11 +00:00
Sam Spilsbury
a8a3c1017f actor: Also recompute paint volume if we recently dropped effects
Otherwise we'll be stuck with the same paint volume on the last
frame of the given effect, which could be wrong.
2018-09-18 19:39:12 +00:00
Sam Spilsbury
5d19aee23a actor: Always use get_paint_volume override for active effects
If an effect is active and it overrides the paint volume, we should
always recompute the paint volume when requested and not use the
cache, since the paint volume override can change from call to
call depending on what phase of painting we are in. For instance,
if we are part way through painting effects and request the
paint volume, the paint volume should only go up to the current
effect, but in a later call to compute repaint regions, the
paint volume needs to expand to accomadate the effect.

This still involves a lot of recomputation in the case of effects -
in a later clutter version it would be worth adding an API to
allow effects to explicitly recompute and return a new the paint
volume up to the current effect as opposed to recomputing
the cached one.
2018-09-18 19:39:12 +00:00
Sam Spilsbury
4270eef16e actor: Fix logic error in determining terminal effect for paint volume
Previously we were checking l->data != NULL || (l->data != NULL &&
l->data != priv->current_effect). This would continue the loop even
if l->data == priv->current_effect, since l->data != NULL, which was
not the intention of that loop.

We also don't need to check that l->data != NULL before checking if
it does not match the current_effect, since we already checked
that current_effect was non-NULL before entering the loop.
2018-09-18 19:39:12 +00:00
Carlos Garnacho
9cfd185316 clutter: Handle grabs from CLUTTER_TABLET_DEVICE devices
Those would result in warnings. Actually, these should be dealt
similarly to pointers, as they get their own standalone pointer
cursor in Wayland.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/issues/540
2018-09-07 15:17:36 +02:00
Peter Hutterer
176117c5f7 device-manager-evdev: handle tablet axis motion before button and tip events
Some tablets have a noticable pointer jump on tip down/up, causing unintended
lines during drawing. Likewise, a button event may have an axis update that we
currently ignore. libinput provides tablet axis events only if no other state
changes, the client must instead get the current axis data from the tip/button
event. So let's do this, process the event axis data during tip/button as
well.

A libinput recording to reproduce is the 'dots.yml' in
https://gitlab.freedesktop.org/libinput/libinput/issues/128

Fixes #289
2018-09-07 19:54:06 +10:00
Carlos Garnacho
85284acb00 clutter/x11: Implement keycode lookup from keysyms on virtual key devices
Unfortunately XKeysymToKeycode() falls short in that it coalesces keysyms
into keycodes pertaining to the first level (i.e. lowercase). Add a
ClutterKeymapX11 method (much alike its GdkKeymap counterpart) to look up
all matches for the given keysym.

Two other helper methods have been added so the virtual device can fetch
the current keyboard group, and latch modifiers for key emission. Combining
all this, the virtual device is now able to handle keycodes in further
levels.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/135
2018-08-28 12:22:52 +02:00
Carlos Garnacho
aaed7c9a4f clutter: Set can_show_preedit flag on ClutterText
It is certainly able to visualize preedit text inline, so it must
announce itself as such.
2018-08-23 20:03:51 +00:00
Carlos Garnacho
fa8930817e clutter: Refactor ClutterText IM focus in into separate function
A just focused ClutterInputFocus must set itself up correctly on
all situations. Refactor this into a function, so it can be used
for the case where a ClutterText gets editable while focused.
2018-08-23 20:03:51 +00:00
Daniel van Vugt
b8340f1355 clutter-text: Avoid clipping the wrong framebuffer
`ClutterText` painting for editable single_line_mode actors like `StEntry`
is always clipped by:

`cogl_framebuffer_push_rectangle_clip (fb, 0, 0, alloc_width, alloc_height)`

So it's difficult to get the rectangle wrong. However in cases where the
target framebuffer has changed (`cogl_push_framebuffer`) such as when
updating `ClutterOffscreenEffect` we had the wrong old value of `fb`. And
so would be clipping the wrong framebuffer, effectively not clipping at all.
2018-08-20 18:07:32 +00:00
Andrea Azzarone
e1513b6b00 clutter/x11: Detect auto-repeated key events
Detect auto-repeated key events using the XIKeyRepeat flag.
2018-08-20 10:16:33 +00:00
Andrea Azzarone
0f40541bb2 clutter/enum: Add CLUTTER_EVENT_FLAG_REPEATED for auto-repeated events 2018-08-20 10:16:33 +00:00
Jonas Ådahl
24aef44baf virtual-input/evdev: Translate from button internal codes to evdev
Sending button events to a ClutterVirtualInputDevice, the API expects
button codes to be of the internal clutter type. The evdev
implementation incorrectly assumed it was already prepared evdev event
codes, which was not the case. Fix the evdev implementation to translate
from the internal representation to evdev before passing it along to
ClutterSeatEvdev.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/190
2018-08-09 13:04:07 +00:00
Daniel van Vugt
b393f3d540 clutter/actor: Inherit clone branch depth from parent
Children added to a parent after that parent (or its ancestors)
have already been cloned now inherit the clone branch depth of
the parent. Otherwise `clutter_actor_is_in_clone_paint` on the child
could return FALSE when it should have been returning TRUE.
2018-08-01 11:53:10 +08:00
Florian Müllner
7fdaf7721c Don't cast free function passed to g_clear_pointer
The function is intentionally provided as macro to not require a
cast. Recently the macro was improved to check that the passed in
pointer matches the free function, so the cast to GDestroyNotify
is now even harmful.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Florian Müllner
4fe594bf9c clutter: Stop using g_type_class_add_private()
It is now deprecated in favor of the G_ADD_PRIVATE() macro (usually
called via G_DEFINE_WITH_PRIVATE()).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/176
2018-07-31 23:40:01 +02:00
Carlos Garnacho
161d2540e6 ClutterActor: Preserve valid paint volumes till the next relayout/repaint
Cuts down approximately all paint volume calculations when there's
windows that redraw frequently, but don't move.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2018-07-13 11:42:28 +00:00
Corentin Noël
2a45b7de7c clutter-input-device-xi2: Check for null group_modes before unref 2018-06-07 12:54:56 +01:00
Daniel van Vugt
62c67be4c8 clutter-actor: Fix uninitialized matrix multiply
`modelview` is uninitialized and the `apply` function just multiplies it.
What we really want is to initialize `modelview` so replace `apply` with
`get`.

Who knows what bugs this may have caused...
2018-05-31 15:43:27 +08:00
Marco Trevisan (Treviño)
15f41c9f68 device-manager-evdev: Add main seat to seats by default
Treat the main seat as other seats, so we don't have to handle it differently
in specific places. This was already the case before when a real device
was plugged before the startup, but not applied when hotplugging a device.
2018-05-29 10:35:51 +00:00
Marco Trevisan (Treviño)
2a38601b42 device-manager-evdev: Free the main seat on finalize 2018-05-29 10:35:51 +00:00