Compare commits

...

114 Commits

Author SHA1 Message Date
Carlos Garnacho
27fa62f110 wayland: Reword comment
This is no longer directly related to DBus messages, but our own event
queue. Change the wording and use CLUTTER_PRIORITY_EVENTS to make it
bolder, even though it's the same than G_PRIORITY_DEFAULT.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1286
2020-08-17 12:39:15 +02:00
Carlos Garnacho
35680ee7c6 wayland: Flush text_input.done event after IM key event
We set an idle to coalesce multiple IM events together, as the protocol
requires us to send them in one frame, and unfortunately there is no
idea about whether more IM events are upcoming.

One good hint though are key events generated from the IM, we want to
apply all IM changes before the key event is processed, so make it sure
that the .done event is flushed before the key event is handled.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1286
2020-08-17 12:36:10 +02:00
Carlos Garnacho
98c1a469ad clutter: Push commit/delete_sourrounding as IM events
These are not given directly to the input focus anymore, instead
queued up as events. This way, all actions triggered by the input
method (commit and preedit buffer ones, but also synthesized key
events) queue up the same way, and are thus processed in the exact
same order than they are given to us.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1286
2020-08-17 12:31:08 +02:00
Carlos Garnacho
4a43e295d2 clutter: Prepare input focus for IM event delivery
The clutter_input_focus_filter_key_event() function has been made
a more generic filter_event(). Besides its old role about letting
key events go through the IM, it will also process the IM events
that are possibly injected as a result.

Users have been updated to these changes.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1286
2020-08-17 12:30:38 +02:00
Carlos Garnacho
612a17443a clutter: Add IM events
These will be used to make IM commands into something that is processed
in a fixed order relative to key events.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1286
2020-08-17 12:30:28 +02:00
Jonas Ådahl
3d54f973ce clutter/main: Remove unused "fuzzy picking" option
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
678e1fcd47 clutter/stage: Remove clutter_stage_new()
It's never expected that anything creates its own stage directly, so
remove the constructor function.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
e848414f89 clutter: Remove main loop helper
It's expected to always use meta_*() or your own main loop.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
961a1376cd clutter: Remove 'eglnative' backend layer
It's completely empty, so remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
72a389ef12 clutter/egl: Remove unused clutter_egl_get_egl_display()
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
3566fa7bb0 clutter/main: Remove checking windowing system
Last user in gnome-shell removed with
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1358.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
c2a155f767 clutter: Remove support not specifying backend
This was from the old clutter-as-application-library days, where it had
to try find a suitable backend. Now we already have a backend selected
(MetaBackend), and the clutter backend is already predecided depending
on that, so we don't need the code that auto detects an appropriate one
anymore.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
0d95f4d854 tests/clutter: Always use stage from backend
This removes all occurrences of creating a custom stage from the tests,
making them always use the one from MetaBackend. This will allow for
further cleanups.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
21e2f41a26 tests/clutter/conform: Make sure to destroy created actors
We're moving towards not supporting stand-alone application style
clutter stages, meaning the stage tests use will be reused instead of
recreated. To make this feasable, tests must clean up after themself.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:56 +02:00
Jonas Ådahl
06d5973851 main: Split up meta_run() into meta_start() and meta_run_main_loop()
meta_run() is still left intact and does the same as before; the new
functions are only intended to be used by tests, as they may need to set
things up after starting up. Doing so linearly in the test case is much
easier than adding callbacks, so meta_run() is split up to make this
possible.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 17:51:30 +02:00
Jonas Ådahl
ebfa94f360 clutter/eglnative: Remove unused source field
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Jonas Ådahl
5279e9a922 clutter/eglnative: Remove unused timer
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Jonas Ådahl
3958a019bb clutter: Move font settings reading to ClutterSettings
There is no reason to use Xsettings for the X11 backend, as it comes
from the GSetting store anyway, so move the font setting reading to
ClutterSettings and read directly from GSettings.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Jonas Ådahl
7e97268592 clutter/x11: Remove helper for checking XComposite presence
It's not used by anything.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Jonas Ådahl
d857edf09c clutter: Remove support for transparent windows
We're only ever a compositor, so we're never asking to be transparent.
Thus remove support for requesting to paint to GLX or EGL displays with
an alpha channel.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Jonas Ådahl
787bc3d993 tests/clutter: Make $DISPLAY non-optional
All our tests rely on the nested backend, which runs on top of X11, so
there is no point in having code that tries to handle not finding a
valid $DISPLAY.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Jonas Ådahl
28cb025190 clutter: Remove DELETE event, signal and vfunc
The delete event was used for signalling the close button was clicked on
clutter windows. Being a compositor we should never see these, unless
we're running nested. Remove the plumbing of the DELETE event and just
directly call meta_quit() when we see it, if we're running nested.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Jonas Ådahl
c7429e8aad clutter/main: Use "is display server" state to decide a11y routing
We checked if we were using the usig the X11 backend to decide when to
deal with a11y event posting - in order to make the clutter code less
windowing system dependent, make this check a check whether we're a
display server or not, in contrast to a window/compositing manager
client. This is made into a vfunc ot ClutterBackendClass, implemented by
MetaClutterBackendNative and MetaClutterBackendX11.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1364
2020-08-13 14:45:10 +02:00
Daniel Mustieles
e0562f192f Updated Spanish translation 2020-08-13 10:35:11 +02:00
Jonas Ådahl
9581e9e31b tests/stage-view: Test timeline updates clock when parent moves
Test that if a timeline got its frame clock from a parent of the
associated actor, if that actor moves across the stage so that the stage
views changes and thus the would be picked frame clock too, this is
noticed by the timeline so that it also changes to the correct frame
clock.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:05 +00:00
Jonas Ådahl
090c72b3c3 tests/stage-view: Test timelines notice stage views changing
Timelines where the frame clock was picked from a parent of the
associated actor didn't get notified about any stage views changes, as
it only listened on the associated actor. If that actor didn't actually
get its stage views changed (because it went from empty to empty), we'd
end up with a stale frame clock, leading to crashes.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:05 +00:00
Jonas Ådahl
06c4841e22 clutter/timeline: Listen to 'stage-view-changed' on picked actor
When we pick the frame clock given the associated actor, that frame
clock in fact comes from a picked actor. In order to not end up with
stale frame clocks, which may happen on e.g. hotplugs, monitor layout
changes, or non-optimal frame clocks, which may happen when the parent
used for picking the clock moves to another view, lets listen to
'stage-views-changed' on the actor used for picking the clock too.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1327
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:05 +00:00
Jonas Ådahl
c6fc3a8953 stage/x11: Only resize X11 CM stage in response to ConfigureNotify
Flip flop resize, which is the result of respecting ConfigureNotify
makes test annoyingly racy, as one cannot do

    clutter_actor_set_size (stage, 1024, 768);
    wait_for_paint (stage);
    g_assert_assert (clutter_actor_get_width (stage) == 1024);

The reason for this is any lingering ConfigureNotify event that might
arrive in an inconvenient time in response to some earlier resize.

In order to not risk breaking any current behavior in the X11 CM case
(running as a compositing window manager), only avoid changing the stage
size in response to ConfigureNotify when running nested.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:05 +00:00
Jonas Ådahl
07e964e9fc clutter/actor: Return the actor used when picking clock
The actor used might be relevant, so that e.g. if it moves or for some
other reason changes stage views, the user can listen for that.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:05 +00:00
Jonas Ådahl
9bcb03ab48 clutter/actor: Make frame clock picking semi private API
Let's not expose that outside of mutter quite yet; it's not used in
gnome-shell, and to avoid future breakage if it starts to be used, lets
move it to clutter-mutter.h so only mutter and clutter itself can use
it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:04 +00:00
Jonas Ådahl
fb0f03640a stage-view: Add clutter_stage_view_destroy()
This aims to make sure a view and its resources are destroyed when it
should. Using references might keep certain components (e.g frame clock)
alive for too long.

We currently don't take any long lived references to the stage view
anywhere, so this doesn't matter in practice, but this may change, and
will be used by a to be added test case.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:04 +00:00
Jonas Ådahl
a13c307fa4 frame-clock: Fix indentation
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1404
2020-08-13 06:34:04 +00:00
Fran Dieguez
adf513c7fc Update Galician translation 2020-08-12 22:46:49 +00:00
Florian Müllner
623d562933 Bump version to 3.37.90
Update NEWS.
2020-08-11 15:20:10 +02:00
Alexandre Franke
c8f30be91d Update French translation 2020-08-11 06:11:27 +00:00
Yuri Chornoivan
7c2c3e7880 Update Ukrainian translation 2020-08-08 15:01:05 +00:00
Florian Müllner
2611ee14b5 ci: Add gnome-shell runtime dependencies
In order to run gnome-shell as part of the CI pipeline, we need
an additional runtime dependency plus python3 modules to mock
required system services and run gnome-shell-perf-tool.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1401
2020-08-07 16:49:59 +02:00
Jonas Ådahl
a54a01d1e2 wayland/dma-buf: Advertise support for 64 half point RGBA formats
Just as wl_shm, hook up the Wayland DMA-BUF protocol to the 64 bit half
point pixel formats too. This makes it possible for Wayland EGL clients
to use 64 bit pixel EGL configurations.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:49 +00:00
Jonas Ådahl
d3f629bfa8 wayland/shm: Advertise support for 64 half point RGBA formats
Now that cogl understands them, hook wl_shm up so they can be used.

This also bumps the wayland-server version dependency to 1.17.90, which
corresponds to the master branch of wayland. The new formats will be
available in 1.18.0.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:49 +00:00
Jonas Ådahl
8e673d5798 wayland/dma-buf: Advertise support for XRGB2101010 too
https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:49 +00:00
Jonas Ådahl
115de303b0 wayland/shm: Add ARGB2101010 formats and friends
In order to get higher color pixel precision when the alpha channel is
less important. Only advertise these formats if it is supported by the
used cogl renderer.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:49 +00:00
Jonas Ådahl
2d6040e2a3 wayland/shm: Advertise support for RGB565
Doesn't hurt to support it, could save memory bandwidth would any client
use it without degrading visual quality.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:49 +00:00
Jonas Ådahl
5a8e4da2a8 wayland/shm: Send error if client uses unsupported format
Instead of rendering incorrectly (we fell back on some arbitrary
format), just send an error.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:49 +00:00
Jonas Ådahl
d6b5f89a1c cogl: Add API to check whether a format is supported by the driver
Will let us advertise what we actually support at runtime.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:49 +00:00
Jonas Ådahl
6777a547ca cogl: Add 64 bit half-point pixel RGBA formats
In order to support the DRM formats DRM_FORMAT_ABGR16161616F and
friends, as well as the wl_shm formats WL_SHM_FORMAT_ABGR16161616F and
friends, cogl needs to have knowledge about said formats too.

We don't have a software implementation of the half point data types
however, so the pack/unpack methods remain unimplemented. We don't need
them for now, so it's not crucial that we add them.

For the GLES2 driver, currently only two formats are supported, and
since we don't currently have pack/unpack implementations, the other
formats will for now remain unsupported, until we have a half float
implementation.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:48 +00:00
Jonas Ådahl
b191f89305 cogl/gles2: Add support for actual 10 bpc formats
Only for little-endian, depends on an extension, and needs unpack/pack
for many of the formats.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:48 +00:00
Jonas Ådahl
2fc8841416 cogl: Add private feature flags for 10 bpc and 16 bpc formats
10 bpc are enabled for OpenGL and GLES 2 with the right extension. 16
bpc (half float) are enabled for OpenGL 3 and higher, and GLES 2 with
the right extension.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:48 +00:00
Jonas Ådahl
598f536c51 cogl/bitmap-packing: Use hexadecimals for bit masks
It's easier to reason about what bits are 1 or 0 with e.g. 0x1f vs 0x3f
compared to 31 and 63.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/804
2020-08-07 09:02:48 +00:00
Jonas Ådahl
fc778e2bd3 cursor-tracker/x11: Also update sprite when updating position
Without doing this, we'd use the same sprite that was last set by
mutter, most likely a leftptr cursor, and fail to update when e.g.
moving the pointer above a text entry and the displayed cursor updated
to a cursor position marker.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 16:22:16 +02:00
Jonas Ådahl
2d010c9b84 cursor-renderer: Disconnect the overlay cursor from the displayed cursor
The displayed cursor is the one displayed on the screen, e.g. via the
hardware cursor plane, by Xorg, or using the stage overlay.

When screen recording under X11, we don't get a stream of pointer and
cursor updates, as they might be grabbed by some other client. Because
of this, the cursor tracker or cursor renderer are not kept up to date
with positional and cursor state.

To be able to use the stage overlays when recording, we need to be able
to update the overlay without updating the displayed cursor, as we
shouldn't update the X server with cursor state we just retrieved from
it.

Thus, to achieve this, create a separate overlay cursor pointer. When
being a display server, they are always the same, but when using X11,
during screen recording, the overlay one will be polled at a fixed
interval to get a somewhat up to date state.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
a10f35c613 cursor-renderer: Keep ref to displayed cursor sprite
If it'd end up beig the XCursor sprite, it'll be unref:ed by the cursor
tracker when receiving a XFixesCursorNotify:XFixesDisplayCursorNotify
X11 event.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
5f5ef704fc cursor-tracker/x11: Don't leak xfixes cursor sprite
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
3d19b8f49c cursor-tracker: Move out more X11:isms to the X11 backend
This includes the xfixes cursor management.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
a80b0f34e3 clutter: Remove old split capture based screen shooting API
This is no longer used, and the replacement (clutter_stage_paint_to_*())
should be used instead.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
1743887fa7 clutter: Expose clutter_stage_paint_to_(frame)buffer()
This will be used by GNOME Shell to take screenshots.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
b4a8247191 screen-cast: Track and always record cursors
Always force-track the cursor position (so that the X11 backend can keep
it up to date), and if the cursor wasn't part of the sampled
framebuffer when reading pixels into CPU memory, draw it in an extra
pass using cairo after the fact. The cairo based cursor painting only
happens on the X11 backend, as we otherwise inhibit the hw cursor.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
eeee7bed1d cursor-tracker: Add way to force tracking cursor position
On X11 we won't always receive cursor positions, as some other client
might have grabbed the pointer (e.g. for implementing a popup menu). To
make screen casting show a somewhat correct cursor position, we need to
actively poll the X server about the current cursor position.

We only really want to do this when screen casting or taking a
screenshot, so add an API that forces the cursor tracker to track the
cursor position.

On the native backend this is a no-op as we by default always track the
cursor position anyway.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
b24b95db15 cursor-tracker: Only emit 'cursor-moved' if it moved
This makes it safe to update the position with the same coordinates
without risking 'cursor-moved' being emitted when nothing actually
moved.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
e1f25b7244 cursor-sprite: Don't NULL check realize_texture() vfunc
All non-abstract MetaCursorSprite type implementations implement this
function, so no need to NULL check it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
b319add04b cursor-renderer: Remove unneeded NULL check
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
3abbfef66e cursor-tracker: Add X11 cursor tracker backend
The intention is to use this to actively track the cursor position given
a fixed interval when needed, e.g. when screen casting.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
fcf7c4d0c7 cursor-renderer: Always keep the cursor overlay on the stage
Only when the cursor isn't handled by the backend is the overlay made
visible. This is intended to be used when painting the stage to an
offscreen using clutter_stage_paint_to_(frame)buffer() in a way where
the cursor is always included.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
d8be2a8b85 stage: Use g_list_foreach instead of manual for loop
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
f5958fa473 stage: Keep a pointer to the backend
Will be used later.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
c23b675daf cursor-tracker: Keep a pointer to the backend
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
59a2fc4f5a cursor-tracker: Move struct fields into instance private
This is so that we can make the cursor tracker type derivable.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Jonas Ådahl
4a125e73a2 cursor-tracker: Move struct definition into .c file
Not used externally, and if so should use API.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1391
2020-08-05 11:11:38 +02:00
Daniel van Vugt
2de69cd3cc clutter-offscreen-effect: Invalidate cache on gl-video-memory-purged
This fixes graphics corruption that could occur on resume from suspend
with the Nvidia driver.

https://www.khronos.org/registry/OpenGL/extensions/NV/NV_robustness_video_memory_purge.txt

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1374
2020-08-05 08:26:37 +00:00
Daniel van Vugt
305fcd0713 clutter-stage: Add gl-video-memory-purged signal
For when you want parts of Clutter to connect to the signal, without
referencing Meta classes.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1374
2020-08-05 08:26:37 +00:00
Philipp Zabel
7564c2f2e4 kms: Skip displays with 'non-desktop' property set
Detect displays marked as 'non-desktop' by the kernel and skip them when
creating the outputs. Mutter is not able to render images that are shown
properly on those devices anyway.

This avoids lighting up attached VR HMDs and showing the GDM login
screen between the eyes in a VR HMD instead of on the monitor.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1393
2020-08-05 06:09:36 +00:00
Florian Müllner
769997b0bc ci: Explicitly specify job dependencies
We can speed up CI a bit by allowing build jobs to run in parallel
with review jobs, and don't have test jobs wait for non-default
build configuration builds.

See https://gitlab.gnome.org/help/ci/yaml/README.md#needs for details.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1398
2020-08-04 18:00:04 +02:00
Jonas Ådahl
5ea0034943 renderer/native: Remove left-over comment
Since the frame clock split it's no longer valid, so remove it.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1397
2020-08-04 15:20:54 +02:00
Daniel van Vugt
4c513e3e19 backends/native: Remove unused meta_gpu_kms_wait_for_flip and more
Remove unused function `meta_gpu_kms_wait_for_flip` and other code which
only existed to support `meta_gpu_kms_wait_for_flip`.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1388
2020-08-04 08:57:06 +00:00
Daniel van Vugt
f3ad63e206 Remove unused flag COGL_WINSYS_FEATURE_SWAP_THROTTLE
This also removes an old comment about `wait_for_pending_flips` which
no longer exists.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1390
2020-08-04 08:43:57 +00:00
Daniel van Vugt
593e610415 clutter: Remove unused flag CLUTTER_FEATURE_SWAP_THROTTLE
It's been unused ever since e415cc538a.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1390
2020-08-04 08:43:57 +00:00
Sergio Costas
f894f5cc13 wayland: Add API to launch trusted clients
Allowing code from inside mutter to create a child process and
delegate on it some of its tasks is something very useful. This can
be done easily with the g_subprocess and g_subprocess_launcher classes
already available in GLib and GObject.

Unfortunately, although the child process can be a graphical program,
currently it is not possible for the inner code to identify the
windows created by the child in a secure manner (this is: being able
to ensure that a malicious program won't be able to trick the inner
code into thinking it is a child process launched by it).

Under X11 this is not a problem because any program has full control
over their windows, but under Wayland it is a different story: a
program can't neither force their window to be kept at the top (like a
docker program does) or at the bottom (like a program for desktop icons
does), nor hide it from the list of windows. This means that it is not
possible for a "classic", non-priviledged program, to fulfill these
tasks, and it can be done only from code inside mutter (like a
gnome-shell extension).

This is a non desirable situation, because an extension runs in the
same main loop than the whole desktop itself, which means that a
complex extension can need to do too much work inside the main loop,
and freeze the whole desktop for too much time. Also, it is important
to note that javascript doesn't have access to fork(), or threads,
which means that, at most, all the parallel computing that can do is
those available in the _async calls in GLib/GObject.

Also, having to create an extension for any priviledged graphical
element is an stopper for a lot of programmers who already know
GTK+ but doesn't know Clutter.

This patch wants to offer a solution to this problem, by offering a
new class that allows to launch a trusted child process from inside
mutter, and make it to use an specific UNIX socket to communicate
with the compositor. It also allows to check whether an specific
MetaWindow was created by one of this trusted child processes or not.

This allows to create extensions that launch a child process, and
when that process creates a window, the extension can confirm in a
secure way that the window really belongs to that process
launched by it, so it can give to that window "superpowers" like
being kept at the bottom of the desktop, not being listed in the
list of windows or shown in the Activities panel... Also, in future
versions, it could easily implement protocol extensions that only
could be used by these trusted child processes.

Several examples of the usefulness of this are that, with it, it
is possible to write programs that implements:

- desktop icons
- a dock
- a top or bottom bar
...

all in a secure manner, avoiding insecure programs to do the same.
In fact, even if the same code is launched manually, it won't have
those privileges, only the specific process launched from inside
mutter.

Since this is only needed under Wayland, it won't work under X11.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/741
2020-08-04 08:42:29 +00:00
Olivier Fourdan
17417a82a5 cleanup: remove controversial naming
Replace "whitelist" and "blacklist" with "allow_list" and "deny_list"
which better represent the purpose of those variables.

There is no functional change.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1396
2020-08-04 10:04:16 +02:00
Jordi Mas
5ed97f3a02 Update Catalan translation 2020-08-02 12:24:58 +02:00
Jonas Ådahl
34579d71cc remote-access-handle: Add 'is-recording' property
Will be TRUE if it is a screen cast session where all streams have the
'is-recording' set to TRUE. For other screen casts or remote desktop
sessions, it'll be FALSE.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1377
2020-07-31 10:41:38 +02:00
Jonas Ådahl
153357cd36 screen-cast: Add 'is-recording' option to record methods
This can be used by the Shell to change the UI to be the same as the
current built in screen recording.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1377
2020-07-31 10:41:15 +02:00
Jonas Ådahl
14cd78a016 screen-cast: Add screen cast flag to streams
Intended to be used to pass state from screen cast clients down the
line. The first use case will be a boolean whether a screen cast is a
plain recording or not, e.g. letting the Shell decide whether to use a
red dot as the icon, or the generic "sharing" symbol.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1377
2020-07-30 09:51:16 +02:00
Daniel García Moreno
109fbdbac9 clutter/actor: Add get_transformed_extents
The clutter_actor_get_transformed_position returns the position of the
top left point of the actor, with the actor transformations. That means
that if the actor is rotated 180º it'll return the "screen" position top
right.

Using this to calculate if the actor is in the screen is causing
problems when it's transformted.

This patch adds a new function clutter_actor_get_transformed_extents,
that will return the transformed actor bounding rect.

This new function is used on the update_stage_views so the actor will
get updated. this way rotated actors will be updated if they are on the
screen.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1386
2020-07-29 11:12:26 +02:00
Christian Hergert
2c08eb6d16 build: bump ABI to sysprof-capture-4
GLib will now be linking against sysprof-capture-4.a. To support that,
sysprof had to remove the GLib dependency from sysprof-capture-4 which
had the side-effect of breaking ABi.

This bumps the dependency and includes a fallback to compile just the
libsysprof-capture-4.a using a subproject wrap.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1352
2020-07-28 11:13:30 -07:00
Olivier Fourdan
ca64a308eb surface-actor: Restore drop shadow with server-side decorations
Commit 510cbef15a changed the logic in `handle_update()` for X11 window
actors to return early if the surface is not an X11 surface.

That works fine for plain Xorg, but on Xwayland, the surface is actually
a Wayland surface, therefore the function returns early before updating
the drop shadows of server-side decorations for X11 windows.

Change the test logic to restore drops shadows with Xwayland windows.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1384
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1358
2020-07-28 13:21:23 +00:00
Olivier Fourdan
d0ee02fae7 cleanup: Remove duplicate semicolons in C code
No functional change, it just hurts my eyes when reading the code.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1385
2020-07-28 10:32:46 +02:00
Sebastian Keller
c7d14244b1 x11: Add STRING/UTF8_STRING targets for selection sources lacking them
The memory selection source was only providing the "text/plain" or the
"text/plain;charset=utf-8" mimetype, but not "STRING" or "UTF8_STRING",
which some X11 clients, like wine, are looking for. This was breaking
pasting from the clipboard in wine applications.

Fix this by adding those targets when they are missing and the selection
source provides the corresponding mimetypes.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1369
2020-07-27 08:34:40 +00:00
Sebastian Keller
e1c4e55880 x11: Handle selection windows being destroyed before new selection
Wine destroys its old selection window immediately before creating a new
selection. This would trigger restoring the clipboard, which would
overwrite the new selection with the old one. The selection window
however can also be destroyed as part of the shutdown process of
applications, such as Chromium for example. In those cases we want the
clipboard to be restored after the selection window has been destroyed.

Solve this by not immediately restoring the clipboard but instead using
a timeout which can be canceled by any new selection owner, such as in
the Wine case.

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1338
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1369
2020-07-27 08:34:40 +00:00
Martin Whitaker
7b79fcee45 Fix segfaults on 32-bit systems.
The new "id" properties for the MetaCrtc* and MetaOuput* objects are 64-bit
values, so take care to pass 64-bit values when calling g_object_new.

Fixes https://gitlab.gnome.org/GNOME/mutter/-/issues/1343.
2020-07-24 11:24:08 +00:00
Carlos Garnacho
ac6990ef51 build: Depend on an up-to-date gsettings-desktop-schemas
Update the dependency as we use newer settings there.

Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3004

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1376
2020-07-21 12:54:42 +02:00
Erik Kurzinger
0aa4bab539 kms: Use custom page flip function when retrying failed flips
When using its EGLStream-based presentation path with the proprietary NVIDIA
driver, mutter will use a different function to process page flips -
custom_egl_stream_page_flip.  If that fails due to an EBUSY error, it will
attempt to retry the flip.  However, when retrying, it unconditionally uses the
libdrm-based path. In practice, this causes a segfault when attempting to
access plane_assignments->fb_id, since plane_assignments will be NULL in the
EGLStream case.  The issue can be reproduced reliably by VT-switching away from
GNOME and back again while an EGL application is running.

This patch has mutter also use the custom page flip function when retrying the
failed flip.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1375
2020-07-19 12:50:37 -07:00
Rafael Fontenelle
224db78409 Update Brazilian Portuguese translation
(cherry picked from commit ef3dac7064)
2020-07-17 21:36:43 +00:00
Daniel van Vugt
7658e07beb Include the pkgconfig-specified gdesktop-enums.h
Instead of blindly hoping that `$INCLUDE` contains the parent directory
of `gsettings-desktop-schemas`.

Because `gsettings-desktop-schemas.pc` says:
```
Cflags: -I/SOME/DIRECTORY/gsettings-desktop-schemas
```
Which means to include the version that Meson has configured you need
to drop the directory prefix and only `#include <gdesktop-enums.h>`.

This fixes a build failure with local installs triggered by 775ec67a44
but it's also the right thing to do™.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1370
2020-07-13 17:30:20 +08:00
Fabio Tomat
1faba58ccc Update Friulian translation 2020-07-12 16:35:03 +00:00
Giusy Margarita
775ec67a44 Add tap-button-map and tap-and-drag-lock support to X11 and Wayland
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1319
2020-07-10 13:31:46 +00:00
Jonas Ådahl
d67ba3ea65 screen-cast/src: Remove follow up timeout source on disable
We failed to remove the timeout source when disabling, meaning that if a
follow up was scheduled, and shortly after we disabled the source, the
timeout would be invoked after the source was freed causing
use-after-free bugs.

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1337

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1365
2020-07-10 09:08:59 +02:00
Jonas Ådahl
50634d450e screen-cast/src: Use G_USEC_PER_SEC instead of 1000000
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
9bab8e8751 screen-cast/src: Record follow up frame after timeout
During animation or other things that cause multiple frames in a row
being painted, we might skip recording frames if the max framerate is
reached.

Doing so means we might end up skipping the last frame in a series,
ending with the last frame we sent was not the last one, making things
appear to get stuck sometimes.

Handle this by creating a timeout if we ever throttle, and at the time
the timeout callback is triggered, make sure we eventually send an up to
date frame.

This is handle differently depending on the source type. A monitor
source type reports 1x1 pixel damage on each view its monitor overlaps,
while a window source type simply records a frame from the surface
directly, except without recording a timestamp, so that timestamps
always refer to when damage actually happened.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
7adc24d3a6 screen-cast/src: Fix signedness of timestamp field
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
047da80c3b screen-cast/src: Make record functions return an error when failing
Now that we don't use the record function to early out depending on
implicit state (don't record pixels if only cursor moved for example),
let it simply report an error when it fails, as we should no longer ever
return without pixels if nothing failed.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
882967d3ce screen-cast: Let the reason for recording determine what to record
E.g. we'll have pointer movement that, if no painting is already
scheduled, should only send new cursor metadata without any new pixel
buffer. When this happens, tell next step to not record the pixels if
this was the case, instead of having it rediscover this itself.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1323
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
cea0722e72 screen-cast/src: Add flag to maybe_record()
Will later be used to make recording avoid recording actual pixel
content if e.g. only the cursor moved.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:23 +02:00
Jonas Ådahl
03823128c4 screen-cast/window-stream-src: Fix indentation
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:22 +02:00
Jonas Ådahl
7b35ed8c35 screen-cast-src: Make the two record vfuncs more similarly named
Both do more or less the same but with different methods - one puts
pixels into a buffer using the CPU, the other puts pixels into a buffer
using the GPU.

However, they are behaving slightly different, which they shouldn't.
Lets first address the misleading disconnect in naming, and later we'll
make them behave more similarly.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1361
2020-07-08 21:42:22 +02:00
Daniel van Vugt
ecaaccb064 background: Use NEAREST filtering when the texture is the monitor resolution
That was obviously always the intention, but it didn't work when the
display was scaled. My 3840x2160 monitor with a 3840x2160 texture was
being rendered with LINEAR filtering.

It seems the `force_bilinear` flag was TRUE when it should be FALSE.
Because a texture area that's an integer fraction of the texture
resolution is still a perfect match when that integer is the monitor
scale. We were also getting:

`meta_actor_painting_untransformed (fb, W, H, W, H, NULL, NULL) == FALSE`

when the display was scaled. Because the second W,H was not the real
sampling resolution. So with both of those issues fixed we now get
NEAREST filtering when the texture resolution matches the resolution it's
physically being rendered at.

Note: The background texture actually wasn't equal to the physical monitor
resolution prior to January 2020 (76240e24f7). So it wasn't possible to do
this before then. Since then however, the texture resolution is always
equal to the physical monitor resolution.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1346
2020-07-08 07:26:50 +00:00
Florian Müllner
30d9d1968c Bump version to 3.37.3
Update NEWS.
2020-07-07 19:24:32 +02:00
Florian Müllner
65aa476414 tests/stage-view: Keep old stage views alive on hotplug
Otherwise we cannot reliably compare them to the new post-hotplug
views.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1357
2020-07-07 17:07:20 +00:00
Jonas Dreßler
03d177cf64 clutter/actor: Add position argument to allocate_preferred_size()
Make clutter_actor_allocate_preferred_size() convenient to use from
layout managers by not "automatically" honouring the fixed position of
the actor, but instead allowing to pass a position to allocate the
actor at.

This way we can move the handling of fixed positions to
ClutterFixedLayout, the layout manager which is responsible for
allocating actors using fixed positions.

This also makes clutter_actor_allocate_preferred_size() more similar to
clutter_actor_allocate_available_size().

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1310
2020-07-07 16:47:00 +00:00
Jonas Dreßler
dfa235aa5d clutter/actor: Add API to get fixed position
It's currently a bit hard to get the fixed position of an actor. It can
be either done by using g_object_get() with the "fixed-x"/"fixed-y"
properties or by calling clutter_actor_get_position().

Calling clutter_actor_get_position() can return the fixed position, but
it might also return the allocated position if the allocation is valid.
The latter is not the best behavior when querying the fixed position
during an allocation, so introduce a new function
clutter_actor_get_fixed_position() which always gets the fixed position
and returns FALSE in case no fixed position is set.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1310
2020-07-07 16:47:00 +00:00
Robert Mader
d722e59aac window-actor/wayland: Remove custom get_paint_volume() vfunc
It doesn't take all children - subsurfaces in this case - into
account, thus creating glitches if subsurfaces extend outside
of the toplevel surface.

Further more it doesn't seem to serve any special purpose - it was
added in f7315c9a36, a pretty big commit, and no discussion was
started about the code in question. So it was likely just overlooked
in the review process.

Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/873
Closes https://gitlab.gnome.org/GNOME/mutter/-/issues/1316
2020-07-07 12:25:43 +00:00
Daniel van Vugt
32dbcd9352 background-content: Mipmap background texture rendering
gnome-shell displays workspace previews at one tenth scale. That's a
few binary orders of magnitude so even using a LINEAR filter was
resulting in visible jaggies. Now we apply mipmapping so they appear
smooth.

As an added bonus, the mipmaps used occupy roughly 1% the memory of
the original image (0.1 x 0.1 = 0.01) so they actually fit into GPU/CPU
caches now and rendering performance is improved. There's no need to
traverse the original texture which at 4K resolution occupies 33MB,
only a 331KB mipmap.

In my case this reduces the render time for the overview by ~10%.

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

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1347
2020-07-07 16:15:28 +08:00
Daniel van Vugt
3a474556b8 cogl-texture-2d: Flush the journal before mipmapping
In the case of indirect rendering like the first frame to use mutter's
background wallpaper:

  Texture_A -> FBO_B (Texture_B) -> FBO_C (screen)

we would be trying to render the contents of both FBO_B and FBO_C in
the same flush, before the contents of Texture_A had made it to FBO_B.
So when FBO_C wants to use mipmaps of Texture_B they didn't exist yet
and appeared all black. And the blackness would remain for subsequent
frames as cogl has now decided the mipmaps of FBO_B are no longer
"dirty" and don't need refreshing:

  FBO_B (Texture_B) (mipmaps_dirty==FALSE but black) -> FBO_C (screen)

We must flush FBO_B before referencing Texture_B for use in rendering
FBO_C. This only happens when Texture_A changes (e.g. when the user
changes their background wallpaper) so there's no ongoing performance
penalty from this flush.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1347
2020-07-07 16:15:24 +08:00
Jonas Dreßler
249274c677 clutter/actor: Pass stage as user_data when unrealizing
We can avoid having to get the stage again for every child of the
subtree we're unrealizing by getting the stage once and passing it as
user_data to the callbacks.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1356
2020-07-06 19:51:35 +00:00
Jonas Dreßler
ae83a61e67 clutter/actor: Remove actors from shallow relayout list when unrealizing
With the introduction of the shallow relayout mechanism another small
but severe regression sneaked into our layout machinery: We might
allocate an actor twice during the same allocation cycle, with one
allocation happening using the wrong parent.

This issue happens when reparenting an actor from a NO_LAYOUT parent to
a non-NO_LAYOUT parent, in particular it triggered a bug in gnome-shell
when DND reparents a child from the NO_LAYOUT uiGroup to the overviews
Workspace actor after a drag ended. The reason the issue happens is the
following chain of events:

1. child of a NO_LAYOUT parent queues a relayout, this child is added to
the priv->pending_relayouts list maintained by ClutterStage

2. child is reparented to a different parent which doesn't have the
NO_LAYOUT flag set, another relayout is queued, this time a different
actor is added to the priv->pending_relayouts list

3. the relayout happens and we go through the pending_relayouts list
backwards, that means the correct relayout queued during 2. happens
first, then the old one happens and we simply call
clutter_actor_allocate_preferred_size() on the actor, that allocation
overrides the other, correct one.

So fix that issue by adding a method to ClutterStage which removes
actors from the pending_relayouts list again and call this method as
soon as an actor with a NO_LAYOUT parent is detached from the stage.

With that in place, we can also remove the check whether an actor is
still on stage while looping through pending_relayouts. In case
something else is going wrong and the actor is not on stage,
clutter_actor_allocate() will warn anyway.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1356
2020-07-06 19:51:35 +00:00
Andre Klapper
826573ccce Fix broken markup in Hausa UI translation 2020-07-06 19:32:08 +02:00
241 changed files with 4460 additions and 2448 deletions

1
.gitignore vendored
View File

@@ -103,3 +103,4 @@ doc/reference/meta.types
.dirstamp .dirstamp
**/tags.* **/tags.*
build/ build/
subprojects/sysprof/

View File

@@ -17,6 +17,7 @@ check-commit-log:
build-mutter: build-mutter:
stage: build stage: build
needs: []
script: script:
- meson . build -Dbuildtype=debugoptimized -Db_coverage=true -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr - meson . build -Dbuildtype=debugoptimized -Db_coverage=true -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
- ninja -C build - ninja -C build
@@ -31,6 +32,7 @@ build-mutter:
build-without-opengl-and-glx: build-without-opengl-and-glx:
stage: build stage: build
needs: []
script: script:
- meson . build -Dbuildtype=debugoptimized -Dopengl=false -Dglx=false -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr - meson . build -Dbuildtype=debugoptimized -Dopengl=false -Dglx=false -Degl_device=true -Dwayland_eglstream=true --werror --prefix /usr
- ninja -C build - ninja -C build
@@ -44,6 +46,7 @@ build-without-opengl-and-glx:
build-without-native-backend-and-wayland: build-without-native-backend-and-wayland:
stage: build stage: build
needs: []
script: script:
- meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr - meson . build -Dbuildtype=debugoptimized -Dnative_backend=false -Dudev=false -Dwayland=false -Dcore_tests=false --werror --prefix /usr
- ninja -C build - ninja -C build
@@ -59,6 +62,7 @@ test-mutter:
stage: test stage: test
dependencies: dependencies:
- build-mutter - build-mutter
needs: ["build-mutter"]
variables: variables:
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir" XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data" GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
@@ -84,6 +88,7 @@ test-mutter-coverage:
stage: coverage stage: coverage
dependencies: dependencies:
- test-mutter - test-mutter
needs: ["test-mutter"]
script: script:
- ninja -C build coverage - ninja -C build coverage
- cat build/meson-logs/coverage.txt - cat build/meson-logs/coverage.txt
@@ -100,6 +105,7 @@ can-build-gnome-shell:
stage: test stage: test
dependencies: dependencies:
- build-mutter - build-mutter
needs: ["build-mutter"]
before_script: before_script:
- meson install --no-rebuild -C build - meson install --no-rebuild -C build
script: script:

View File

@@ -17,6 +17,7 @@ RUN dnf -y update && dnf -y upgrade && \
# For running unit tests # For running unit tests
dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 \ dnf install -y xorg-x11-server-Xvfb mesa-dri-drivers dbus dbus-x11 \
'*/xvfb-run' gdm-lib accountsservice-libs gnome-control-center gcovr \ '*/xvfb-run' gdm-lib accountsservice-libs gnome-control-center gcovr \
libnma python3-gobject python3-dbusmock \
--setopt=install_weak_deps=False && \ --setopt=install_weak_deps=False && \
# GNOME Shell # GNOME Shell

54
NEWS
View File

@@ -1,3 +1,57 @@
3.37.90
=======
* Fix using NEAREST filter for backgrounds on scaled monitors [Daniel V.; !1346]
* Screencast fixes and improvements [Jonas; !1361, !1377, !1391]
* Support tap-button-map and tap-drag-lock touchpad settings [Giusy; !1319]
* Fix wine copy & paste [Sebastian; !1369]
* Fix shadows of server-side decorated XWayland windows [Olivier; #1358]
* Replace some loaded terms with more descriptive ones [Olivier; !1396]
* Add API to launch trusted wayland clients [Sergio; #741]
* Skip displays with 'non-desktop' property set [Philipp; !1393]
* Invalidate offscreen effect cache on video memory purge [Daniel V.; !1374]
* Add wl_shm support for 10 bpc and 16 bpc half float formats [Jonas; !804]
* Fixed crashes [Jonas, Erik, Martin; !1365, !1375, #1343]
* Misc. bug fixes and cleanups [Daniel V., Carlos, Olivier, Christian,
Daniel * G., Jonas, Florian; !1370, !1376, !1385, !1352, !1386, !1390,
!1388, !1397, !1398, !1401]
Contributors:
Jonas Ådahl, Sergio Costas, Olivier Fourdan, Carlos Garnacho,
Christian Hergert, Sebastian Keller, Erik Kurzinger, Giusy Margarita,
Daniel García Moreno, Florian Müllner, Daniel van Vugt, Martin Whitaker,
Philipp Zabel
Translators:
Fabio Tomat [fur], Rafael Fontenelle [pt_BR], Jordi Mas [ca],
Yuri Chornoivan [uk], Alexandre Franke [fr]
3.37.3
======
* Support custom keyboard layouts in $XDG_CONFIG_HOME/xkb [Peter; !936]
* Optimize resource scale computation [Jonas D.; !1196, !1276, !1343]
* Allow animating ClutterActor's content property [Georges; !1301]
* Implement backgrounds as ClutterContent [Georges; !1302]
* Add ClutterAlignContraint:pivot-point property [Jonas D.; !737]
* Fix crash on area screenshots with fractional scaling [Sebastian; !1320]
* Do not paint textures of fully obscured windows [Robert; !1326]
* Use a more appropriate combine function on opaque areas [Daniel; !1331]
* Fix remote desktop being broken without screencast session [Olivier; #1307]
* Remove more long-deprecated Clutter APIs [Adam, Georges; !1194, !1332]
* Drive each monitor by its own frame clock [Jonas Å.; !1285]
* Fix copy/paste failures on X11 [Carlos; !1350]
* Mipmap background texture rendering [Daniel; !1347]
* Plugged memory leaks [Sebastian, Jonas D.; !1293, !1281, !1304]
* Misc. bug fixes and cleanups [Jonas Å., Jonas D., Daniel, Corentin, Carlos,
Sebastian, Michel, Robert, Florian; !1288, !1289, !1291, !1296, !1292, !1298,
!1300, !1303, !1290, !1287, !1306, !1305, !1308, !1313, !1250, !1314, !1267,
!1275, !1317, !1270, !1322, !1181, !1282, !1325, !1323, !1240, !1295, !1329,
!1333, !1334, !1336, !1341, #1312, !1345, !1349, !1356, #873, !1310, !1357]
Contributors:
Jonas Dreßler, Michel Dänzer, Olivier Fourdan, Carlos Garnacho,
Peter Hutterer, Adam Jackson, Sebastian Keller, Robert Mader, Florian Müllner,
Georges Basile Stavracas Neto, Corentin Noël, Daniel van Vugt, Jonas Ådahl
3.37.2 3.37.2
====== ======
* Fix move-to-center keybinding with multiple monitors [Sergey; #1073] * Fix move-to-center keybinding with multiple monitors [Sergey; #1073]

View File

@@ -1093,11 +1093,11 @@ static GQuark quark_scroll = 0;
static GQuark quark_stage = 0; static GQuark quark_stage = 0;
static GQuark quark_destroy = 0; static GQuark quark_destroy = 0;
static GQuark quark_client = 0; static GQuark quark_client = 0;
static GQuark quark_delete = 0;
static GQuark quark_touch = 0; static GQuark quark_touch = 0;
static GQuark quark_touchpad = 0; static GQuark quark_touchpad = 0;
static GQuark quark_proximity = 0; static GQuark quark_proximity = 0;
static GQuark quark_pad = 0; static GQuark quark_pad = 0;
static GQuark quark_im = 0;
G_DEFINE_TYPE_WITH_CODE (ClutterActor, G_DEFINE_TYPE_WITH_CODE (ClutterActor,
clutter_actor, clutter_actor,
@@ -2201,11 +2201,19 @@ unrealize_actor_after_children_cb (ClutterActor *self,
int depth, int depth,
void *user_data) void *user_data)
{ {
ClutterActor *stage = user_data;
/* We want to unset the realized flag only _after_ /* We want to unset the realized flag only _after_
* child actors are unrealized, to maintain invariants. * child actors are unrealized, to maintain invariants.
*/ */
CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_REALIZED); CLUTTER_ACTOR_UNSET_FLAGS (self, CLUTTER_ACTOR_REALIZED);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_REALIZED]); g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_REALIZED]);
if (stage != NULL &&
self->priv->parent != NULL &&
self->priv->parent->flags & CLUTTER_ACTOR_NO_LAYOUT)
clutter_stage_dequeue_actor_relayout (CLUTTER_STAGE (stage), self);
return CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE; return CLUTTER_ACTOR_TRAVERSE_VISIT_CONTINUE;
} }
@@ -2236,11 +2244,13 @@ unrealize_actor_after_children_cb (ClutterActor *self,
static void static void
clutter_actor_unrealize_not_hiding (ClutterActor *self) clutter_actor_unrealize_not_hiding (ClutterActor *self)
{ {
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
_clutter_actor_traverse (self, _clutter_actor_traverse (self,
CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST, CLUTTER_ACTOR_TRAVERSE_DEPTH_FIRST,
unrealize_actor_before_children_cb, unrealize_actor_before_children_cb,
unrealize_actor_after_children_cb, unrealize_actor_after_children_cb,
NULL); stage);
} }
/* /*
@@ -5993,11 +6003,11 @@ clutter_actor_class_init (ClutterActorClass *klass)
quark_stage = g_quark_from_static_string ("stage"); quark_stage = g_quark_from_static_string ("stage");
quark_destroy = g_quark_from_static_string ("destroy"); quark_destroy = g_quark_from_static_string ("destroy");
quark_client = g_quark_from_static_string ("client"); quark_client = g_quark_from_static_string ("client");
quark_delete = g_quark_from_static_string ("delete");
quark_touch = g_quark_from_static_string ("touch"); quark_touch = g_quark_from_static_string ("touch");
quark_touchpad = g_quark_from_static_string ("touchpad"); quark_touchpad = g_quark_from_static_string ("touchpad");
quark_proximity = g_quark_from_static_string ("proximity"); quark_proximity = g_quark_from_static_string ("proximity");
quark_pad = g_quark_from_static_string ("pad"); quark_pad = g_quark_from_static_string ("pad");
quark_im = g_quark_from_static_string ("im");
object_class->constructor = clutter_actor_constructor; object_class->constructor = clutter_actor_constructor;
object_class->set_property = clutter_actor_set_property; object_class->set_property = clutter_actor_set_property;
@@ -10248,6 +10258,75 @@ clutter_actor_get_position (ClutterActor *self,
*y = clutter_actor_get_y (self); *y = clutter_actor_get_y (self);
} }
/**
* clutter_actor_get_fixed_position:
* @self: a #ClutterActor
* @x: (out) (allow-none): return location for the X coordinate, or %NULL
* @y: (out) (allow-none): return location for the Y coordinate, or %NULL
*
* This function gets the fixed position of the actor, if set. If there
* is no fixed position set, this function returns %FALSE and doesn't set
* the x and y coordinates.
*
* Returns: %TRUE if the fixed position is set, %FALSE if it isn't
*/
gboolean
clutter_actor_get_fixed_position (ClutterActor *self,
float *x,
float *y)
{
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
if (self->priv->position_set)
{
const ClutterLayoutInfo *info;
info = _clutter_actor_get_layout_info_or_defaults (self);
if (x)
*x = info->fixed_pos.x;
if (y)
*y = info->fixed_pos.y;
return TRUE;
}
return FALSE;
}
/**
* clutter_actor_get_transformed_extents:
* @self: A #ClutterActor
* @rect: (out): return location for the transformed bounding rect
*
* Gets the transformed bounding rect of an actor, in pixels relative to the stage.
*/
void
clutter_actor_get_transformed_extents (ClutterActor *self,
graphene_rect_t *rect)
{
graphene_quad_t quad;
graphene_point3d_t v[4];
ClutterActorBox box;
box.x1 = 0;
box.y1 = 0;
box.x2 = clutter_actor_box_get_width (&self->priv->allocation);
box.y2 = clutter_actor_box_get_height (&self->priv->allocation);
if (_clutter_actor_transform_and_project_box (self, &box, v))
{
graphene_quad_init (&quad,
(graphene_point_t *) &v[0],
(graphene_point_t *) &v[1],
(graphene_point_t *) &v[2],
(graphene_point_t *) &v[3]);
if (rect)
graphene_quad_bounds (&quad, rect);
}
}
/** /**
* clutter_actor_get_transformed_position: * clutter_actor_get_transformed_position:
* @self: A #ClutterActor * @self: A #ClutterActor
@@ -12626,10 +12705,6 @@ clutter_actor_event (ClutterActor *actor,
signal_num = -1; signal_num = -1;
detail = quark_pad; detail = quark_pad;
break; break;
case CLUTTER_DELETE:
signal_num = -1;
detail = quark_delete;
break;
case CLUTTER_DESTROY_NOTIFY: case CLUTTER_DESTROY_NOTIFY:
signal_num = -1; signal_num = -1;
detail = quark_destroy; detail = quark_destroy;
@@ -12642,6 +12717,12 @@ clutter_actor_event (ClutterActor *actor,
signal_num = -1; signal_num = -1;
detail = quark_stage; detail = quark_stage;
break; break;
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_DELETE:
case CLUTTER_IM_PREEDIT:
signal_num = -1;
detail = quark_im;
break;
case CLUTTER_EVENT_LAST: /* Just keep compiler warnings quiet */ case CLUTTER_EVENT_LAST: /* Just keep compiler warnings quiet */
break; break;
} }
@@ -13987,6 +14068,8 @@ clutter_actor_allocate_available_size (ClutterActor *self,
/** /**
* clutter_actor_allocate_preferred_size: * clutter_actor_allocate_preferred_size:
* @self: a #ClutterActor * @self: a #ClutterActor
* @x: the actor's X coordinate
* @y: the actor's Y coordinate
* *
* Allocates the natural size of @self. * Allocates the natural size of @self.
* *
@@ -14004,37 +14087,22 @@ clutter_actor_allocate_available_size (ClutterActor *self,
* Since: 0.8 * Since: 0.8
*/ */
void void
clutter_actor_allocate_preferred_size (ClutterActor *self) clutter_actor_allocate_preferred_size (ClutterActor *self,
float x,
float y)
{ {
gfloat actor_x, actor_y;
gfloat natural_width, natural_height; gfloat natural_width, natural_height;
ClutterActorBox actor_box; ClutterActorBox actor_box;
ClutterActorPrivate *priv;
const ClutterLayoutInfo *info;
g_return_if_fail (CLUTTER_IS_ACTOR (self)); g_return_if_fail (CLUTTER_IS_ACTOR (self));
priv = self->priv;
if (priv->position_set)
{
info = _clutter_actor_get_layout_info_or_defaults (self);
actor_x = info->fixed_pos.x;
actor_y = info->fixed_pos.y;
}
else
{
actor_x = 0;
actor_y = 0;
}
clutter_actor_get_preferred_size (self, clutter_actor_get_preferred_size (self,
NULL, NULL, NULL, NULL,
&natural_width, &natural_width,
&natural_height); &natural_height);
actor_box.x1 = actor_x; actor_box.x1 = x;
actor_box.y1 = actor_y; actor_box.y1 = y;
actor_box.x2 = actor_box.x1 + natural_width; actor_box.x2 = actor_box.x1 + natural_width;
actor_box.y2 = actor_box.y1 + natural_height; actor_box.y2 = actor_box.y1 + natural_height;
@@ -16149,12 +16217,7 @@ update_stage_views (ClutterActor *self)
stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self)); stage = CLUTTER_STAGE (_clutter_actor_get_stage_internal (self));
g_return_if_fail (stage); g_return_if_fail (stage);
clutter_actor_get_transformed_position (self, clutter_actor_get_transformed_extents (self, &bounding_rect);
&bounding_rect.origin.x,
&bounding_rect.origin.y);
clutter_actor_get_transformed_size (self,
&bounding_rect.size.width,
&bounding_rect.size.height);
if (bounding_rect.size.width == 0.0 || if (bounding_rect.size.width == 0.0 ||
bounding_rect.size.height == 0.0) bounding_rect.size.height == 0.0)
@@ -16293,15 +16356,19 @@ clutter_actor_is_effectively_on_stage_view (ClutterActor *self,
} }
/** /**
* clutter_actor_pick_frame_clock: * clutter_actor_pick_frame_clock: (skip)
* @self: a #ClutterActor * @self: a #ClutterActor
* @out_actor: (nullable): a pointer to an #ClutterActor
* *
* Pick the most suitable frame clock for driving animations for this actor. * Pick the most suitable frame clock for driving animations for this actor.
* *
* The #ClutterActor used for picking the frame clock is written @out_actor.
*
* Returns: (transfer none): a #ClutterFrameClock * Returns: (transfer none): a #ClutterFrameClock
*/ */
ClutterFrameClock * ClutterFrameClock *
clutter_actor_pick_frame_clock (ClutterActor *self) clutter_actor_pick_frame_clock (ClutterActor *self,
ClutterActor **out_actor)
{ {
ClutterActorPrivate *priv = self->priv; ClutterActorPrivate *priv = self->priv;
float max_refresh_rate = 0.0; float max_refresh_rate = 0.0;
@@ -16311,7 +16378,7 @@ clutter_actor_pick_frame_clock (ClutterActor *self)
if (!priv->stage_views) if (!priv->stage_views)
{ {
if (priv->parent) if (priv->parent)
return clutter_actor_pick_frame_clock (priv->parent); return clutter_actor_pick_frame_clock (priv->parent, out_actor);
else else
return NULL; return NULL;
} }
@@ -16330,9 +16397,15 @@ clutter_actor_pick_frame_clock (ClutterActor *self)
} }
if (best_view) if (best_view)
return clutter_stage_view_get_frame_clock (best_view); {
if (out_actor)
*out_actor = self;
return clutter_stage_view_get_frame_clock (best_view);
}
else else
return NULL; {
return NULL;
}
} }
/** /**

View File

@@ -419,7 +419,9 @@ CLUTTER_EXPORT
void clutter_actor_allocate (ClutterActor *self, void clutter_actor_allocate (ClutterActor *self,
const ClutterActorBox *box); const ClutterActorBox *box);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_actor_allocate_preferred_size (ClutterActor *self); void clutter_actor_allocate_preferred_size (ClutterActor *self,
float x,
float y);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_actor_allocate_available_size (ClutterActor *self, void clutter_actor_allocate_available_size (ClutterActor *self,
gfloat x, gfloat x,
@@ -454,6 +456,10 @@ void clutter_actor_set_position
gfloat x, gfloat x,
gfloat y); gfloat y);
CLUTTER_EXPORT CLUTTER_EXPORT
gboolean clutter_actor_get_fixed_position (ClutterActor *self,
float *x,
float *y);
CLUTTER_EXPORT
void clutter_actor_get_position (ClutterActor *self, void clutter_actor_get_position (ClutterActor *self,
gfloat *x, gfloat *x,
gfloat *y); gfloat *y);
@@ -807,6 +813,11 @@ void clutter_actor_set_child_transform
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_actor_get_child_transform (ClutterActor *self, void clutter_actor_get_child_transform (ClutterActor *self,
ClutterMatrix *transform); ClutterMatrix *transform);
CLUTTER_EXPORT
void clutter_actor_get_transformed_extents (ClutterActor *self,
graphene_rect_t *rect);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_actor_get_transformed_position (ClutterActor *self, void clutter_actor_get_transformed_position (ClutterActor *self,
gfloat *x, gfloat *x,
@@ -924,9 +935,6 @@ GList * clutter_actor_peek_stage_views (ClutterActor *self);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_actor_invalidate_transform (ClutterActor *self); void clutter_actor_invalidate_transform (ClutterActor *self);
CLUTTER_EXPORT
ClutterFrameClock * clutter_actor_pick_frame_clock (ClutterActor *self);
G_END_DECLS G_END_DECLS
#endif /* __CLUTTER_ACTOR_H__ */ #endif /* __CLUTTER_ACTOR_H__ */

View File

@@ -93,6 +93,8 @@ struct _ClutterBackendClass
ClutterSeat * (* get_default_seat) (ClutterBackend *backend); ClutterSeat * (* get_default_seat) (ClutterBackend *backend);
gboolean (* is_display_server) (ClutterBackend *backend);
/* signals */ /* signals */
void (* resolution_changed) (ClutterBackend *backend); void (* resolution_changed) (ClutterBackend *backend);
void (* font_changed) (ClutterBackend *backend); void (* font_changed) (ClutterBackend *backend);
@@ -142,6 +144,8 @@ void clutter_backend_set_fallback_resource_scale (ClutterBackend *backend,
float clutter_backend_get_fallback_resource_scale (ClutterBackend *backend); float clutter_backend_get_fallback_resource_scale (ClutterBackend *backend);
gboolean clutter_backend_is_display_server (ClutterBackend *backend);
G_END_DECLS G_END_DECLS
#endif /* __CLUTTER_BACKEND_PRIVATE_H__ */ #endif /* __CLUTTER_BACKEND_PRIVATE_H__ */

View File

@@ -58,13 +58,6 @@
#include <cogl/cogl.h> #include <cogl/cogl.h>
#ifdef CLUTTER_INPUT_X11
#include "x11/clutter-backend-x11.h"
#endif
#ifdef CLUTTER_WINDOWING_EGL
#include "egl/clutter-backend-eglnative.h"
#endif
#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT #ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
#include <cogl/cogl-wayland-server.h> #include <cogl/cogl-wayland-server.h>
#include <wayland-server.h> #include <wayland-server.h>
@@ -422,14 +415,6 @@ clutter_backend_real_get_features (ClutterBackend *backend)
flags |= CLUTTER_FEATURE_STAGE_STATIC; flags |= CLUTTER_FEATURE_STAGE_STATIC;
} }
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_THROTTLE))
{
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers throttling");
flags |= CLUTTER_FEATURE_SWAP_THROTTLE;
}
else
CLUTTER_NOTE (BACKEND, "Cogl doesn't support swap buffers throttling");
if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_BUFFERS_EVENT)) if (cogl_clutter_winsys_has_feature (COGL_WINSYS_FEATURE_SWAP_BUFFERS_EVENT))
{ {
CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers complete events"); CLUTTER_NOTE (BACKEND, "Cogl supports swap buffers complete events");
@@ -439,23 +424,8 @@ clutter_backend_real_get_features (ClutterBackend *backend)
return flags; return flags;
} }
static const char *allowed_backends;
static ClutterBackend * (* custom_backend_func) (void); static ClutterBackend * (* custom_backend_func) (void);
static const struct {
const char *name;
ClutterBackend * (* create_backend) (void);
} available_backends[] = {
#ifdef CLUTTER_WINDOWING_X11
{ CLUTTER_WINDOWING_X11, clutter_backend_x11_new },
#endif
#ifdef CLUTTER_WINDOWING_EGL
{ CLUTTER_WINDOWING_EGL, clutter_backend_egl_native_new },
#endif
{ NULL, NULL },
};
void void
clutter_set_custom_backend_func (ClutterBackend *(* func) (void)) clutter_set_custom_backend_func (ClutterBackend *(* func) (void))
{ {
@@ -465,58 +435,13 @@ clutter_set_custom_backend_func (ClutterBackend *(* func) (void))
ClutterBackend * ClutterBackend *
_clutter_create_backend (void) _clutter_create_backend (void)
{ {
const char *backends_list;
ClutterBackend *retval; ClutterBackend *retval;
gboolean allow_any;
char **backends;
int i;
if (custom_backend_func) g_return_val_if_fail (custom_backend_func, NULL);
{
retval = custom_backend_func ();
if (!retval) retval = custom_backend_func ();
g_error ("Failed to create custom backend."); if (!retval)
g_error ("Failed to create custom backend.");
return retval;
}
if (allowed_backends == NULL)
allowed_backends = "*";
allow_any = strstr (allowed_backends, "*") != NULL;
backends_list = g_getenv ("CLUTTER_BACKEND");
if (backends_list == NULL)
backends_list = allowed_backends;
backends = g_strsplit (backends_list, ",", 0);
retval = NULL;
for (i = 0; retval == NULL && backends[i] != NULL; i++)
{
const char *backend = backends[i];
gboolean is_any = g_str_equal (backend, "*");
int j;
for (j = 0; available_backends[j].name != NULL; j++)
{
if ((is_any && allow_any) ||
(is_any && strstr (allowed_backends, available_backends[j].name)) ||
g_str_equal (backend, available_backends[j].name))
{
retval = available_backends[j].create_backend ();
if (retval != NULL)
break;
}
}
}
g_strfreev (backends);
if (retval == NULL)
g_error ("No default Clutter backend found.");
return retval; return retval;
} }
@@ -1046,3 +971,9 @@ clutter_backend_get_fallback_resource_scale (ClutterBackend *backend)
{ {
return backend->fallback_resource_scale; return backend->fallback_resource_scale;
} }
gboolean
clutter_backend_is_display_server (ClutterBackend *backend)
{
return CLUTTER_BACKEND_GET_CLASS (backend)->is_display_server (backend);
}

View File

@@ -245,7 +245,13 @@ clutter_clone_allocate (ClutterActor *self,
*/ */
if (clutter_actor_get_parent (priv->clone_source) != NULL && if (clutter_actor_get_parent (priv->clone_source) != NULL &&
!clutter_actor_has_allocation (priv->clone_source)) !clutter_actor_has_allocation (priv->clone_source))
clutter_actor_allocate_preferred_size (priv->clone_source); {
float x = 0.f;
float y = 0.f;
clutter_actor_get_fixed_position (priv->clone_source, &x, &y);
clutter_actor_allocate_preferred_size (priv->clone_source, x, y);
}
clutter_actor_get_allocation_box (priv->clone_source, &source_box); clutter_actor_get_allocation_box (priv->clone_source, &source_box);

View File

@@ -857,7 +857,6 @@ typedef enum /*< flags prefix=CLUTTER_EVENT >*/
* @CLUTTER_STAGE_STATE: Stage state change event * @CLUTTER_STAGE_STATE: Stage state change event
* @CLUTTER_DESTROY_NOTIFY: Destroy notification event * @CLUTTER_DESTROY_NOTIFY: Destroy notification event
* @CLUTTER_CLIENT_MESSAGE: Client message event * @CLUTTER_CLIENT_MESSAGE: Client message event
* @CLUTTER_DELETE: Stage delete event
* @CLUTTER_TOUCH_BEGIN: A new touch event sequence has started; * @CLUTTER_TOUCH_BEGIN: A new touch event sequence has started;
* event added in 1.10 * event added in 1.10
* @CLUTTER_TOUCH_UPDATE: A touch event sequence has been updated; * @CLUTTER_TOUCH_UPDATE: A touch event sequence has been updated;
@@ -895,7 +894,6 @@ typedef enum /*< prefix=CLUTTER >*/
CLUTTER_STAGE_STATE, CLUTTER_STAGE_STATE,
CLUTTER_DESTROY_NOTIFY, CLUTTER_DESTROY_NOTIFY,
CLUTTER_CLIENT_MESSAGE, CLUTTER_CLIENT_MESSAGE,
CLUTTER_DELETE,
CLUTTER_TOUCH_BEGIN, CLUTTER_TOUCH_BEGIN,
CLUTTER_TOUCH_UPDATE, CLUTTER_TOUCH_UPDATE,
CLUTTER_TOUCH_END, CLUTTER_TOUCH_END,
@@ -908,6 +906,9 @@ typedef enum /*< prefix=CLUTTER >*/
CLUTTER_PAD_BUTTON_RELEASE, CLUTTER_PAD_BUTTON_RELEASE,
CLUTTER_PAD_STRIP, CLUTTER_PAD_STRIP,
CLUTTER_PAD_RING, CLUTTER_PAD_RING,
CLUTTER_IM_COMMIT,
CLUTTER_IM_DELETE,
CLUTTER_IM_PREEDIT,
CLUTTER_EVENT_LAST /* helper */ CLUTTER_EVENT_LAST /* helper */
} ClutterEventType; } ClutterEventType;
@@ -951,7 +952,6 @@ typedef enum
/** /**
* ClutterFeatureFlags: * ClutterFeatureFlags:
* @CLUTTER_FEATURE_SWAP_THROTTLE: Set if backend throttles buffer swaps.
* @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer) * @CLUTTER_FEATURE_STAGE_STATIC: Set if stage size if fixed (i.e framebuffer)
* @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor. * @CLUTTER_FEATURE_STAGE_CURSOR: Set if stage has a graphical cursor.
* @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders. * @CLUTTER_FEATURE_SHADERS_GLSL: Set if the backend supports GLSL shaders.
@@ -966,7 +966,6 @@ typedef enum
*/ */
typedef enum typedef enum
{ {
CLUTTER_FEATURE_SWAP_THROTTLE = (1 << 3),
CLUTTER_FEATURE_STAGE_STATIC = (1 << 6), CLUTTER_FEATURE_STAGE_STATIC = (1 << 6),
CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8), CLUTTER_FEATURE_STAGE_CURSOR = (1 << 8),
CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9), CLUTTER_FEATURE_SHADERS_GLSL = (1 << 9),

View File

@@ -407,7 +407,6 @@ clutter_event_get_position (const ClutterEvent *event,
case CLUTTER_STAGE_STATE: case CLUTTER_STAGE_STATE:
case CLUTTER_DESTROY_NOTIFY: case CLUTTER_DESTROY_NOTIFY:
case CLUTTER_CLIENT_MESSAGE: case CLUTTER_CLIENT_MESSAGE:
case CLUTTER_DELETE:
case CLUTTER_EVENT_LAST: case CLUTTER_EVENT_LAST:
case CLUTTER_PROXIMITY_IN: case CLUTTER_PROXIMITY_IN:
case CLUTTER_PROXIMITY_OUT: case CLUTTER_PROXIMITY_OUT:
@@ -415,6 +414,9 @@ clutter_event_get_position (const ClutterEvent *event,
case CLUTTER_PAD_BUTTON_RELEASE: case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP: case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING: case CLUTTER_PAD_RING:
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_DELETE:
case CLUTTER_IM_PREEDIT:
graphene_point_init (position, 0.f, 0.f); graphene_point_init (position, 0.f, 0.f);
break; break;
@@ -481,7 +483,6 @@ clutter_event_set_coords (ClutterEvent *event,
case CLUTTER_STAGE_STATE: case CLUTTER_STAGE_STATE:
case CLUTTER_DESTROY_NOTIFY: case CLUTTER_DESTROY_NOTIFY:
case CLUTTER_CLIENT_MESSAGE: case CLUTTER_CLIENT_MESSAGE:
case CLUTTER_DELETE:
case CLUTTER_EVENT_LAST: case CLUTTER_EVENT_LAST:
case CLUTTER_PROXIMITY_IN: case CLUTTER_PROXIMITY_IN:
case CLUTTER_PROXIMITY_OUT: case CLUTTER_PROXIMITY_OUT:
@@ -489,6 +490,9 @@ clutter_event_set_coords (ClutterEvent *event,
case CLUTTER_PAD_BUTTON_RELEASE: case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP: case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING: case CLUTTER_PAD_RING:
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_DELETE:
case CLUTTER_IM_PREEDIT:
break; break;
case CLUTTER_ENTER: case CLUTTER_ENTER:
@@ -1105,8 +1109,10 @@ clutter_event_set_device (ClutterEvent *event,
case CLUTTER_STAGE_STATE: case CLUTTER_STAGE_STATE:
case CLUTTER_DESTROY_NOTIFY: case CLUTTER_DESTROY_NOTIFY:
case CLUTTER_CLIENT_MESSAGE: case CLUTTER_CLIENT_MESSAGE:
case CLUTTER_DELETE:
case CLUTTER_EVENT_LAST: case CLUTTER_EVENT_LAST:
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_DELETE:
case CLUTTER_IM_PREEDIT:
break; break;
case CLUTTER_ENTER: case CLUTTER_ENTER:
@@ -1202,7 +1208,9 @@ clutter_event_get_device (const ClutterEvent *event)
case CLUTTER_STAGE_STATE: case CLUTTER_STAGE_STATE:
case CLUTTER_DESTROY_NOTIFY: case CLUTTER_DESTROY_NOTIFY:
case CLUTTER_CLIENT_MESSAGE: case CLUTTER_CLIENT_MESSAGE:
case CLUTTER_DELETE: case CLUTTER_IM_COMMIT:
case CLUTTER_IM_DELETE:
case CLUTTER_IM_PREEDIT:
case CLUTTER_EVENT_LAST: case CLUTTER_EVENT_LAST:
break; break;
@@ -1411,6 +1419,11 @@ clutter_event_copy (const ClutterEvent *event)
sizeof (gdouble) * n_axes); sizeof (gdouble) * n_axes);
break; break;
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_PREEDIT:
new_event->im.text = g_strdup (event->im.text);
break;
default: default:
break; break;
} }
@@ -1466,6 +1479,11 @@ clutter_event_free (ClutterEvent *event)
g_free (event->touch.axes); g_free (event->touch.axes);
break; break;
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_PREEDIT:
g_free (event->im.text);
break;
default: default:
break; break;
} }
@@ -1725,7 +1743,6 @@ clutter_event_get_axes (const ClutterEvent *event,
case CLUTTER_STAGE_STATE: case CLUTTER_STAGE_STATE:
case CLUTTER_DESTROY_NOTIFY: case CLUTTER_DESTROY_NOTIFY:
case CLUTTER_CLIENT_MESSAGE: case CLUTTER_CLIENT_MESSAGE:
case CLUTTER_DELETE:
case CLUTTER_ENTER: case CLUTTER_ENTER:
case CLUTTER_LEAVE: case CLUTTER_LEAVE:
case CLUTTER_KEY_PRESS: case CLUTTER_KEY_PRESS:
@@ -1761,6 +1778,9 @@ clutter_event_get_axes (const ClutterEvent *event,
case CLUTTER_PAD_BUTTON_RELEASE: case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP: case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING: case CLUTTER_PAD_RING:
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_DELETE:
case CLUTTER_IM_PREEDIT:
break; break;
} }

View File

@@ -121,6 +121,7 @@ typedef struct _ClutterProximityEvent ClutterProximityEvent;
typedef struct _ClutterPadButtonEvent ClutterPadButtonEvent; typedef struct _ClutterPadButtonEvent ClutterPadButtonEvent;
typedef struct _ClutterPadStripEvent ClutterPadStripEvent; typedef struct _ClutterPadStripEvent ClutterPadStripEvent;
typedef struct _ClutterPadRingEvent ClutterPadRingEvent; typedef struct _ClutterPadRingEvent ClutterPadRingEvent;
typedef struct _ClutterIMEvent ClutterIMEvent;
/** /**
* ClutterAnyEvent: * ClutterAnyEvent:
@@ -544,6 +545,19 @@ struct _ClutterPadRingEvent
guint32 mode; guint32 mode;
}; };
struct _ClutterIMEvent
{
ClutterEventType type;
uint32_t time;
ClutterEventFlags flags;
ClutterStage *stage;
ClutterActor *source;
char *text;
int32_t offset;
uint32_t len;
};
/** /**
* ClutterEvent: * ClutterEvent:
* *
@@ -570,6 +584,7 @@ union _ClutterEvent
ClutterPadButtonEvent pad_button; ClutterPadButtonEvent pad_button;
ClutterPadStripEvent pad_strip; ClutterPadStripEvent pad_strip;
ClutterPadRingEvent pad_ring; ClutterPadRingEvent pad_ring;
ClutterIMEvent im;
}; };
/** /**

View File

@@ -139,7 +139,11 @@ clutter_fixed_layout_allocate (ClutterLayoutManager *manager,
child != NULL; child != NULL;
child = clutter_actor_get_next_sibling (child)) child = clutter_actor_get_next_sibling (child))
{ {
clutter_actor_allocate_preferred_size (child); float x = 0.f;
float y = 0.f;
clutter_actor_get_fixed_position (child, &x, &y);
clutter_actor_allocate_preferred_size (child, x, y);
} }
} }

View File

@@ -514,7 +514,7 @@ clutter_frame_clock_destroy (ClutterFrameClock *frame_clock)
static void static void
clutter_frame_clock_dispose (GObject *object) clutter_frame_clock_dispose (GObject *object)
{ {
ClutterFrameClock *frame_clock = CLUTTER_FRAME_CLOCK (object); ClutterFrameClock *frame_clock = CLUTTER_FRAME_CLOCK (object);
if (frame_clock->source) if (frame_clock->source)
{ {

View File

@@ -147,8 +147,8 @@ clutter_input_focus_set_content_purpose (ClutterInputFocus *focus,
} }
gboolean gboolean
clutter_input_focus_filter_key_event (ClutterInputFocus *focus, clutter_input_focus_filter_event (ClutterInputFocus *focus,
const ClutterKeyEvent *key) const ClutterEvent *event)
{ {
ClutterInputFocusPrivate *priv; ClutterInputFocusPrivate *priv;
@@ -157,7 +157,30 @@ clutter_input_focus_filter_key_event (ClutterInputFocus *focus,
priv = clutter_input_focus_get_instance_private (focus); priv = clutter_input_focus_get_instance_private (focus);
return clutter_input_method_filter_key_event (priv->im, key); if (event->type == CLUTTER_KEY_PRESS ||
event->type == CLUTTER_KEY_RELEASE)
{
return clutter_input_method_filter_key_event (priv->im, &event->key);
}
else if (event->type == CLUTTER_IM_COMMIT)
{
clutter_input_focus_commit (focus, event->im.text);
return TRUE;
}
else if (event->type == CLUTTER_IM_DELETE)
{
clutter_input_focus_delete_surrounding (focus, event->im.offset,
event->im.len);
return TRUE;
}
else if (event->type == CLUTTER_IM_PREEDIT)
{
clutter_input_focus_set_preedit_text (focus, event->im.text,
event->im.offset);
return TRUE;
}
return FALSE;
} }
void void

View File

@@ -72,8 +72,8 @@ CLUTTER_EXPORT
void clutter_input_focus_set_content_purpose (ClutterInputFocus *focus, void clutter_input_focus_set_content_purpose (ClutterInputFocus *focus,
ClutterInputContentPurpose purpose); ClutterInputContentPurpose purpose);
CLUTTER_EXPORT CLUTTER_EXPORT
gboolean clutter_input_focus_filter_key_event (ClutterInputFocus *focus, gboolean clutter_input_focus_filter_event (ClutterInputFocus *focus,
const ClutterKeyEvent *key); const ClutterEvent *event);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus, void clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
gboolean can_show_preedit); gboolean can_show_preedit);

View File

@@ -277,17 +277,45 @@ clutter_input_method_get_focus (ClutterInputMethod *im)
return priv->focus; return priv->focus;
} }
static void
clutter_input_method_put_im_event (ClutterInputMethod *im,
ClutterEventType event_type,
const char *text,
int32_t offset,
uint32_t len)
{
ClutterInputDevice *keyboard;
ClutterSeat *seat;
ClutterStage *stage;
ClutterEvent *event;
seat = clutter_backend_get_default_seat (clutter_get_default_backend ());
keyboard = clutter_seat_get_keyboard (seat);
stage = _clutter_input_device_get_stage (keyboard);
if (stage == NULL)
return;
event = clutter_event_new (event_type);
event->im.text = g_strdup (text);
event->im.offset = offset;
event->im.len = len;
clutter_event_set_device (event, keyboard);
clutter_event_set_source_device (event, keyboard);
clutter_event_set_flags (event, CLUTTER_EVENT_FLAG_INPUT_METHOD);
clutter_event_set_stage (event, stage);
clutter_event_put (event);
clutter_event_free (event);
}
void void
clutter_input_method_commit (ClutterInputMethod *im, clutter_input_method_commit (ClutterInputMethod *im,
const gchar *text) const gchar *text)
{ {
ClutterInputMethodPrivate *priv;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im)); g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
priv = clutter_input_method_get_instance_private (im); clutter_input_method_put_im_event (im, CLUTTER_IM_COMMIT, text, 0, 0);
if (priv->focus)
clutter_input_focus_commit (priv->focus, text);
} }
void void
@@ -295,13 +323,9 @@ clutter_input_method_delete_surrounding (ClutterInputMethod *im,
int offset, int offset,
guint len) guint len)
{ {
ClutterInputMethodPrivate *priv;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im)); g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
priv = clutter_input_method_get_instance_private (im); clutter_input_method_put_im_event (im, CLUTTER_IM_DELETE, NULL, offset, len);
if (priv->focus)
clutter_input_focus_delete_surrounding (priv->focus, offset, len);
} }
void void
@@ -329,13 +353,9 @@ clutter_input_method_set_preedit_text (ClutterInputMethod *im,
const gchar *preedit, const gchar *preedit,
guint cursor) guint cursor)
{ {
ClutterInputMethodPrivate *priv;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im)); g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
priv = clutter_input_method_get_instance_private (im); clutter_input_method_put_im_event (im, CLUTTER_IM_PREEDIT, preedit, cursor, 0);
if (priv->focus)
clutter_input_focus_set_preedit_text (priv->focus, preedit, cursor);
} }
void void

View File

@@ -67,13 +67,7 @@
#include "clutter-settings-private.h" #include "clutter-settings-private.h"
#include "clutter-stage-manager.h" #include "clutter-stage-manager.h"
#include "clutter-stage-private.h" #include "clutter-stage-private.h"
#include "clutter-backend-private.h"
#ifdef CLUTTER_WINDOWING_X11
#include "x11/clutter-backend-x11.h"
#endif
#ifdef CLUTTER_WINDOWING_EGL
#include "egl/clutter-backend-eglnative.h"
#endif
#include <cogl/cogl.h> #include <cogl/cogl.h>
#include <cogl-pango/cogl-pango.h> #include <cogl-pango/cogl-pango.h>
@@ -88,7 +82,6 @@ static gboolean clutter_is_initialized = FALSE;
static gboolean clutter_show_fps = FALSE; static gboolean clutter_show_fps = FALSE;
static gboolean clutter_fatal_warnings = FALSE; static gboolean clutter_fatal_warnings = FALSE;
static gboolean clutter_disable_mipmap_text = FALSE; static gboolean clutter_disable_mipmap_text = FALSE;
static gboolean clutter_use_fuzzy_picking = FALSE;
static gboolean clutter_enable_accessibility = TRUE; static gboolean clutter_enable_accessibility = TRUE;
static gboolean clutter_sync_to_vblank = TRUE; static gboolean clutter_sync_to_vblank = TRUE;
@@ -96,9 +89,6 @@ static guint clutter_default_fps = 60;
static ClutterTextDirection clutter_text_direction = CLUTTER_TEXT_DIRECTION_LTR; static ClutterTextDirection clutter_text_direction = CLUTTER_TEXT_DIRECTION_LTR;
static guint clutter_main_loop_level = 0;
static GSList *main_loops = NULL;
/* debug flags */ /* debug flags */
guint clutter_debug_flags = 0; guint clutter_debug_flags = 0;
guint clutter_paint_debug_flags = 0; guint clutter_paint_debug_flags = 0;
@@ -185,16 +175,6 @@ clutter_config_read_from_key_file (GKeyFile *keyfile)
else else
clutter_disable_mipmap_text = bool_value; clutter_disable_mipmap_text = bool_value;
bool_value =
g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP,
"UseFuzzyPicking",
&key_error);
if (key_error != NULL)
g_clear_error (&key_error);
else
clutter_use_fuzzy_picking = bool_value;
bool_value = bool_value =
g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP, g_key_file_get_boolean (keyfile, ENVIRONMENT_GROUP,
"EnableAccessibility", "EnableAccessibility",
@@ -449,76 +429,6 @@ clutter_get_text_direction (void)
return dir; return dir;
} }
/**
* clutter_main_quit:
*
* Terminates the Clutter mainloop.
*/
void
clutter_main_quit (void)
{
if (main_loops == NULL)
{
g_critical ("Calling clutter_main_quit() without calling clutter_main() "
"is not allowed. If you are using another main loop, use the "
"appropriate API to terminate it.");
return;
}
CLUTTER_NOTE (MISC, "Terminating main loop level %d", clutter_main_loop_level);
g_main_loop_quit (main_loops->data);
}
/**
* clutter_main_level:
*
* Retrieves the depth of the Clutter mainloop.
*
* Return value: The level of the mainloop.
*/
gint
clutter_main_level (void)
{
return clutter_main_loop_level;
}
/**
* clutter_main:
*
* Starts the Clutter mainloop.
*/
void
clutter_main (void)
{
GMainLoop *loop;
if (!_clutter_context_is_initialized ())
{
g_warning ("Called clutter_main() but Clutter wasn't initialised. "
"You must call clutter_init() first.");
return;
}
clutter_main_loop_level++;
CLUTTER_NOTE (MISC, "Entering main loop level %d", clutter_main_loop_level);
loop = g_main_loop_new (NULL, TRUE);
main_loops = g_slist_prepend (main_loops, loop);
if (g_main_loop_is_running (main_loops->data))
g_main_loop_run (loop);
main_loops = g_slist_remove (main_loops, loop);
g_main_loop_unref (loop);
CLUTTER_NOTE (MISC, "Leaving main loop level %d", clutter_main_loop_level);
clutter_main_loop_level--;
}
gboolean gboolean
_clutter_threads_dispatch (gpointer data) _clutter_threads_dispatch (gpointer data)
{ {
@@ -923,9 +833,6 @@ static GOptionEntry clutter_args[] = {
{ "clutter-disable-mipmapped-text", 0, 0, G_OPTION_ARG_NONE, { "clutter-disable-mipmapped-text", 0, 0, G_OPTION_ARG_NONE,
&clutter_disable_mipmap_text, &clutter_disable_mipmap_text,
N_("Disable mipmapping on text"), NULL }, N_("Disable mipmapping on text"), NULL },
{ "clutter-use-fuzzy-picking", 0, 0, G_OPTION_ARG_NONE,
&clutter_use_fuzzy_picking,
N_("Use 'fuzzy' picking"), NULL },
#ifdef CLUTTER_ENABLE_DEBUG #ifdef CLUTTER_ENABLE_DEBUG
{ "clutter-debug", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_debug_cb, { "clutter-debug", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_debug_cb,
N_("Clutter debugging flags to set"), "FLAGS" }, N_("Clutter debugging flags to set"), "FLAGS" },
@@ -1007,10 +914,6 @@ pre_parse_hook (GOptionContext *context,
if (env_string) if (env_string)
clutter_disable_mipmap_text = TRUE; clutter_disable_mipmap_text = TRUE;
env_string = g_getenv ("CLUTTER_FUZZY_PICK");
if (env_string)
clutter_use_fuzzy_picking = TRUE;
return _clutter_backend_pre_parse (backend, error); return _clutter_backend_pre_parse (backend, error);
} }
@@ -1669,6 +1572,11 @@ _clutter_process_event_details (ClutterActor *stage,
ClutterEvent *event) ClutterEvent *event)
{ {
ClutterInputDevice *device = clutter_event_get_device (event); ClutterInputDevice *device = clutter_event_get_device (event);
ClutterMainContext *clutter_context;
ClutterBackend *backend;
clutter_context = _clutter_context_get_default ();
backend = clutter_context->backend;
switch (event->type) switch (event->type)
{ {
@@ -1682,6 +1590,9 @@ _clutter_process_event_details (ClutterActor *stage,
case CLUTTER_PAD_BUTTON_RELEASE: case CLUTTER_PAD_BUTTON_RELEASE:
case CLUTTER_PAD_STRIP: case CLUTTER_PAD_STRIP:
case CLUTTER_PAD_RING: case CLUTTER_PAD_RING:
case CLUTTER_IM_COMMIT:
case CLUTTER_IM_DELETE:
case CLUTTER_IM_PREEDIT:
{ {
ClutterActor *actor = NULL; ClutterActor *actor = NULL;
@@ -1754,7 +1665,6 @@ _clutter_process_event_details (ClutterActor *stage,
break; break;
case CLUTTER_DESTROY_NOTIFY: case CLUTTER_DESTROY_NOTIFY:
case CLUTTER_DELETE:
event->any.source = stage; event->any.source = stage;
if (_clutter_event_process_filters (event)) if (_clutter_event_process_filters (event))
@@ -1765,8 +1675,7 @@ _clutter_process_event_details (ClutterActor *stage,
break; break;
case CLUTTER_MOTION: case CLUTTER_MOTION:
#ifdef CLUTTER_WINDOWING_X11 if (clutter_backend_is_display_server (backend) &&
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11) &&
!(event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC)) !(event->any.flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
{ {
if (_clutter_is_input_pointer_a11y_enabled (device)) if (_clutter_is_input_pointer_a11y_enabled (device))
@@ -1777,7 +1686,6 @@ _clutter_process_event_details (ClutterActor *stage,
_clutter_input_pointer_a11y_on_motion_event (device, x, y); _clutter_input_pointer_a11y_on_motion_event (device, x, y);
} }
} }
#endif /* CLUTTER_WINDOWING_X11 */
/* only the stage gets motion events if they are enabled */ /* only the stage gets motion events if they are enabled */
if (!clutter_stage_get_motion_events_enabled (CLUTTER_STAGE (stage)) && if (!clutter_stage_get_motion_events_enabled (CLUTTER_STAGE (stage)) &&
event->any.source == NULL) event->any.source == NULL)
@@ -1808,8 +1716,7 @@ _clutter_process_event_details (ClutterActor *stage,
G_GNUC_FALLTHROUGH; G_GNUC_FALLTHROUGH;
case CLUTTER_BUTTON_PRESS: case CLUTTER_BUTTON_PRESS:
case CLUTTER_BUTTON_RELEASE: case CLUTTER_BUTTON_RELEASE:
#ifdef CLUTTER_WINDOWING_X11 if (clutter_backend_is_display_server (backend))
if (!clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
{ {
if (_clutter_is_input_pointer_a11y_enabled (device) && (event->type != CLUTTER_MOTION)) if (_clutter_is_input_pointer_a11y_enabled (device) && (event->type != CLUTTER_MOTION))
{ {
@@ -1818,7 +1725,6 @@ _clutter_process_event_details (ClutterActor *stage,
event->type == CLUTTER_BUTTON_PRESS); event->type == CLUTTER_BUTTON_PRESS);
} }
} }
#endif /* CLUTTER_WINDOWING_X11 */
case CLUTTER_SCROLL: case CLUTTER_SCROLL:
case CLUTTER_TOUCHPAD_PINCH: case CLUTTER_TOUCHPAD_PINCH:
case CLUTTER_TOUCHPAD_SWIPE: case CLUTTER_TOUCHPAD_SWIPE:
@@ -2442,58 +2348,6 @@ _clutter_context_get_pick_mode (void)
return context->pick_mode; return context->pick_mode;
} }
/**
* clutter_check_windowing_backend:
* @backend_type: the name of the backend to check
*
* Checks the run-time name of the Clutter windowing system backend, using
* the symbolic macros like %CLUTTER_WINDOWING_X11.
*
* This function should be used in conjuction with the compile-time macros
* inside applications and libraries that are using the platform-specific
* windowing system API, to ensure that they are running on the correct
* windowing system; for instance:
*
* |[
* #ifdef CLUTTER_WINDOWING_X11
* if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
* {
* // it is safe to use the clutter_x11_* API
* }
* else
* #endif
* g_error ("Unknown Clutter backend.");
* ]|
*
* Return value: %TRUE if the current Clutter windowing system backend is
* the one checked, and %FALSE otherwise
*
* Since: 1.10
*/
gboolean
clutter_check_windowing_backend (const char *backend_type)
{
ClutterMainContext *context = _clutter_context_get_default ();
g_return_val_if_fail (backend_type != NULL, FALSE);
backend_type = g_intern_string (backend_type);
#ifdef CLUTTER_WINDOWING_EGL
if (backend_type == I_(CLUTTER_WINDOWING_EGL) &&
CLUTTER_IS_BACKEND_EGL_NATIVE (context->backend))
return TRUE;
else
#endif
#ifdef CLUTTER_WINDOWING_X11
if (backend_type == I_(CLUTTER_WINDOWING_X11) &&
CLUTTER_IS_BACKEND_X11 (context->backend))
return TRUE;
else
#endif
return FALSE;
}
/** /**
* clutter_add_debug_flags: (skip) * clutter_add_debug_flags: (skip)
* *

View File

@@ -136,14 +136,6 @@ GOptionGroup * clutter_get_option_group (void);
CLUTTER_EXPORT CLUTTER_EXPORT
GOptionGroup * clutter_get_option_group_without_init (void); GOptionGroup * clutter_get_option_group_without_init (void);
/* Mainloop */
CLUTTER_EXPORT
void clutter_main (void);
CLUTTER_EXPORT
void clutter_main_quit (void);
CLUTTER_EXPORT
gint clutter_main_level (void);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_do_event (ClutterEvent *event); void clutter_do_event (ClutterEvent *event);
@@ -194,9 +186,6 @@ ClutterTextDirection clutter_get_default_text_direction (void);
CLUTTER_EXPORT CLUTTER_EXPORT
guint clutter_get_default_frame_rate (void); guint clutter_get_default_frame_rate (void);
CLUTTER_EXPORT
gboolean clutter_check_windowing_backend (const char *backend_type);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_add_debug_flags (ClutterDebugFlag debug_flags, void clutter_add_debug_flags (ClutterDebugFlag debug_flags,
ClutterDrawDebugFlag draw_flags, ClutterDrawDebugFlag draw_flags,

View File

@@ -55,23 +55,6 @@ void clutter_stage_capture_into (ClutterStage *stage,
cairo_rectangle_int_t *rect, cairo_rectangle_int_t *rect,
uint8_t *data); uint8_t *data);
CLUTTER_EXPORT
void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
CoglFramebuffer *framebuffer,
const cairo_rectangle_int_t *rect,
float scale,
ClutterPaintFlag paint_flags);
CLUTTER_EXPORT
gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
float scale,
uint8_t *data,
int stride,
CoglPixelFormat format,
ClutterPaintFlag paint_flags,
GError **error);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_stage_clear_stage_views (ClutterStage *stage); void clutter_stage_clear_stage_views (ClutterStage *stage);
@@ -85,6 +68,10 @@ gboolean clutter_actor_has_damage (ClutterActor *actor);
CLUTTER_EXPORT CLUTTER_EXPORT
gboolean clutter_actor_has_transitions (ClutterActor *actor); gboolean clutter_actor_has_transitions (ClutterActor *actor);
CLUTTER_EXPORT
ClutterFrameClock * clutter_actor_pick_frame_clock (ClutterActor *self,
ClutterActor **out_actor);
#undef __CLUTTER_H_INSIDE__ #undef __CLUTTER_H_INSIDE__
#endif /* __CLUTTER_MUTTER_H__ */ #endif /* __CLUTTER_MUTTER_H__ */

View File

@@ -100,6 +100,8 @@ struct _ClutterOffscreenEffectPrivate
int target_height; int target_height;
gint old_opacity_override; gint old_opacity_override;
gulong purge_handler_id;
}; };
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterOffscreenEffect, G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterOffscreenEffect,
@@ -158,6 +160,12 @@ ensure_pipeline_filter_for_scale (ClutterOffscreenEffect *self,
filter, filter); filter, filter);
} }
static void
video_memory_purged (ClutterOffscreenEffect *self)
{
g_clear_pointer (&self->priv->offscreen, cogl_object_unref);
}
static gboolean static gboolean
update_fbo (ClutterEffect *effect, update_fbo (ClutterEffect *effect,
int target_width, int target_width,
@@ -166,8 +174,26 @@ update_fbo (ClutterEffect *effect,
{ {
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect); ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
ClutterOffscreenEffectPrivate *priv = self->priv; ClutterOffscreenEffectPrivate *priv = self->priv;
ClutterActor *stage_actor;
stage_actor = clutter_actor_get_stage (priv->actor);
if (stage_actor != priv->stage)
{
g_clear_signal_handler (&priv->purge_handler_id, priv->stage);
priv->stage = stage_actor;
if (priv->stage)
{
priv->purge_handler_id =
g_signal_connect_object (priv->stage,
"gl-video-memory-purged",
G_CALLBACK (video_memory_purged),
self,
G_CONNECT_SWAPPED);
}
}
priv->stage = clutter_actor_get_stage (priv->actor);
if (priv->stage == NULL) if (priv->stage == NULL)
{ {
CLUTTER_NOTE (MISC, "The actor '%s' is not part of a stage", CLUTTER_NOTE (MISC, "The actor '%s' is not part of a stage",

View File

@@ -33,6 +33,7 @@ typedef enum _ClutterPaintFlag
{ {
CLUTTER_PAINT_FLAG_NONE = 0, CLUTTER_PAINT_FLAG_NONE = 0,
CLUTTER_PAINT_FLAG_NO_CURSORS = 1 << 0, CLUTTER_PAINT_FLAG_NO_CURSORS = 1 << 0,
CLUTTER_PAINT_FLAG_FORCE_CURSORS = 1 << 1,
} ClutterPaintFlag; } ClutterPaintFlag;
#define CLUTTER_TYPE_PAINT_CONTEXT (clutter_paint_context_get_type ()) #define CLUTTER_TYPE_PAINT_CONTEXT (clutter_paint_context_get_type ())

View File

@@ -313,6 +313,12 @@ us (uint64_t us)
return us; return us;
} }
static inline uint32_t
ms (uint32_t ms)
{
return ms;
}
static inline uint64_t static inline uint64_t
ms2us (uint64_t ms) ms2us (uint64_t ms)
{ {

View File

@@ -40,6 +40,18 @@
#define CLUTTER_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SETTINGS)) #define CLUTTER_IS_SETTINGS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SETTINGS))
#define CLUTTER_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SETTINGS, ClutterSettingsClass)) #define CLUTTER_SETTINGS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SETTINGS, ClutterSettingsClass))
typedef struct
{
cairo_antialias_t cairo_antialias;
gint clutter_font_antialias;
cairo_hint_style_t cairo_hint_style;
const char *clutter_font_hint_style;
cairo_subpixel_order_t cairo_subpixel_order;
const char *clutter_font_subpixel_order;
} FontSettings;
/** /**
* ClutterSettings: * ClutterSettings:
* *
@@ -53,6 +65,7 @@ struct _ClutterSettings
GObject parent_instance; GObject parent_instance;
ClutterBackend *backend; ClutterBackend *backend;
GSettings *xsettings;
gint double_click_time; gint double_click_time;
gint double_click_distance; gint double_click_distance;
@@ -267,6 +280,159 @@ settings_update_fontmap (ClutterSettings *self,
#endif /* HAVE_PANGO_FT2 */ #endif /* HAVE_PANGO_FT2 */
} }
static void
get_font_gsettings (GSettings *xsettings,
FontSettings *output)
{
/* org.gnome.settings-daemon.GsdFontAntialiasingMode */
static const struct
{
cairo_antialias_t cairo_antialias;
gint clutter_font_antialias;
}
antialiasings[] =
{
/* none=0 */ {CAIRO_ANTIALIAS_NONE, 0},
/* grayscale=1 */ {CAIRO_ANTIALIAS_GRAY, 1},
/* rgba=2 */ {CAIRO_ANTIALIAS_SUBPIXEL, 1},
};
/* org.gnome.settings-daemon.GsdFontHinting */
static const struct
{
cairo_hint_style_t cairo_hint_style;
const char *clutter_font_hint_style;
}
hintings[] =
{
/* none=0 */ {CAIRO_HINT_STYLE_NONE, "hintnone"},
/* slight=1 */ {CAIRO_HINT_STYLE_SLIGHT, "hintslight"},
/* medium=2 */ {CAIRO_HINT_STYLE_MEDIUM, "hintmedium"},
/* full=3 */ {CAIRO_HINT_STYLE_FULL, "hintfull"},
};
/* org.gnome.settings-daemon.GsdFontRgbaOrder */
static const struct
{
cairo_subpixel_order_t cairo_subpixel_order;
const char *clutter_font_subpixel_order;
}
rgba_orders[] =
{
/* rgba=0 */ {CAIRO_SUBPIXEL_ORDER_RGB, "rgb"}, /* XXX what is 'rgba'? */
/* rgb=1 */ {CAIRO_SUBPIXEL_ORDER_RGB, "rgb"},
/* bgr=2 */ {CAIRO_SUBPIXEL_ORDER_BGR, "bgr"},
/* vrgb=3 */ {CAIRO_SUBPIXEL_ORDER_VRGB, "vrgb"},
/* vbgr=4 */ {CAIRO_SUBPIXEL_ORDER_VBGR, "vbgr"},
};
guint i;
i = g_settings_get_enum (xsettings, "hinting");
if (i < G_N_ELEMENTS (hintings))
{
output->cairo_hint_style = hintings[i].cairo_hint_style;
output->clutter_font_hint_style = hintings[i].clutter_font_hint_style;
}
else
{
output->cairo_hint_style = CAIRO_HINT_STYLE_DEFAULT;
output->clutter_font_hint_style = NULL;
}
i = g_settings_get_enum (xsettings, "antialiasing");
if (i < G_N_ELEMENTS (antialiasings))
{
output->cairo_antialias = antialiasings[i].cairo_antialias;
output->clutter_font_antialias = antialiasings[i].clutter_font_antialias;
}
else
{
output->cairo_antialias = CAIRO_ANTIALIAS_DEFAULT;
output->clutter_font_antialias = -1;
}
i = g_settings_get_enum (xsettings, "rgba-order");
if (i < G_N_ELEMENTS (rgba_orders))
{
output->cairo_subpixel_order = rgba_orders[i].cairo_subpixel_order;
output->clutter_font_subpixel_order = rgba_orders[i].clutter_font_subpixel_order;
}
else
{
output->cairo_subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
output->clutter_font_subpixel_order = NULL;
}
if (output->cairo_antialias == CAIRO_ANTIALIAS_GRAY)
output->clutter_font_subpixel_order = "none";
}
static void
init_font_options (ClutterSettings *self)
{
GSettings *xsettings = self->xsettings;
cairo_font_options_t *options = cairo_font_options_create ();
FontSettings fs;
get_font_gsettings (xsettings, &fs);
cairo_font_options_set_hint_style (options, fs.cairo_hint_style);
cairo_font_options_set_antialias (options, fs.cairo_antialias);
cairo_font_options_set_subpixel_order (options, fs.cairo_subpixel_order);
clutter_backend_set_font_options (self->backend, options);
cairo_font_options_destroy (options);
}
static gboolean
on_xsettings_change_event (GSettings *xsettings,
gpointer keys,
gint n_keys,
gpointer user_data)
{
ClutterSettings *self = CLUTTER_SETTINGS (user_data);
FontSettings fs;
gint hinting;
get_font_gsettings (xsettings, &fs);
hinting = fs.cairo_hint_style == CAIRO_HINT_STYLE_NONE ? 0 : 1;
g_object_set (self,
"font-hinting", hinting,
"font-hint-style", fs.clutter_font_hint_style,
"font-antialias", fs.clutter_font_antialias,
"font-subpixel-order", fs.clutter_font_subpixel_order,
NULL);
return FALSE;
}
static void
load_initial_settings (ClutterSettings *self)
{
static const gchar xsettings_path[] =
"org.gnome.settings-daemon.plugins.xsettings";
GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
GSettingsSchema *schema;
schema = g_settings_schema_source_lookup (source, xsettings_path, TRUE);
if (!schema)
{
g_warning ("Failed to find schema: %s", xsettings_path);
}
else
{
self->xsettings = g_settings_new_full (schema, NULL, NULL);
if (self->xsettings)
{
init_font_options (self);
g_signal_connect (self->xsettings, "change-event",
G_CALLBACK (on_xsettings_change_event),
self);
}
}
}
static void static void
clutter_settings_finalize (GObject *gobject) clutter_settings_finalize (GObject *gobject)
{ {
@@ -276,6 +442,8 @@ clutter_settings_finalize (GObject *gobject)
g_free (self->xft_hint_style); g_free (self->xft_hint_style);
g_free (self->xft_rgba); g_free (self->xft_rgba);
g_clear_object (&self->xsettings);
G_OBJECT_CLASS (clutter_settings_parent_class)->finalize (gobject); G_OBJECT_CLASS (clutter_settings_parent_class)->finalize (gobject);
} }
@@ -740,6 +908,8 @@ _clutter_settings_set_backend (ClutterSettings *settings,
g_assert (CLUTTER_IS_BACKEND (backend)); g_assert (CLUTTER_IS_BACKEND (backend));
settings->backend = backend; settings->backend = backend;
load_initial_settings (settings);
} }
#define SETTINGS_GROUP "Settings" #define SETTINGS_GROUP "Settings"

View File

@@ -141,6 +141,9 @@ void clutter_stage_presented (ClutterStage *stag
void clutter_stage_queue_actor_relayout (ClutterStage *stage, void clutter_stage_queue_actor_relayout (ClutterStage *stage,
ClutterActor *actor); ClutterActor *actor);
void clutter_stage_dequeue_actor_relayout (ClutterStage *stage,
ClutterActor *actor);
GList * clutter_stage_get_views_for_rect (ClutterStage *stage, GList * clutter_stage_get_views_for_rect (ClutterStage *stage,
const graphene_rect_t *rect); const graphene_rect_t *rect);

View File

@@ -86,6 +86,13 @@ typedef struct _ClutterStageViewPrivate
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageView, clutter_stage_view, G_TYPE_OBJECT) G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageView, clutter_stage_view, G_TYPE_OBJECT)
void
clutter_stage_view_destroy (ClutterStageView *view)
{
g_object_run_dispose (G_OBJECT (view));
g_object_unref (view);
}
void void
clutter_stage_view_get_layout (ClutterStageView *view, clutter_stage_view_get_layout (ClutterStageView *view,
cairo_rectangle_int_t *rect) cairo_rectangle_int_t *rect)

View File

@@ -52,6 +52,9 @@ struct _ClutterStageViewClass
cairo_rectangle_int_t *dst_rect); cairo_rectangle_int_t *dst_rect);
}; };
CLUTTER_EXPORT
void clutter_stage_view_destroy (ClutterStageView *view);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_stage_view_get_layout (ClutterStageView *view, void clutter_stage_view_get_layout (ClutterStageView *view,
cairo_rectangle_int_t *rect); cairo_rectangle_int_t *rect);

View File

@@ -172,6 +172,7 @@ enum
AFTER_UPDATE, AFTER_UPDATE,
PAINT_VIEW, PAINT_VIEW,
PRESENTED, PRESENTED,
GL_VIDEO_MEMORY_PURGED,
LAST_SIGNAL LAST_SIGNAL
}; };
@@ -544,23 +545,6 @@ queue_full_redraw (ClutterStage *stage)
clutter_stage_add_redraw_clip (stage, NULL); clutter_stage_add_redraw_clip (stage, NULL);
} }
static gboolean
stage_is_default (ClutterStage *stage)
{
ClutterStageManager *stage_manager;
ClutterStageWindow *impl;
stage_manager = clutter_stage_manager_get_default ();
if (stage != clutter_stage_manager_get_default_stage (stage_manager))
return FALSE;
impl = _clutter_stage_get_window (stage);
if (impl != _clutter_stage_get_default_window ())
return FALSE;
return TRUE;
}
static void static void
clutter_stage_allocate (ClutterActor *self, clutter_stage_allocate (ClutterActor *self,
const ClutterActorBox *box) const ClutterActorBox *box)
@@ -1202,6 +1186,28 @@ clutter_stage_queue_actor_relayout (ClutterStage *stage,
g_object_ref (actor)); g_object_ref (actor));
} }
void
clutter_stage_dequeue_actor_relayout (ClutterStage *stage,
ClutterActor *actor)
{
ClutterStagePrivate *priv = stage->priv;
GSList *l;
for (l = priv->pending_relayouts; l; l = l->next)
{
ClutterActor *relayout_actor = l->data;
if (relayout_actor == actor)
{
g_object_unref (relayout_actor);
priv->pending_relayouts =
g_slist_delete_link (priv->pending_relayouts, l);
return;
}
}
}
void void
clutter_stage_maybe_relayout (ClutterActor *actor) clutter_stage_maybe_relayout (ClutterActor *actor)
{ {
@@ -1223,14 +1229,12 @@ clutter_stage_maybe_relayout (ClutterActor *actor)
for (l = stolen_list; l; l = l->next) for (l = stolen_list; l; l = l->next)
{ {
g_autoptr (ClutterActor) queued_actor = l->data; g_autoptr (ClutterActor) queued_actor = l->data;
float x = 0.f;
float y = 0.f;
if (CLUTTER_ACTOR_IN_RELAYOUT (queued_actor)) /* avoid reentrancy */ if (CLUTTER_ACTOR_IN_RELAYOUT (queued_actor)) /* avoid reentrancy */
continue; continue;
/* An actor may have been destroyed or hidden between queuing and now */
if (clutter_actor_get_stage (queued_actor) != actor)
continue;
if (queued_actor == actor) if (queued_actor == actor)
CLUTTER_NOTE (ACTOR, " Deep relayout of stage %s", CLUTTER_NOTE (ACTOR, " Deep relayout of stage %s",
_clutter_actor_get_debug_name (queued_actor)); _clutter_actor_get_debug_name (queued_actor));
@@ -1240,7 +1244,8 @@ clutter_stage_maybe_relayout (ClutterActor *actor)
CLUTTER_SET_PRIVATE_FLAGS (queued_actor, CLUTTER_IN_RELAYOUT); CLUTTER_SET_PRIVATE_FLAGS (queued_actor, CLUTTER_IN_RELAYOUT);
clutter_actor_allocate_preferred_size (queued_actor); clutter_actor_get_fixed_position (queued_actor, &x, &y);
clutter_actor_allocate_preferred_size (queued_actor, x, y);
CLUTTER_UNSET_PRIVATE_FLAGS (queued_actor, CLUTTER_IN_RELAYOUT); CLUTTER_UNSET_PRIVATE_FLAGS (queued_actor, CLUTTER_IN_RELAYOUT);
@@ -1569,18 +1574,6 @@ _clutter_stage_do_pick (ClutterStage *stage,
return actor; return actor;
} }
static gboolean
clutter_stage_real_delete_event (ClutterStage *stage,
ClutterEvent *event)
{
if (stage_is_default (stage))
clutter_main_quit ();
else
clutter_actor_destroy (CLUTTER_ACTOR (stage));
return CLUTTER_EVENT_STOP;
}
static void static void
clutter_stage_real_apply_transform (ClutterActor *stage, clutter_stage_real_apply_transform (ClutterActor *stage,
CoglMatrix *matrix) CoglMatrix *matrix)
@@ -1856,37 +1849,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
/**
* ClutterStage::delete-event:
* @stage: the stage that received the event
* @event: a #ClutterEvent of type %CLUTTER_DELETE
*
* The ::delete-event signal is emitted when the user closes a
* #ClutterStage window using the window controls.
*
* Clutter by default will call clutter_main_quit() if @stage is
* the default stage, and clutter_actor_destroy() for any other
* stage.
*
* It is possible to override the default behaviour by connecting
* a new handler and returning %TRUE there.
*
* This signal is emitted only on Clutter backends that
* embed #ClutterStage in native windows. It is not emitted for
* backends that use a static frame buffer.
*
* Since: 1.2
*/
stage_signals[DELETE_EVENT] =
g_signal_new (I_("delete-event"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterStageClass, delete_event),
_clutter_boolean_handled_accumulator, NULL,
_clutter_marshal_BOOLEAN__BOXED,
G_TYPE_BOOLEAN, 1,
CLUTTER_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
/** /**
* ClutterStage::before-update: * ClutterStage::before-update:
* @stage: the #ClutterStage * @stage: the #ClutterStage
@@ -1990,9 +1952,24 @@ clutter_stage_class_init (ClutterStageClass *klass)
CLUTTER_TYPE_STAGE_VIEW, CLUTTER_TYPE_STAGE_VIEW,
G_TYPE_POINTER); G_TYPE_POINTER);
/**
* ClutterStage::gl-video-memory-purged: (skip)
* @stage: the stage that received the event
*
* Signals that the underlying GL driver has had its texture memory purged
* so anything presently held in texture memory is now invalidated, and
* likely corrupt. It needs redrawing.
*/
stage_signals[GL_VIDEO_MEMORY_PURGED] =
g_signal_new (I_("gl-video-memory-purged"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
klass->activate = clutter_stage_real_activate; klass->activate = clutter_stage_real_activate;
klass->deactivate = clutter_stage_real_deactivate; klass->deactivate = clutter_stage_real_deactivate;
klass->delete_event = clutter_stage_real_delete_event;
} }
static void static void
@@ -2439,18 +2416,6 @@ clutter_stage_event (ClutterStage *stage,
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE); g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
g_return_val_if_fail (event != NULL, FALSE); g_return_val_if_fail (event != NULL, FALSE);
if (event->type == CLUTTER_DELETE)
{
gboolean retval = FALSE;
g_signal_emit_by_name (stage, "event", event, &retval);
if (!retval)
g_signal_emit_by_name (stage, "delete-event", event, &retval);
return retval;
}
if (event->type != CLUTTER_STAGE_STATE) if (event->type != CLUTTER_STAGE_STATE)
return FALSE; return FALSE;
@@ -2626,29 +2591,6 @@ G_DEFINE_BOXED_TYPE (ClutterPerspective, clutter_perspective,
clutter_perspective_copy, clutter_perspective_copy,
clutter_perspective_free); clutter_perspective_free);
/**
* clutter_stage_new:
*
* Creates a new, non-default stage. A non-default stage is a new
* top-level actor which can be used as another container.
*
* The ability to support multiple stages depends on the current
* backend. Use clutter_feature_available() and
* %CLUTTER_FEATURE_STAGE_MULTIPLE to check at runtime whether a
* backend supports multiple stages.
*
* Return value: a new stage, or %NULL if the default backend does
* not support multiple stages. Use clutter_actor_destroy() to
* programmatically close the returned stage.
*
* Since: 0.8
*/
ClutterActor *
clutter_stage_new (void)
{
return g_object_new (CLUTTER_TYPE_STAGE, NULL);
}
/** /**
* clutter_stage_ensure_viewport: * clutter_stage_ensure_viewport:
* @stage: a #ClutterStage * @stage: a #ClutterStage
@@ -3603,102 +3545,6 @@ clutter_stage_presented (ClutterStage *stage,
g_signal_emit (stage, stage_signals[PRESENTED], 0, view, frame_info); g_signal_emit (stage, stage_signals[PRESENTED], 0, view, frame_info);
} }
static void
capture_view (ClutterStage *stage,
gboolean paint,
ClutterStageView *view,
ClutterCapture *capture)
{
cairo_surface_t *image;
uint8_t *data;
int stride;
cairo_rectangle_int_t *rect;
float view_scale;
float texture_width;
float texture_height;
rect = &capture->rect;
view_scale = clutter_stage_view_get_scale (view);
texture_width = roundf (rect->width * view_scale);
texture_height = roundf (rect->height * view_scale);
image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
texture_width, texture_height);
cairo_surface_set_device_scale (image, view_scale, view_scale);
data = cairo_image_surface_get_data (image);
stride = cairo_image_surface_get_stride (image);
capture_view_into (stage, paint, view, rect, data, stride);
capture->image = image;
cairo_surface_mark_dirty (capture->image);
}
/**
* clutter_stage_capture:
* @stage: a #ClutterStage
* @paint: whether to pain the frame
* @rect: a #cairo_rectangle_int_t in stage coordinates
* @out_captures: (out) (array length=out_n_captures): an array of
* #ClutterCapture
* @out_n_captures: (out): the number of captures in @out_captures
*
* Captures the stage pixels of @rect into @captures. @rect is in stage
* coordinates.
*
* Returns: %TRUE if a #ClutterCapture has been created, %FALSE otherwise
*/
gboolean
clutter_stage_capture (ClutterStage *stage,
gboolean paint,
cairo_rectangle_int_t *rect,
ClutterCapture **out_captures,
int *out_n_captures)
{
ClutterStagePrivate *priv = stage->priv;
GList *views = _clutter_stage_window_get_views (priv->impl);
GList *l;
ClutterCapture *captures;
int n_captures;
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
captures = g_new0 (ClutterCapture, g_list_length (views));
n_captures = 0;
for (l = views; l; l = l->next)
{
ClutterStageView *view = l->data;
ClutterCapture *capture;
cairo_rectangle_int_t view_layout;
cairo_region_t *region;
clutter_stage_view_get_layout (view, &view_layout);
region = cairo_region_create_rectangle (&view_layout);
cairo_region_intersect_rectangle (region, rect);
capture = &captures[n_captures];
cairo_region_get_extents (region, &capture->rect);
cairo_region_destroy (region);
if (capture->rect.width == 0 || capture->rect.height == 0)
continue;
capture_view (stage, paint, view, capture);
n_captures++;
}
if (n_captures == 0)
g_clear_pointer (&captures, g_free);
*out_captures = captures;
*out_n_captures = n_captures;
return n_captures > 0;
}
gboolean gboolean
clutter_stage_get_capture_final_size (ClutterStage *stage, clutter_stage_get_capture_final_size (ClutterStage *stage,
cairo_rectangle_int_t *rect, cairo_rectangle_int_t *rect,

View File

@@ -64,7 +64,6 @@ struct _ClutterStage
* ClutterStageClass: * ClutterStageClass:
* @activate: handler for the #ClutterStage::activate signal * @activate: handler for the #ClutterStage::activate signal
* @deactivate: handler for the #ClutterStage::deactivate signal * @deactivate: handler for the #ClutterStage::deactivate signal
* @delete_event: handler for the #ClutterStage::delete-event signal
* *
* The #ClutterStageClass structure contains only private data * The #ClutterStageClass structure contains only private data
* *
@@ -81,16 +80,13 @@ struct _ClutterStageClass
void (* activate) (ClutterStage *stage); void (* activate) (ClutterStage *stage);
void (* deactivate) (ClutterStage *stage); void (* deactivate) (ClutterStage *stage);
gboolean (* delete_event) (ClutterStage *stage,
ClutterEvent *event);
void (* paint_view) (ClutterStage *stage, void (* paint_view) (ClutterStage *stage,
ClutterStageView *view, ClutterStageView *view,
const cairo_region_t *redraw_clip); const cairo_region_t *redraw_clip);
/*< private >*/ /*< private >*/
/* padding for future expansion */ /* padding for future expansion */
gpointer _padding_dummy[30]; gpointer _padding_dummy[31];
}; };
/** /**
@@ -136,9 +132,6 @@ GType clutter_perspective_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT CLUTTER_EXPORT
GType clutter_stage_get_type (void) G_GNUC_CONST; GType clutter_stage_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
ClutterActor * clutter_stage_new (void);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_stage_get_perspective (ClutterStage *stage, void clutter_stage_get_perspective (ClutterStage *stage,
ClutterPerspective *perspective); ClutterPerspective *perspective);
@@ -219,11 +212,22 @@ gboolean clutter_stage_get_capture_final_size (ClutterStage *stage,
float *scale); float *scale);
CLUTTER_EXPORT CLUTTER_EXPORT
gboolean clutter_stage_capture (ClutterStage *stage, void clutter_stage_paint_to_framebuffer (ClutterStage *stage,
gboolean paint, CoglFramebuffer *framebuffer,
cairo_rectangle_int_t *rect, const cairo_rectangle_int_t *rect,
ClutterCapture **out_captures, float scale,
int *out_n_captures); ClutterPaintFlag paint_flags);
CLUTTER_EXPORT
gboolean clutter_stage_paint_to_buffer (ClutterStage *stage,
const cairo_rectangle_int_t *rect,
float scale,
uint8_t *data,
int stride,
CoglPixelFormat format,
ClutterPaintFlag paint_flags,
GError **error);
CLUTTER_EXPORT CLUTTER_EXPORT
ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage, ClutterStageView * clutter_stage_get_view_at (ClutterStage *stage,
float x, float x,

View File

@@ -2400,7 +2400,8 @@ clutter_text_key_press (ClutterActor *actor,
if (!(event->flags & CLUTTER_EVENT_FLAG_INPUT_METHOD) && if (!(event->flags & CLUTTER_EVENT_FLAG_INPUT_METHOD) &&
clutter_input_focus_is_focused (priv->input_focus) && clutter_input_focus_is_focused (priv->input_focus) &&
clutter_input_focus_filter_key_event (priv->input_focus, event)) clutter_input_focus_filter_event (priv->input_focus,
(ClutterEvent *) event))
return CLUTTER_EVENT_STOP; return CLUTTER_EVENT_STOP;
/* we allow passing synthetic events that only contain /* we allow passing synthetic events that only contain
@@ -2469,7 +2470,8 @@ clutter_text_key_release (ClutterActor *actor,
ClutterTextPrivate *priv = self->priv; ClutterTextPrivate *priv = self->priv;
if (clutter_input_focus_is_focused (priv->input_focus) && if (clutter_input_focus_is_focused (priv->input_focus) &&
clutter_input_focus_filter_key_event (priv->input_focus, event)) clutter_input_focus_filter_event (priv->input_focus,
(ClutterEvent *) event))
return CLUTTER_EVENT_STOP; return CLUTTER_EVENT_STOP;
return CLUTTER_EVENT_PROPAGATE; return CLUTTER_EVENT_PROPAGATE;
@@ -3068,6 +3070,24 @@ clutter_text_resource_scale_changed (ClutterActor *actor)
clutter_actor_queue_immediate_relayout (actor); clutter_actor_queue_immediate_relayout (actor);
} }
static gboolean
clutter_text_event (ClutterActor *self,
ClutterEvent *event)
{
ClutterText *text = CLUTTER_TEXT (self);
ClutterTextPrivate *priv = text->priv;
if (clutter_input_focus_is_focused (priv->input_focus) &&
(event->type == CLUTTER_IM_COMMIT ||
event->type == CLUTTER_IM_DELETE ||
event->type == CLUTTER_IM_PREEDIT))
{
return clutter_input_focus_filter_event (priv->input_focus, event);
}
return CLUTTER_EVENT_PROPAGATE;
}
static void static void
clutter_text_im_focus (ClutterText *text) clutter_text_im_focus (ClutterText *text)
{ {
@@ -3818,6 +3838,7 @@ clutter_text_class_init (ClutterTextClass *klass)
actor_class->has_overlaps = clutter_text_has_overlaps; actor_class->has_overlaps = clutter_text_has_overlaps;
actor_class->calculate_resource_scale = clutter_text_calculate_resource_scale; actor_class->calculate_resource_scale = clutter_text_calculate_resource_scale;
actor_class->resource_scale_changed = clutter_text_resource_scale_changed; actor_class->resource_scale_changed = clutter_text_resource_scale_changed;
actor_class->event = clutter_text_event;
/** /**
* ClutterText:buffer: * ClutterText:buffer:
@@ -5326,7 +5347,7 @@ clutter_text_set_selection_bound (ClutterText *self,
if (priv->selection_bound != selection_bound) if (priv->selection_bound != selection_bound)
{ {
gint len = clutter_text_buffer_get_length (get_buffer (self));; gint len = clutter_text_buffer_get_length (get_buffer (self));
if (selection_bound < 0 || selection_bound >= len) if (selection_bound < 0 || selection_bound >= len)
priv->selection_bound = -1; priv->selection_bound = -1;

View File

@@ -103,6 +103,7 @@
#include "clutter-frame-clock.h" #include "clutter-frame-clock.h"
#include "clutter-main.h" #include "clutter-main.h"
#include "clutter-marshal.h" #include "clutter-marshal.h"
#include "clutter-mutter.h"
#include "clutter-private.h" #include "clutter-private.h"
#include "clutter-scriptable.h" #include "clutter-scriptable.h"
#include "clutter-timeline-private.h" #include "clutter-timeline-private.h"
@@ -113,6 +114,8 @@ struct _ClutterTimelinePrivate
ClutterFrameClock *custom_frame_clock; ClutterFrameClock *custom_frame_clock;
ClutterFrameClock *frame_clock; ClutterFrameClock *frame_clock;
ClutterActor *frame_clock_actor;
gulong frame_clock_actor_stage_views_handler_id;
ClutterActor *actor; ClutterActor *actor;
gulong actor_destroy_handler_id; gulong actor_destroy_handler_id;
@@ -382,19 +385,40 @@ on_stage_stage_views_changed (ClutterActor *stage,
update_frame_clock (timeline); update_frame_clock (timeline);
} }
static void
on_frame_clock_actor_stage_views_changed (ClutterActor *frame_clock_actor,
ClutterTimeline *timeline)
{
update_frame_clock (timeline);
}
static void static void
update_frame_clock (ClutterTimeline *timeline) update_frame_clock (ClutterTimeline *timeline)
{ {
ClutterTimelinePrivate *priv = timeline->priv; ClutterTimelinePrivate *priv = timeline->priv;
ClutterFrameClock *frame_clock = NULL; ClutterFrameClock *frame_clock = NULL;
ClutterActor *stage; ClutterActor *stage;
ClutterActor *frame_clock_actor;
if (!priv->actor) if (!priv->actor)
goto out; goto out;
frame_clock = clutter_actor_pick_frame_clock (priv->actor); if (priv->frame_clock_actor)
{
g_clear_signal_handler (&priv->frame_clock_actor_stage_views_handler_id,
priv->frame_clock_actor);
g_clear_weak_pointer (&priv->frame_clock_actor);
}
frame_clock = clutter_actor_pick_frame_clock (priv->actor, &frame_clock_actor);
if (frame_clock) if (frame_clock)
{ {
g_set_weak_pointer (&priv->frame_clock_actor, frame_clock_actor);
priv->frame_clock_actor_stage_views_handler_id =
g_signal_connect (frame_clock_actor, "stage-views-changed",
G_CALLBACK (on_frame_clock_actor_stage_views_changed),
timeline);
g_clear_signal_handler (&priv->stage_stage_views_handler_id, priv->stage); g_clear_signal_handler (&priv->stage_stage_views_handler_id, priv->stage);
goto out; goto out;
} }
@@ -736,6 +760,13 @@ clutter_timeline_dispose (GObject *object)
priv->actor = NULL; priv->actor = NULL;
} }
if (priv->frame_clock_actor)
{
g_clear_signal_handler (&priv->frame_clock_actor_stage_views_handler_id,
priv->frame_clock_actor);
g_clear_weak_pointer (&priv->frame_clock_actor);
}
if (priv->progress_notify != NULL) if (priv->progress_notify != NULL)
{ {
priv->progress_notify (priv->progress_data); priv->progress_notify (priv->progress_data);

View File

@@ -773,16 +773,16 @@ on_framebuffer_set (ClutterStageView *view)
} }
static void static void
clutter_stage_view_cogl_finalize (GObject *object) clutter_stage_view_cogl_dispose (GObject *object)
{ {
ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (object); ClutterStageViewCogl *view_cogl = CLUTTER_STAGE_VIEW_COGL (object);
ClutterStageViewCoglPrivate *view_priv = ClutterStageViewCoglPrivate *view_priv =
clutter_stage_view_cogl_get_instance_private (view_cogl); clutter_stage_view_cogl_get_instance_private (view_cogl);
g_clear_handle_id (&view_priv->notify_presented_handle_id, g_source_remove); g_clear_handle_id (&view_priv->notify_presented_handle_id, g_source_remove);
clutter_damage_history_free (view_priv->damage_history); g_clear_pointer (&view_priv->damage_history, clutter_damage_history_free);
G_OBJECT_CLASS (clutter_stage_view_cogl_parent_class)->finalize (object); G_OBJECT_CLASS (clutter_stage_view_cogl_parent_class)->dispose (object);
} }
static void static void
@@ -802,5 +802,5 @@ clutter_stage_view_cogl_class_init (ClutterStageViewCoglClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = clutter_stage_view_cogl_finalize; object_class->dispose = clutter_stage_view_cogl_dispose;
} }

View File

@@ -1,297 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2010,2011 Intel Corporation.
* 2011 Giovanni Campagna <scampa.giovanni@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
* Authors:
* Matthew Allum
* Emmanuele Bassi
* Robert Bragg
* Neil Roberts
*/
#include "clutter-build-config.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include "clutter-backend-eglnative.h"
/* This is a Cogl based backend */
#include "cogl/clutter-stage-cogl.h"
#include "clutter-debug.h"
#include "clutter-private.h"
#include "clutter-main.h"
#include "clutter-stage-private.h"
#include "clutter-settings-private.h"
#ifdef COGL_HAS_EGL_SUPPORT
#include "clutter-egl.h"
#endif
G_DEFINE_TYPE (ClutterBackendEglNative, clutter_backend_egl_native, CLUTTER_TYPE_BACKEND);
static void
clutter_backend_egl_native_dispose (GObject *gobject)
{
ClutterBackendEglNative *backend_egl_native = CLUTTER_BACKEND_EGL_NATIVE (gobject);
g_clear_object (&backend_egl_native->xsettings);
if (backend_egl_native->event_timer != NULL)
{
g_timer_destroy (backend_egl_native->event_timer);
backend_egl_native->event_timer = NULL;
}
G_OBJECT_CLASS (clutter_backend_egl_native_parent_class)->dispose (gobject);
}
static void
clutter_backend_egl_native_class_init (ClutterBackendEglNativeClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
gobject_class->dispose = clutter_backend_egl_native_dispose;
}
typedef struct
{
cairo_antialias_t cairo_antialias;
gint clutter_font_antialias;
cairo_hint_style_t cairo_hint_style;
const char *clutter_font_hint_style;
cairo_subpixel_order_t cairo_subpixel_order;
const char *clutter_font_subpixel_order;
} FontSettings;
static void
get_font_gsettings (GSettings *xsettings,
FontSettings *output)
{
/* org.gnome.settings-daemon.GsdFontAntialiasingMode */
static const struct
{
cairo_antialias_t cairo_antialias;
gint clutter_font_antialias;
}
antialiasings[] =
{
/* none=0 */ {CAIRO_ANTIALIAS_NONE, 0},
/* grayscale=1 */ {CAIRO_ANTIALIAS_GRAY, 1},
/* rgba=2 */ {CAIRO_ANTIALIAS_SUBPIXEL, 1},
};
/* org.gnome.settings-daemon.GsdFontHinting */
static const struct
{
cairo_hint_style_t cairo_hint_style;
const char *clutter_font_hint_style;
}
hintings[] =
{
/* none=0 */ {CAIRO_HINT_STYLE_NONE, "hintnone"},
/* slight=1 */ {CAIRO_HINT_STYLE_SLIGHT, "hintslight"},
/* medium=2 */ {CAIRO_HINT_STYLE_MEDIUM, "hintmedium"},
/* full=3 */ {CAIRO_HINT_STYLE_FULL, "hintfull"},
};
/* org.gnome.settings-daemon.GsdFontRgbaOrder */
static const struct
{
cairo_subpixel_order_t cairo_subpixel_order;
const char *clutter_font_subpixel_order;
}
rgba_orders[] =
{
/* rgba=0 */ {CAIRO_SUBPIXEL_ORDER_RGB, "rgb"}, /* XXX what is 'rgba'? */
/* rgb=1 */ {CAIRO_SUBPIXEL_ORDER_RGB, "rgb"},
/* bgr=2 */ {CAIRO_SUBPIXEL_ORDER_BGR, "bgr"},
/* vrgb=3 */ {CAIRO_SUBPIXEL_ORDER_VRGB, "vrgb"},
/* vbgr=4 */ {CAIRO_SUBPIXEL_ORDER_VBGR, "vbgr"},
};
guint i;
i = g_settings_get_enum (xsettings, "hinting");
if (i < G_N_ELEMENTS (hintings))
{
output->cairo_hint_style = hintings[i].cairo_hint_style;
output->clutter_font_hint_style = hintings[i].clutter_font_hint_style;
}
else
{
output->cairo_hint_style = CAIRO_HINT_STYLE_DEFAULT;
output->clutter_font_hint_style = NULL;
}
i = g_settings_get_enum (xsettings, "antialiasing");
if (i < G_N_ELEMENTS (antialiasings))
{
output->cairo_antialias = antialiasings[i].cairo_antialias;
output->clutter_font_antialias = antialiasings[i].clutter_font_antialias;
}
else
{
output->cairo_antialias = CAIRO_ANTIALIAS_DEFAULT;
output->clutter_font_antialias = -1;
}
i = g_settings_get_enum (xsettings, "rgba-order");
if (i < G_N_ELEMENTS (rgba_orders))
{
output->cairo_subpixel_order = rgba_orders[i].cairo_subpixel_order;
output->clutter_font_subpixel_order = rgba_orders[i].clutter_font_subpixel_order;
}
else
{
output->cairo_subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
output->clutter_font_subpixel_order = NULL;
}
if (output->cairo_antialias == CAIRO_ANTIALIAS_GRAY)
output->clutter_font_subpixel_order = "none";
}
static void
init_font_options (ClutterBackendEglNative *backend_egl_native)
{
GSettings *xsettings = backend_egl_native->xsettings;
cairo_font_options_t *options = cairo_font_options_create ();
FontSettings fs;
get_font_gsettings (xsettings, &fs);
cairo_font_options_set_hint_style (options, fs.cairo_hint_style);
cairo_font_options_set_antialias (options, fs.cairo_antialias);
cairo_font_options_set_subpixel_order (options, fs.cairo_subpixel_order);
clutter_backend_set_font_options (CLUTTER_BACKEND (backend_egl_native),
options);
cairo_font_options_destroy (options);
}
static gboolean
on_xsettings_change_event (GSettings *xsettings,
gpointer keys,
gint n_keys,
gpointer user_data)
{
/*
* A simpler alternative to this function that does not update the screen
* immediately (like macOS :P):
*
* init_font_options (CLUTTER_BACKEND_EGL_NATIVE (user_data));
*
* which has the added benefit of eliminating the need for all the
* FontSettings.clutter_ fields. However the below approach is better for
* testing settings and more consistent with the existing x11 backend...
*/
ClutterSettings *csettings = clutter_settings_get_default ();
FontSettings fs;
gint hinting;
get_font_gsettings (xsettings, &fs);
hinting = fs.cairo_hint_style == CAIRO_HINT_STYLE_NONE ? 0 : 1;
g_object_set (csettings,
"font-hinting", hinting,
"font-hint-style", fs.clutter_font_hint_style,
"font-antialias", fs.clutter_font_antialias,
"font-subpixel-order", fs.clutter_font_subpixel_order,
NULL);
return FALSE;
}
static void
clutter_backend_egl_native_init (ClutterBackendEglNative *backend_egl_native)
{
static const gchar xsettings_path[] = "org.gnome.settings-daemon.plugins.xsettings";
GSettingsSchemaSource *source = g_settings_schema_source_get_default ();
GSettingsSchema *schema = g_settings_schema_source_lookup (source,
xsettings_path,
TRUE);
if (!schema)
{
g_warning ("Failed to find schema: %s", xsettings_path);
}
else
{
backend_egl_native->xsettings = g_settings_new_full (schema, NULL, NULL);
if (backend_egl_native->xsettings)
{
init_font_options (backend_egl_native);
g_signal_connect (backend_egl_native->xsettings, "change-event",
G_CALLBACK (on_xsettings_change_event),
backend_egl_native);
}
}
backend_egl_native->event_timer = g_timer_new ();
}
ClutterBackend *
clutter_backend_egl_native_new (void)
{
return g_object_new (CLUTTER_TYPE_BACKEND_EGL_NATIVE, NULL);
}
/**
* clutter_egl_get_egl_display:
*
* Retrieves the EGL display used by Clutter, if it supports the
* EGL windowing system and if it is running using an EGL backend.
*
* Return value: the EGL display used by Clutter, or 0
*
* Since: 1.6
*/
EGLDisplay
clutter_egl_get_egl_display (void)
{
ClutterBackend *backend;
if (!_clutter_context_is_initialized ())
{
g_critical ("The Clutter backend has not been initialized yet");
return 0;
}
backend = clutter_get_default_backend ();
if (!CLUTTER_IS_BACKEND_EGL_NATIVE (backend))
{
g_critical ("The Clutter backend is not an EGL backend");
return 0;
}
#ifdef COGL_HAS_EGL_SUPPORT
return cogl_egl_context_get_egl_display (backend->cogl_context);
#else
return 0;
#endif
}

View File

@@ -1,78 +0,0 @@
/* Clutter.
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2006, 2007 OpenedHand
* Copyright (C) 2010 Intel Corp
* 2011 Giovanni Campagna <scampa.giovanni@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Matthew Allum
* Robert Bragg
*/
#ifndef __CLUTTER_BACKEND_EGL_NATIVE_H__
#define __CLUTTER_BACKEND_EGL_NATIVE_H__
#include <glib-object.h>
#include <gio/gio.h>
#include <cogl/cogl.h>
#include <cogl/cogl-egl.h>
#include <clutter/clutter-event.h>
#include <clutter/clutter-backend.h>
#include "clutter-backend-private.h"
G_BEGIN_DECLS
#define CLUTTER_TYPE_BACKEND_EGL_NATIVE (clutter_backend_egl_native_get_type ())
#define CLUTTER_BACKEND_EGL_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_BACKEND_EGL_NATIVE, ClutterBackendEglNative))
#define CLUTTER_IS_BACKEND_EGL_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_BACKEND_EGL_NATIVE))
#define CLUTTER_BACKEND_EGL_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_BACKEND_EGL_NATIVE, ClutterBackendEglNativeClass))
#define CLUTTER_IS_BACKEND_EGL_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_BACKEND_EGL_NATIVE))
#define CLUTTER_BACKEND_EGL_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_BACKEND_EGL_NATIVE, ClutterBackendEglNativeClass))
typedef struct _ClutterBackendEglNative ClutterBackendEglNative;
typedef struct _ClutterBackendEglNativeClass ClutterBackendEglNativeClass;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackendEglNative, g_object_unref)
struct _ClutterBackendEglNative
{
ClutterBackend parent_instance;
/* event source */
GSource *event_source;
/* event timer */
GTimer *event_timer;
/* "xsettings" is still the defacto place for Xft settings, even in Wayland */
GSettings *xsettings;
};
struct _ClutterBackendEglNativeClass
{
ClutterBackendClass parent_class;
};
CLUTTER_EXPORT
GType clutter_backend_egl_native_get_type (void) G_GNUC_CONST;
ClutterBackend *clutter_backend_egl_native_new (void);
G_END_DECLS
#endif /* __CLUTTER_BACKEND_EGL_NATIVE_H__ */

View File

@@ -1,59 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
/**
* SECTION:clutter-egl
* @short_description: EGL specific API
*
* The EGL backend for Clutter provides some EGL specific API
*
* You need to include `clutter-egl.h` to have access to the functions documented here.
*/
#ifndef __CLUTTER_EGL_H__
#define __CLUTTER_EGL_H__
#include <glib.h>
#include "clutter-egl-headers.h"
#include <clutter/clutter.h>
G_BEGIN_DECLS
/**
* clutter_egl_get_egl_display:
*
* Retrieves the #EGLDisplay used by Clutter.
*
* Return value: the EGL display
*
* Since: 1.6
*/
CLUTTER_EXPORT
EGLDisplay clutter_egl_get_egl_display (void);
G_END_DECLS
#endif /* __CLUTTER_EGL_H__ */

View File

@@ -257,13 +257,6 @@ if have_x11
clutter_backend_nonintrospected_sources += clutter_x11_nonintrospected_sources clutter_backend_nonintrospected_sources += clutter_x11_nonintrospected_sources
endif endif
if have_native_backend
clutter_native_nonintrospected_sources = [
'egl/clutter-backend-eglnative.c',
]
clutter_backend_nonintrospected_sources += clutter_native_nonintrospected_sources
endif
if have_wayland if have_wayland
clutter_wayland_private_headers = [ clutter_wayland_private_headers = [
'wayland/clutter-wayland-compositor.h', 'wayland/clutter-wayland-compositor.h',

View File

@@ -98,7 +98,6 @@ static const gchar *atom_names[] = {
/* various flags corresponding to pre init setup calls */ /* various flags corresponding to pre init setup calls */
static gboolean clutter_enable_xinput = TRUE; static gboolean clutter_enable_xinput = TRUE;
static gboolean clutter_enable_argb = FALSE;
static gboolean clutter_enable_stereo = FALSE; static gboolean clutter_enable_stereo = FALSE;
static Display *_foreign_dpy = NULL; static Display *_foreign_dpy = NULL;
@@ -240,13 +239,6 @@ clutter_backend_x11_pre_parse (ClutterBackend *backend,
env_string = NULL; env_string = NULL;
} }
env_string = g_getenv ("CLUTTER_DISABLE_ARGB_VISUAL");
if (env_string)
{
clutter_enable_argb = FALSE;
env_string = NULL;
}
env_string = g_getenv ("CLUTTER_DISABLE_XINPUT"); env_string = g_getenv ("CLUTTER_DISABLE_XINPUT");
if (env_string) if (env_string)
{ {
@@ -550,15 +542,12 @@ clutter_backend_x11_get_renderer (ClutterBackend *backend,
static gboolean static gboolean
check_onscreen_template (CoglRenderer *renderer, check_onscreen_template (CoglRenderer *renderer,
CoglSwapChain *swap_chain,
CoglOnscreenTemplate *onscreen_template, CoglOnscreenTemplate *onscreen_template,
gboolean enable_argb,
gboolean enable_stereo, gboolean enable_stereo,
GError **error) GError **error)
{ {
GError *internal_error = NULL; GError *internal_error = NULL;
cogl_swap_chain_set_has_alpha (swap_chain, enable_argb);
cogl_onscreen_template_set_stereo_enabled (onscreen_template, cogl_onscreen_template_set_stereo_enabled (onscreen_template,
clutter_enable_stereo); clutter_enable_stereo);
@@ -573,17 +562,15 @@ check_onscreen_template (CoglRenderer *renderer,
*/ */
if (cogl_renderer_check_onscreen_template (renderer, onscreen_template, &internal_error)) if (cogl_renderer_check_onscreen_template (renderer, onscreen_template, &internal_error))
{ {
clutter_enable_argb = enable_argb;
clutter_enable_stereo = enable_stereo; clutter_enable_stereo = enable_stereo;
return TRUE; return TRUE;
} }
else else
{ {
if (enable_argb || enable_stereo) /* More possibilities to try */ if (enable_stereo) /* More possibilities to try */
CLUTTER_NOTE (BACKEND, CLUTTER_NOTE (BACKEND,
"Creation of a CoglDisplay with alpha=%s, stereo=%s failed: %s", "Creation of a CoglDisplay with, stereo=%s failed: %s",
enable_argb ? "enabled" : "disabled",
enable_stereo ? "enabled" : "disabled", enable_stereo ? "enabled" : "disabled",
internal_error != NULL internal_error != NULL
? internal_error->message ? internal_error->message
@@ -611,8 +598,7 @@ clutter_backend_x11_get_display (ClutterBackend *backend,
CoglDisplay *display = NULL; CoglDisplay *display = NULL;
gboolean res = FALSE; gboolean res = FALSE;
CLUTTER_NOTE (BACKEND, "Creating CoglDisplay, alpha=%s, stereo=%s", CLUTTER_NOTE (BACKEND, "Creating CoglDisplay, stereo=%s",
clutter_enable_argb ? "enabled" : "disabled",
clutter_enable_stereo ? "enabled" : "disabled"); clutter_enable_stereo ? "enabled" : "disabled");
onscreen_template = cogl_onscreen_template_new (swap_chain); onscreen_template = cogl_onscreen_template_new (swap_chain);
@@ -620,22 +606,13 @@ clutter_backend_x11_get_display (ClutterBackend *backend,
/* It's possible that the current renderer doesn't support transparency /* It's possible that the current renderer doesn't support transparency
* or doesn't support stereo, so we try the different combinations. * or doesn't support stereo, so we try the different combinations.
*/ */
if (clutter_enable_argb && clutter_enable_stereo) if (clutter_enable_stereo)
res = check_onscreen_template (renderer, swap_chain, onscreen_template, res = check_onscreen_template (renderer, onscreen_template,
TRUE, TRUE, error); TRUE, error);
/* Prioritize stereo over alpha */
if (!res && clutter_enable_stereo)
res = check_onscreen_template (renderer, swap_chain, onscreen_template,
FALSE, TRUE, error);
if (!res && clutter_enable_argb)
res = check_onscreen_template (renderer, swap_chain, onscreen_template,
TRUE, FALSE, error);
if (!res) if (!res)
res = check_onscreen_template (renderer, swap_chain, onscreen_template, res = check_onscreen_template (renderer, onscreen_template,
FALSE, FALSE, error); FALSE, error);
if (res) if (res)
display = cogl_display_new (renderer, onscreen_template); display = cogl_display_new (renderer, onscreen_template);
@@ -929,99 +906,6 @@ clutter_x11_remove_filter (ClutterX11FilterFunc func,
} }
} }
/**
* clutter_x11_has_composite_extension:
*
* Retrieves whether Clutter is running on an X11 server with the
* XComposite extension
*
* Return value: %TRUE if the XComposite extension is available
*/
gboolean
clutter_x11_has_composite_extension (void)
{
static gboolean have_composite = FALSE, done_check = FALSE;
int error = 0, event = 0;
Display *dpy;
if (done_check)
return have_composite;
if (!_clutter_context_is_initialized ())
{
g_critical ("X11 backend has not been initialised");
return FALSE;
}
dpy = clutter_x11_get_default_display();
if (dpy == NULL)
return FALSE;
if (XCompositeQueryExtension (dpy, &event, &error))
{
int major = 0, minor = 0;
if (XCompositeQueryVersion (dpy, &major, &minor))
{
if (major >= 0 && minor >= 3)
have_composite = TRUE;
}
}
done_check = TRUE;
return have_composite;
}
/**
* clutter_x11_set_use_argb_visual:
* @use_argb: %TRUE if ARGB visuals should be requested by default
*
* Sets whether the Clutter X11 backend should request ARGB visuals by default
* or not.
*
* By default, Clutter requests RGB visuals.
*
* If no ARGB visuals are found, the X11 backend will fall back to
* requesting a RGB visual instead.
*
* ARGB visuals are required for the #ClutterStage:use-alpha property to work.
*
* This function can only be called once, and before clutter_init() is
* called.
*
* Since: 1.2
*/
void
clutter_x11_set_use_argb_visual (gboolean use_argb)
{
if (_clutter_context_is_initialized ())
{
g_warning ("%s() can only be used before calling clutter_init()",
G_STRFUNC);
return;
}
CLUTTER_NOTE (BACKEND, "ARGB visuals are %s",
use_argb ? "enabled" : "disabled");
clutter_enable_argb = use_argb;
}
/**
* clutter_x11_get_use_argb_visual:
*
* Retrieves whether the Clutter X11 backend is using ARGB visuals by default
*
* Return value: %TRUE if ARGB visuals are queried by default
*
* Since: 1.2
*/
gboolean
clutter_x11_get_use_argb_visual (void)
{
return clutter_enable_argb;
}
/** /**
* clutter_x11_set_use_stereo_stage: * clutter_x11_set_use_stereo_stage:
* @use_stereo: %TRUE if the stereo stages should be used if possible. * @use_stereo: %TRUE if the stereo stages should be used if possible.

View File

@@ -8,12 +8,6 @@ static const struct {
} _clutter_settings_map[] = { } _clutter_settings_map[] = {
{ "Net/DoubleClickDistance", "double-click-distance" }, { "Net/DoubleClickDistance", "double-click-distance" },
{ "Net/DndDragThreshold", "dnd-drag-threshold" }, { "Net/DndDragThreshold", "dnd-drag-threshold" },
{ "Gtk/FontName", "font-name" },
{ "Xft/Antialias", "font-antialias" },
{ "Xft/Hinting", "font-hinting" },
{ "Xft/HintStyle", "font-hint-style" },
{ "Xft/RGBA", "font-subpixel-order" },
{ "Fontconfig/Timestamp", "fontconfig-timestamp" },
}; };
static const gint _n_clutter_settings_map = G_N_ELEMENTS (_clutter_settings_map); static const gint _n_clutter_settings_map = G_N_ELEMENTS (_clutter_settings_map);

View File

@@ -109,14 +109,6 @@ CLUTTER_EXPORT
void clutter_x11_remove_filter (ClutterX11FilterFunc func, void clutter_x11_remove_filter (ClutterX11FilterFunc func,
gpointer data); gpointer data);
CLUTTER_EXPORT
gboolean clutter_x11_has_composite_extension (void);
CLUTTER_EXPORT
void clutter_x11_set_use_argb_visual (gboolean use_argb);
CLUTTER_EXPORT
gboolean clutter_x11_get_use_argb_visual (void);
CLUTTER_EXPORT CLUTTER_EXPORT
void clutter_x11_set_use_stereo_stage (gboolean use_stereo); void clutter_x11_set_use_stereo_stage (gboolean use_stereo);
CLUTTER_EXPORT CLUTTER_EXPORT

View File

@@ -351,6 +351,14 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
case COGL_PIXEL_FORMAT_BGRA_1010102_PRE: case COGL_PIXEL_FORMAT_BGRA_1010102_PRE:
case COGL_PIXEL_FORMAT_ARGB_2101010_PRE: case COGL_PIXEL_FORMAT_ARGB_2101010_PRE:
case COGL_PIXEL_FORMAT_ABGR_2101010_PRE: case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE:
return TRUE; return TRUE;
} }

View File

@@ -40,13 +40,13 @@
#define UNPACK_2(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \ #define UNPACK_2(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \
1) / 3) 1) / 3)
#define UNPACK_4(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \ #define UNPACK_4(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \
7) / 15) 7) / 0xf)
#define UNPACK_5(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \ #define UNPACK_5(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \
15) / 31) 0xf) / 0x1f)
#define UNPACK_6(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \ #define UNPACK_6(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \
31) / 63) 0x1f) / 0x3f)
#define UNPACK_10(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \ #define UNPACK_10(b) (((b) * ((1 << (sizeof (component_type) * 8)) - 1) + \
511) / 1023) 0x1ff) / 0x3ff)
inline static void inline static void
G_PASTE (_cogl_unpack_a_8_, component_size) (const uint8_t *src, G_PASTE (_cogl_unpack_a_8_, component_size) (const uint8_t *src,
@@ -207,8 +207,8 @@ G_PASTE (_cogl_unpack_rgb_565_, component_size) (const uint8_t *src,
uint16_t v = *(const uint16_t *) src; uint16_t v = *(const uint16_t *) src;
dst[0] = UNPACK_5 (v >> 11); dst[0] = UNPACK_5 (v >> 11);
dst[1] = UNPACK_6 ((v >> 5) & 63); dst[1] = UNPACK_6 ((v >> 5) & 0x3f);
dst[2] = UNPACK_5 (v & 31); dst[2] = UNPACK_5 (v & 0x1f);
dst[3] = UNPACK_BYTE (255); dst[3] = UNPACK_BYTE (255);
dst += 4; dst += 4;
src += 2; src += 2;
@@ -225,9 +225,9 @@ G_PASTE (_cogl_unpack_rgba_4444_, component_size) (const uint8_t *src,
uint16_t v = *(const uint16_t *) src; uint16_t v = *(const uint16_t *) src;
dst[0] = UNPACK_4 (v >> 12); dst[0] = UNPACK_4 (v >> 12);
dst[1] = UNPACK_4 ((v >> 8) & 15); dst[1] = UNPACK_4 ((v >> 8) & 0xf);
dst[2] = UNPACK_4 ((v >> 4) & 15); dst[2] = UNPACK_4 ((v >> 4) & 0xf);
dst[3] = UNPACK_4 (v & 15); dst[3] = UNPACK_4 (v & 0xf);
dst += 4; dst += 4;
src += 2; src += 2;
} }
@@ -243,8 +243,8 @@ G_PASTE (_cogl_unpack_rgba_5551_, component_size) (const uint8_t *src,
uint16_t v = *(const uint16_t *) src; uint16_t v = *(const uint16_t *) src;
dst[0] = UNPACK_5 (v >> 11); dst[0] = UNPACK_5 (v >> 11);
dst[1] = UNPACK_5 ((v >> 6) & 31); dst[1] = UNPACK_5 ((v >> 6) & 0x1f);
dst[2] = UNPACK_5 ((v >> 1) & 31); dst[2] = UNPACK_5 ((v >> 1) & 0x1f);
dst[3] = UNPACK_1 (v & 1); dst[3] = UNPACK_1 (v & 1);
dst += 4; dst += 4;
src += 2; src += 2;
@@ -261,8 +261,8 @@ G_PASTE (_cogl_unpack_rgba_1010102_, component_size) (const uint8_t *src,
uint32_t v = *(const uint32_t *) src; uint32_t v = *(const uint32_t *) src;
dst[0] = UNPACK_10 (v >> 22); dst[0] = UNPACK_10 (v >> 22);
dst[1] = UNPACK_10 ((v >> 12) & 1023); dst[1] = UNPACK_10 ((v >> 12) & 0x3ff);
dst[2] = UNPACK_10 ((v >> 2) & 1023); dst[2] = UNPACK_10 ((v >> 2) & 0x3ff);
dst[3] = UNPACK_2 (v & 3); dst[3] = UNPACK_2 (v & 3);
dst += 4; dst += 4;
src += 2; src += 2;
@@ -279,8 +279,8 @@ G_PASTE (_cogl_unpack_bgra_1010102_, component_size) (const uint8_t *src,
uint32_t v = *(const uint32_t *) src; uint32_t v = *(const uint32_t *) src;
dst[2] = UNPACK_10 (v >> 22); dst[2] = UNPACK_10 (v >> 22);
dst[1] = UNPACK_10 ((v >> 12) & 1023); dst[1] = UNPACK_10 ((v >> 12) & 0x3ff);
dst[0] = UNPACK_10 ((v >> 2) & 1023); dst[0] = UNPACK_10 ((v >> 2) & 0x3ff);
dst[3] = UNPACK_2 (v & 3); dst[3] = UNPACK_2 (v & 3);
dst += 4; dst += 4;
src += 2; src += 2;
@@ -297,9 +297,9 @@ G_PASTE (_cogl_unpack_argb_2101010_, component_size) (const uint8_t *src,
uint32_t v = *(const uint32_t *) src; uint32_t v = *(const uint32_t *) src;
dst[3] = UNPACK_2 (v >> 30); dst[3] = UNPACK_2 (v >> 30);
dst[0] = UNPACK_10 ((v >> 20) & 1023); dst[0] = UNPACK_10 ((v >> 20) & 0x3ff);
dst[1] = UNPACK_10 ((v >> 10) & 1023); dst[1] = UNPACK_10 ((v >> 10) & 0x3ff);
dst[2] = UNPACK_10 (v & 1023); dst[2] = UNPACK_10 (v & 0x3ff);
dst += 4; dst += 4;
src += 2; src += 2;
} }
@@ -315,14 +315,22 @@ G_PASTE (_cogl_unpack_abgr_2101010_, component_size) (const uint8_t *src,
uint32_t v = *(const uint32_t *) src; uint32_t v = *(const uint32_t *) src;
dst[3] = UNPACK_2 (v >> 30); dst[3] = UNPACK_2 (v >> 30);
dst[2] = UNPACK_10 ((v >> 20) & 1023); dst[2] = UNPACK_10 ((v >> 20) & 0x3ff);
dst[1] = UNPACK_10 ((v >> 10) & 1023); dst[1] = UNPACK_10 ((v >> 10) & 0x3ff);
dst[0] = UNPACK_10 (v & 1023); dst[0] = UNPACK_10 (v & 0x3ff);
dst += 4; dst += 4;
src += 2; src += 2;
} }
} }
inline static void
G_PASTE (_cogl_unpack_argb_fp_16161616_, component_size) (const uint8_t *src,
component_type *dst,
int width)
{
g_warning ("Not implemented");
}
#undef UNPACK_1 #undef UNPACK_1
#undef UNPACK_2 #undef UNPACK_2
#undef UNPACK_4 #undef UNPACK_4
@@ -396,6 +404,16 @@ G_PASTE (_cogl_unpack_, component_size) (CoglPixelFormat format,
case COGL_PIXEL_FORMAT_ABGR_2101010_PRE: case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
G_PASTE (_cogl_unpack_abgr_2101010_, component_size) (src, dst, width); G_PASTE (_cogl_unpack_abgr_2101010_, component_size) (src, dst, width);
break; break;
case COGL_PIXEL_FORMAT_RGBA_FP_16161616:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE:
G_PASTE (_cogl_unpack_argb_fp_16161616_, component_size) (src, dst, width);
break;
case COGL_PIXEL_FORMAT_DEPTH_16: case COGL_PIXEL_FORMAT_DEPTH_16:
case COGL_PIXEL_FORMAT_DEPTH_32: case COGL_PIXEL_FORMAT_DEPTH_32:
case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8: case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
@@ -414,10 +432,10 @@ G_PASTE (_cogl_unpack_, component_size) (CoglPixelFormat format,
#define PACK_1(b) PACK_SIZE (b, 1) #define PACK_1(b) PACK_SIZE (b, 1)
#define PACK_2(b) PACK_SIZE (b, 3) #define PACK_2(b) PACK_SIZE (b, 3)
#define PACK_4(b) PACK_SIZE (b, 15) #define PACK_4(b) PACK_SIZE (b, 0xf)
#define PACK_5(b) PACK_SIZE (b, 31) #define PACK_5(b) PACK_SIZE (b, 0x1f)
#define PACK_6(b) PACK_SIZE (b, 63) #define PACK_6(b) PACK_SIZE (b, 0x3f)
#define PACK_10(b) PACK_SIZE (b, 1023) #define PACK_10(b) PACK_SIZE (b, 0x3ff)
inline static void inline static void
G_PASTE (_cogl_pack_a_8_, component_size) (const component_type *src, G_PASTE (_cogl_pack_a_8_, component_size) (const component_type *src,
@@ -683,6 +701,14 @@ G_PASTE (_cogl_pack_abgr_2101010_, component_size) (const component_type *src,
} }
} }
inline static void
G_PASTE (_cogl_pack_argb_fp_16161616_, component_size) (const component_type *src,
uint8_t *dst,
int width)
{
g_warning ("Not implemented");
}
#undef PACK_SIZE #undef PACK_SIZE
#undef PACK_1 #undef PACK_1
#undef PACK_2 #undef PACK_2
@@ -757,6 +783,16 @@ G_PASTE (_cogl_pack_, component_size) (CoglPixelFormat format,
case COGL_PIXEL_FORMAT_ABGR_2101010_PRE: case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
G_PASTE (_cogl_pack_abgr_2101010_, component_size) (src, dst, width); G_PASTE (_cogl_pack_abgr_2101010_, component_size) (src, dst, width);
break; break;
case COGL_PIXEL_FORMAT_RGBA_FP_16161616:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE:
G_PASTE (_cogl_pack_argb_fp_16161616_, component_size) (src, dst, width);
break;
case COGL_PIXEL_FORMAT_DEPTH_16: case COGL_PIXEL_FORMAT_DEPTH_16:
case COGL_PIXEL_FORMAT_DEPTH_32: case COGL_PIXEL_FORMAT_DEPTH_32:
case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8: case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:

View File

@@ -30,6 +30,7 @@
#include "cogl-config.h" #include "cogl-config.h"
#include "cogl-mutter.h"
#include "cogl-object.h" #include "cogl-object.h"
#include "cogl-private.h" #include "cogl-private.h"
#include "cogl-profile.h" #include "cogl-profile.h"
@@ -464,3 +465,10 @@ cogl_context_is_hardware_accelerated (CoglContext *context)
{ {
return context->driver_vtable->is_hardware_accelerated (context); return context->driver_vtable->is_hardware_accelerated (context);
} }
gboolean
cogl_context_format_supports_upload (CoglContext *ctx,
CoglPixelFormat format)
{
return ctx->texture_driver->format_supports_upload (ctx, format);
}

View File

@@ -325,7 +325,7 @@ foreach_clamped_region (CoglMetaTexture *meta_texture,
if (*tx_1 < 0) if (*tx_1 < 0)
{ {
clamp_data.start = *tx_1; clamp_data.start = *tx_1;
clamp_data.end = MIN (0, *tx_2);; clamp_data.end = MIN (0, *tx_2);
cogl_meta_texture_foreach_in_region (meta_texture, cogl_meta_texture_foreach_in_region (meta_texture,
half_texel_width, *ty_1, half_texel_width, *ty_1,
half_texel_width, *ty_2, half_texel_width, *ty_2,
@@ -377,7 +377,7 @@ foreach_clamped_region (CoglMetaTexture *meta_texture,
if (*ty_1 < 0) if (*ty_1 < 0)
{ {
clamp_data.start = *ty_1; clamp_data.start = *ty_1;
clamp_data.end = MIN (0, *ty_2);; clamp_data.end = MIN (0, *ty_2);
cogl_meta_texture_foreach_in_region (meta_texture, cogl_meta_texture_foreach_in_region (meta_texture,
*tx_1, half_texel_height, *tx_1, half_texel_height,
*tx_2, half_texel_height, *tx_2, half_texel_height,
@@ -396,7 +396,7 @@ foreach_clamped_region (CoglMetaTexture *meta_texture,
/* Handle any bottom clamped region */ /* Handle any bottom clamped region */
if (*ty_2 > max_t_coord) if (*ty_2 > max_t_coord)
{ {
clamp_data.start = MAX (max_t_coord, *ty_1);; clamp_data.start = MAX (max_t_coord, *ty_1);
clamp_data.end = *ty_2; clamp_data.end = *ty_2;
cogl_meta_texture_foreach_in_region (meta_texture, cogl_meta_texture_foreach_in_region (meta_texture,
*tx_1, *tx_1,

View File

@@ -48,4 +48,8 @@ void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglCustomWinsysVtableGetter winsys_vtable_getter, CoglCustomWinsysVtableGetter winsys_vtable_getter,
void *user_data); void *user_data);
COGL_EXPORT
gboolean cogl_context_format_supports_upload (CoglContext *ctx,
CoglPixelFormat format);
#endif /* __COGL_MUTTER_H___ */ #endif /* __COGL_MUTTER_H___ */

View File

@@ -245,6 +245,62 @@ static const CoglPixelFormatInfo format_info_table[] = {
.aligned = 0, .aligned = 0,
.bpp = { 4 }, .bpp = { 4 },
}, },
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_FP_16161616,
.format_str = "RGBA_FP_16161616",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_BGRA_FP_16161616,
.format_str = "BGRA_FP_16161616",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ARGB_FP_16161616,
.format_str = "ARGB_FP_16161616",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ABGR_FP_16161616,
.format_str = "ABGR_FP_16161616",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE,
.format_str = "RGBA_FP_16161616_PRE",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE,
.format_str = "BGRA_FP_16161616_PRE",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE,
.format_str = "ARGB_FP_16161616_PRE",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{
.cogl_format = COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE,
.format_str = "ABGR_FP_16161616_PRE",
.n_planes = 1,
.bpp = { 8 },
.aligned = 1
},
{ {
.cogl_format = COGL_PIXEL_FORMAT_DEPTH_16, .cogl_format = COGL_PIXEL_FORMAT_DEPTH_16,
.format_str = "DEPTH_16", .format_str = "DEPTH_16",

View File

@@ -103,7 +103,7 @@ G_BEGIN_DECLS
* 7 = YUV: undefined bpp, undefined alignment * 7 = YUV: undefined bpp, undefined alignment
* 9 = 2 bpp, aligned * 9 = 2 bpp, aligned
* 10 = depth, aligned (8, 16, 24, 32, 32f) * 10 = depth, aligned (8, 16, 24, 32, 32f)
* 11 = undefined * 11 = 8 bpp fp16
* 12 = 3 bpp, not aligned * 12 = 3 bpp, not aligned
* 13 = 4 bpp, not aligned (e.g. 2101010) * 13 = 4 bpp, not aligned (e.g. 2101010)
* 14-15 = undefined * 14-15 = undefined
@@ -168,6 +168,14 @@ G_BEGIN_DECLS
* @COGL_PIXEL_FORMAT_BGRA_1010102_PRE: Premultiplied BGRA, 32 bits, 10 bpc * @COGL_PIXEL_FORMAT_BGRA_1010102_PRE: Premultiplied BGRA, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ARGB_2101010_PRE: Premultiplied ARGB, 32 bits, 10 bpc * @COGL_PIXEL_FORMAT_ARGB_2101010_PRE: Premultiplied ARGB, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_ABGR_2101010_PRE: Premultiplied ABGR, 32 bits, 10 bpc * @COGL_PIXEL_FORMAT_ABGR_2101010_PRE: Premultiplied ABGR, 32 bits, 10 bpc
* @COGL_PIXEL_FORMAT_RGBA_FP_16161616: RGBA half floating point, 64 bit
* @COGL_PIXEL_FORMAT_BGRA_FP_16161616: BGRA half floating point, 64 bit
* @COGL_PIXEL_FORMAT_ARGB_FP_16161616: ARGB half floating point, 64 bit
* @COGL_PIXEL_FORMAT_ABGR_FP_16161616: ABGR half floating point, 64 bit
* @COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE: Premultiplied RGBA half floating point, 64 bit
* @COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE: Premultiplied BGRA half floating point, 64 bit
* @COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE: Premultiplied ARGB half floating point, 64 bit
* @COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE: Premultiplied ABGR half floating point, 64 bit
* *
* Pixel formats used by Cogl. For the formats with a byte per * Pixel formats used by Cogl. For the formats with a byte per
* component, the order of the components specify the order in * component, the order of the components specify the order in
@@ -216,6 +224,11 @@ typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/
COGL_PIXEL_FORMAT_ARGB_2101010 = (13 | COGL_A_BIT | COGL_AFIRST_BIT), COGL_PIXEL_FORMAT_ARGB_2101010 = (13 | COGL_A_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_2101010 = (13 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT), COGL_PIXEL_FORMAT_ABGR_2101010 = (13 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_FP_16161616 = (11 | COGL_A_BIT),
COGL_PIXEL_FORMAT_BGRA_FP_16161616 = (11 | COGL_A_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_FP_16161616 = (11 | COGL_A_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_FP_16161616 = (11 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT), COGL_PIXEL_FORMAT_RGBA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT), COGL_PIXEL_FORMAT_BGRA_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT), COGL_PIXEL_FORMAT_ARGB_8888_PRE = (3 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT),
@@ -228,6 +241,11 @@ typedef enum /*< prefix=COGL_PIXEL_FORMAT >*/
COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (COGL_PIXEL_FORMAT_ARGB_2101010 | COGL_PREMULT_BIT), COGL_PIXEL_FORMAT_ARGB_2101010_PRE = (COGL_PIXEL_FORMAT_ARGB_2101010 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (COGL_PIXEL_FORMAT_ABGR_2101010 | COGL_PREMULT_BIT), COGL_PIXEL_FORMAT_ABGR_2101010_PRE = (COGL_PIXEL_FORMAT_ABGR_2101010 | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE = (11 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE = (11 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE = (11 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE = (11 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_DEPTH_16 = (9 | COGL_DEPTH_BIT), COGL_PIXEL_FORMAT_DEPTH_16 = (9 | COGL_DEPTH_BIT),
COGL_PIXEL_FORMAT_DEPTH_32 = (3 | COGL_DEPTH_BIT), COGL_PIXEL_FORMAT_DEPTH_32 = (3 | COGL_DEPTH_BIT),

View File

@@ -46,6 +46,8 @@ typedef enum
COGL_PRIVATE_FEATURE_EXT_PACKED_DEPTH_STENCIL, COGL_PRIVATE_FEATURE_EXT_PACKED_DEPTH_STENCIL,
COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL, COGL_PRIVATE_FEATURE_OES_PACKED_DEPTH_STENCIL,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_BGRA8888, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_BGRA8888,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT,
COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE, COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE,
COGL_PRIVATE_FEATURE_SAMPLER_OBJECTS, COGL_PRIVATE_FEATURE_SAMPLER_OBJECTS,
COGL_PRIVATE_FEATURE_READ_PIXELS_ANY_FORMAT, COGL_PRIVATE_FEATURE_READ_PIXELS_ANY_FORMAT,

View File

@@ -37,8 +37,6 @@ struct _CoglSwapChain
{ {
CoglObject _parent; CoglObject _parent;
gboolean has_alpha;
int length; int length;
}; };

View File

@@ -59,13 +59,6 @@ cogl_swap_chain_new (void)
return _cogl_swap_chain_object_new (swap_chain); return _cogl_swap_chain_object_new (swap_chain);
} }
void
cogl_swap_chain_set_has_alpha (CoglSwapChain *swap_chain,
gboolean has_alpha)
{
swap_chain->has_alpha = has_alpha;
}
void void
cogl_swap_chain_set_length (CoglSwapChain *swap_chain, cogl_swap_chain_set_length (CoglSwapChain *swap_chain,
int length) int length)

View File

@@ -402,6 +402,11 @@ _cogl_texture_2d_pre_paint (CoglTexture *tex, CoglTexturePrePaintFlags flags)
{ {
CoglContext *ctx = tex->context; CoglContext *ctx = tex->context;
/* Since we are about to ask the GPU to generate mipmaps of tex, we
* better make sure tex is up-to-date.
*/
_cogl_texture_flush_journal_rendering (tex);
ctx->driver_vtable->texture_2d_generate_mipmap (tex_2d); ctx->driver_vtable->texture_2d_generate_mipmap (tex_2d);
tex_2d->mipmaps_dirty = FALSE; tex_2d->mipmaps_dirty = FALSE;

View File

@@ -128,6 +128,11 @@ struct _CoglTextureDriver
int width, int width,
int height); int height);
gboolean
(* format_supports_upload) (CoglContext *ctx,
CoglPixelFormat format);
/* /*
* The driver may impose constraints on what formats can be used to store * The driver may impose constraints on what formats can be used to store
* texture data read from textures. For example GLES currently only supports * texture data read from textures. For example GLES currently only supports

View File

@@ -428,10 +428,6 @@ typedef enum _CoglWinsysFeature
* framebuffers at the same time. */ * framebuffers at the same time. */
COGL_WINSYS_FEATURE_MULTIPLE_ONSCREEN, COGL_WINSYS_FEATURE_MULTIPLE_ONSCREEN,
/* Available if onscreen framebuffer swaps can be automatically
* throttled to the vblank frequency. */
COGL_WINSYS_FEATURE_SWAP_THROTTLE,
/* Available if its possible to query a counter that /* Available if its possible to query a counter that
* increments at each vblank. */ * increments at each vblank. */
COGL_WINSYS_FEATURE_VBLANK_COUNTER, COGL_WINSYS_FEATURE_VBLANK_COUNTER,

View File

@@ -288,6 +288,31 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
gltype = GL_UNSIGNED_SHORT_5_5_5_1; gltype = GL_UNSIGNED_SHORT_5_5_5_1;
break; break;
case COGL_PIXEL_FORMAT_RGBA_FP_16161616:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE:
glintformat = GL_RGBA;
glformat = GL_RGBA;
gltype = GL_HALF_FLOAT;
break;
case COGL_PIXEL_FORMAT_BGRA_FP_16161616:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE:
glintformat = GL_RGBA;
glformat = GL_BGRA;
gltype = GL_HALF_FLOAT;
break;
case COGL_PIXEL_FORMAT_ARGB_FP_16161616:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE:
glintformat = GL_RGBA;
glformat = GL_BGRA;
gltype = GL_HALF_FLOAT;
break;
case COGL_PIXEL_FORMAT_ABGR_FP_16161616:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE:
glintformat = GL_RGBA;
glformat = GL_RGBA;
gltype = GL_HALF_FLOAT;
break;
case COGL_PIXEL_FORMAT_DEPTH_16: case COGL_PIXEL_FORMAT_DEPTH_16:
glintformat = GL_DEPTH_COMPONENT16; glintformat = GL_DEPTH_COMPONENT16;
glformat = GL_DEPTH_COMPONENT; glformat = GL_DEPTH_COMPONENT;
@@ -506,6 +531,14 @@ _cogl_driver_update_features (CoglContext *ctx,
COGL_FEATURE_ID_TEXTURE_RG, COGL_FEATURE_ID_TEXTURE_RG,
TRUE); TRUE);
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102, TRUE);
if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 3, 0))
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT,
TRUE);
/* Cache features */ /* Cache features */
for (i = 0; i < G_N_ELEMENTS (private_features); i++) for (i = 0; i < G_N_ELEMENTS (private_features); i++)
ctx->private_features[i] |= private_features[i]; ctx->private_features[i] |= private_features[i];

View File

@@ -396,6 +396,64 @@ _cogl_texture_driver_size_supported (CoglContext *ctx,
return new_width != 0; return new_width != 0;
} }
static gboolean
_cogl_texture_driver_upload_supported (CoglContext *ctx,
CoglPixelFormat format)
{
switch (format)
{
case COGL_PIXEL_FORMAT_A_8:
case COGL_PIXEL_FORMAT_G_8:
case COGL_PIXEL_FORMAT_RG_88:
case COGL_PIXEL_FORMAT_BGRA_8888:
case COGL_PIXEL_FORMAT_BGRA_8888_PRE:
case COGL_PIXEL_FORMAT_RGB_888:
case COGL_PIXEL_FORMAT_BGR_888:
case COGL_PIXEL_FORMAT_RGBA_1010102:
case COGL_PIXEL_FORMAT_RGBA_1010102_PRE:
case COGL_PIXEL_FORMAT_BGRA_1010102:
case COGL_PIXEL_FORMAT_BGRA_1010102_PRE:
case COGL_PIXEL_FORMAT_ABGR_2101010:
case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
case COGL_PIXEL_FORMAT_ARGB_2101010:
case COGL_PIXEL_FORMAT_ARGB_2101010_PRE:
case COGL_PIXEL_FORMAT_RGBA_8888:
case COGL_PIXEL_FORMAT_RGBA_8888_PRE:
case COGL_PIXEL_FORMAT_ARGB_8888:
case COGL_PIXEL_FORMAT_ARGB_8888_PRE:
case COGL_PIXEL_FORMAT_ABGR_8888:
case COGL_PIXEL_FORMAT_ABGR_8888_PRE:
case COGL_PIXEL_FORMAT_RGB_565:
case COGL_PIXEL_FORMAT_RGBA_4444:
case COGL_PIXEL_FORMAT_RGBA_4444_PRE:
case COGL_PIXEL_FORMAT_RGBA_5551:
case COGL_PIXEL_FORMAT_RGBA_5551_PRE:
return TRUE;
case COGL_PIXEL_FORMAT_BGRA_FP_16161616:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE:
if (_cogl_has_private_feature
(ctx, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT))
return TRUE;
else
return FALSE;
case COGL_PIXEL_FORMAT_DEPTH_16:
case COGL_PIXEL_FORMAT_DEPTH_32:
case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
case COGL_PIXEL_FORMAT_ANY:
case COGL_PIXEL_FORMAT_YUV:
return TRUE;
}
g_assert_not_reached ();
return FALSE;
}
static CoglPixelFormat static CoglPixelFormat
_cogl_texture_driver_find_best_gl_get_data_format _cogl_texture_driver_find_best_gl_get_data_format
(CoglContext *context, (CoglContext *context,
@@ -419,5 +477,6 @@ _cogl_texture_driver_gl =
_cogl_texture_driver_prep_gl_for_pixels_download, _cogl_texture_driver_prep_gl_for_pixels_download,
_cogl_texture_driver_gl_get_tex_image, _cogl_texture_driver_gl_get_tex_image,
_cogl_texture_driver_size_supported, _cogl_texture_driver_size_supported,
_cogl_texture_driver_upload_supported,
_cogl_texture_driver_find_best_gl_get_data_format _cogl_texture_driver_find_best_gl_get_data_format
}; };

View File

@@ -56,6 +56,12 @@
#ifndef GL_RG8 #ifndef GL_RG8
#define GL_RG8 0x822B #define GL_RG8 0x822B
#endif #endif
#ifndef GL_UNSIGNED_INT_2_10_10_10_REV_EXT
#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
#endif
#ifndef GL_HALF_FLOAT_OES
#define GL_HALF_FLOAT_OES 0x8D61
#endif
static gboolean static gboolean
_cogl_driver_pixel_format_from_gl_internal (CoglContext *context, _cogl_driver_pixel_format_from_gl_internal (CoglContext *context,
@@ -138,21 +144,44 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
required_format = COGL_PIXEL_FORMAT_RGB_888; required_format = COGL_PIXEL_FORMAT_RGB_888;
break; break;
/* Just one 32-bit ordering supported */
case COGL_PIXEL_FORMAT_RGBA_8888:
case COGL_PIXEL_FORMAT_RGBA_8888_PRE:
case COGL_PIXEL_FORMAT_ARGB_8888:
case COGL_PIXEL_FORMAT_ARGB_8888_PRE:
case COGL_PIXEL_FORMAT_ABGR_8888:
case COGL_PIXEL_FORMAT_ABGR_8888_PRE:
case COGL_PIXEL_FORMAT_RGBA_1010102: case COGL_PIXEL_FORMAT_RGBA_1010102:
case COGL_PIXEL_FORMAT_RGBA_1010102_PRE: case COGL_PIXEL_FORMAT_RGBA_1010102_PRE:
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
if (_cogl_has_private_feature
(context, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102))
{
glintformat = GL_RGBA;
glformat = GL_RGBA;
gltype = GL_UNSIGNED_INT_2_10_10_10_REV_EXT;
break;
}
#endif
case COGL_PIXEL_FORMAT_BGRA_1010102: case COGL_PIXEL_FORMAT_BGRA_1010102:
case COGL_PIXEL_FORMAT_BGRA_1010102_PRE: case COGL_PIXEL_FORMAT_BGRA_1010102_PRE:
case COGL_PIXEL_FORMAT_ABGR_2101010: case COGL_PIXEL_FORMAT_ABGR_2101010:
case COGL_PIXEL_FORMAT_ABGR_2101010_PRE: case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
case COGL_PIXEL_FORMAT_ARGB_2101010: case COGL_PIXEL_FORMAT_ARGB_2101010:
case COGL_PIXEL_FORMAT_ARGB_2101010_PRE: case COGL_PIXEL_FORMAT_ARGB_2101010_PRE:
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
if (_cogl_has_private_feature
(context, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102))
{
glintformat = GL_RGBA;
glformat = GL_RGBA;
gltype = GL_UNSIGNED_INT_2_10_10_10_REV_EXT;
required_format = COGL_PIXEL_FORMAT_RGBA_1010102;
required_format |= (format & COGL_PREMULT_BIT);
break;
}
#endif
G_GNUC_FALLTHROUGH;
case COGL_PIXEL_FORMAT_RGBA_8888:
case COGL_PIXEL_FORMAT_RGBA_8888_PRE:
case COGL_PIXEL_FORMAT_ARGB_8888:
case COGL_PIXEL_FORMAT_ARGB_8888_PRE:
case COGL_PIXEL_FORMAT_ABGR_8888:
case COGL_PIXEL_FORMAT_ABGR_8888_PRE:
glintformat = GL_RGBA; glintformat = GL_RGBA;
glformat = GL_RGBA; glformat = GL_RGBA;
gltype = GL_UNSIGNED_BYTE; gltype = GL_UNSIGNED_BYTE;
@@ -181,6 +210,26 @@ _cogl_driver_pixel_format_to_gl (CoglContext *context,
gltype = GL_UNSIGNED_SHORT_5_5_5_1; gltype = GL_UNSIGNED_SHORT_5_5_5_1;
break; break;
case COGL_PIXEL_FORMAT_BGRA_FP_16161616:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE:
g_warning ("Unhandled 16 bpc pixel format used");
G_GNUC_FALLTHROUGH;
case COGL_PIXEL_FORMAT_RGBA_FP_16161616:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE:
if (!_cogl_has_private_feature
(context, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT))
g_warning ("Missing 16 bpc half float extension");
glintformat = GL_RGBA;
glformat = GL_RGBA;
gltype = GL_HALF_FLOAT_OES;
break;
case COGL_PIXEL_FORMAT_DEPTH_16: case COGL_PIXEL_FORMAT_DEPTH_16:
glintformat = GL_DEPTH_COMPONENT; glintformat = GL_DEPTH_COMPONENT;
glformat = GL_DEPTH_COMPONENT; glformat = GL_DEPTH_COMPONENT;
@@ -355,6 +404,14 @@ _cogl_driver_update_features (CoglContext *context,
COGL_FLAGS_SET (private_features, COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_BGRA8888, TRUE); COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_BGRA8888, TRUE);
if (_cogl_check_extension ("GL_EXT_texture_type_2_10_10_10_REV", gl_extensions))
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102, TRUE);
if (_cogl_check_extension ("GL_OES_texture_half_float", gl_extensions))
COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT, TRUE);
if (_cogl_check_extension ("GL_EXT_unpack_subimage", gl_extensions)) if (_cogl_check_extension ("GL_EXT_unpack_subimage", gl_extensions))
COGL_FLAGS_SET (private_features, COGL_FLAGS_SET (private_features,
COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE, TRUE); COGL_PRIVATE_FEATURE_UNPACK_SUBIMAGE, TRUE);

View File

@@ -439,6 +439,75 @@ _cogl_texture_driver_size_supported (CoglContext *ctx,
return width <= max_size && height <= max_size; return width <= max_size && height <= max_size;
} }
static gboolean
_cogl_texture_driver_upload_supported (CoglContext *ctx,
CoglPixelFormat format)
{
switch (format)
{
case COGL_PIXEL_FORMAT_A_8:
case COGL_PIXEL_FORMAT_G_8:
case COGL_PIXEL_FORMAT_RG_88:
case COGL_PIXEL_FORMAT_BGRA_8888:
case COGL_PIXEL_FORMAT_BGRA_8888_PRE:
case COGL_PIXEL_FORMAT_RGB_888:
case COGL_PIXEL_FORMAT_BGR_888:
return TRUE;
case COGL_PIXEL_FORMAT_RGBA_1010102:
case COGL_PIXEL_FORMAT_RGBA_1010102_PRE:
case COGL_PIXEL_FORMAT_BGRA_1010102:
case COGL_PIXEL_FORMAT_BGRA_1010102_PRE:
case COGL_PIXEL_FORMAT_ABGR_2101010:
case COGL_PIXEL_FORMAT_ABGR_2101010_PRE:
case COGL_PIXEL_FORMAT_ARGB_2101010:
case COGL_PIXEL_FORMAT_ARGB_2101010_PRE:
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
if (_cogl_has_private_feature
(ctx, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_RGBA1010102))
return TRUE;
else
return FALSE;
#else
return FALSE;
#endif
case COGL_PIXEL_FORMAT_RGBA_8888:
case COGL_PIXEL_FORMAT_RGBA_8888_PRE:
case COGL_PIXEL_FORMAT_ARGB_8888:
case COGL_PIXEL_FORMAT_ARGB_8888_PRE:
case COGL_PIXEL_FORMAT_ABGR_8888:
case COGL_PIXEL_FORMAT_ABGR_8888_PRE:
case COGL_PIXEL_FORMAT_RGB_565:
case COGL_PIXEL_FORMAT_RGBA_4444:
case COGL_PIXEL_FORMAT_RGBA_4444_PRE:
case COGL_PIXEL_FORMAT_RGBA_5551:
case COGL_PIXEL_FORMAT_RGBA_5551_PRE:
return TRUE;
case COGL_PIXEL_FORMAT_BGRA_FP_16161616:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616:
case COGL_PIXEL_FORMAT_BGRA_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ARGB_FP_16161616_PRE:
case COGL_PIXEL_FORMAT_ABGR_FP_16161616_PRE:
return FALSE;
case COGL_PIXEL_FORMAT_RGBA_FP_16161616:
case COGL_PIXEL_FORMAT_RGBA_FP_16161616_PRE:
if (_cogl_has_private_feature
(ctx, COGL_PRIVATE_FEATURE_TEXTURE_FORMAT_HALF_FLOAT))
return TRUE;
else
return FALSE;
case COGL_PIXEL_FORMAT_DEPTH_16:
case COGL_PIXEL_FORMAT_DEPTH_32:
case COGL_PIXEL_FORMAT_DEPTH_24_STENCIL_8:
case COGL_PIXEL_FORMAT_ANY:
case COGL_PIXEL_FORMAT_YUV:
return TRUE;
}
g_assert_not_reached ();
return FALSE;
}
static CoglPixelFormat static CoglPixelFormat
_cogl_texture_driver_find_best_gl_get_data_format _cogl_texture_driver_find_best_gl_get_data_format
(CoglContext *context, (CoglContext *context,
@@ -463,5 +532,6 @@ _cogl_texture_driver_gles =
_cogl_texture_driver_prep_gl_for_pixels_download, _cogl_texture_driver_prep_gl_for_pixels_download,
_cogl_texture_driver_gl_get_tex_image, _cogl_texture_driver_gl_get_tex_image,
_cogl_texture_driver_size_supported, _cogl_texture_driver_size_supported,
_cogl_texture_driver_upload_supported,
_cogl_texture_driver_find_best_gl_get_data_format _cogl_texture_driver_find_best_gl_get_data_format
}; };

View File

@@ -50,7 +50,6 @@ typedef struct _CoglGLXDisplay
CoglGLXCachedConfig glx_cached_configs[COGL_GLX_N_CACHED_CONFIGS]; CoglGLXCachedConfig glx_cached_configs[COGL_GLX_N_CACHED_CONFIGS];
gboolean found_fbconfig; gboolean found_fbconfig;
gboolean fbconfig_has_rgba_visual;
gboolean is_direct; gboolean is_direct;
gboolean have_vblank_counter; gboolean have_vblank_counter;
gboolean can_vblank_wait; gboolean can_vblank_wait;

View File

@@ -223,7 +223,7 @@ egl_attributes_from_framebuffer_config (CoglDisplay *display,
attributes[i++] = 1; attributes[i++] = 1;
attributes[i++] = EGL_ALPHA_SIZE; attributes[i++] = EGL_ALPHA_SIZE;
attributes[i++] = config->swap_chain->has_alpha ? 1 : EGL_DONT_CARE; attributes[i++] = EGL_DONT_CARE;
attributes[i++] = EGL_DEPTH_SIZE; attributes[i++] = EGL_DEPTH_SIZE;
attributes[i++] = 1; attributes[i++] = 1;

View File

@@ -130,7 +130,7 @@ COGL_WINSYS_FEATURE_BEGIN (255, 255,
"SGI\0", "SGI\0",
"swap_control\0", "swap_control\0",
0, 0,
COGL_WINSYS_FEATURE_SWAP_THROTTLE) 0)
COGL_WINSYS_FEATURE_FUNCTION (int, glXSwapInterval, COGL_WINSYS_FEATURE_FUNCTION (int, glXSwapInterval,
(int interval)) (int interval))
COGL_WINSYS_FEATURE_END () COGL_WINSYS_FEATURE_END ()

View File

@@ -885,7 +885,7 @@ glx_attributes_from_framebuffer_config (CoglDisplay *display,
attributes[i++] = GLX_BLUE_SIZE; attributes[i++] = GLX_BLUE_SIZE;
attributes[i++] = 1; attributes[i++] = 1;
attributes[i++] = GLX_ALPHA_SIZE; attributes[i++] = GLX_ALPHA_SIZE;
attributes[i++] = config->swap_chain->has_alpha ? 1 : GLX_DONT_CARE; attributes[i++] = GLX_DONT_CARE;
attributes[i++] = GLX_DEPTH_SIZE; attributes[i++] = GLX_DEPTH_SIZE;
attributes[i++] = 1; attributes[i++] = 1;
attributes[i++] = GLX_STENCIL_SIZE; attributes[i++] = GLX_STENCIL_SIZE;
@@ -944,40 +944,8 @@ find_fbconfig (CoglDisplay *display,
goto done; goto done;
} }
if (config->swap_chain->has_alpha) COGL_NOTE (WINSYS, "Using the first available FBConfig");
{ *config_ret = configs[0];
int i;
for (i = 0; i < n_configs; i++)
{
XVisualInfo *vinfo;
vinfo = glx_renderer->glXGetVisualFromFBConfig (xlib_renderer->xdpy,
configs[i]);
if (vinfo == NULL)
continue;
if (vinfo->depth == 32 &&
(vinfo->red_mask | vinfo->green_mask | vinfo->blue_mask)
!= 0xffffffff)
{
COGL_NOTE (WINSYS, "Found an ARGB FBConfig [index:%d]", i);
*config_ret = configs[i];
goto done;
}
}
g_set_error_literal (error, COGL_WINSYS_ERROR,
COGL_WINSYS_ERROR_CREATE_CONTEXT,
"Unable to find fbconfig with rgba visual");
ret = FALSE;
goto done;
}
else
{
COGL_NOTE (WINSYS, "Using the first available FBConfig");
*config_ret = configs[0];
}
done: done:
XFree (configs); XFree (configs);
@@ -1059,8 +1027,6 @@ create_context (CoglDisplay *display, GError **error)
CoglXlibRenderer *xlib_renderer = CoglXlibRenderer *xlib_renderer =
_cogl_xlib_renderer_get_data (display->renderer); _cogl_xlib_renderer_get_data (display->renderer);
CoglGLXRenderer *glx_renderer = display->renderer->winsys; CoglGLXRenderer *glx_renderer = display->renderer->winsys;
gboolean support_transparent_windows =
display->onscreen_template->config.swap_chain->has_alpha;
GLXFBConfig config; GLXFBConfig config;
GError *fbconfig_error = NULL; GError *fbconfig_error = NULL;
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
@@ -1084,7 +1050,6 @@ create_context (CoglDisplay *display, GError **error)
} }
glx_display->fbconfig = config; glx_display->fbconfig = config;
glx_display->fbconfig_has_rgba_visual = support_transparent_windows;
COGL_NOTE (WINSYS, "Creating GLX Context (display: %p)", COGL_NOTE (WINSYS, "Creating GLX Context (display: %p)",
xlib_renderer->xdpy); xlib_renderer->xdpy);

View File

@@ -162,7 +162,7 @@ on_paint (ClutterActor *actor,
/* Comment this out if you want visual feedback for what this test paints */ /* Comment this out if you want visual feedback for what this test paints */
#if 1 #if 1
clutter_main_quit (); clutter_test_quit ();
#endif #endif
} }
@@ -191,7 +191,7 @@ test_multitexture (TestUtilsGTestFixture *fixture,
clutter_container_add_actor (CLUTTER_CONTAINER (stage), group); clutter_container_add_actor (CLUTTER_CONTAINER (stage), group);
/* We force continuous redrawing incase someone comments out the /* We force continuous redrawing incase someone comments out the
* clutter_main_quit and wants visual feedback for the test since we * clutter_test_quit and wants visual feedback for the test since we
* wont be doing anything else that will trigger redrawing. */ * wont be doing anything else that will trigger redrawing. */
idle_source = g_idle_add (queue_redraw, stage); idle_source = g_idle_add (queue_redraw, stage);
@@ -199,7 +199,7 @@ test_multitexture (TestUtilsGTestFixture *fixture,
clutter_actor_show (stage); clutter_actor_show (stage);
clutter_main (); clutter_test_main ();
g_clear_handle_id (&idle_source, g_source_remove); g_clear_handle_id (&idle_source, g_source_remove);

View File

@@ -137,7 +137,7 @@ on_paint (ClutterActor *actor,
/* Comment this out if you want visual feedback of what this test /* Comment this out if you want visual feedback of what this test
* paints. * paints.
*/ */
clutter_main_quit (); clutter_test_quit ();
} }
static gboolean static gboolean
@@ -165,7 +165,7 @@ test_readpixels (TestUtilsGTestFixture *fixture,
g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL); g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL);
clutter_actor_show (stage); clutter_actor_show (stage);
clutter_main (); clutter_test_main ();
g_clear_handle_id (&idle_source, g_source_remove); g_clear_handle_id (&idle_source, g_source_remove);

View File

@@ -92,7 +92,7 @@ on_paint (ClutterActor *actor,
/* Comment this out if you want visual feedback for what this test paints */ /* Comment this out if you want visual feedback for what this test paints */
#if 1 #if 1
clutter_main_quit (); clutter_test_quit ();
#endif #endif
} }
@@ -129,7 +129,7 @@ test_texture_mipmaps (TestUtilsGTestFixture *fixture,
clutter_actor_show (stage); clutter_actor_show (stage);
clutter_main (); clutter_test_main ();
g_clear_handle_id (&idle_source, g_source_remove); g_clear_handle_id (&idle_source, g_source_remove);

View File

@@ -183,7 +183,7 @@ on_paint (ClutterActor *actor,
update_pixmap (state); update_pixmap (state);
else if (big_updated) else if (big_updated)
/* If we successfully got the update then the test is over */ /* If we successfully got the update then the test is over */
clutter_main_quit (); clutter_test_quit ();
} }
state->frame_count++; state->frame_count++;
@@ -226,7 +226,7 @@ test_texture_pixmap_x11 (TestUtilsGTestFixture *fixture,
clutter_actor_show (state.stage); clutter_actor_show (state.stage);
clutter_main (); clutter_test_main ();
g_clear_signal_handler (&paint_handler, state.stage); g_clear_signal_handler (&paint_handler, state.stage);

View File

@@ -375,7 +375,7 @@ on_paint (ClutterActor *actor,
/* Comment this out if you want visual feedback of what this test /* Comment this out if you want visual feedback of what this test
* paints. * paints.
*/ */
clutter_main_quit (); clutter_test_quit ();
} }
static gboolean static gboolean
@@ -403,7 +403,7 @@ test_viewport (TestUtilsGTestFixture *fixture,
g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL); g_signal_connect_after (stage, "paint", G_CALLBACK (on_paint), NULL);
clutter_actor_show (stage); clutter_actor_show (stage);
clutter_main (); clutter_test_main ();
g_clear_handle_id (&idle_source, g_source_remove); g_clear_handle_id (&idle_source, g_source_remove);

View File

@@ -75,7 +75,7 @@
For a X11 grab to be taken into account under Wayland, the client must For a X11 grab to be taken into account under Wayland, the client must
also either send a specific X11 ClientMessage to the root window or be also either send a specific X11 ClientMessage to the root window or be
among the applications white-listed in key “xwayland-grab-access-rules”. among the applications allowed in key “xwayland-grab-access-rules”.
</description> </description>
</key> </key>
@@ -91,8 +91,9 @@
Wildcards “*” and jokers “?” in the values are supported. Wildcards “*” and jokers “?” in the values are supported.
Values starting with “!” are blacklisted, which has precedence over Values starting with “!” are denied, which has precedence over
the whitelist, to revoke applications from the default system list. the list of values allowed, to revoke applications from the default
system list.
The default system list includes the following applications: The default system list includes the following applications:

View File

@@ -1,6 +1,6 @@
project('mutter', 'c', project('mutter', 'c',
version: '3.37.2', version: '3.37.90',
meson_version: '>= 0.50.0', meson_version: '>= 0.51.0',
license: 'GPLv2+' license: 'GPLv2+'
) )
@@ -24,7 +24,7 @@ uprof_req = '>= 0.3'
pango_req = '>= 1.2.0' pango_req = '>= 1.2.0'
cairo_req = '>= 1.10.0' cairo_req = '>= 1.10.0'
pangocairo_req = '>= 1.20' pangocairo_req = '>= 1.20'
gsettings_desktop_schemas_req = '>= 3.33.0' gsettings_desktop_schemas_req = '>= 3.37.2'
json_glib_req = '>= 0.12.0' json_glib_req = '>= 0.12.0'
upower_glib_req = '>= 0.99.0' upower_glib_req = '>= 0.99.0'
xcomposite_req = '>= 0.4' xcomposite_req = '>= 0.4'
@@ -42,7 +42,7 @@ udev_req = '>= 228'
gudev_req = '>= 232' gudev_req = '>= 232'
# wayland version requirements # wayland version requirements
wayland_server_req = '>= 1.13.0' wayland_server_req = '>= 1.18'
wayland_protocols_req = '>= 1.19' wayland_protocols_req = '>= 1.19'
# native backend version requirements # native backend version requirements
@@ -53,7 +53,7 @@ gbm_req = '>= 10.3'
libpipewire_req = '>= 0.3.0' libpipewire_req = '>= 0.3.0'
# profiler requirements # profiler requirements
sysprof_req = '>= 3.35.2' sysprof_req = '>= 3.37.2'
gnome = import('gnome') gnome = import('gnome')
pkg = import('pkgconfig') pkg = import('pkgconfig')
@@ -279,7 +279,20 @@ endif
have_profiler = get_option('profiler') have_profiler = get_option('profiler')
if have_profiler if have_profiler
sysprof_dep = dependency('sysprof-capture-3', version: sysprof_req) # libsysprof-capture support
sysprof_dep = dependency('sysprof-capture-4',
required: true,
default_options: [
'enable_examples=false',
'enable_gtk=false',
'enable_tests=false',
'enable_tools=false',
'libsysprof=false',
'with_sysprofd=none',
'help=false',
],
fallback: ['sysprof', 'libsysprof_capture_dep'],
)
endif endif
required_functions = [ required_functions = [

172
po/ca.po
View File

@@ -12,7 +12,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: metacity 2.24\n" "Project-Id-Version: metacity 2.24\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2019-08-06 00:49+0000\n" "POT-Creation-Date: 2020-05-26 13:44+0000\n"
"PO-Revision-Date: 2018-06-17 10:25+0200\n" "PO-Revision-Date: 2018-06-17 10:25+0200\n"
"Last-Translator: Jordi Mas <jmas@softcatala.org>\n" "Last-Translator: Jordi Mas <jmas@softcatala.org>\n"
"Language-Team: Catalan <tradgnome@softcatala.org>\n" "Language-Team: Catalan <tradgnome@softcatala.org>\n"
@@ -261,16 +261,16 @@ msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:8 #: data/org.gnome.mutter.gschema.xml.in:8
msgid "" msgid ""
"This key will initiate the “overlay”, which is a combination window overview " "This key will initiate the “overlay”, which is a combination window overview"
"and application launching system. The default is intended to be the “Windows " " and application launching system. The default is intended to be the "
"key” on PC hardware. Its expected that this binding either the default or " "“Windows key” on PC hardware. Its expected that this binding either the "
"set to the empty string." "default or set to the empty string."
msgstr "" msgstr ""
"Aquesta tecla iniciarà l'«overlay» (superposador), el qual és una combinació " "Aquesta tecla iniciarà l'«overlay» (superposador), el qual és una combinació"
"de visualització de finestres i sistema de llançament d'aplicacions. El " " de visualització de finestres i sistema de llançament d'aplicacions. El "
"valor predeterminat és la «tecla Windows» en maquinari basat en ordinadors " "valor predeterminat és la «tecla Windows» en maquinari basat en ordinadors "
"PC. El valor d'aquesta vinculació s'espera que sigui el predeterminat o text " "PC. El valor d'aquesta vinculació s'espera que sigui el predeterminat o text"
"en blanc." " en blanc."
#: data/org.gnome.mutter.gschema.xml.in:20 #: data/org.gnome.mutter.gschema.xml.in:20
msgid "Attach modal dialogs" msgid "Attach modal dialogs"
@@ -282,9 +282,9 @@ msgid ""
"attached to the titlebar of the parent window and are moved together with " "attached to the titlebar of the parent window and are moved together with "
"the parent window." "the parent window."
msgstr "" msgstr ""
"Quan sigui «true» (cert), en lloc de tenir barres de títol independents, els " "Quan sigui «true» (cert), en lloc de tenir barres de títol independents, els"
"diàlegs modals apareixeran adjuntats a la barra de títol de la finestra mare " " diàlegs modals apareixeran adjuntats a la barra de títol de la finestra "
"i es mouran juntament amb aquesta." "mare i es mouran juntament amb aquesta."
#: data/org.gnome.mutter.gschema.xml.in:30 #: data/org.gnome.mutter.gschema.xml.in:30
msgid "Enable edge tiling when dropping windows on screen edges" msgid "Enable edge tiling when dropping windows on screen edges"
@@ -299,9 +299,9 @@ msgid ""
"area. Dropping windows on the top screen edge maximizes them completely." "area. Dropping windows on the top screen edge maximizes them completely."
msgstr "" msgstr ""
"Si s'habilita, es maximitzaran les finestres verticalment i es " "Si s'habilita, es maximitzaran les finestres verticalment i es "
"redimensionaran horitzontalment per cobrir la meitat de l'àrea disponible en " "redimensionaran horitzontalment per cobrir la meitat de l'àrea disponible en"
"deixar-les anar a les vores verticals de la pantalla. Si es deixen anar a la " " deixar-les anar a les vores verticals de la pantalla. Si es deixen anar a "
"vora superior de la pantalla es maximitzaran completament." "la vora superior de la pantalla es maximitzaran completament."
#: data/org.gnome.mutter.gschema.xml.in:40 #: data/org.gnome.mutter.gschema.xml.in:40
msgid "Workspaces are managed dynamically" msgid "Workspaces are managed dynamically"
@@ -310,8 +310,8 @@ msgstr "Els espais de treball es gestionen dinàmicament"
#: data/org.gnome.mutter.gschema.xml.in:41 #: data/org.gnome.mutter.gschema.xml.in:41
msgid "" msgid ""
"Determines whether workspaces are managed dynamically or whether theres a " "Determines whether workspaces are managed dynamically or whether theres a "
"static number of workspaces (determined by the num-workspaces key in org." "static number of workspaces (determined by the num-workspaces key in "
"gnome.desktop.wm.preferences)." "org.gnome.desktop.wm.preferences)."
msgstr "" msgstr ""
"Determina si els espais de treball es gestionen dinàmicament o hi ha un " "Determina si els espais de treball es gestionen dinàmicament o hi ha un "
"nombre determinat d'espais de treball (determinat per la clau «num-" "nombre determinat d'espais de treball (determinat per la clau «num-"
@@ -348,8 +348,8 @@ msgstr "Retarda el canvi del focus fins que s'aturi el punter"
#: data/org.gnome.mutter.gschema.xml.in:69 #: data/org.gnome.mutter.gschema.xml.in:69
msgid "" msgid ""
"If set to true, and the focus mode is either “sloppy” or “mouse” then the " "If set to true, and the focus mode is either “sloppy” or “mouse” then the "
"focus will not be changed immediately when entering a window, but only after " "focus will not be changed immediately when entering a window, but only after"
"the pointer stops moving." " the pointer stops moving."
msgstr "" msgstr ""
"Si és «true» (cert), i el mode del focus és «sloppy» o «mouse», no es " "Si és «true» (cert), i el mode del focus és «sloppy» o «mouse», no es "
"canviarà el focus immediatament quan s'entri a una finestra, només es " "canviarà el focus immediatament quan s'entri a una finestra, només es "
@@ -365,8 +365,8 @@ msgid ""
"not enough, invisible borders will be added to meet this value." "not enough, invisible borders will be added to meet this value."
msgstr "" msgstr ""
"La quantitat total de contorn arrossegable. Si els contorns visibles del " "La quantitat total de contorn arrossegable. Si els contorns visibles del "
"tema no són suficients, s'afegiran contorns invisibles per aconseguir aquest " "tema no són suficients, s'afegiran contorns invisibles per aconseguir aquest"
"valor." " valor."
#: data/org.gnome.mutter.gschema.xml.in:89 #: data/org.gnome.mutter.gschema.xml.in:89
msgid "Auto maximize nearly monitor sized windows" msgid "Auto maximize nearly monitor sized windows"
@@ -399,6 +399,7 @@ msgid "Enable experimental features"
msgstr "Habilita les funcionalitats experimentals" msgstr "Habilita les funcionalitats experimentals"
#: data/org.gnome.mutter.gschema.xml.in:108 #: data/org.gnome.mutter.gschema.xml.in:108
#, fuzzy
msgid "" msgid ""
"To enable experimental features, add the feature keyword to the list. " "To enable experimental features, add the feature keyword to the list. "
"Whether the feature requires restarting the compositor depends on the given " "Whether the feature requires restarting the compositor depends on the given "
@@ -412,6 +413,14 @@ msgid ""
"must have CAP_SYS_NICE. Requires a restart. • “autostart-xwayland” — " "must have CAP_SYS_NICE. Requires a restart. • “autostart-xwayland” — "
"initializes Xwayland lazily if there are X11 clients. Requires restart." "initializes Xwayland lazily if there are X11 clients. Requires restart."
msgstr "" msgstr ""
"Per habilitar les característiques experimentals afegiu la paraula clau de "
"la característica a la llista. Si la característica requereix reiniciar el "
"compositor depèn de la característica donada. Qualsevol característica "
"experimental no es requereix per estar disponible o configurable. No espereu"
" afegir res en aquest ajustament per ser una prova futura. Actualment les "
"paraules clau possibles • • “inici del monitor d'escala” framebuffer — fa "
"que el «mutter-start» estigui disponible per defecte als monitors lògics en "
"un espai de reinici de píxels lògic mentre que cal «ICE»"
#: data/org.gnome.mutter.gschema.xml.in:134 #: data/org.gnome.mutter.gschema.xml.in:134
msgid "Modifier to use to locate the pointer" msgid "Modifier to use to locate the pointer"
@@ -421,19 +430,32 @@ msgstr "Modificar a usar per localitzar el punter"
msgid "This key will initiate the “locate pointer” action." msgid "This key will initiate the “locate pointer” action."
msgstr "Aquesta clau inicialitzarà l'acció «locate pointer»." msgstr "Aquesta clau inicialitzarà l'acció «locate pointer»."
#: data/org.gnome.mutter.gschema.xml.in:155 #: data/org.gnome.mutter.gschema.xml.in:142
msgid "Timeout for check-alive ping"
msgstr "Temps d'espera per a la comprovació «ping alive»"
#: data/org.gnome.mutter.gschema.xml.in:143
msgid ""
"Number of milliseconds a client has to respond to a ping request in order to"
" not be detected as frozen. Using 0 will disable the alive check completely."
msgstr ""
"Nombre de mil·lisegons en què un client ha de respondre a una sol·licitud de"
" «ping» per no ser detectat com a congelat. L'ús de 0 inhabilitarà "
"completament la comprovació."
#: data/org.gnome.mutter.gschema.xml.in:165
msgid "Select window from tab popup" msgid "Select window from tab popup"
msgstr "Selecció de finestra entre les emergents d'una pestanya" msgstr "Selecció de finestra entre les emergents d'una pestanya"
#: data/org.gnome.mutter.gschema.xml.in:160 #: data/org.gnome.mutter.gschema.xml.in:170
msgid "Cancel tab popup" msgid "Cancel tab popup"
msgstr "Cancel·lació de les finestres emergents a les pestanyes" msgstr "Cancel·lació de les finestres emergents a les pestanyes"
#: data/org.gnome.mutter.gschema.xml.in:165 #: data/org.gnome.mutter.gschema.xml.in:175
msgid "Switch monitor configurations" msgid "Switch monitor configurations"
msgstr "Canvia configuracions de monitor" msgstr "Canvia configuracions de monitor"
#: data/org.gnome.mutter.gschema.xml.in:170 #: data/org.gnome.mutter.gschema.xml.in:180
msgid "Rotates the built-in monitor configuration" msgid "Rotates the built-in monitor configuration"
msgstr "Gira la configuració del monitor integrada" msgstr "Gira la configuració del monitor integrada"
@@ -491,9 +513,12 @@ msgstr "Torna a habilitar les dreceres"
#: data/org.gnome.mutter.wayland.gschema.xml.in:64 #: data/org.gnome.mutter.wayland.gschema.xml.in:64
msgid "Allow X11 grabs to lock keyboard focus with Xwayland" msgid "Allow X11 grabs to lock keyboard focus with Xwayland"
msgstr "Permetre la captura amb Xwayland per bloquejar el focus del teclat amb Xwayland" msgstr ""
"Permetre la captura amb Xwayland per bloquejar el focus del teclat amb "
"Xwayland"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65 #: data/org.gnome.mutter.wayland.gschema.xml.in:65
#, fuzzy
msgid "" msgid ""
"Allow all keyboard events to be routed to X11 “override redirect” windows " "Allow all keyboard events to be routed to X11 “override redirect” windows "
"with a grab when running in Xwayland. This option is to support X11 clients " "with a grab when running in Xwayland. This option is to support X11 clients "
@@ -505,16 +530,25 @@ msgid ""
"specific X11 ClientMessage to the root window or be among the applications " "specific X11 ClientMessage to the root window or be among the applications "
"white-listed in key “xwayland-grab-access-rules”." "white-listed in key “xwayland-grab-access-rules”."
msgstr "" msgstr ""
"Permet que tots els esdeveniments de teclat s'encaminin a les finestres X11 "
"«sobredirigir redirecció» amb una captura en executar-se a Xwayland. Aquesta"
" opció és per donar suport als clients X11 que mapan una finestra «override "
"redirect» (que no rep el focus del teclat) i emeten un teclat per forçar "
"tots els esdeveniments del teclat a aquesta finestra. Aquesta opció "
"s'utilitza rarament i no té cap efecte en les finestres regulars de "
"l'enviament de X11 que poden rebre el focus del teclat segons el client "
"arrel"
#: data/org.gnome.mutter.wayland.gschema.xml.in:84 #: data/org.gnome.mutter.wayland.gschema.xml.in:84
msgid "Xwayland applications allowed to issue keyboard grabs" msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr "Les aplicacions Xwayland poden capturar el teclat" msgstr "Les aplicacions Xwayland poden capturar el teclat"
#: data/org.gnome.mutter.wayland.gschema.xml.in:85 #: data/org.gnome.mutter.wayland.gschema.xml.in:85
#, fuzzy
msgid "" msgid ""
"List the resource names or resource class of X11 windows either allowed or " "List the resource names or resource class of X11 windows either allowed or "
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or " "not allowed to issue X11 keyboard grabs under Xwayland. The resource name or"
"resource class of a given X11 window can be obtained using the command " " resource class of a given X11 window can be obtained using the command "
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. " "“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
"Values starting with “!” are blacklisted, which has precedence over the " "Values starting with “!” are blacklisted, which has precedence over the "
"whitelist, to revoke applications from the default system list. The default " "whitelist, to revoke applications from the default system list. The default "
@@ -523,46 +557,52 @@ msgid ""
"using the specific keyboard shortcut defined by the keybinding key “restore-" "using the specific keyboard shortcut defined by the keybinding key “restore-"
"shortcuts”." "shortcuts”."
msgstr "" msgstr ""
"Llista els noms dels recursos o la classe de recursos de les finestres X11 "
"ja sigui permet o no permet emetre captures de teclat X11 sota Xwayland. El "
"nom dels recursos o la classe dels recursos d'una finestra X11 donada es pot"
" obtenir usant l'ordre «xprop WMCLASS». Els usuaris de les targetes "
"salvatges «*» i els bromistes «?» als valors que comencen amb «EFABD» tenen "
"prioritat sobre la llista blancaESS les aplicacions de dreceres del sistema "
"per defecte."
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #: src/backends/meta-input-settings.c:2631
#: src/backends/meta-input-settings.c:2531
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Mode de commutació (grup %d)" msgstr "Mode de commutació (grup %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #: src/backends/meta-input-settings.c:2654
#: src/backends/meta-input-settings.c:2554
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Commuta el monitor" msgstr "Commuta el monitor"
#: src/backends/meta-input-settings.c:2556 #: src/backends/meta-input-settings.c:2656
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Mostra l'ajuda en pantalla" msgstr "Mostra l'ajuda en pantalla"
#: src/backends/meta-monitor.c:223 #: src/backends/meta-monitor.c:226
msgid "Built-in display" msgid "Built-in display"
msgstr "Pantalla integrada" msgstr "Pantalla integrada"
#: src/backends/meta-monitor.c:252 #: src/backends/meta-monitor.c:255
msgid "Unknown" msgid "Unknown"
msgstr "Desconeguda" msgstr "Desconeguda"
#: src/backends/meta-monitor.c:254 #: src/backends/meta-monitor.c:257
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Pantalla desconeguda" msgstr "Pantalla desconeguda"
#: src/backends/meta-monitor.c:262 #: src/backends/meta-monitor.c:265
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" "This is a monitor vendor name, followed by a size in inches, like 'Dell "
"15\"'"
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#: src/backends/meta-monitor.c:270 #: src/backends/meta-monitor.c:273
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name followed by product/model name where size in " "This is a monitor vendor name followed by product/model name where size in "
@@ -571,13 +611,13 @@ msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#. Translators: this string will appear in Sysprof #. Translators: this string will appear in Sysprof
#: src/backends/meta-profiler.c:82 #: src/backends/meta-profiler.c:79
msgid "Compositor" msgid "Compositor"
msgstr "Compositor" msgstr "Compositor"
#. This probably means that a non-WM compositor like xcompmgr is running; #. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit #. * we have no way to get it to exit
#: src/compositor/compositor.c:510 #: src/compositor/compositor.c:545
#, c-format #, c-format
msgid "" msgid ""
"Another compositing manager is already running on screen %i on display “%s”." "Another compositing manager is already running on screen %i on display “%s”."
@@ -589,52 +629,52 @@ msgstr ""
msgid "Bell event" msgid "Bell event"
msgstr "Esdeveniment de campana" msgstr "Esdeveniment de campana"
#: src/core/main.c:185 #: src/core/main.c:190
msgid "Disable connection to session manager" msgid "Disable connection to session manager"
msgstr "Inhabilita la connexió al gestor de sessions" msgstr "Inhabilita la connexió al gestor de sessions"
#: src/core/main.c:191 #: src/core/main.c:196
msgid "Replace the running window manager" msgid "Replace the running window manager"
msgstr "Reemplaça el gestor de finestres en execució" msgstr "Reemplaça el gestor de finestres en execució"
#: src/core/main.c:197 #: src/core/main.c:202
msgid "Specify session management ID" msgid "Specify session management ID"
msgstr "Especifica l'ID de gestió de sessió" msgstr "Especifica l'ID de gestió de sessió"
#: src/core/main.c:202 #: src/core/main.c:207
msgid "X Display to use" msgid "X Display to use"
msgstr "Visualització X per usar" msgstr "Visualització X per usar"
#: src/core/main.c:208 #: src/core/main.c:213
msgid "Initialize session from savefile" msgid "Initialize session from savefile"
msgstr "Inicialitza la sessió des del fitxer desat" msgstr "Inicialitza la sessió des del fitxer desat"
#: src/core/main.c:214 #: src/core/main.c:219
msgid "Make X calls synchronous" msgid "Make X calls synchronous"
msgstr "Fes que les crides a l'X siguin síncrones" msgstr "Fes que les crides a l'X siguin síncrones"
#: src/core/main.c:221 #: src/core/main.c:226
msgid "Run as a wayland compositor" msgid "Run as a wayland compositor"
msgstr "Funciona com a compositor de Wayland" msgstr "Funciona com a compositor de Wayland"
# Notes: # Notes:
# Afegeix una nota # Afegeix una nota
# #
# Camins: # Camins:
# ../src/core/main.c:223 # ../src/core/main.c:223
#: src/core/main.c:227 #: src/core/main.c:232
msgid "Run as a nested compositor" msgid "Run as a nested compositor"
msgstr "Funciona com a compositor imbricat" msgstr "Funciona com a compositor imbricat"
#: src/core/main.c:233 #: src/core/main.c:238
msgid "Run wayland compositor without starting Xwayland" msgid "Run wayland compositor without starting Xwayland"
msgstr "Executa el compositor wayland sense iniciar Xwayland" msgstr "Executa el compositor wayland sense iniciar Xwayland"
#: src/core/main.c:241 #: src/core/main.c:246
msgid "Run as a full display server, rather than nested" msgid "Run as a full display server, rather than nested"
msgstr "Funciona com a servidor de pantalla completa, en comptes d'imbricat" msgstr "Funciona com a servidor de pantalla completa, en comptes d'imbricat"
#: src/core/main.c:247 #: src/core/main.c:252
msgid "Run with X11 backend" msgid "Run with X11 backend"
msgstr "Executa amb un rerefons X11" msgstr "Executa amb un rerefons X11"
@@ -670,8 +710,7 @@ msgid ""
"mutter %s\n" "mutter %s\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n" "Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"This is free software; see the source for copying conditions.\n" "This is free software; see the source for copying conditions.\n"
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A " "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
"PARTICULAR PURPOSE.\n"
msgstr "" msgstr ""
"Mutter %s\n" "Mutter %s\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., i d'altres\n" "Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., i d'altres\n"
@@ -688,45 +727,45 @@ msgstr "Escriu versió"
msgid "Mutter plugin to use" msgid "Mutter plugin to use"
msgstr "Connector del Mutter a utilitzar" msgstr "Connector del Mutter a utilitzar"
#: src/core/prefs.c:1849 #: src/core/prefs.c:1911
#, c-format #, c-format
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Espai de treball %d" msgstr "Espai de treball %d"
#: src/core/util.c:121 #: src/core/util.c:119
msgid "Mutter was compiled without support for verbose mode\n" msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter es va compilar sense compatibilitat per al mode detallat\n" msgstr "Mutter es va compilar sense compatibilitat per al mode detallat\n"
#: src/wayland/meta-wayland-tablet-pad.c:567 #: src/wayland/meta-wayland-tablet-pad.c:568
#, c-format #, c-format
msgid "Mode Switch: Mode %d" msgid "Mode Switch: Mode %d"
msgstr "Mode de commutació: mode %d" msgstr "Mode de commutació: mode %d"
#: src/x11/meta-x11-display.c:671 #: src/x11/meta-x11-display.c:676
#, c-format #, c-format
msgid "" msgid ""
"Display “%s” already has a window manager; try using the --replace option to " "Display “%s” already has a window manager; try using the --replace option to"
"replace the current window manager." " replace the current window manager."
msgstr "" msgstr ""
"La pantalla «%s» ja té un gestor de finestres; proveu l'opció --replace per " "La pantalla «%s» ja té un gestor de finestres; proveu l'opció --replace per "
"reemplaçar el gestor de finestres actual." "reemplaçar el gestor de finestres actual."
#: src/x11/meta-x11-display.c:1032 #: src/x11/meta-x11-display.c:1089
msgid "Failed to initialize GDK\n" msgid "Failed to initialize GDK\n"
msgstr "S'ha produït un error en inicialitzar GDK\n" msgstr "S'ha produït un error en inicialitzar GDK\n"
#: src/x11/meta-x11-display.c:1056 #: src/x11/meta-x11-display.c:1113
#, c-format #, c-format
msgid "Failed to open X Window System display “%s”\n" msgid "Failed to open X Window System display “%s”\n"
msgstr "" msgstr ""
"S'ha produït un error en obrir la pantalla del sistema de finestres X «%s»\n" "S'ha produït un error en obrir la pantalla del sistema de finestres X «%s»\n"
#: src/x11/meta-x11-display.c:1140 #: src/x11/meta-x11-display.c:1196
#, c-format #, c-format
msgid "Screen %d on display “%s” is invalid\n" msgid "Screen %d on display “%s” is invalid\n"
msgstr "El monitor %d en la pantalla «%s»' no és vàlida\n" msgstr "El monitor %d en la pantalla «%s»' no és vàlida\n"
#: src/x11/meta-x11-selection-input-stream.c:445 #: src/x11/meta-x11-selection-input-stream.c:460
#, c-format #, c-format
msgid "Format %s not supported" msgid "Format %s not supported"
msgstr "El format %s no és compatible" msgstr "El format %s no és compatible"
@@ -739,8 +778,7 @@ msgstr ""
"Aquestes finestres no implementen «desa la configuració actual» i s'hauran " "Aquestes finestres no implementen «desa la configuració actual» i s'hauran "
"de reiniciar manualment la pròxima vegada que entreu." "de reiniciar manualment la pròxima vegada que entreu."
#: src/x11/window-props.c:569 #: src/x11/window-props.c:548
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (a %s)" msgstr "%s (a %s)"

View File

@@ -13,8 +13,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mutter.master\n" "Project-Id-Version: mutter.master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2020-02-23 17:41+0000\n" "POT-Creation-Date: 2020-08-04 08:31+0000\n"
"PO-Revision-Date: 2020-02-24 13:15+0100\n" "PO-Revision-Date: 2020-08-13 10:31+0200\n"
"Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n" "Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n"
"Language-Team: Spanish - Spain <gnome-es-list@gnome.org>\n" "Language-Team: Spanish - Spain <gnome-es-list@gnome.org>\n"
"Language: es_ES\n" "Language: es_ES\n"
@@ -22,7 +22,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Gtranslator 3.34.0\n" "X-Generator: Gtranslator 3.36.0\n"
#: data/50-mutter-navigation.xml:6 #: data/50-mutter-navigation.xml:6
msgid "Navigation" msgid "Navigation"
@@ -518,6 +518,16 @@ msgstr ""
"Permitir capturas con X11 para bloquear el foco del teclado con Xwayland" "Permitir capturas con X11 para bloquear el foco del teclado con Xwayland"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65 #: data/org.gnome.mutter.wayland.gschema.xml.in:65
#| msgid ""
#| "Allow all keyboard events to be routed to X11 “override redirect” windows "
#| "with a grab when running in Xwayland. This option is to support X11 "
#| "clients which map an “override redirect” window (which do not receive "
#| "keyboard focus) and issue a keyboard grab to force all keyboard events to "
#| "that window. This option is seldom used and has no effect on regular X11 "
#| "windows which can receive keyboard focus under normal circumstances. For "
#| "a X11 grab to be taken into account under Wayland, the client must also "
#| "either send a specific X11 ClientMessage to the root window or be among "
#| "the applications white-listed in key “xwayland-grab-access-rules”."
msgid "" msgid ""
"Allow all keyboard events to be routed to X11 “override redirect” windows " "Allow all keyboard events to be routed to X11 “override redirect” windows "
"with a grab when running in Xwayland. This option is to support X11 clients " "with a grab when running in Xwayland. This option is to support X11 clients "
@@ -527,7 +537,7 @@ msgid ""
"which can receive keyboard focus under normal circumstances. For a X11 grab " "which can receive keyboard focus under normal circumstances. For a X11 grab "
"to be taken into account under Wayland, the client must also either send a " "to be taken into account under Wayland, the client must also either send a "
"specific X11 ClientMessage to the root window or be among the applications " "specific X11 ClientMessage to the root window or be among the applications "
"white-listed in key “xwayland-grab-access-rules”." "allowed in key “xwayland-grab-access-rules”."
msgstr "" msgstr ""
"Permitir que los eventos del teclado se dirijan a ventanas X11 “override " "Permitir que los eventos del teclado se dirijan a ventanas X11 “override "
"redirect” con una pulsación cuando se ejecutan en Xwayland. Esta opción es " "redirect” con una pulsación cuando se ejecutan en Xwayland. Esta opción es "
@@ -545,14 +555,25 @@ msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr "Aplicaciones de Xwayland que pueden capturar el teclado" msgstr "Aplicaciones de Xwayland que pueden capturar el teclado"
#: data/org.gnome.mutter.wayland.gschema.xml.in:85 #: data/org.gnome.mutter.wayland.gschema.xml.in:85
#| msgid ""
#| "List the resource names or resource class of X11 windows either allowed "
#| "or not allowed to issue X11 keyboard grabs under Xwayland. The resource "
#| "name or resource class of a given X11 window can be obtained using the "
#| "command “xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are "
#| "supported. Values starting with “!” are blacklisted, which has precedence "
#| "over the whitelist, to revoke applications from the default system list. "
#| "The default system list includes the following applications: "
#| "“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab "
#| "by using the specific keyboard shortcut defined by the keybinding key "
#| "“restore-shortcuts”."
msgid "" msgid ""
"List the resource names or resource class of X11 windows either allowed or " "List the resource names or resource class of X11 windows either allowed or "
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or " "not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
"resource class of a given X11 window can be obtained using the command " "resource class of a given X11 window can be obtained using the command "
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. " "“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
"Values starting with “!” are blacklisted, which has precedence over the " "Values starting with “!” are denied, which has precedence over the list of "
"whitelist, to revoke applications from the default system list. The default " "values allowed, to revoke applications from the default system list. The "
"system list includes the following applications: " "default system list includes the following applications: "
"“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by " "“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by "
"using the specific keyboard shortcut defined by the keybinding key “restore-" "using the specific keyboard shortcut defined by the keybinding key “restore-"
"shortcuts”." "shortcuts”."
@@ -570,7 +591,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #.
#: src/backends/meta-input-settings.c:2567 #: src/backends/meta-input-settings.c:2698
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Cambiar modo (grupo %d)" msgstr "Cambiar modo (grupo %d)"
@@ -578,34 +599,34 @@ msgstr "Cambiar modo (grupo %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #.
#: src/backends/meta-input-settings.c:2590 #: src/backends/meta-input-settings.c:2721
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Cambiar monitor" msgstr "Cambiar monitor"
#: src/backends/meta-input-settings.c:2592 #: src/backends/meta-input-settings.c:2723
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Mostrar la ayuda en pantalla" msgstr "Mostrar la ayuda en pantalla"
#: src/backends/meta-monitor.c:223 #: src/backends/meta-monitor.c:235
msgid "Built-in display" msgid "Built-in display"
msgstr "Pantalla integrada" msgstr "Pantalla integrada"
#: src/backends/meta-monitor.c:252 #: src/backends/meta-monitor.c:264
msgid "Unknown" msgid "Unknown"
msgstr "Desconocida" msgstr "Desconocida"
#: src/backends/meta-monitor.c:254 #: src/backends/meta-monitor.c:266
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Pantalla desconocida" msgstr "Pantalla desconocida"
#: src/backends/meta-monitor.c:262 #: src/backends/meta-monitor.c:274
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" "This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#: src/backends/meta-monitor.c:270 #: src/backends/meta-monitor.c:282
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name followed by product/model name where size in " "This is a monitor vendor name followed by product/model name where size in "
@@ -620,7 +641,7 @@ msgstr "Compositor"
#. This probably means that a non-WM compositor like xcompmgr is running; #. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit #. * we have no way to get it to exit
#: src/compositor/compositor.c:533 #: src/compositor/compositor.c:516
#, c-format #, c-format
msgid "" msgid ""
"Another compositing manager is already running on screen %i on display “%s”." "Another compositing manager is already running on screen %i on display “%s”."
@@ -731,7 +752,7 @@ msgstr "Complemento de mutter que usar"
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Área de trabajo %d" msgstr "Área de trabajo %d"
#: src/core/util.c:122 #: src/core/util.c:119
msgid "Mutter was compiled without support for verbose mode\n" msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter fue compilado sin soporte para modo prolijo\n" msgstr "Mutter fue compilado sin soporte para modo prolijo\n"
@@ -776,7 +797,7 @@ msgstr ""
"Estas ventanas no soportan «guardar la configuración actual» y tendrán que " "Estas ventanas no soportan «guardar la configuración actual» y tendrán que "
"reiniciarse manualmente la próxima vez que inicie una sesión." "reiniciarse manualmente la próxima vez que inicie una sesión."
#: src/x11/window-props.c:569 #: src/x11/window-props.c:548
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (on %s)" msgstr "%s (on %s)"

View File

@@ -20,8 +20,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mutter master\n" "Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2020-02-23 17:41+0000\n" "POT-Creation-Date: 2020-08-04 08:31+0000\n"
"PO-Revision-Date: 2020-03-01 13:19+0100\n" "PO-Revision-Date: 2020-08-10 12:54+0200\n"
"Last-Translator: Guillaume Bernard <associations@guillaume-bernard.fr>\n" "Last-Translator: Guillaume Bernard <associations@guillaume-bernard.fr>\n"
"Language-Team: GNOME French Team <gnomefr@traduc.org>\n" "Language-Team: GNOME French Team <gnomefr@traduc.org>\n"
"Language: fr\n" "Language: fr\n"
@@ -536,7 +536,7 @@ msgid ""
"which can receive keyboard focus under normal circumstances. For a X11 grab " "which can receive keyboard focus under normal circumstances. For a X11 grab "
"to be taken into account under Wayland, the client must also either send a " "to be taken into account under Wayland, the client must also either send a "
"specific X11 ClientMessage to the root window or be among the applications " "specific X11 ClientMessage to the root window or be among the applications "
"white-listed in key “xwayland-grab-access-rules”." "allowed in key “xwayland-grab-access-rules”."
msgstr "" msgstr ""
"Permettre à tous les évènements clavier dêtre routés vers les fenêtres X11 " "Permettre à tous les évènements clavier dêtre routés vers les fenêtres X11 "
 override redirect » avec capture lors du fonctionnement avec Xwayland. "  override redirect » avec capture lors du fonctionnement avec Xwayland. "
@@ -547,7 +547,7 @@ msgstr ""
"fenêtres X11 normales qui peuvent recevoir le focus du clavier dans des " "fenêtres X11 normales qui peuvent recevoir le focus du clavier dans des "
"circonstances normales. Pour quune capture X11 soit prise en compte sous " "circonstances normales. Pour quune capture X11 soit prise en compte sous "
"Wayland, le client doit aussi soit envoyer un ClientMessage X11 spécifique à " "Wayland, le client doit aussi soit envoyer un ClientMessage X11 spécifique à "
"la fenêtre racine, soit figurer parmi la liste blanche des applications dans " "la fenêtre racine, soit figurer parmi la liste des applications autorisées dans "
"la clé « xwayland-grab-access-rules »." "la clé « xwayland-grab-access-rules »."
#: data/org.gnome.mutter.wayland.gschema.xml.in:84 #: data/org.gnome.mutter.wayland.gschema.xml.in:84
@@ -560,9 +560,9 @@ msgid ""
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or " "not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
"resource class of a given X11 window can be obtained using the command " "resource class of a given X11 window can be obtained using the command "
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. " "“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
"Values starting with “!” are blacklisted, which has precedence over the " "Values starting with “!” are denied, which has precedence over the list of "
"whitelist, to revoke applications from the default system list. The default " "values allowed, to revoke applications from the default system list. The "
"system list includes the following applications: " "default system list includes the following applications: "
"“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by " "“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by "
"using the specific keyboard shortcut defined by the keybinding key “restore-" "using the specific keyboard shortcut defined by the keybinding key “restore-"
"shortcuts”." "shortcuts”."
@@ -571,8 +571,8 @@ msgstr ""
"autorisées ou non à émettre des captures clavier sous Xwayland. Le nom ou la " "autorisées ou non à émettre des captures clavier sous Xwayland. Le nom ou la "
"classe de ressource dune fenêtre X11 donnée peut être obtenue à laide de " "classe de ressource dune fenêtre X11 donnée peut être obtenue à laide de "
"la commande « xprop WM_CLASS ». Les caractères joker « * » et « ? » sont " "la commande « xprop WM_CLASS ». Les caractères joker « * » et « ? » sont "
"acceptées dans les valeurs. Les valeurs commençant par « ! » sont en liste " "acceptées dans les valeurs. Les valeurs commençant par « ! » sont bloquées, "
"noire, qui a priorité sur la liste blanche, pour révoquer les applications " "en priorité par rapport à la liste des applications autorisées, pour révoquer les applications "
"de la liste système par défaut. Celle-ci contient les applications " "de la liste système par défaut. Celle-ci contient les applications "
"suivantes : « @XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@ ». Les utilisateurs " "suivantes : « @XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@ ». Les utilisateurs "
"peuvent casser une capture existante en utilisant le raccourci clavier " "peuvent casser une capture existante en utilisant le raccourci clavier "
@@ -581,7 +581,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #.
#: src/backends/meta-input-settings.c:2567 #: src/backends/meta-input-settings.c:2698
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Changement de mode (groupe %d)" msgstr "Changement de mode (groupe %d)"
@@ -589,34 +589,34 @@ msgstr "Changement de mode (groupe %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #.
#: src/backends/meta-input-settings.c:2590 #: src/backends/meta-input-settings.c:2721
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Changer de moniteur" msgstr "Changer de moniteur"
#: src/backends/meta-input-settings.c:2592 #: src/backends/meta-input-settings.c:2723
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Afficher laide à lécran" msgstr "Afficher laide à lécran"
#: src/backends/meta-monitor.c:223 #: src/backends/meta-monitor.c:235
msgid "Built-in display" msgid "Built-in display"
msgstr "Affichage intégré" msgstr "Affichage intégré"
#: src/backends/meta-monitor.c:252 #: src/backends/meta-monitor.c:264
msgid "Unknown" msgid "Unknown"
msgstr "Inconnu" msgstr "Inconnu"
#: src/backends/meta-monitor.c:254 #: src/backends/meta-monitor.c:266
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Affichage inconnu" msgstr "Affichage inconnu"
#: src/backends/meta-monitor.c:262 #: src/backends/meta-monitor.c:274
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" "This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#: src/backends/meta-monitor.c:270 #: src/backends/meta-monitor.c:282
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name followed by product/model name where size in " "This is a monitor vendor name followed by product/model name where size in "
@@ -631,7 +631,7 @@ msgstr "Compositeur"
#. This probably means that a non-WM compositor like xcompmgr is running; #. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit #. * we have no way to get it to exit
#: src/compositor/compositor.c:533 #: src/compositor/compositor.c:516
#, c-format #, c-format
msgid "" msgid ""
"Another compositing manager is already running on screen %i on display “%s”." "Another compositing manager is already running on screen %i on display “%s”."
@@ -742,7 +742,7 @@ msgstr "Greffon de Mutter à utiliser"
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Espace de travail %d" msgstr "Espace de travail %d"
#: src/core/util.c:122 #: src/core/util.c:119
msgid "Mutter was compiled without support for verbose mode\n" msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter a été compilé sans la prise en charge du mode bavard\n" msgstr "Mutter a été compilé sans la prise en charge du mode bavard\n"
@@ -788,7 +788,7 @@ msgstr ""
"configuration actuelle » et devront être redémarrées manuellement à la " "configuration actuelle » et devront être redémarrées manuellement à la "
"prochaine connexion." "prochaine connexion."
#: src/x11/window-props.c:569 #: src/x11/window-props.c:548
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (sur %s)" msgstr "%s (sur %s)"

View File

@@ -7,15 +7,15 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mutter master\n" "Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2019-08-06 00:49+0000\n" "POT-Creation-Date: 2020-05-26 13:44+0000\n"
"PO-Revision-Date: 2019-09-03 09:53+0200\n" "PO-Revision-Date: 2020-07-12 18:34+0200\n"
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n" "Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
"Language-Team: Friulian <fur@li.org>\n" "Language-Team: Friulian <fur@li.org>\n"
"Language: fur\n" "Language: fur\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.3\n" "X-Generator: Poedit 2.3.1\n"
#: data/50-mutter-navigation.xml:6 #: data/50-mutter-navigation.xml:6
msgid "Navigation" msgid "Navigation"
@@ -420,19 +420,32 @@ msgstr "Modificadôr di doprâ par localizâ il pontadôr"
msgid "This key will initiate the “locate pointer” action." msgid "This key will initiate the “locate pointer” action."
msgstr "Cheste clâf e inizializerâ la azion “localize pontadôr”." msgstr "Cheste clâf e inizializerâ la azion “localize pontadôr”."
#: data/org.gnome.mutter.gschema.xml.in:155 #: data/org.gnome.mutter.gschema.xml.in:142
msgid "Timeout for check-alive ping"
msgstr "Timp scjadût pal control di sorevivence dal ping"
#: data/org.gnome.mutter.gschema.xml.in:143
msgid ""
"Number of milliseconds a client has to respond to a ping request in order to "
"not be detected as frozen. Using 0 will disable the alive check completely."
msgstr ""
"Numar di miliseconts jenfri di chei che un client al à di rispuindi a une "
"richieste di ping, par fâ in mût che nol vegni identificât tant che "
"inglaçât. Doprant 0 si disabilitarà dal dut il control di sorevivence."
#: data/org.gnome.mutter.gschema.xml.in:165
msgid "Select window from tab popup" msgid "Select window from tab popup"
msgstr "Selezione barcon dal tab popup" msgstr "Selezione barcon dal tab popup"
#: data/org.gnome.mutter.gschema.xml.in:160 #: data/org.gnome.mutter.gschema.xml.in:170
msgid "Cancel tab popup" msgid "Cancel tab popup"
msgstr "Anule tab popup" msgstr "Anule tab popup"
#: data/org.gnome.mutter.gschema.xml.in:165 #: data/org.gnome.mutter.gschema.xml.in:175
msgid "Switch monitor configurations" msgid "Switch monitor configurations"
msgstr "Cambie configurazions visôr" msgstr "Cambie configurazions visôr"
#: data/org.gnome.mutter.gschema.xml.in:170 #: data/org.gnome.mutter.gschema.xml.in:180
msgid "Rotates the built-in monitor configuration" msgid "Rotates the built-in monitor configuration"
msgstr "Al volte la configurazion dal visôr integrât" msgstr "Al volte la configurazion dal visôr integrât"
@@ -546,7 +559,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #.
#: src/backends/meta-input-settings.c:2531 #: src/backends/meta-input-settings.c:2631
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Cambie mût (Grup %d)" msgstr "Cambie mût (Grup %d)"
@@ -554,34 +567,34 @@ msgstr "Cambie mût (Grup %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #.
#: src/backends/meta-input-settings.c:2554 #: src/backends/meta-input-settings.c:2654
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Cambie visôr" msgstr "Cambie visôr"
#: src/backends/meta-input-settings.c:2556 #: src/backends/meta-input-settings.c:2656
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Mostre jutori a schermi" msgstr "Mostre jutori a schermi"
#: src/backends/meta-monitor.c:223 #: src/backends/meta-monitor.c:226
msgid "Built-in display" msgid "Built-in display"
msgstr "Display integrât" msgstr "Display integrât"
#: src/backends/meta-monitor.c:252 #: src/backends/meta-monitor.c:255
msgid "Unknown" msgid "Unknown"
msgstr "No cognossût" msgstr "No cognossût"
#: src/backends/meta-monitor.c:254 #: src/backends/meta-monitor.c:257
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Display no cognossût" msgstr "Display no cognossût"
#: src/backends/meta-monitor.c:262 #: src/backends/meta-monitor.c:265
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" "This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#: src/backends/meta-monitor.c:270 #: src/backends/meta-monitor.c:273
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name followed by product/model name where size in " "This is a monitor vendor name followed by product/model name where size in "
@@ -590,13 +603,13 @@ msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#. Translators: this string will appear in Sysprof #. Translators: this string will appear in Sysprof
#: src/backends/meta-profiler.c:82 #: src/backends/meta-profiler.c:79
msgid "Compositor" msgid "Compositor"
msgstr "Composidôr" msgstr "Composidôr"
#. This probably means that a non-WM compositor like xcompmgr is running; #. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit #. * we have no way to get it to exit
#: src/compositor/compositor.c:510 #: src/compositor/compositor.c:545
#, c-format #, c-format
msgid "" msgid ""
"Another compositing manager is already running on screen %i on display “%s”." "Another compositing manager is already running on screen %i on display “%s”."
@@ -608,47 +621,47 @@ msgstr ""
msgid "Bell event" msgid "Bell event"
msgstr "Event cjampane" msgstr "Event cjampane"
#: src/core/main.c:185 #: src/core/main.c:190
msgid "Disable connection to session manager" msgid "Disable connection to session manager"
msgstr "Disabilite la conession al gjestôr de session" msgstr "Disabilite la conession al gjestôr de session"
#: src/core/main.c:191 #: src/core/main.c:196
msgid "Replace the running window manager" msgid "Replace the running window manager"
msgstr "Rimplace il window manager in vore" msgstr "Rimplace il window manager in vore"
#: src/core/main.c:197 #: src/core/main.c:202
msgid "Specify session management ID" msgid "Specify session management ID"
msgstr "Specifiche il ID di gjestion session" msgstr "Specifiche il ID di gjestion session"
#: src/core/main.c:202 #: src/core/main.c:207
msgid "X Display to use" msgid "X Display to use"
msgstr "Display X di doprâ" msgstr "Display X di doprâ"
#: src/core/main.c:208 #: src/core/main.c:213
msgid "Initialize session from savefile" msgid "Initialize session from savefile"
msgstr "Inizialize session da file salvât" msgstr "Inizialize session da file salvât"
#: src/core/main.c:214 #: src/core/main.c:219
msgid "Make X calls synchronous" msgid "Make X calls synchronous"
msgstr "Fâs lis clamadis X sincronis" msgstr "Fâs lis clamadis X sincronis"
#: src/core/main.c:221 #: src/core/main.c:226
msgid "Run as a wayland compositor" msgid "Run as a wayland compositor"
msgstr "Eseguìs come compositor wayland" msgstr "Eseguìs come compositor wayland"
#: src/core/main.c:227 #: src/core/main.c:232
msgid "Run as a nested compositor" msgid "Run as a nested compositor"
msgstr "Eseguìs come compositor nidiât" msgstr "Eseguìs come compositor nidiât"
#: src/core/main.c:233 #: src/core/main.c:238
msgid "Run wayland compositor without starting Xwayland" msgid "Run wayland compositor without starting Xwayland"
msgstr "Eseguìs il compositôr di wayland cence inviâ Xwayland" msgstr "Eseguìs il compositôr di wayland cence inviâ Xwayland"
#: src/core/main.c:241 #: src/core/main.c:246
msgid "Run as a full display server, rather than nested" msgid "Run as a full display server, rather than nested"
msgstr "Eseguìs come servidôr display complet, invezit che nidiât" msgstr "Eseguìs come servidôr display complet, invezit che nidiât"
#: src/core/main.c:247 #: src/core/main.c:252
msgid "Run with X11 backend" msgid "Run with X11 backend"
msgstr "Eseguìs cul backend X11" msgstr "Eseguìs cul backend X11"
@@ -701,21 +714,21 @@ msgstr "Stampe version"
msgid "Mutter plugin to use" msgid "Mutter plugin to use"
msgstr "Plugin Mutter di doprâ" msgstr "Plugin Mutter di doprâ"
#: src/core/prefs.c:1849 #: src/core/prefs.c:1911
#, c-format #, c-format
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Spazi di lavôr %d" msgstr "Spazi di lavôr %d"
#: src/core/util.c:121 #: src/core/util.c:119
msgid "Mutter was compiled without support for verbose mode\n" msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter al è stât compilât cence supuart pe modalitât fetose\n" msgstr "Mutter al è stât compilât cence supuart pe modalitât fetose\n"
#: src/wayland/meta-wayland-tablet-pad.c:567 #: src/wayland/meta-wayland-tablet-pad.c:568
#, c-format #, c-format
msgid "Mode Switch: Mode %d" msgid "Mode Switch: Mode %d"
msgstr "Cambie mût: mût %d" msgstr "Cambie mût: mût %d"
#: src/x11/meta-x11-display.c:671 #: src/x11/meta-x11-display.c:676
#, c-format #, c-format
msgid "" msgid ""
"Display “%s” already has a window manager; try using the --replace option to " "Display “%s” already has a window manager; try using the --replace option to "
@@ -724,21 +737,21 @@ msgstr ""
"Il display “%s” al à za un window manager; prove dopre la opzion --replace " "Il display “%s” al à za un window manager; prove dopre la opzion --replace "
"par rimplaçâ chel atuâl." "par rimplaçâ chel atuâl."
#: src/x11/meta-x11-display.c:1032 #: src/x11/meta-x11-display.c:1089
msgid "Failed to initialize GDK\n" msgid "Failed to initialize GDK\n"
msgstr "No si è rivâts a inizializâ GDK\n" msgstr "No si è rivâts a inizializâ GDK\n"
#: src/x11/meta-x11-display.c:1056 #: src/x11/meta-x11-display.c:1113
#, c-format #, c-format
msgid "Failed to open X Window System display “%s”\n" msgid "Failed to open X Window System display “%s”\n"
msgstr "Impussibil vierzi il display “%s” di X Window System\n" msgstr "Impussibil vierzi il display “%s” di X Window System\n"
#: src/x11/meta-x11-display.c:1140 #: src/x11/meta-x11-display.c:1196
#, c-format #, c-format
msgid "Screen %d on display “%s” is invalid\n" msgid "Screen %d on display “%s” is invalid\n"
msgstr "Schermi %d su display “%s” no valit\n" msgstr "Schermi %d su display “%s” no valit\n"
#: src/x11/meta-x11-selection-input-stream.c:445 #: src/x11/meta-x11-selection-input-stream.c:460
#, c-format #, c-format
msgid "Format %s not supported" msgid "Format %s not supported"
msgstr "Il formât %s nol è supuartât" msgstr "Il formât %s nol è supuartât"
@@ -751,7 +764,7 @@ msgstr ""
"Chescj barcons no supuartin la funzion “salve impostazions atuâls” e si " "Chescj barcons no supuartin la funzion “salve impostazions atuâls” e si "
"scugnarà tornâ a inviâlis a man tal prossim acès." "scugnarà tornâ a inviâlis a man tal prossim acès."
#: src/x11/window-props.c:569 #: src/x11/window-props.c:548
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (su %s)" msgstr "%s (su %s)"

View File

@@ -9,21 +9,22 @@
# Mancomún - Centro de Referencia e Servizos de Software Libre <g11n@mancomun.org>, 2009. # Mancomún - Centro de Referencia e Servizos de Software Libre <g11n@mancomun.org>, 2009.
# Fran Diéguez <frandieguez@gnome.org>, 2009, 2010, 2011, 2012. # Fran Diéguez <frandieguez@gnome.org>, 2009, 2010, 2011, 2012.
# Leandro Regueiro <leandro.regueiro@gmail.com>, 2012. # Leandro Regueiro <leandro.regueiro@gmail.com>, 2012.
# Fran Dieguez <frandieguez@gnome.org>, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019. # Fran Dieguez <frandieguez@gnome.org>, 2012-2020.
#
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gl\n" "Project-Id-Version: gl\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2020-02-23 17:41+0000\n" "POT-Creation-Date: 2020-08-04 08:31+0000\n"
"PO-Revision-Date: 2020-02-26 21:56+0100\n" "PO-Revision-Date: 2020-08-13 00:46+0200\n"
"Last-Translator: Fran Dieguez <frandieguez@gnome.org>\n" "Last-Translator: Fran Dieguez <frandieguez@gnome.org>\n"
"Language-Team: Galician\n" "Language-Team: Galician <proxecto@trasno.gal>\n"
"Language: gl\n" "Language: gl\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1)\n"
"X-Generator: Poedit 2.3\n" "X-Generator: Gtranslator 3.36.0\n"
"X-Project-Style: gnome\n" "X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6 #: data/50-mutter-navigation.xml:6
@@ -514,6 +515,16 @@ msgstr ""
"Permitir os capturadores de X11 bloquear o foco do teclado con Xwayland" "Permitir os capturadores de X11 bloquear o foco do teclado con Xwayland"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65 #: data/org.gnome.mutter.wayland.gschema.xml.in:65
#| msgid ""
#| "Allow all keyboard events to be routed to X11 “override redirect” windows "
#| "with a grab when running in Xwayland. This option is to support X11 "
#| "clients which map an “override redirect” window (which do not receive "
#| "keyboard focus) and issue a keyboard grab to force all keyboard events to "
#| "that window. This option is seldom used and has no effect on regular X11 "
#| "windows which can receive keyboard focus under normal circumstances. For "
#| "a X11 grab to be taken into account under Wayland, the client must also "
#| "either send a specific X11 ClientMessage to the root window or be among "
#| "the applications white-listed in key “xwayland-grab-access-rules”."
msgid "" msgid ""
"Allow all keyboard events to be routed to X11 “override redirect” windows " "Allow all keyboard events to be routed to X11 “override redirect” windows "
"with a grab when running in Xwayland. This option is to support X11 clients " "with a grab when running in Xwayland. This option is to support X11 clients "
@@ -523,7 +534,7 @@ msgid ""
"which can receive keyboard focus under normal circumstances. For a X11 grab " "which can receive keyboard focus under normal circumstances. For a X11 grab "
"to be taken into account under Wayland, the client must also either send a " "to be taken into account under Wayland, the client must also either send a "
"specific X11 ClientMessage to the root window or be among the applications " "specific X11 ClientMessage to the root window or be among the applications "
"white-listed in key “xwayland-grab-access-rules”." "allowed in key “xwayland-grab-access-rules”."
msgstr "" msgstr ""
"Permite que todos os eventos de teclado se redirixan a xanelas X11 " "Permite que todos os eventos de teclado se redirixan a xanelas X11 "
"«invalidar redirección» con un capturador ao executarse en Xwayland. Esta " "«invalidar redirección» con un capturador ao executarse en Xwayland. Esta "
@@ -533,7 +544,7 @@ msgstr ""
"esta xanela. Esta opción é rara vez usada e non ten efecto en xanelas X11 " "esta xanela. Esta opción é rara vez usada e non ten efecto en xanelas X11 "
"normais que poden recibir o foco do teclado baixo circunstancias normais. " "normais que poden recibir o foco do teclado baixo circunstancias normais. "
"Para que a captura de X11 se leve a cabo baixo Wayland, o cliente debe " "Para que a captura de X11 se leve a cabo baixo Wayland, o cliente debe "
"enviar un ClienteMessage de X11 específico á xanela pai ou estar na lista " "enviar un ClientMessage de X11 específico á xanela pai ou estar na lista "
"branca de aplicacións na chave «xwayland-grab-access-rules»." "branca de aplicacións na chave «xwayland-grab-access-rules»."
#: data/org.gnome.mutter.wayland.gschema.xml.in:84 #: data/org.gnome.mutter.wayland.gschema.xml.in:84
@@ -541,14 +552,25 @@ msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr "Aplicaciones de Xwayland que poden capturar o teclado" msgstr "Aplicaciones de Xwayland que poden capturar o teclado"
#: data/org.gnome.mutter.wayland.gschema.xml.in:85 #: data/org.gnome.mutter.wayland.gschema.xml.in:85
#| msgid ""
#| "List the resource names or resource class of X11 windows either allowed "
#| "or not allowed to issue X11 keyboard grabs under Xwayland. The resource "
#| "name or resource class of a given X11 window can be obtained using the "
#| "command “xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are "
#| "supported. Values starting with “!” are blacklisted, which has precedence "
#| "over the whitelist, to revoke applications from the default system list. "
#| "The default system list includes the following applications: "
#| "“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab "
#| "by using the specific keyboard shortcut defined by the keybinding key "
#| "“restore-shortcuts”."
msgid "" msgid ""
"List the resource names or resource class of X11 windows either allowed or " "List the resource names or resource class of X11 windows either allowed or "
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or " "not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
"resource class of a given X11 window can be obtained using the command " "resource class of a given X11 window can be obtained using the command "
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. " "“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
"Values starting with “!” are blacklisted, which has precedence over the " "Values starting with “!” are denied, which has precedence over the list of "
"whitelist, to revoke applications from the default system list. The default " "values allowed, to revoke applications from the default system list. The "
"system list includes the following applications: " "default system list includes the following applications: "
"“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by " "“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by "
"using the specific keyboard shortcut defined by the keybinding key “restore-" "using the specific keyboard shortcut defined by the keybinding key “restore-"
"shortcuts”." "shortcuts”."
@@ -567,7 +589,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #.
#: src/backends/meta-input-settings.c:2567 #: src/backends/meta-input-settings.c:2698
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Modo conmutador (Grupo %d)" msgstr "Modo conmutador (Grupo %d)"
@@ -575,34 +597,34 @@ msgstr "Modo conmutador (Grupo %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #.
#: src/backends/meta-input-settings.c:2590 #: src/backends/meta-input-settings.c:2721
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Cambiar monitor" msgstr "Cambiar monitor"
#: src/backends/meta-input-settings.c:2592 #: src/backends/meta-input-settings.c:2723
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Mostrar axuda en pantalla" msgstr "Mostrar axuda en pantalla"
#: src/backends/meta-monitor.c:223 #: src/backends/meta-monitor.c:235
msgid "Built-in display" msgid "Built-in display"
msgstr "Pantalla embebida" msgstr "Pantalla embebida"
#: src/backends/meta-monitor.c:252 #: src/backends/meta-monitor.c:264
msgid "Unknown" msgid "Unknown"
msgstr "Descoñecido" msgstr "Descoñecido"
#: src/backends/meta-monitor.c:254 #: src/backends/meta-monitor.c:266
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Pantalla descoñecida" msgstr "Pantalla descoñecida"
#: src/backends/meta-monitor.c:262 #: src/backends/meta-monitor.c:274
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" "This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#: src/backends/meta-monitor.c:270 #: src/backends/meta-monitor.c:282
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name followed by product/model name where size in " "This is a monitor vendor name followed by product/model name where size in "
@@ -617,7 +639,7 @@ msgstr "Compositor"
#. This probably means that a non-WM compositor like xcompmgr is running; #. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit #. * we have no way to get it to exit
#: src/compositor/compositor.c:533 #: src/compositor/compositor.c:516
#, c-format #, c-format
msgid "" msgid ""
"Another compositing manager is already running on screen %i on display “%s”." "Another compositing manager is already running on screen %i on display “%s”."
@@ -727,7 +749,7 @@ msgstr "Engadido de mutter que usar"
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Espazo de traballo %d" msgstr "Espazo de traballo %d"
#: src/core/util.c:122 #: src/core/util.c:119
msgid "Mutter was compiled without support for verbose mode\n" msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter foi compilado sen compatibilidade para o modo detallado\n" msgstr "Mutter foi compilado sen compatibilidade para o modo detallado\n"
@@ -772,7 +794,7 @@ msgstr ""
"Estas xanelas non soportan «save current setup» e terán que reiniciarse " "Estas xanelas non soportan «save current setup» e terán que reiniciarse "
"manualmente a próxima vez que inicie a sesión." "manualmente a próxima vez que inicie a sesión."
#: src/x11/window-props.c:569 #: src/x11/window-props.c:548
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (en %s)" msgstr "%s (en %s)"

View File

@@ -1813,7 +1813,7 @@ msgstr ""
msgid "" msgid ""
"Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>" "Missing <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style=\"whatever\"/>"
msgstr "" msgstr ""
"Wanda ya ɓata <halin firam=\"%s\" sake girma=\"%s\" zura ido=\"%s\" salo=" "Wanda ya ɓata <frame state=\"%s\" resize=\"%s\" focus=\"%s\" style="
"\"komene ne\"/>" "\"komene ne\"/>"
#: ../src/ui/theme.c:4704 #: ../src/ui/theme.c:4704
@@ -1834,7 +1834,7 @@ msgid ""
"type=\"%s\" style_set=\"whatever\"/> element" "type=\"%s\" style_set=\"whatever\"/> element"
msgstr "" msgstr ""
"Babu salon firam da aka daidaita wa nau'in taga \"%s\" cikin jigon \"%s\", " "Babu salon firam da aka daidaita wa nau'in taga \"%s\" cikin jigon \"%s\", "
"ƙara wata ƙanshi na <nau'in taga=\"%s\" salon_daidaita=\"komene ne\"/>" "ƙara wata ƙanshi na <window type=\"%s\" style_set=\"komene ne\"/>"
#: ../src/ui/theme.c:5295 ../src/ui/theme.c:5357 ../src/ui/theme.c:5420 #: ../src/ui/theme.c:5295 ../src/ui/theme.c:5357 ../src/ui/theme.c:5420
#, c-format #, c-format

View File

@@ -21,8 +21,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: mutter\n" "Project-Id-Version: mutter\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2020-02-23 17:41+0000\n" "POT-Creation-Date: 2020-04-27 14:06+0000\n"
"PO-Revision-Date: 2020-02-24 06:39-0300\n" "PO-Revision-Date: 2020-07-17 17:56-0300\n"
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n" "Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
"Language-Team: Brazilian Portuguese <gnome-pt_br-list@gnome.org>\n" "Language-Team: Brazilian Portuguese <gnome-pt_br-list@gnome.org>\n"
"Language: pt_BR\n" "Language: pt_BR\n"
@@ -30,7 +30,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1)\n" "Plural-Forms: nplurals=2; plural=(n > 1)\n"
"X-Generator: Gtranslator 3.32.0\n" "X-Generator: Gtranslator 3.36.0\n"
"X-Project-Style: gnome\n" "X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6 #: data/50-mutter-navigation.xml:6
@@ -59,35 +59,35 @@ msgstr "Mover a janela para o último espaço de trabalho"
#: data/50-mutter-navigation.xml:24 #: data/50-mutter-navigation.xml:24
msgid "Move window one workspace up" msgid "Move window one workspace up"
msgstr "Mover a janela um espaço de trabalho acima" msgstr "Mover a janela para um espaço de trabalho acima"
#: data/50-mutter-navigation.xml:27 #: data/50-mutter-navigation.xml:27
msgid "Move window one workspace down" msgid "Move window one workspace down"
msgstr "Mover a janela um espaço de trabalho abaixo" msgstr "Mover a janela para um espaço de trabalho abaixo"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico # Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: data/50-mutter-navigation.xml:30 #: data/50-mutter-navigation.xml:30
msgid "Move window one monitor to the left" msgid "Move window one monitor to the left"
msgstr "Mover janela para o monitor da esquerda" msgstr "Mover a janela para o monitor da esquerda"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico # Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: data/50-mutter-navigation.xml:33 #: data/50-mutter-navigation.xml:33
msgid "Move window one monitor to the right" msgid "Move window one monitor to the right"
msgstr "Mover janela para o monitor da direita" msgstr "Mover a janela para o monitor da direita"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico # Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: data/50-mutter-navigation.xml:36 #: data/50-mutter-navigation.xml:36
msgid "Move window one monitor up" msgid "Move window one monitor up"
msgstr "Mover janela para o monitor acima" msgstr "Mover a janela para o monitor acima"
# Em conformidade com a tradução do gsettings-desktop-schemas --Enrico # Em conformidade com a tradução do gsettings-desktop-schemas --Enrico
#: data/50-mutter-navigation.xml:39 #: data/50-mutter-navigation.xml:39
msgid "Move window one monitor down" msgid "Move window one monitor down"
msgstr "Mover janela para o monitor abaixo" msgstr "Mover a janela para o monitor abaixo"
#: data/50-mutter-navigation.xml:43 #: data/50-mutter-navigation.xml:43
msgid "Switch applications" msgid "Switch applications"
msgstr "Alternar aplicativos" msgstr "Alternar entre aplicativos"
#: data/50-mutter-navigation.xml:48 #: data/50-mutter-navigation.xml:48
msgid "Switch to previous application" msgid "Switch to previous application"
@@ -95,7 +95,7 @@ msgstr "Alternar para o aplicativo anterior"
#: data/50-mutter-navigation.xml:52 #: data/50-mutter-navigation.xml:52
msgid "Switch windows" msgid "Switch windows"
msgstr "Alternar janelas" msgstr "Alternar entre janelas"
#: data/50-mutter-navigation.xml:57 #: data/50-mutter-navigation.xml:57
msgid "Switch to previous window" msgid "Switch to previous window"
@@ -111,7 +111,7 @@ msgstr "Alternar para a janela anterior de um aplicativo"
#: data/50-mutter-navigation.xml:70 #: data/50-mutter-navigation.xml:70
msgid "Switch system controls" msgid "Switch system controls"
msgstr "Alternar controles do sistema" msgstr "Alternar os controles do sistema"
#: data/50-mutter-navigation.xml:75 #: data/50-mutter-navigation.xml:75
msgid "Switch to previous system control" msgid "Switch to previous system control"
@@ -167,11 +167,11 @@ msgstr "Trocar para o último espaço de trabalho"
#: data/50-mutter-navigation.xml:123 #: data/50-mutter-navigation.xml:123
msgid "Move to workspace above" msgid "Move to workspace above"
msgstr "Mover para o espaço de trabalho acima" msgstr "Mover a visualização para o espaço de trabalho acima"
#: data/50-mutter-navigation.xml:126 #: data/50-mutter-navigation.xml:126
msgid "Move to workspace below" msgid "Move to workspace below"
msgstr "Mover para o espaço de trabalho abaixo" msgstr "Mover a visualização para o espaço de trabalho abaixo"
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6 #: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
msgid "System" msgid "System"
@@ -199,11 +199,11 @@ msgstr "Ativar o menu da janela"
#: data/50-mutter-windows.xml:10 #: data/50-mutter-windows.xml:10
msgid "Toggle fullscreen mode" msgid "Toggle fullscreen mode"
msgstr "Alternar modo de tela inteira" msgstr "Alternar o modo de tela inteira"
#: data/50-mutter-windows.xml:12 #: data/50-mutter-windows.xml:12
msgid "Toggle maximization state" msgid "Toggle maximization state"
msgstr "Alternar estado de maximização" msgstr "Alternar o estado de maximização"
#: data/50-mutter-windows.xml:14 #: data/50-mutter-windows.xml:14
msgid "Maximize window" msgid "Maximize window"
@@ -211,35 +211,35 @@ msgstr "Maximizar a janela"
#: data/50-mutter-windows.xml:16 #: data/50-mutter-windows.xml:16
msgid "Restore window" msgid "Restore window"
msgstr "Restaurar janela" msgstr "Restaurar a anela"
#: data/50-mutter-windows.xml:18 #: data/50-mutter-windows.xml:18
msgid "Close window" msgid "Close window"
msgstr "Fechar janela" msgstr "Fechar a janela"
#: data/50-mutter-windows.xml:20 #: data/50-mutter-windows.xml:20
msgid "Hide window" msgid "Hide window"
msgstr "Ocultar janela" msgstr "Ocultar a janela"
#: data/50-mutter-windows.xml:22 #: data/50-mutter-windows.xml:22
msgid "Move window" msgid "Move window"
msgstr "Mover janela" msgstr "Mover a janela"
#: data/50-mutter-windows.xml:24 #: data/50-mutter-windows.xml:24
msgid "Resize window" msgid "Resize window"
msgstr "Redimensionar janela" msgstr "Redimensionar a janela"
#: data/50-mutter-windows.xml:27 #: data/50-mutter-windows.xml:27
msgid "Toggle window on all workspaces or one" msgid "Toggle window on all workspaces or one"
msgstr "Alternar a janela em todos os espaços de trabalho ou em apenas um" msgstr "Alternar a janela em todos os espaços de trabalho ou apenas em um"
#: data/50-mutter-windows.xml:29 #: data/50-mutter-windows.xml:29
msgid "Raise window if covered, otherwise lower it" msgid "Raise window if covered, otherwise lower it"
msgstr "Elevar a janela se estiver coberta; caso contrário, a abaixa" msgstr "Trazer a janela se estiver coberta; caso contrário, coloca atrás"
#: data/50-mutter-windows.xml:31 #: data/50-mutter-windows.xml:31
msgid "Raise window above other windows" msgid "Raise window above other windows"
msgstr "Elevar a janela para frente das outras" msgstr "Trazer a janela para frente das outras"
#: data/50-mutter-windows.xml:33 #: data/50-mutter-windows.xml:33
msgid "Lower window below other windows" msgid "Lower window below other windows"
@@ -255,11 +255,11 @@ msgstr "Maximizar a janela horizontalmente"
#: data/50-mutter-windows.xml:41 #: data/50-mutter-windows.xml:41
msgid "View split on left" msgid "View split on left"
msgstr "Visualizar divisão à esquerda" msgstr "Visualizar a divisão à esquerda"
#: data/50-mutter-windows.xml:45 #: data/50-mutter-windows.xml:45
msgid "View split on right" msgid "View split on right"
msgstr "Visualizar divisão à direita" msgstr "Visualizar a divisão à direita"
#: data/mutter.desktop.in:4 #: data/mutter.desktop.in:4
msgid "Mutter" msgid "Mutter"
@@ -580,7 +580,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #.
#: src/backends/meta-input-settings.c:2567 #: src/backends/meta-input-settings.c:2631
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Alternador de modo (Grupo %d)" msgstr "Alternador de modo (Grupo %d)"
@@ -588,34 +588,34 @@ msgstr "Alternador de modo (Grupo %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #.
#: src/backends/meta-input-settings.c:2590 #: src/backends/meta-input-settings.c:2654
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Trocar monitor" msgstr "Trocar monitor"
#: src/backends/meta-input-settings.c:2592 #: src/backends/meta-input-settings.c:2656
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Mostrar ajuda na tela" msgstr "Mostrar ajuda na tela"
#: src/backends/meta-monitor.c:223 #: src/backends/meta-monitor.c:226
msgid "Built-in display" msgid "Built-in display"
msgstr "Tela embutida" msgstr "Tela embutida"
#: src/backends/meta-monitor.c:252 #: src/backends/meta-monitor.c:255
msgid "Unknown" msgid "Unknown"
msgstr "Desconhecido" msgstr "Desconhecido"
#: src/backends/meta-monitor.c:254 #: src/backends/meta-monitor.c:257
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Monitor desconhecido" msgstr "Monitor desconhecido"
#: src/backends/meta-monitor.c:262 #: src/backends/meta-monitor.c:265
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" "This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#: src/backends/meta-monitor.c:270 #: src/backends/meta-monitor.c:273
#, c-format #, c-format
msgctxt "" msgctxt ""
"This is a monitor vendor name followed by product/model name where size in " "This is a monitor vendor name followed by product/model name where size in "

184
po/uk.po
View File

@@ -7,8 +7,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: metacity\n" "Project-Id-Version: metacity\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n" "Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2020-02-23 17:41+0000\n" "POT-Creation-Date: 2020-08-04 08:31+0000\n"
"PO-Revision-Date: 2020-03-03 19:30+0200\n" "PO-Revision-Date: 2020-08-08 18:00+0300\n"
"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n" "Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
"Language-Team: Ukrainian <kde-i18n-uk@kde.org>\n" "Language-Team: Ukrainian <kde-i18n-uk@kde.org>\n"
"Language: uk\n" "Language: uk\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 20.03.70\n" "X-Generator: Lokalize 20.07.70\n"
"X-Project-Style: gnome\n" "X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6 #: data/50-mutter-navigation.xml:6
@@ -255,11 +255,6 @@ msgstr ""
"Модифікатор, що використовується для розширених дій віконного менеджера" "Модифікатор, що використовується для розширених дій віконного менеджера"
#: data/org.gnome.mutter.gschema.xml.in:8 #: data/org.gnome.mutter.gschema.xml.in:8
#| msgid ""
#| "This key will initiate the \"overlay\", which is a combination window "
#| "overview and application launching system. The default is intended to be "
#| "the \"Windows key\" on PC hardware. It's expected that this binding "
#| "either the default or set to the empty string."
msgid "" msgid ""
"This key will initiate the “overlay”, which is a combination window overview " "This key will initiate the “overlay”, which is a combination window overview "
"and application launching system. The default is intended to be the “Windows " "and application launching system. The default is intended to be the “Windows "
@@ -303,10 +298,6 @@ msgid "Workspaces are managed dynamically"
msgstr "Робочі простори організовуються динамічно" msgstr "Робочі простори організовуються динамічно"
#: data/org.gnome.mutter.gschema.xml.in:41 #: data/org.gnome.mutter.gschema.xml.in:41
#| msgid ""
#| "Determines whether workspaces are managed dynamically or whether there's "
#| "a static number of workspaces (determined by the num-workspaces key in "
#| "org.gnome.desktop.wm.preferences)."
msgid "" msgid ""
"Determines whether workspaces are managed dynamically or whether theres a " "Determines whether workspaces are managed dynamically or whether theres a "
"static number of workspaces (determined by the num-workspaces key in org." "static number of workspaces (determined by the num-workspaces key in org."
@@ -345,10 +336,6 @@ msgid "Delay focus changes until the pointer stops moving"
msgstr "Затримувати зміни фокусу, поки вказівник не перестане рухатись" msgstr "Затримувати зміни фокусу, поки вказівник не перестане рухатись"
#: data/org.gnome.mutter.gschema.xml.in:69 #: data/org.gnome.mutter.gschema.xml.in:69
#| msgid ""
#| "If set to true, and the focus mode is either \"sloppy\" or \"mouse\" then "
#| "the focus will not be changed immediately when entering a window, but "
#| "only after the pointer stops moving."
msgid "" msgid ""
"If set to true, and the focus mode is either “sloppy” or “mouse” then the " "If set to true, and the focus mode is either “sloppy” or “mouse” then the "
"focus will not be changed immediately when entering a window, but only after " "focus will not be changed immediately when entering a window, but only after "
@@ -363,9 +350,6 @@ msgid "Draggable border width"
msgstr "Перетяжна ширина меж" msgstr "Перетяжна ширина меж"
#: data/org.gnome.mutter.gschema.xml.in:80 #: data/org.gnome.mutter.gschema.xml.in:80
#| msgid ""
#| "The amount of total draggable borders. If the theme's visible borders are "
#| "not enough, invisible borders will be added to meet this value."
msgid "" msgid ""
"The amount of total draggable borders. If the themes visible borders are " "The amount of total draggable borders. If the themes visible borders are "
"not enough, invisible borders will be added to meet this value." "not enough, invisible borders will be added to meet this value."
@@ -413,21 +397,21 @@ msgid ""
"must have CAP_SYS_NICE. Requires a restart. • “autostart-xwayland” — " "must have CAP_SYS_NICE. Requires a restart. • “autostart-xwayland” — "
"initializes Xwayland lazily if there are X11 clients. Requires restart." "initializes Xwayland lazily if there are X11 clients. Requires restart."
msgstr "" msgstr ""
"Щоб увімкнути експериментальну можливість, додайте до списку ключове слово" "Щоб увімкнути експериментальну можливість, додайте до списку ключове слово "
" можливості. Те, чи потребуватиме вмикання можливості перезапуску" "можливості. Те, чи потребуватиме вмикання можливості перезапуску "
" композитора, залежить від типу можливості. Експериментальні можливості не" "композитора, залежить від типу можливості. Експериментальні можливості не "
" обов'язково завжди доступні чи придатні до налаштовування. Не слід" "обов'язково завжди доступні чи придатні до налаштовування. Не слід "
" очікувати, що у майбутніх версіях обов'язково буде збережено якусь із" "очікувати, що у майбутніх версіях обов'язково буде збережено якусь із "
" експериментальних можливостей. У поточній версії передбачено такі ключові" "експериментальних можливостей. У поточній версії передбачено такі ключові "
" слова: • «scale-monitor-framebuffer» — наказує mutter типово розташовувати" "слова: • «scale-monitor-framebuffer» — наказує mutter типово розташовувати "
" логічні монітори у координатному просторі логічних пікселів, масштабуючи" "логічні монітори у координатному просторі логічних пікселів, масштабуючи "
" буфери кадрів моніторів, замість вмісту вікон. Призначено для роботи із" "буфери кадрів моніторів, замість вмісту вікон. Призначено для роботи із "
" моніторами із високою роздільною здатністю. Не потребує перезапуску" "моніторами із високою роздільною здатністю. Не потребує перезапуску "
" композитора. • «rt-scheduler» — наказати mutter надсилати до системи запит" "композитора. • «rt-scheduler» — наказати mutter надсилати до системи запит "
" щодо низькопріоритетного планування режиму реального часу. Для виконуваного" "щодо низькопріоритетного планування режиму реального часу. Для виконуваного "
" файла або запису користувача має бути встановлено CAP_SYS_NICE. Потребує" "файла або запису користувача має бути встановлено CAP_SYS_NICE. Потребує "
" перезапуску композитора. • «autostart-xwayland» — лінива ініціалізація" "перезапуску композитора. • «autostart-xwayland» — лінива ініціалізація "
" Xwayland, якщо виявлено клієнти X11. Потребує перезапуску композитора." "Xwayland, якщо виявлено клієнти X11. Потребує перезапуску композитора."
#: data/org.gnome.mutter.gschema.xml.in:134 #: data/org.gnome.mutter.gschema.xml.in:134
msgid "Modifier to use to locate the pointer" msgid "Modifier to use to locate the pointer"
@@ -446,9 +430,9 @@ msgid ""
"Number of milliseconds a client has to respond to a ping request in order to " "Number of milliseconds a client has to respond to a ping request in order to "
"not be detected as frozen. Using 0 will disable the alive check completely." "not be detected as frozen. Using 0 will disable the alive check completely."
msgstr "" msgstr ""
"Проміжок часу у мілісекундах, протягом якого клієнт має відповісти на" "Проміжок часу у мілісекундах, протягом якого клієнт має відповісти на луна-"
" луна-запит, щоб вважатися працездатним. Скористайтеся значенням 0, щоб" "запит, щоб вважатися працездатним. Скористайтеся значенням 0, щоб повністю "
" повністю вимкнути перевірку працездатності." "вимкнути перевірку працездатності."
#: data/org.gnome.mutter.gschema.xml.in:165 #: data/org.gnome.mutter.gschema.xml.in:165
msgid "Select window from tab popup" msgid "Select window from tab popup"
@@ -459,7 +443,6 @@ msgid "Cancel tab popup"
msgstr "Скасувати контекстні вкладки" msgstr "Скасувати контекстні вкладки"
#: data/org.gnome.mutter.gschema.xml.in:175 #: data/org.gnome.mutter.gschema.xml.in:175
#| msgid "Switch applications"
msgid "Switch monitor configurations" msgid "Switch monitor configurations"
msgstr "Перемкнути налаштування монітора" msgstr "Перемкнути налаштування монітора"
@@ -525,6 +508,16 @@ msgstr ""
"Дозволити захопленням у X11 блокувати зміну фокусування клавіатури з Xwayland" "Дозволити захопленням у X11 блокувати зміну фокусування клавіатури з Xwayland"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65 #: data/org.gnome.mutter.wayland.gschema.xml.in:65
#| msgid ""
#| "Allow all keyboard events to be routed to X11 “override redirect” windows "
#| "with a grab when running in Xwayland. This option is to support X11 "
#| "clients which map an “override redirect” window (which do not receive "
#| "keyboard focus) and issue a keyboard grab to force all keyboard events to "
#| "that window. This option is seldom used and has no effect on regular X11 "
#| "windows which can receive keyboard focus under normal circumstances. For "
#| "a X11 grab to be taken into account under Wayland, the client must also "
#| "either send a specific X11 ClientMessage to the root window or be among "
#| "the applications white-listed in key “xwayland-grab-access-rules”."
msgid "" msgid ""
"Allow all keyboard events to be routed to X11 “override redirect” windows " "Allow all keyboard events to be routed to X11 “override redirect” windows "
"with a grab when running in Xwayland. This option is to support X11 clients " "with a grab when running in Xwayland. This option is to support X11 clients "
@@ -534,20 +527,20 @@ msgid ""
"which can receive keyboard focus under normal circumstances. For a X11 grab " "which can receive keyboard focus under normal circumstances. For a X11 grab "
"to be taken into account under Wayland, the client must also either send a " "to be taken into account under Wayland, the client must also either send a "
"specific X11 ClientMessage to the root window or be among the applications " "specific X11 ClientMessage to the root window or be among the applications "
"white-listed in key “xwayland-grab-access-rules”." "allowed in key “xwayland-grab-access-rules”."
msgstr "" msgstr ""
"Дозволяє маршрутизацію усіх подій клавіатури до вікон X11 із «перевизначенням" "Дозволяє маршрутизацію усіх подій клавіатури до вікон X11 із "
" переспрямовування», які захоплюють клавіатуру, коли їх запущено у Xwayland." "«перевизначенням переспрямовування», які захоплюють клавіатуру, коли їх "
" Цей параметр призначено для реалізації підтримки клієнтів X11, які" "запущено у Xwayland. Цей параметр призначено для реалізації підтримки "
" здійснюють відображення вікна із «перевизначенням переспрямовування» (вікна," "клієнтів X11, які здійснюють відображення вікна із «перевизначенням "
" яке не отримує фокусування клавіатури) і видають сигнал щодо захоплення" "переспрямовування» (вікна, яке не отримує фокусування клавіатури) і видають "
" клавіатури, щоб примусово переспрямувати усі події з клавіатури у відповідне" "сигнал щодо захоплення клавіатури, щоб примусово переспрямувати усі події з "
" вікно. Використання цього параметра є рідкісним. Воно не впливає на звичайні" "клавіатури у відповідне вікно. Використання цього параметра є рідкісним. "
" вікна X11, які можуть отримувати фокусування клавіатури за звичних обставин." "Воно не впливає на звичайні вікна X11, які можуть отримувати фокусування "
" Щоб захоплення клавіатури X11 бралося до уваги у Wayland, клієнтська" "клавіатури за звичних обставин. Щоб захоплення клавіатури X11 бралося до "
" програма також має або надіслати специфічне ClientMessage X11 до кореневого" "уваги у Wayland, клієнтська програма також має або надіслати специфічне "
" вікна, або мати свій пункт у «білому» списку ключа" "ClientMessage X11 до кореневого вікна, або мати свій пункт у списку"
" «xwayland-grab-access-rules»." " дозволених програм ключа «xwayland-grab-access-rules»."
#: data/org.gnome.mutter.wayland.gschema.xml.in:84 #: data/org.gnome.mutter.wayland.gschema.xml.in:84
msgid "Xwayland applications allowed to issue keyboard grabs" msgid "Xwayland applications allowed to issue keyboard grabs"
@@ -555,35 +548,46 @@ msgstr ""
"Програми Xwayland, яким дозволено надсилати запит щодо захоплення клавіатури" "Програми Xwayland, яким дозволено надсилати запит щодо захоплення клавіатури"
#: data/org.gnome.mutter.wayland.gschema.xml.in:85 #: data/org.gnome.mutter.wayland.gschema.xml.in:85
#| msgid ""
#| "List the resource names or resource class of X11 windows either allowed "
#| "or not allowed to issue X11 keyboard grabs under Xwayland. The resource "
#| "name or resource class of a given X11 window can be obtained using the "
#| "command “xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are "
#| "supported. Values starting with “!” are blacklisted, which has precedence "
#| "over the whitelist, to revoke applications from the default system list. "
#| "The default system list includes the following applications: "
#| "“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab "
#| "by using the specific keyboard shortcut defined by the keybinding key "
#| "“restore-shortcuts”."
msgid "" msgid ""
"List the resource names or resource class of X11 windows either allowed or " "List the resource names or resource class of X11 windows either allowed or "
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or " "not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
"resource class of a given X11 window can be obtained using the command " "resource class of a given X11 window can be obtained using the command "
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. " "“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
"Values starting with “!” are blacklisted, which has precedence over the " "Values starting with “!” are denied, which has precedence over the list of "
"whitelist, to revoke applications from the default system list. The default " "values allowed, to revoke applications from the default system list. The "
"system list includes the following applications: " "default system list includes the following applications: "
"“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by " "“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by "
"using the specific keyboard shortcut defined by the keybinding key “restore-" "using the specific keyboard shortcut defined by the keybinding key “restore-"
"shortcuts”." "shortcuts”."
msgstr "" msgstr ""
"Список назв ресурсів або клас ресурсів вікон X11, яким дозволено або" "Список назв ресурсів або клас ресурсів вікон X11, яким дозволено або "
" заборонено видавати запити на захоплення фокусу клавіатури X11 у Xwayland." "заборонено видавати запити на захоплення фокусу клавіатури X11 у Xwayland. "
" Назву ресурсу або клас ресурсу певного вікна X11 можна визначити за" "Назву ресурсу або клас ресурсу певного вікна X11 можна визначити за "
" допомогою команди «xprop WM_CLASS». Передбачено підтримку" "допомогою команди «xprop WM_CLASS». Передбачено підтримку символів-"
" символів-замінників «*» і «?» у записах. Значення, які починатимуться з «!»," "замінників «*» і «?» у записах. Значення, які починатимуться з «!», буде "
" буде додано до «чорного» списку, який матиме пріоритет над «білим» списком," "додано до списку заборонених, який матиме пріоритет над списком дозволених"
" щоб програми можна було вилучати із типового загальносистемного списку." " значень, щоб "
" Типовий загальносистемний список містить записи таких програм:" "програми можна було вилучати із типового загальносистемного списку. Типовий "
" «@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@». Користувачі можуть усувати наявне" "загальносистемний список містить записи таких програм: "
" захоплення фокуса за допомогою певного клавіатурного скорочення, яке" "«@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@». Користувачі можуть усувати наявне "
" визначається ключем «restore-" "захоплення фокуса за допомогою певного клавіатурного скорочення, яке "
"shortcuts»." "визначається ключем «restore-shortcuts»."
#. TRANSLATORS: This string refers to a button that switches between #. TRANSLATORS: This string refers to a button that switches between
#. * different modes. #. * different modes.
#. #.
#: src/backends/meta-input-settings.c:2567 #: src/backends/meta-input-settings.c:2698
#, c-format #, c-format
msgid "Mode Switch (Group %d)" msgid "Mode Switch (Group %d)"
msgstr "Перемкнути режим (група %d)" msgstr "Перемкнути режим (група %d)"
@@ -591,38 +595,35 @@ msgstr "Перемкнути режим (група %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets' #. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs. #. * mapping through the available outputs.
#. #.
#: src/backends/meta-input-settings.c:2590 #: src/backends/meta-input-settings.c:2721
#| msgid "Switch system controls"
msgid "Switch monitor" msgid "Switch monitor"
msgstr "Перемкнути монітор" msgstr "Перемкнути монітор"
#: src/backends/meta-input-settings.c:2592 #: src/backends/meta-input-settings.c:2723
msgid "Show on-screen help" msgid "Show on-screen help"
msgstr "Показати довідку на екрані" msgstr "Показати довідку на екрані"
#: src/backends/meta-monitor.c:223 #: src/backends/meta-monitor.c:235
msgid "Built-in display" msgid "Built-in display"
msgstr "Вбудований екран" msgstr "Вбудований екран"
#: src/backends/meta-monitor.c:252 #: src/backends/meta-monitor.c:264
msgid "Unknown" msgid "Unknown"
msgstr "Невідомо" msgstr "Невідомо"
#: src/backends/meta-monitor.c:254 #: src/backends/meta-monitor.c:266
msgid "Unknown Display" msgid "Unknown Display"
msgstr "Невідомий екран" msgstr "Невідомий екран"
#: src/backends/meta-monitor.c:262 #: src/backends/meta-monitor.c:274
#, c-format #, c-format
#| msgid "%s %s"
msgctxt "" msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'" "This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s" msgid "%s %s"
msgstr "%s %s" msgstr "%s %s"
#: src/backends/meta-monitor.c:270 #: src/backends/meta-monitor.c:282
#, c-format #, c-format
#| msgid "%s %s"
msgctxt "" msgctxt ""
"This is a monitor vendor name followed by product/model name where size in " "This is a monitor vendor name followed by product/model name where size in "
"inches could not be calculated, e.g. Dell U2414H" "inches could not be calculated, e.g. Dell U2414H"
@@ -631,17 +632,13 @@ msgstr "%s %s"
#. Translators: this string will appear in Sysprof #. Translators: this string will appear in Sysprof
#: src/backends/meta-profiler.c:79 #: src/backends/meta-profiler.c:79
#| msgid "Compositing Manager"
msgid "Compositor" msgid "Compositor"
msgstr "Композитор" msgstr "Композитор"
#. This probably means that a non-WM compositor like xcompmgr is running; #. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit #. * we have no way to get it to exit
#: src/compositor/compositor.c:533 #: src/compositor/compositor.c:516
#, c-format #, c-format
#| msgid ""
#| "Another compositing manager is already running on screen %i on display "
#| "\"%s\"."
msgid "" msgid ""
"Another compositing manager is already running on screen %i on display “%s”." "Another compositing manager is already running on screen %i on display “%s”."
msgstr "Уже запущено інший композитний менеджер на екрані %i через показ «%s»." msgstr "Уже запущено інший композитний менеджер на екрані %i через показ «%s»."
@@ -679,7 +676,6 @@ msgid "Run as a wayland compositor"
msgstr "запустити як композитор wayland" msgstr "запустити як композитор wayland"
#: src/core/main.c:232 #: src/core/main.c:232
#| msgid "Run as a wayland compositor"
msgid "Run as a nested compositor" msgid "Run as a nested compositor"
msgstr "Запустити як вкладений композитор" msgstr "Запустити як вкладений композитор"
@@ -722,12 +718,6 @@ msgstr "_Зачекати"
#: src/core/mutter.c:38 #: src/core/mutter.c:38
#, c-format #, c-format
#| msgid ""
#| "mutter %s\n"
#| "Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
#| "This is free software; see the source for copying conditions.\n"
#| "There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
#| "PARTICULAR PURPOSE.\n"
msgid "" msgid ""
"mutter %s\n" "mutter %s\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n" "Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
@@ -754,7 +744,7 @@ msgstr "Додатки Clutter для використання"
msgid "Workspace %d" msgid "Workspace %d"
msgstr "Робочий простір %d" msgstr "Робочий простір %d"
#: src/core/util.c:122 #: src/core/util.c:119
msgid "Mutter was compiled without support for verbose mode\n" msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter зібрано без підтримки докладного режиму\n" msgstr "Mutter зібрано без підтримки докладного режиму\n"
@@ -765,9 +755,6 @@ msgstr "Перемикання режимів: режим %d"
#: src/x11/meta-x11-display.c:676 #: src/x11/meta-x11-display.c:676
#, c-format #, c-format
#| msgid ""
#| "Display \"%s\" already has a window manager; try using the --replace "
#| "option to replace the current window manager."
msgid "" msgid ""
"Display “%s” already has a window manager; try using the --replace option to " "Display “%s” already has a window manager; try using the --replace option to "
"replace the current window manager." "replace the current window manager."
@@ -781,13 +768,11 @@ msgstr "Не вдалося ініціалізувати GDK\n"
#: src/x11/meta-x11-display.c:1113 #: src/x11/meta-x11-display.c:1113
#, c-format #, c-format
#| msgid "Failed to open X Window System display '%s'\n"
msgid "Failed to open X Window System display “%s”\n" msgid "Failed to open X Window System display “%s”\n"
msgstr "Не вдалось відкрити дисплей віконної системи X «%s»\n" msgstr "Не вдалось відкрити дисплей віконної системи X «%s»\n"
#: src/x11/meta-x11-display.c:1196 #: src/x11/meta-x11-display.c:1196
#, c-format #, c-format
#| msgid "Screen %d on display '%s' is invalid\n"
msgid "Screen %d on display “%s” is invalid\n" msgid "Screen %d on display “%s” is invalid\n"
msgstr "Екран %d на дисплеї «%s» не правильний\n" msgstr "Екран %d на дисплеї «%s» не правильний\n"
@@ -797,17 +782,14 @@ msgid "Format %s not supported"
msgstr "Підтримки формату %s не передбачено" msgstr "Підтримки формату %s не передбачено"
#: src/x11/session.c:1821 #: src/x11/session.c:1821
#| msgid ""
#| "These windows do not support &quot;save current setup&quot; and will have "
#| "to be restarted manually next time you log in."
msgid "" msgid ""
"These windows do not support “save current setup” and will have to be " "These windows do not support “save current setup” and will have to be "
"restarted manually next time you log in." "restarted manually next time you log in."
msgstr "" msgstr ""
"Ці вікна не підтримують «збереження поточних параметрів», і при " "Ці вікна не підтримують «збереження поточних параметрів», і при наступному "
"наступному входженні їх треба запустити власноруч." "входженні їх треба запустити власноруч."
#: src/x11/window-props.c:569 #: src/x11/window-props.c:548
#, c-format #, c-format
msgid "%s (on %s)" msgid "%s (on %s)"
msgstr "%s (на %s)" msgstr "%s (на %s)"

View File

@@ -68,6 +68,7 @@ struct _MetaBackendClass
MetaMonitorManager * (* create_monitor_manager) (MetaBackend *backend, MetaMonitorManager * (* create_monitor_manager) (MetaBackend *backend,
GError **error); GError **error);
MetaCursorRenderer * (* create_cursor_renderer) (MetaBackend *backend); MetaCursorRenderer * (* create_cursor_renderer) (MetaBackend *backend);
MetaCursorTracker * (* create_cursor_tracker) (MetaBackend *backend);
MetaRenderer * (* create_renderer) (MetaBackend *backend, MetaRenderer * (* create_renderer) (MetaBackend *backend,
GError **error); GError **error);
MetaInputSettings * (* create_input_settings) (MetaBackend *backend); MetaInputSettings * (* create_input_settings) (MetaBackend *backend);

View File

@@ -592,6 +592,14 @@ meta_backend_real_is_lid_closed (MetaBackend *backend)
return priv->lid_is_closed; return priv->lid_is_closed;
} }
static MetaCursorTracker *
meta_backend_real_create_cursor_tracker (MetaBackend *backend)
{
return g_object_new (META_TYPE_CURSOR_TRACKER,
"backend", backend,
NULL);
}
gboolean gboolean
meta_backend_is_lid_closed (MetaBackend *backend) meta_backend_is_lid_closed (MetaBackend *backend)
{ {
@@ -745,6 +753,7 @@ meta_backend_class_init (MetaBackendClass *klass)
klass->ungrab_device = meta_backend_real_ungrab_device; klass->ungrab_device = meta_backend_real_ungrab_device;
klass->select_stage_events = meta_backend_real_select_stage_events; klass->select_stage_events = meta_backend_real_select_stage_events;
klass->is_lid_closed = meta_backend_real_is_lid_closed; klass->is_lid_closed = meta_backend_real_is_lid_closed;
klass->create_cursor_tracker = meta_backend_real_create_cursor_tracker;
signals[KEYMAP_CHANGED] = signals[KEYMAP_CHANGED] =
g_signal_new ("keymap-changed", g_signal_new ("keymap-changed",
@@ -988,7 +997,8 @@ meta_backend_initable_init (GInitable *initable,
if (!priv->renderer) if (!priv->renderer)
return FALSE; return FALSE;
priv->cursor_tracker = g_object_new (META_TYPE_CURSOR_TRACKER, NULL); priv->cursor_tracker =
META_BACKEND_GET_CLASS (backend)->create_cursor_tracker (backend);
priv->dnd = g_object_new (META_TYPE_DND, NULL); priv->dnd = g_object_new (META_TYPE_DND, NULL);

View File

@@ -58,6 +58,8 @@ struct _MetaCursorRendererPrivate
float current_y; float current_y;
MetaCursorSprite *displayed_cursor; MetaCursorSprite *displayed_cursor;
MetaCursorSprite *overlay_cursor;
MetaOverlay *stage_overlay; MetaOverlay *stage_overlay;
gboolean handled_by_backend; gboolean handled_by_backend;
gulong after_paint_handler_id; gulong after_paint_handler_id;
@@ -123,18 +125,16 @@ align_cursor_position (MetaCursorRenderer *renderer,
graphene_rect_offset (rect, view_layout.x, view_layout.y); graphene_rect_offset (rect, view_layout.x, view_layout.y);
} }
static void void
queue_redraw (MetaCursorRenderer *renderer, meta_cursor_renderer_update_stage_overlay (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite) MetaCursorSprite *cursor_sprite)
{ {
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer); MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
ClutterActor *stage = meta_backend_get_stage (priv->backend); ClutterActor *stage = meta_backend_get_stage (priv->backend);
CoglTexture *texture; CoglTexture *texture;
graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO; graphene_rect_t rect = GRAPHENE_RECT_INIT_ZERO;
/* During early initialization, we can have no stage */ g_set_object (&priv->overlay_cursor, cursor_sprite);
if (!stage)
return;
if (cursor_sprite) if (cursor_sprite)
{ {
@@ -145,11 +145,12 @@ queue_redraw (MetaCursorRenderer *renderer,
if (!priv->stage_overlay) if (!priv->stage_overlay)
priv->stage_overlay = meta_stage_create_cursor_overlay (META_STAGE (stage)); priv->stage_overlay = meta_stage_create_cursor_overlay (META_STAGE (stage));
if (cursor_sprite && !priv->handled_by_backend) if (cursor_sprite)
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite); texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
else else
texture = NULL; texture = NULL;
meta_overlay_set_visible (priv->stage_overlay, !priv->handled_by_backend);
meta_stage_update_cursor_overlay (META_STAGE (stage), priv->stage_overlay, meta_stage_update_cursor_overlay (META_STAGE (stage), priv->stage_overlay,
texture, &rect); texture, &rect);
} }
@@ -241,6 +242,9 @@ meta_cursor_renderer_finalize (GObject *object)
g_clear_signal_handler (&priv->after_paint_handler_id, stage); g_clear_signal_handler (&priv->after_paint_handler_id, stage);
g_clear_object (&priv->displayed_cursor);
g_clear_object (&priv->overlay_cursor);
G_OBJECT_CLASS (meta_cursor_renderer_parent_class)->finalize (object); G_OBJECT_CLASS (meta_cursor_renderer_parent_class)->finalize (object);
} }
@@ -334,7 +338,6 @@ meta_cursor_renderer_update_cursor (MetaCursorRenderer *renderer,
{ {
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer); MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
gboolean handled_by_backend; gboolean handled_by_backend;
gboolean should_redraw = FALSE;
if (cursor_sprite) if (cursor_sprite)
meta_cursor_sprite_prepare_at (cursor_sprite, meta_cursor_sprite_prepare_at (cursor_sprite,
@@ -345,16 +348,9 @@ meta_cursor_renderer_update_cursor (MetaCursorRenderer *renderer,
META_CURSOR_RENDERER_GET_CLASS (renderer)->update_cursor (renderer, META_CURSOR_RENDERER_GET_CLASS (renderer)->update_cursor (renderer,
cursor_sprite); cursor_sprite);
if (handled_by_backend != priv->handled_by_backend) if (handled_by_backend != priv->handled_by_backend)
{ priv->handled_by_backend = handled_by_backend;
priv->handled_by_backend = handled_by_backend;
should_redraw = TRUE;
}
if (!handled_by_backend) meta_cursor_renderer_update_stage_overlay (renderer, cursor_sprite);
should_redraw = TRUE;
if (should_redraw)
queue_redraw (renderer, cursor_sprite);
} }
MetaCursorRenderer * MetaCursorRenderer *
@@ -373,7 +369,7 @@ meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
if (priv->displayed_cursor == cursor_sprite) if (priv->displayed_cursor == cursor_sprite)
return; return;
priv->displayed_cursor = cursor_sprite; g_set_object (&priv->displayed_cursor, cursor_sprite);
meta_cursor_renderer_update_cursor (renderer, cursor_sprite); meta_cursor_renderer_update_cursor (renderer, cursor_sprite);
} }
@@ -394,8 +390,6 @@ meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
{ {
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer); MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
g_assert (meta_is_wayland_compositor ());
priv->current_x = x; priv->current_x = x;
priv->current_y = y; priv->current_y = y;
@@ -419,7 +413,19 @@ meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer)
{ {
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer); MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
return priv->displayed_cursor; return priv->overlay_cursor;
}
gboolean
meta_cursor_renderer_is_overlay_visible (MetaCursorRenderer *renderer)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
if (!priv->stage_overlay)
return FALSE;
return meta_overlay_is_visible (priv->stage_overlay);
} }
void void

View File

@@ -67,6 +67,8 @@ void meta_cursor_renderer_force_update (MetaCursorRenderer *renderer);
MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer); MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer);
gboolean meta_cursor_renderer_is_overlay_visible (MetaCursorRenderer *renderer);
void meta_cursor_renderer_add_hw_cursor_inhibitor (MetaCursorRenderer *renderer, void meta_cursor_renderer_add_hw_cursor_inhibitor (MetaCursorRenderer *renderer,
MetaHwCursorInhibitor *inhibitor); MetaHwCursorInhibitor *inhibitor);
@@ -82,4 +84,7 @@ graphene_rect_t meta_cursor_renderer_calculate_rect (MetaCursorRenderer *rendere
void meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer, void meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite); MetaCursorSprite *cursor_sprite);
void meta_cursor_renderer_update_stage_overlay (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);
#endif /* META_CURSOR_RENDERER_H */ #endif /* META_CURSOR_RENDERER_H */

View File

@@ -24,34 +24,17 @@
#include "backends/meta-cursor.h" #include "backends/meta-cursor.h"
#include "backends/meta-cursor-renderer.h" #include "backends/meta-cursor-renderer.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
#include "meta/meta-cursor-tracker.h" #include "meta/meta-cursor-tracker.h"
struct _MetaCursorTracker { struct _MetaCursorTrackerClass
GObject parent_instance; {
GObjectClass parent_class;
gboolean is_showing; void (* set_force_track_position) (MetaCursorTracker *tracker,
gboolean is_enabled);
MetaCursorSprite *effective_cursor; /* May be NULL when hidden */ MetaCursorSprite * (* get_sprite) (MetaCursorTracker *tracker);
MetaCursorSprite *displayed_cursor;
/* Wayland clients can set a NULL buffer as their cursor
* explicitly, which means that we shouldn't display anything.
* So, we can't simply store a NULL in window_cursor to
* determine an unset window cursor; we need an extra boolean.
*/
gboolean has_window_cursor;
MetaCursorSprite *window_cursor;
MetaCursorSprite *root_cursor;
/* The cursor from the X11 server. */
MetaCursorSpriteXfixes *xfixes_cursor;
}; };
gboolean meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
XEvent *xevent);
void meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker, void meta_cursor_tracker_set_window_cursor (MetaCursorTracker *tracker,
MetaCursorSprite *cursor_sprite); MetaCursorSprite *cursor_sprite);
void meta_cursor_tracker_unset_window_cursor (MetaCursorTracker *tracker); void meta_cursor_tracker_unset_window_cursor (MetaCursorTracker *tracker);
@@ -62,6 +45,14 @@ void meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
float new_x, float new_x,
float new_y); float new_y);
void meta_cursor_tracker_track_position (MetaCursorTracker *tracker);
void meta_cursor_tracker_untrack_position (MetaCursorTracker *tracker);
MetaCursorSprite * meta_cursor_tracker_get_displayed_cursor (MetaCursorTracker *tracker); MetaCursorSprite * meta_cursor_tracker_get_displayed_cursor (MetaCursorTracker *tracker);
MetaBackend * meta_cursor_tracker_get_backend (MetaCursorTracker *tracker);
void meta_cursor_tracker_notify_cursor_changed (MetaCursorTracker *tracker);
#endif #endif

View File

@@ -36,16 +36,51 @@
#include <string.h> #include <string.h>
#include "backends/meta-backend-private.h" #include "backends/meta-backend-private.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
#include "cogl/cogl.h" #include "cogl/cogl.h"
#include "core/display-private.h"
#include "clutter/clutter.h" #include "clutter/clutter.h"
#include "meta-marshal.h" #include "meta-marshal.h"
#include "meta/main.h" #include "meta/main.h"
#include "meta/meta-x11-errors.h"
#include "meta/util.h" #include "meta/util.h"
#include "x11/meta-x11-display-private.h"
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT); enum
{
PROP_0,
PROP_BACKEND,
N_PROPS
};
static GParamSpec *obj_props[N_PROPS];
typedef struct _MetaCursorTrackerPrivate
{
MetaBackend *backend;
gboolean is_showing;
int track_position_count;
float x;
float y;
MetaCursorSprite *effective_cursor; /* May be NULL when hidden */
MetaCursorSprite *displayed_cursor;
/* Wayland clients can set a NULL buffer as their cursor
* explicitly, which means that we shouldn't display anything.
* So, we can't simply store a NULL in window_cursor to
* determine an unset window cursor; we need an extra boolean.
*/
gboolean has_window_cursor;
MetaCursorSprite *window_cursor;
MetaCursorSprite *root_cursor;
} MetaCursorTrackerPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorTracker, meta_cursor_tracker,
G_TYPE_OBJECT)
enum enum
{ {
@@ -57,6 +92,12 @@ enum
static guint signals[LAST_SIGNAL]; static guint signals[LAST_SIGNAL];
void
meta_cursor_tracker_notify_cursor_changed (MetaCursorTracker *tracker)
{
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
}
static void static void
cursor_texture_updated (MetaCursorSprite *cursor, cursor_texture_updated (MetaCursorSprite *cursor,
MetaCursorTracker *tracker) MetaCursorTracker *tracker)
@@ -67,26 +108,28 @@ cursor_texture_updated (MetaCursorSprite *cursor,
static gboolean static gboolean
update_displayed_cursor (MetaCursorTracker *tracker) update_displayed_cursor (MetaCursorTracker *tracker)
{ {
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
MetaDisplay *display = meta_get_display (); MetaDisplay *display = meta_get_display ();
MetaCursorSprite *cursor = NULL; MetaCursorSprite *cursor = NULL;
if (display && meta_display_windows_are_interactable (display) && if (display && meta_display_windows_are_interactable (display) &&
tracker->has_window_cursor) priv->has_window_cursor)
cursor = tracker->window_cursor; cursor = priv->window_cursor;
else else
cursor = tracker->root_cursor; cursor = priv->root_cursor;
if (tracker->displayed_cursor == cursor) if (priv->displayed_cursor == cursor)
return FALSE; return FALSE;
if (tracker->displayed_cursor) if (priv->displayed_cursor)
{ {
g_signal_handlers_disconnect_by_func (tracker->displayed_cursor, g_signal_handlers_disconnect_by_func (priv->displayed_cursor,
cursor_texture_updated, cursor_texture_updated,
tracker); tracker);
} }
g_set_object (&tracker->displayed_cursor, cursor); g_set_object (&priv->displayed_cursor, cursor);
if (cursor) if (cursor)
{ {
@@ -100,22 +143,25 @@ update_displayed_cursor (MetaCursorTracker *tracker)
static gboolean static gboolean
update_effective_cursor (MetaCursorTracker *tracker) update_effective_cursor (MetaCursorTracker *tracker)
{ {
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
MetaCursorSprite *cursor = NULL; MetaCursorSprite *cursor = NULL;
if (tracker->is_showing) if (priv->is_showing)
cursor = tracker->displayed_cursor; cursor = priv->displayed_cursor;
return g_set_object (&tracker->effective_cursor, cursor); return g_set_object (&priv->effective_cursor, cursor);
} }
static void static void
change_cursor_renderer (MetaCursorTracker *tracker) change_cursor_renderer (MetaCursorTracker *tracker)
{ {
MetaBackend *backend = meta_get_backend (); MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
MetaCursorRenderer *cursor_renderer = MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend); meta_backend_get_cursor_renderer (priv->backend);
meta_cursor_renderer_set_cursor (cursor_renderer, tracker->effective_cursor); meta_cursor_renderer_set_cursor (cursor_renderer, priv->effective_cursor);
} }
static void static void
@@ -133,22 +179,83 @@ sync_cursor (MetaCursorTracker *tracker)
} }
static void static void
meta_cursor_tracker_init (MetaCursorTracker *self) meta_cursor_tracker_real_set_force_track_position (MetaCursorTracker *tracker,
gboolean is_enabled)
{ {
self->is_showing = TRUE; }
static MetaCursorSprite *
meta_cursor_tracker_real_get_sprite (MetaCursorTracker *tracker)
{
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
return priv->displayed_cursor;
}
static void
meta_cursor_tracker_init (MetaCursorTracker *tracker)
{
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
priv->is_showing = TRUE;
priv->x = -1.0;
priv->y = -1.0;
}
static void
meta_cursor_tracker_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaCursorTracker *tracker = META_CURSOR_TRACKER (object);
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
switch (prop_id)
{
case PROP_BACKEND:
g_value_set_object (value, priv->backend);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
meta_cursor_tracker_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaCursorTracker *tracker = META_CURSOR_TRACKER (object);
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
switch (prop_id)
{
case PROP_BACKEND:
priv->backend = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
} }
static void static void
meta_cursor_tracker_finalize (GObject *object) meta_cursor_tracker_finalize (GObject *object)
{ {
MetaCursorTracker *self = META_CURSOR_TRACKER (object); MetaCursorTracker *tracker = META_CURSOR_TRACKER (object);
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
if (self->effective_cursor) g_clear_object (&priv->effective_cursor);
g_object_unref (self->effective_cursor); g_clear_object (&priv->displayed_cursor);
if (self->displayed_cursor) g_clear_object (&priv->root_cursor);
g_object_unref (self->displayed_cursor);
if (self->root_cursor)
g_object_unref (self->root_cursor);
G_OBJECT_CLASS (meta_cursor_tracker_parent_class)->finalize (object); G_OBJECT_CLASS (meta_cursor_tracker_parent_class)->finalize (object);
} }
@@ -158,8 +265,25 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass); GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = meta_cursor_tracker_get_property;
object_class->set_property = meta_cursor_tracker_set_property;
object_class->finalize = meta_cursor_tracker_finalize; object_class->finalize = meta_cursor_tracker_finalize;
klass->set_force_track_position =
meta_cursor_tracker_real_set_force_track_position;
klass->get_sprite =
meta_cursor_tracker_real_get_sprite;
obj_props[PROP_BACKEND] =
g_param_spec_object ("backend",
"backend",
"MetaBackend",
META_TYPE_BACKEND,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPS, obj_props);
signals[CURSOR_CHANGED] = g_signal_new ("cursor-changed", signals[CURSOR_CHANGED] = g_signal_new ("cursor-changed",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,
@@ -219,50 +343,16 @@ set_window_cursor (MetaCursorTracker *tracker,
gboolean has_cursor, gboolean has_cursor,
MetaCursorSprite *cursor_sprite) MetaCursorSprite *cursor_sprite)
{ {
g_clear_object (&tracker->window_cursor); MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
g_clear_object (&priv->window_cursor);
if (cursor_sprite) if (cursor_sprite)
tracker->window_cursor = g_object_ref (cursor_sprite); priv->window_cursor = g_object_ref (cursor_sprite);
tracker->has_window_cursor = has_cursor; priv->has_window_cursor = has_cursor;
sync_cursor (tracker); sync_cursor (tracker);
} }
gboolean
meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
XEvent *xevent)
{
MetaX11Display *x11_display = meta_get_display ()->x11_display;
XFixesCursorNotifyEvent *notify_event;
if (meta_is_wayland_compositor ())
return FALSE;
if (xevent->xany.type != x11_display->xfixes_event_base + XFixesCursorNotify)
return FALSE;
notify_event = (XFixesCursorNotifyEvent *)xevent;
if (notify_event->subtype != XFixesDisplayCursorNotify)
return FALSE;
g_clear_object (&tracker->xfixes_cursor);
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
return TRUE;
}
static void
ensure_xfixes_cursor (MetaCursorTracker *tracker)
{
MetaDisplay *display = meta_get_display ();
g_autoptr (GError) error = NULL;
if (tracker->xfixes_cursor)
return;
tracker->xfixes_cursor = meta_cursor_sprite_xfixes_new (display, &error);
if (!tracker->xfixes_cursor)
g_warning ("Failed to create XFIXES cursor: %s", error->message);
}
/** /**
* meta_cursor_tracker_get_sprite: * meta_cursor_tracker_get_sprite:
* *
@@ -273,27 +363,13 @@ meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker)
{ {
MetaCursorSprite *cursor_sprite; MetaCursorSprite *cursor_sprite;
g_return_val_if_fail (META_IS_CURSOR_TRACKER (tracker), NULL); cursor_sprite = META_CURSOR_TRACKER_GET_CLASS (tracker)->get_sprite (tracker);
if (meta_is_wayland_compositor ()) if (!cursor_sprite)
{ return NULL;
cursor_sprite = tracker->displayed_cursor;
}
else
{
ensure_xfixes_cursor (tracker);
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
}
if (cursor_sprite) meta_cursor_sprite_realize_texture (cursor_sprite);
{ return meta_cursor_sprite_get_cogl_texture (cursor_sprite);
meta_cursor_sprite_realize_texture (cursor_sprite);
return meta_cursor_sprite_get_cogl_texture (cursor_sprite);
}
else
{
return NULL;
}
} }
/** /**
@@ -312,15 +388,7 @@ meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
g_return_if_fail (META_IS_CURSOR_TRACKER (tracker)); g_return_if_fail (META_IS_CURSOR_TRACKER (tracker));
if (meta_is_wayland_compositor ()) cursor_sprite = META_CURSOR_TRACKER_GET_CLASS (tracker)->get_sprite (tracker);
{
cursor_sprite = tracker->displayed_cursor;
}
else
{
ensure_xfixes_cursor (tracker);
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
}
if (cursor_sprite) if (cursor_sprite)
meta_cursor_sprite_get_hotspot (cursor_sprite, x, y); meta_cursor_sprite_get_hotspot (cursor_sprite, x, y);
@@ -358,9 +426,12 @@ void
meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker, meta_cursor_tracker_set_root_cursor (MetaCursorTracker *tracker,
MetaCursorSprite *cursor_sprite) MetaCursorSprite *cursor_sprite)
{ {
g_clear_object (&tracker->root_cursor); MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
g_clear_object (&priv->root_cursor);
if (cursor_sprite) if (cursor_sprite)
tracker->root_cursor = g_object_ref (cursor_sprite); priv->root_cursor = g_object_ref (cursor_sprite);
sync_cursor (tracker); sync_cursor (tracker);
} }
@@ -370,15 +441,27 @@ meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
float new_x, float new_x,
float new_y) float new_y)
{ {
MetaBackend *backend = meta_get_backend (); MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
MetaCursorRenderer *cursor_renderer = MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend); meta_backend_get_cursor_renderer (priv->backend);
gboolean position_changed;
g_assert (meta_is_wayland_compositor ()); if (priv->x != new_x || priv->y != new_y)
{
position_changed = TRUE;
priv->x = new_x;
priv->y = new_y;
}
else
{
position_changed = FALSE;
}
meta_cursor_renderer_set_position (cursor_renderer, new_x, new_y); meta_cursor_renderer_set_position (cursor_renderer, new_x, new_y);
g_signal_emit (tracker, signals[CURSOR_MOVED], 0, new_x, new_y); if (position_changed)
g_signal_emit (tracker, signals[CURSOR_MOVED], 0, new_x, new_y);
} }
static void static void
@@ -438,19 +521,59 @@ meta_cursor_tracker_get_pointer (MetaCursorTracker *tracker,
get_pointer_position_gdk (x, y, (int*)mods); get_pointer_position_gdk (x, y, (int*)mods);
} }
void
meta_cursor_tracker_track_position (MetaCursorTracker *tracker)
{
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
priv->track_position_count++;
if (priv->track_position_count == 1)
{
MetaCursorTrackerClass *klass =
META_CURSOR_TRACKER_GET_CLASS (tracker);
klass->set_force_track_position (tracker, TRUE);
}
}
void
meta_cursor_tracker_untrack_position (MetaCursorTracker *tracker)
{
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
g_return_if_fail (priv->track_position_count > 0);
priv->track_position_count--;
if (priv->track_position_count == 0)
{
MetaCursorTrackerClass *klass =
META_CURSOR_TRACKER_GET_CLASS (tracker);
klass->set_force_track_position (tracker, FALSE);
}
}
gboolean gboolean
meta_cursor_tracker_get_pointer_visible (MetaCursorTracker *tracker) meta_cursor_tracker_get_pointer_visible (MetaCursorTracker *tracker)
{ {
return tracker->is_showing; MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
return priv->is_showing;
} }
void void
meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker, meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
gboolean visible) gboolean visible)
{ {
if (visible == tracker->is_showing) MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
if (visible == priv->is_showing)
return; return;
tracker->is_showing = visible; priv->is_showing = visible;
sync_cursor (tracker); sync_cursor (tracker);
@@ -460,5 +583,17 @@ meta_cursor_tracker_set_pointer_visible (MetaCursorTracker *tracker,
MetaCursorSprite * MetaCursorSprite *
meta_cursor_tracker_get_displayed_cursor (MetaCursorTracker *tracker) meta_cursor_tracker_get_displayed_cursor (MetaCursorTracker *tracker)
{ {
return tracker->displayed_cursor; MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
return priv->displayed_cursor;
}
MetaBackend *
meta_cursor_tracker_get_backend (MetaCursorTracker *tracker)
{
MetaCursorTrackerPrivate *priv =
meta_cursor_tracker_get_instance_private (tracker);
return priv->backend;
} }

View File

@@ -189,10 +189,7 @@ meta_cursor_sprite_prepare_at (MetaCursorSprite *sprite,
void void
meta_cursor_sprite_realize_texture (MetaCursorSprite *sprite) meta_cursor_sprite_realize_texture (MetaCursorSprite *sprite)
{ {
MetaCursorSpriteClass *klass = META_CURSOR_SPRITE_GET_CLASS (sprite); META_CURSOR_SPRITE_GET_CLASS (sprite)->realize_texture (sprite);
if (klass->realize_texture)
klass->realize_texture (sprite);
} }
static void static void

View File

@@ -22,7 +22,7 @@
#ifndef META_INPUT_SETTINGS_PRIVATE_H #ifndef META_INPUT_SETTINGS_PRIVATE_H
#define META_INPUT_SETTINGS_PRIVATE_H #define META_INPUT_SETTINGS_PRIVATE_H
#include <gsettings-desktop-schemas/gdesktop-enums.h> #include <gdesktop-enums.h>
#ifdef HAVE_LIBWACOM #ifdef HAVE_LIBWACOM
#include <libwacom/libwacom.h> #include <libwacom/libwacom.h>
@@ -55,9 +55,15 @@ struct _MetaInputSettingsClass
void (* set_tap_enabled) (MetaInputSettings *settings, void (* set_tap_enabled) (MetaInputSettings *settings,
ClutterInputDevice *device, ClutterInputDevice *device,
gboolean enabled); gboolean enabled);
void (* set_tap_button_map) (MetaInputSettings *settings,
ClutterInputDevice *device,
GDesktopTouchpadTapButtonMap mode);
void (* set_tap_and_drag_enabled) (MetaInputSettings *settings, void (* set_tap_and_drag_enabled) (MetaInputSettings *settings,
ClutterInputDevice *device, ClutterInputDevice *device,
gboolean enabled); gboolean enabled);
void (* set_tap_and_drag_lock_enabled) (MetaInputSettings *settings,
ClutterInputDevice *device,
gboolean enabled);
void (* set_disable_while_typing) (MetaInputSettings *settings, void (* set_disable_while_typing) (MetaInputSettings *settings,
ClutterInputDevice *device, ClutterInputDevice *device,
gboolean enabled); gboolean enabled);

View File

@@ -620,6 +620,36 @@ update_touchpad_tap_enabled (MetaInputSettings *input_settings,
} }
} }
static void
update_touchpad_tap_button_map (MetaInputSettings *input_settings,
ClutterInputDevice *device)
{
MetaInputSettingsClass *input_settings_class;
GDesktopTouchpadTapButtonMap method;
MetaInputSettingsPrivate *priv;
if (device &&
clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
return;
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
method = g_settings_get_enum (priv->touchpad_settings, "tap-button-map");
if (device)
{
settings_device_set_uint_setting (input_settings, device,
input_settings_class->set_tap_button_map,
method);
}
else
{
settings_set_uint_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
(ConfigUintFunc) input_settings_class->set_tap_button_map,
method);
}
}
static void static void
update_touchpad_tap_and_drag_enabled (MetaInputSettings *input_settings, update_touchpad_tap_and_drag_enabled (MetaInputSettings *input_settings,
ClutterInputDevice *device) ClutterInputDevice *device)
@@ -652,6 +682,37 @@ update_touchpad_tap_and_drag_enabled (MetaInputSettings *input_settings,
} }
} }
static void
update_touchpad_tap_and_drag_lock_enabled (MetaInputSettings *input_settings,
ClutterInputDevice *device)
{
MetaInputSettingsClass *input_settings_class;
MetaInputSettingsPrivate *priv;
gboolean enabled;
if (device &&
clutter_input_device_get_device_type (device) != CLUTTER_TOUCHPAD_DEVICE)
return;
priv = meta_input_settings_get_instance_private (input_settings);
input_settings_class = META_INPUT_SETTINGS_GET_CLASS (input_settings);
enabled = g_settings_get_boolean (priv->touchpad_settings, "tap-and-drag-lock");
if (device)
{
settings_device_set_bool_setting (input_settings, device,
input_settings_class->set_tap_and_drag_lock_enabled,
enabled);
}
else
{
settings_set_bool_setting (input_settings, CLUTTER_TOUCHPAD_DEVICE,
NULL,
input_settings_class->set_tap_and_drag_lock_enabled,
enabled);
}
}
static void static void
update_touchpad_edge_scroll (MetaInputSettings *input_settings, update_touchpad_edge_scroll (MetaInputSettings *input_settings,
ClutterInputDevice *device) ClutterInputDevice *device)
@@ -1198,8 +1259,12 @@ meta_input_settings_changed_cb (GSettings *settings,
update_device_natural_scroll (input_settings, NULL); update_device_natural_scroll (input_settings, NULL);
else if (strcmp (key, "tap-to-click") == 0) else if (strcmp (key, "tap-to-click") == 0)
update_touchpad_tap_enabled (input_settings, NULL); update_touchpad_tap_enabled (input_settings, NULL);
else if (strcmp (key, "tap-button-map") == 0)
update_touchpad_tap_button_map (input_settings, NULL);
else if (strcmp (key, "tap-and-drag") == 0) else if (strcmp (key, "tap-and-drag") == 0)
update_touchpad_tap_and_drag_enabled (input_settings, NULL); update_touchpad_tap_and_drag_enabled (input_settings, NULL);
else if (strcmp (key, "tap-and-drag-lock") == 0)
update_touchpad_tap_and_drag_lock_enabled (input_settings, NULL);
else if (strcmp(key, "disable-while-typing") == 0) else if (strcmp(key, "disable-while-typing") == 0)
update_touchpad_disable_while_typing (input_settings, NULL); update_touchpad_disable_while_typing (input_settings, NULL);
else if (strcmp (key, "send-events") == 0) else if (strcmp (key, "send-events") == 0)
@@ -1700,7 +1765,9 @@ apply_device_settings (MetaInputSettings *input_settings,
update_touchpad_left_handed (input_settings, device); update_touchpad_left_handed (input_settings, device);
update_touchpad_tap_enabled (input_settings, device); update_touchpad_tap_enabled (input_settings, device);
update_touchpad_tap_button_map (input_settings, device);
update_touchpad_tap_and_drag_enabled (input_settings, device); update_touchpad_tap_and_drag_enabled (input_settings, device);
update_touchpad_tap_and_drag_lock_enabled (input_settings, device);
update_touchpad_disable_while_typing (input_settings, device); update_touchpad_disable_while_typing (input_settings, device);
update_touchpad_send_events (input_settings, device); update_touchpad_send_events (input_settings, device);
update_touchpad_two_finger_scroll (input_settings, device); update_touchpad_two_finger_scroll (input_settings, device);

View File

@@ -317,7 +317,7 @@ handle_start_element (GMarkupParseContext *context,
} }
else if (g_str_equal (element_name, "monitor")) else if (g_str_equal (element_name, "monitor"))
{ {
parser->current_monitor_config = g_new0 (MetaMonitorConfig, 1);; parser->current_monitor_config = g_new0 (MetaMonitorConfig, 1);
parser->state = STATE_MONITOR; parser->state = STATE_MONITOR;
} }

View File

@@ -96,7 +96,7 @@ create_mode (CrtcModeSpec *spec,
crtc_mode_info->refresh_rate = spec->refresh_rate; crtc_mode_info->refresh_rate = spec->refresh_rate;
return g_object_new (META_TYPE_CRTC_MODE, return g_object_new (META_TYPE_CRTC_MODE,
"id", mode_id, "id", (uint64_t) mode_id,
"info", crtc_mode_info, "info", crtc_mode_info,
NULL); NULL);
} }
@@ -205,7 +205,7 @@ append_monitor (MetaMonitorManager *manager,
*modes = g_list_concat (*modes, new_modes); *modes = g_list_concat (*modes, new_modes);
crtc = g_object_new (META_TYPE_CRTC_DUMMY, crtc = g_object_new (META_TYPE_CRTC_DUMMY,
"id", g_list_length (*crtcs) + 1, "id", (uint64_t) g_list_length (*crtcs) + 1,
"gpu", gpu, "gpu", gpu,
NULL); NULL);
*crtcs = g_list_append (*crtcs, crtc); *crtcs = g_list_append (*crtcs, crtc);
@@ -237,7 +237,7 @@ append_monitor (MetaMonitorManager *manager,
output_info->n_possible_crtcs = 1; output_info->n_possible_crtcs = 1;
output = g_object_new (META_TYPE_OUTPUT_DUMMY, output = g_object_new (META_TYPE_OUTPUT_DUMMY,
"id", number, "id", (uint64_t) number,
"gpu", gpu, "gpu", gpu,
"info", output_info, "info", output_info,
NULL); NULL);
@@ -291,7 +291,7 @@ append_tiled_monitor (MetaMonitorManager *manager,
MetaCrtc *crtc; MetaCrtc *crtc;
crtc = g_object_new (META_TYPE_CRTC_DUMMY, crtc = g_object_new (META_TYPE_CRTC_DUMMY,
"id", g_list_length (*crtcs) + i + 1, "id", (uint64_t) g_list_length (*crtcs) + i + 1,
"gpu", gpu, "gpu", gpu,
NULL); NULL);
new_crtcs = g_list_append (new_crtcs, crtc); new_crtcs = g_list_append (new_crtcs, crtc);
@@ -358,7 +358,7 @@ append_tiled_monitor (MetaMonitorManager *manager,
output_info->n_possible_crtcs = n_tiles; output_info->n_possible_crtcs = n_tiles;
output = g_object_new (META_TYPE_OUTPUT_DUMMY, output = g_object_new (META_TYPE_OUTPUT_DUMMY,
"id", number, "id", (uint64_t) number,
"gpu", gpu, "gpu", gpu,
"info", output_info, "info", output_info,
NULL); NULL);

View File

@@ -1186,7 +1186,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
{ {
MetaCrtcMode *mode = l->data; MetaCrtcMode *mode = l->data;
const MetaCrtcModeInfo *crtc_mode_info = const MetaCrtcModeInfo *crtc_mode_info =
meta_crtc_mode_get_info (mode);; meta_crtc_mode_get_info (mode);
g_variant_builder_add (&mode_builder, "(uxuudu)", g_variant_builder_add (&mode_builder, "(uxuudu)",
i, /* ID */ i, /* ID */

View File

@@ -36,6 +36,17 @@ enum
static int handle_signals[N_HANDLE_SIGNALS]; static int handle_signals[N_HANDLE_SIGNALS];
enum
{
PROP_0,
PROP_IS_RECORDING,
N_PROPS
};
static GParamSpec *obj_props[N_PROPS];
enum enum
{ {
CONTROLLER_NEW_HANDLE, CONTROLLER_NEW_HANDLE,
@@ -50,6 +61,8 @@ typedef struct _MetaRemoteAccessHandlePrivate
gboolean has_stopped; gboolean has_stopped;
gboolean disable_animations; gboolean disable_animations;
gboolean is_recording;
} MetaRemoteAccessHandlePrivate; } MetaRemoteAccessHandlePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaRemoteAccessHandle, G_DEFINE_TYPE_WITH_PRIVATE (MetaRemoteAccessHandle,
@@ -177,6 +190,48 @@ meta_remote_access_controller_new (MetaRemoteDesktop *remote_desktop,
return remote_access_controller; return remote_access_controller;
} }
static void
meta_remote_access_handle_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaRemoteAccessHandle *handle = META_REMOTE_ACCESS_HANDLE (object);
MetaRemoteAccessHandlePrivate *priv =
meta_remote_access_handle_get_instance_private (handle);
switch (prop_id)
{
case PROP_IS_RECORDING:
g_value_set_boolean (value, priv->is_recording);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
meta_remote_access_handle_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaRemoteAccessHandle *handle = META_REMOTE_ACCESS_HANDLE (object);
MetaRemoteAccessHandlePrivate *priv =
meta_remote_access_handle_get_instance_private (handle);
switch (prop_id)
{
case PROP_IS_RECORDING:
priv->is_recording = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void static void
meta_remote_access_handle_init (MetaRemoteAccessHandle *handle) meta_remote_access_handle_init (MetaRemoteAccessHandle *handle)
{ {
@@ -185,6 +240,11 @@ meta_remote_access_handle_init (MetaRemoteAccessHandle *handle)
static void static void
meta_remote_access_handle_class_init (MetaRemoteAccessHandleClass *klass) meta_remote_access_handle_class_init (MetaRemoteAccessHandleClass *klass)
{ {
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = meta_remote_access_handle_get_property;
object_class->set_property = meta_remote_access_handle_set_property;
handle_signals[HANDLE_STOPPED] = handle_signals[HANDLE_STOPPED] =
g_signal_new ("stopped", g_signal_new ("stopped",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
@@ -192,6 +252,16 @@ meta_remote_access_handle_class_init (MetaRemoteAccessHandleClass *klass)
0, 0,
NULL, NULL, NULL, NULL, NULL, NULL,
G_TYPE_NONE, 0); G_TYPE_NONE, 0);
obj_props[PROP_IS_RECORDING] =
g_param_spec_boolean ("is-recording",
"is-recording",
"Is a screen recording",
FALSE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPS, obj_props);
} }
static void static void

View File

@@ -143,7 +143,7 @@ meta_renderer_real_rebuild_views (MetaRenderer *renderer)
meta_backend_get_monitor_manager (backend); meta_backend_get_monitor_manager (backend);
GList *logical_monitors, *l; GList *logical_monitors, *l;
g_list_free_full (priv->views, g_object_unref); g_list_free_full (priv->views, (GDestroyNotify) clutter_stage_view_destroy);
priv->views = NULL; priv->views = NULL;
logical_monitors = logical_monitors =

View File

@@ -170,6 +170,7 @@ static void
sync_cursor_state (MetaScreenCastAreaStreamSrc *area_src) sync_cursor_state (MetaScreenCastAreaStreamSrc *area_src)
{ {
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (area_src); MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (area_src);
MetaScreenCastRecordFlag flags;
if (!is_cursor_in_stream (area_src)) if (!is_cursor_in_stream (area_src))
return; return;
@@ -177,7 +178,8 @@ sync_cursor_state (MetaScreenCastAreaStreamSrc *area_src)
if (is_redraw_queued (area_src)) if (is_redraw_queued (area_src))
return; return;
meta_screen_cast_stream_src_maybe_record_frame (src); flags = META_SCREEN_CAST_RECORD_FLAG_CURSOR_ONLY;
meta_screen_cast_stream_src_maybe_record_frame (src, flags);
} }
static void static void
@@ -233,10 +235,12 @@ maybe_record_frame_on_idle (gpointer user_data)
MetaScreenCastAreaStreamSrc *area_src = MetaScreenCastAreaStreamSrc *area_src =
META_SCREEN_CAST_AREA_STREAM_SRC (user_data); META_SCREEN_CAST_AREA_STREAM_SRC (user_data);
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (area_src); MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (area_src);
MetaScreenCastRecordFlag flags;
area_src->maybe_record_idle_id = 0; area_src->maybe_record_idle_id = 0;
meta_screen_cast_stream_src_maybe_record_frame (src); flags = META_SCREEN_CAST_RECORD_FLAG_NONE;
meta_screen_cast_stream_src_maybe_record_frame (src, flags);
return G_SOURCE_REMOVE; return G_SOURCE_REMOVE;
} }
@@ -339,6 +343,7 @@ meta_screen_cast_area_stream_src_enable (MetaScreenCastStreamSrc *src)
g_signal_connect_after (cursor_tracker, "cursor-changed", g_signal_connect_after (cursor_tracker, "cursor-changed",
G_CALLBACK (cursor_changed), G_CALLBACK (cursor_changed),
area_src); area_src);
meta_cursor_tracker_track_position (cursor_tracker);
G_GNUC_FALLTHROUGH; G_GNUC_FALLTHROUGH;
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN: case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
add_view_painted_watches (area_src, add_view_painted_watches (area_src,
@@ -346,6 +351,7 @@ meta_screen_cast_area_stream_src_enable (MetaScreenCastStreamSrc *src)
break; break;
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED: case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
inhibit_hw_cursor (area_src); inhibit_hw_cursor (area_src);
meta_cursor_tracker_track_position (cursor_tracker);
add_view_painted_watches (area_src, add_view_painted_watches (area_src,
META_STAGE_WATCH_AFTER_ACTOR_PAINT); META_STAGE_WATCH_AFTER_ACTOR_PAINT);
break; break;
@@ -359,6 +365,7 @@ meta_screen_cast_area_stream_src_disable (MetaScreenCastStreamSrc *src)
{ {
MetaScreenCastAreaStreamSrc *area_src = MetaScreenCastAreaStreamSrc *area_src =
META_SCREEN_CAST_AREA_STREAM_SRC (src); META_SCREEN_CAST_AREA_STREAM_SRC (src);
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
MetaBackend *backend = get_backend (area_src); MetaBackend *backend = get_backend (area_src);
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend); MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
ClutterStage *stage; ClutterStage *stage;
@@ -385,11 +392,22 @@ meta_screen_cast_area_stream_src_disable (MetaScreenCastStreamSrc *src)
cursor_tracker); cursor_tracker);
g_clear_handle_id (&area_src->maybe_record_idle_id, g_source_remove); g_clear_handle_id (&area_src->maybe_record_idle_id, g_source_remove);
switch (meta_screen_cast_stream_get_cursor_mode (stream))
{
case META_SCREEN_CAST_CURSOR_MODE_METADATA:
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
meta_cursor_tracker_untrack_position (cursor_tracker);
break;
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
break;
}
} }
static gboolean static gboolean
meta_screen_cast_area_stream_src_record_frame (MetaScreenCastStreamSrc *src, meta_screen_cast_area_stream_src_record_to_buffer (MetaScreenCastStreamSrc *src,
uint8_t *data) uint8_t *data,
GError **error)
{ {
MetaScreenCastAreaStreamSrc *area_src = MetaScreenCastAreaStreamSrc *area_src =
META_SCREEN_CAST_AREA_STREAM_SRC (src); META_SCREEN_CAST_AREA_STREAM_SRC (src);
@@ -400,7 +418,6 @@ meta_screen_cast_area_stream_src_record_frame (MetaScreenCastStreamSrc *src,
float scale; float scale;
int stride; int stride;
ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_NONE; ClutterPaintFlag paint_flags = CLUTTER_PAINT_FLAG_NONE;
g_autoptr (GError) error = NULL;
stage = get_stage (area_src); stage = get_stage (area_src);
area = meta_screen_cast_area_stream_get_area (area_stream); area = meta_screen_cast_area_stream_get_area (area_stream);
@@ -414,6 +431,7 @@ meta_screen_cast_area_stream_src_record_frame (MetaScreenCastStreamSrc *src,
paint_flags |= CLUTTER_PAINT_FLAG_NO_CURSORS; paint_flags |= CLUTTER_PAINT_FLAG_NO_CURSORS;
break; break;
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED: case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
paint_flags |= CLUTTER_PAINT_FLAG_FORCE_CURSORS;
break; break;
} }
@@ -422,18 +440,16 @@ meta_screen_cast_area_stream_src_record_frame (MetaScreenCastStreamSrc *src,
stride, stride,
CLUTTER_CAIRO_FORMAT_ARGB32, CLUTTER_CAIRO_FORMAT_ARGB32,
paint_flags, paint_flags,
&error)) error))
{ return FALSE;
g_warning ("Failed to record area: %s", error->message);
return FALSE;
}
return TRUE; return TRUE;
} }
static gboolean static gboolean
meta_screen_cast_area_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc *src, meta_screen_cast_area_stream_src_record_to_framebuffer (MetaScreenCastStreamSrc *src,
CoglFramebuffer *framebuffer) CoglFramebuffer *framebuffer,
GError **error)
{ {
MetaScreenCastAreaStreamSrc *area_src = MetaScreenCastAreaStreamSrc *area_src =
META_SCREEN_CAST_AREA_STREAM_SRC (src); META_SCREEN_CAST_AREA_STREAM_SRC (src);
@@ -456,6 +472,7 @@ meta_screen_cast_area_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc *s
paint_flags |= CLUTTER_PAINT_FLAG_NO_CURSORS; paint_flags |= CLUTTER_PAINT_FLAG_NO_CURSORS;
break; break;
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED: case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
paint_flags |= CLUTTER_PAINT_FLAG_FORCE_CURSORS;
break; break;
} }
clutter_stage_paint_to_framebuffer (stage, framebuffer, clutter_stage_paint_to_framebuffer (stage, framebuffer,
@@ -467,6 +484,19 @@ meta_screen_cast_area_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc *s
return TRUE; return TRUE;
} }
static void
meta_screen_cast_area_stream_record_follow_up (MetaScreenCastStreamSrc *src)
{
MetaScreenCastAreaStreamSrc *area_src =
META_SCREEN_CAST_AREA_STREAM_SRC (src);
MetaScreenCastRecordFlag flags;
g_clear_handle_id (&area_src->maybe_record_idle_id, g_source_remove);
flags = META_SCREEN_CAST_RECORD_FLAG_NONE;
meta_screen_cast_stream_src_maybe_record_frame (src, flags);
}
static void static void
meta_screen_cast_area_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *src, meta_screen_cast_area_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *src,
struct spa_meta_cursor *spa_meta_cursor) struct spa_meta_cursor *spa_meta_cursor)
@@ -578,9 +608,12 @@ meta_screen_cast_area_stream_src_class_init (MetaScreenCastAreaStreamSrcClass *k
src_class->get_specs = meta_screen_cast_area_stream_src_get_specs; src_class->get_specs = meta_screen_cast_area_stream_src_get_specs;
src_class->enable = meta_screen_cast_area_stream_src_enable; src_class->enable = meta_screen_cast_area_stream_src_enable;
src_class->disable = meta_screen_cast_area_stream_src_disable; src_class->disable = meta_screen_cast_area_stream_src_disable;
src_class->record_frame = meta_screen_cast_area_stream_src_record_frame; src_class->record_to_buffer =
src_class->blit_to_framebuffer = meta_screen_cast_area_stream_src_record_to_buffer;
meta_screen_cast_area_stream_src_blit_to_framebuffer; src_class->record_to_framebuffer =
meta_screen_cast_area_stream_src_record_to_framebuffer;
src_class->record_follow_up =
meta_screen_cast_area_stream_record_follow_up;
src_class->set_cursor_metadata = src_class->set_cursor_metadata =
meta_screen_cast_area_stream_src_set_cursor_metadata; meta_screen_cast_area_stream_src_set_cursor_metadata;
} }

View File

@@ -87,6 +87,7 @@ meta_screen_cast_area_stream_new (MetaScreenCastSession *session,
MetaRectangle *area, MetaRectangle *area,
ClutterStage *stage, ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode, MetaScreenCastCursorMode cursor_mode,
MetaScreenCastFlag flags,
GError **error) GError **error)
{ {
MetaScreenCastAreaStream *area_stream; MetaScreenCastAreaStream *area_stream;
@@ -105,6 +106,7 @@ meta_screen_cast_area_stream_new (MetaScreenCastSession *session,
"session", session, "session", session,
"connection", connection, "connection", connection,
"cursor-mode", cursor_mode, "cursor-mode", cursor_mode,
"flags", flags,
NULL); NULL);
if (!area_stream) if (!area_stream)
return NULL; return NULL;

View File

@@ -37,6 +37,7 @@ MetaScreenCastAreaStream * meta_screen_cast_area_stream_new (MetaScreenCastSessi
MetaRectangle *area, MetaRectangle *area,
ClutterStage *stage, ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode, MetaScreenCastCursorMode cursor_mode,
MetaScreenCastFlag flags,
GError **error); GError **error);
ClutterStage * meta_screen_cast_area_stream_get_stage (MetaScreenCastAreaStream *area_stream); ClutterStage * meta_screen_cast_area_stream_get_stage (MetaScreenCastAreaStream *area_stream);

View File

@@ -121,8 +121,10 @@ stage_painted (MetaStage *stage,
gpointer user_data) gpointer user_data)
{ {
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (user_data); MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (user_data);
MetaScreenCastRecordFlag flags;
meta_screen_cast_stream_src_maybe_record_frame (src); flags = META_SCREEN_CAST_RECORD_FLAG_NONE;
meta_screen_cast_stream_src_maybe_record_frame (src, flags);
} }
static MetaBackend * static MetaBackend *
@@ -202,6 +204,7 @@ static void
sync_cursor_state (MetaScreenCastMonitorStreamSrc *monitor_src) sync_cursor_state (MetaScreenCastMonitorStreamSrc *monitor_src)
{ {
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src); MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src);
MetaScreenCastRecordFlag flags;
if (!is_cursor_in_stream (monitor_src)) if (!is_cursor_in_stream (monitor_src))
return; return;
@@ -209,7 +212,11 @@ sync_cursor_state (MetaScreenCastMonitorStreamSrc *monitor_src)
if (is_redraw_queued (monitor_src)) if (is_redraw_queued (monitor_src))
return; return;
meta_screen_cast_stream_src_maybe_record_frame (src); if (meta_screen_cast_stream_src_pending_follow_up_frame (src))
return;
flags = META_SCREEN_CAST_RECORD_FLAG_CURSOR_ONLY;
meta_screen_cast_stream_src_maybe_record_frame (src, flags);
} }
static void static void
@@ -336,6 +343,7 @@ meta_screen_cast_monitor_stream_src_enable (MetaScreenCastStreamSrc *src)
g_signal_connect_after (cursor_tracker, "cursor-changed", g_signal_connect_after (cursor_tracker, "cursor-changed",
G_CALLBACK (cursor_changed), G_CALLBACK (cursor_changed),
monitor_src); monitor_src);
meta_cursor_tracker_track_position (cursor_tracker);
G_GNUC_FALLTHROUGH; G_GNUC_FALLTHROUGH;
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN: case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
add_view_painted_watches (monitor_src, add_view_painted_watches (monitor_src,
@@ -343,6 +351,7 @@ meta_screen_cast_monitor_stream_src_enable (MetaScreenCastStreamSrc *src)
break; break;
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED: case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
inhibit_hw_cursor (monitor_src); inhibit_hw_cursor (monitor_src);
meta_cursor_tracker_track_position (cursor_tracker);
add_view_painted_watches (monitor_src, add_view_painted_watches (monitor_src,
META_STAGE_WATCH_AFTER_PAINT); META_STAGE_WATCH_AFTER_PAINT);
break; break;
@@ -356,6 +365,7 @@ meta_screen_cast_monitor_stream_src_disable (MetaScreenCastStreamSrc *src)
{ {
MetaScreenCastMonitorStreamSrc *monitor_src = MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (src); META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
MetaBackend *backend = get_backend (monitor_src); MetaBackend *backend = get_backend (monitor_src);
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend); MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
ClutterStage *stage; ClutterStage *stage;
@@ -380,32 +390,115 @@ meta_screen_cast_monitor_stream_src_disable (MetaScreenCastStreamSrc *src)
cursor_tracker); cursor_tracker);
g_clear_signal_handler (&monitor_src->cursor_changed_handler_id, g_clear_signal_handler (&monitor_src->cursor_changed_handler_id,
cursor_tracker); cursor_tracker);
switch (meta_screen_cast_stream_get_cursor_mode (stream))
{
case META_SCREEN_CAST_CURSOR_MODE_METADATA:
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
meta_cursor_tracker_untrack_position (cursor_tracker);
break;
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
break;
}
}
static void
maybe_paint_cursor_sprite (MetaScreenCastMonitorStreamSrc *monitor_src,
uint8_t *data)
{
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src);
MetaBackend *backend = get_backend (monitor_src);
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
MetaCursorSprite *cursor_sprite;
CoglTexture *sprite_texture;
int sprite_width, sprite_height, sprite_stride;
float sprite_scale;
uint8_t *sprite_data;
cairo_surface_t *sprite_surface;
graphene_rect_t sprite_rect;
int width, height, stride;
cairo_surface_t *surface;
cairo_t *cr;
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
if (!cursor_sprite)
return;
if (meta_cursor_renderer_is_overlay_visible (cursor_renderer))
return;
sprite_rect = meta_cursor_renderer_calculate_rect (cursor_renderer,
cursor_sprite);
sprite_texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
sprite_width = cogl_texture_get_width (sprite_texture);
sprite_height = cogl_texture_get_height (sprite_texture);
sprite_stride = sprite_width * 4;
sprite_scale = meta_cursor_sprite_get_texture_scale (cursor_sprite);
sprite_data = g_new0 (uint8_t, sprite_stride * sprite_height);
cogl_texture_get_data (sprite_texture,
CLUTTER_CAIRO_FORMAT_ARGB32,
sprite_stride,
sprite_data);
sprite_surface = cairo_image_surface_create_for_data (sprite_data,
CAIRO_FORMAT_ARGB32,
sprite_width,
sprite_height,
sprite_stride);
cairo_surface_set_device_scale (sprite_surface, sprite_scale, sprite_scale);
stride = meta_screen_cast_stream_src_get_stride (src);
width = meta_screen_cast_stream_src_get_width (src);
height = meta_screen_cast_stream_src_get_height (src);
surface = cairo_image_surface_create_for_data (data,
CAIRO_FORMAT_ARGB32,
width, height, stride);
cr = cairo_create (surface);
cairo_set_source_surface (cr, sprite_surface,
sprite_rect.origin.x,
sprite_rect.origin.y);
cairo_paint (cr);
cairo_destroy (cr);
cairo_surface_destroy (sprite_surface);
cairo_surface_destroy (surface);
g_free (sprite_data);
} }
static gboolean static gboolean
meta_screen_cast_monitor_stream_src_record_frame (MetaScreenCastStreamSrc *src, meta_screen_cast_monitor_stream_src_record_to_buffer (MetaScreenCastStreamSrc *src,
uint8_t *data) uint8_t *data,
GError **error)
{ {
MetaScreenCastMonitorStreamSrc *monitor_src = MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (src); META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
ClutterStage *stage; ClutterStage *stage;
MetaMonitor *monitor; MetaMonitor *monitor;
MetaLogicalMonitor *logical_monitor; MetaLogicalMonitor *logical_monitor;
if (!is_redraw_queued (monitor_src))
return FALSE;
monitor = get_monitor (monitor_src); monitor = get_monitor (monitor_src);
logical_monitor = meta_monitor_get_logical_monitor (monitor); logical_monitor = meta_monitor_get_logical_monitor (monitor);
stage = get_stage (monitor_src); stage = get_stage (monitor_src);
clutter_stage_capture_into (stage, FALSE, &logical_monitor->rect, data); clutter_stage_capture_into (stage, FALSE, &logical_monitor->rect, data);
switch (meta_screen_cast_stream_get_cursor_mode (stream))
{
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
maybe_paint_cursor_sprite (monitor_src, data);
break;
case META_SCREEN_CAST_CURSOR_MODE_METADATA:
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
break;
}
return TRUE; return TRUE;
} }
static gboolean static gboolean
meta_screen_cast_monitor_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc *src, meta_screen_cast_monitor_stream_src_record_to_framebuffer (MetaScreenCastStreamSrc *src,
CoglFramebuffer *framebuffer) CoglFramebuffer *framebuffer,
GError **error)
{ {
MetaScreenCastMonitorStreamSrc *monitor_src = MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (src); META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
@@ -429,7 +522,6 @@ meta_screen_cast_monitor_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc
for (l = meta_renderer_get_views (renderer); l; l = l->next) for (l = meta_renderer_get_views (renderer); l; l = l->next)
{ {
ClutterStageView *view = CLUTTER_STAGE_VIEW (l->data); ClutterStageView *view = CLUTTER_STAGE_VIEW (l->data);
g_autoptr (GError) error = NULL;
CoglFramebuffer *view_framebuffer; CoglFramebuffer *view_framebuffer;
MetaRectangle view_layout; MetaRectangle view_layout;
int x, y; int x, y;
@@ -450,12 +542,8 @@ meta_screen_cast_monitor_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc
x, y, x, y,
cogl_framebuffer_get_width (view_framebuffer), cogl_framebuffer_get_width (view_framebuffer),
cogl_framebuffer_get_height (view_framebuffer), cogl_framebuffer_get_height (view_framebuffer),
&error)) error))
{ return FALSE;
g_warning ("Error blitting view into DMABuf framebuffer: %s",
error->message);
return FALSE;
}
} }
cogl_framebuffer_finish (framebuffer); cogl_framebuffer_finish (framebuffer);
@@ -463,6 +551,44 @@ meta_screen_cast_monitor_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc
return TRUE; return TRUE;
} }
static void
meta_screen_cast_monitor_stream_record_follow_up (MetaScreenCastStreamSrc *src)
{
MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
MetaBackend *backend = get_backend (monitor_src);
MetaRenderer *renderer = meta_backend_get_renderer (backend);
ClutterStage *stage = get_stage (monitor_src);
MetaMonitor *monitor;
MetaLogicalMonitor *logical_monitor;
MetaRectangle logical_monitor_layout;
GList *l;
monitor = get_monitor (monitor_src);
logical_monitor = meta_monitor_get_logical_monitor (monitor);
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
for (l = meta_renderer_get_views (renderer); l; l = l->next)
{
MetaRendererView *view = l->data;
MetaRectangle view_layout;
MetaRectangle damage;
clutter_stage_view_get_layout (CLUTTER_STAGE_VIEW (view), &view_layout);
if (!meta_rectangle_overlap (&logical_monitor_layout, &view_layout))
continue;
damage = (cairo_rectangle_int_t) {
.x = view_layout.x,
.y = view_layout.y,
.width = 1,
.height = 1,
};
clutter_actor_queue_redraw_with_clip (CLUTTER_ACTOR (stage), &damage);
}
}
static void static void
meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *src, meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *src,
struct spa_meta_cursor *spa_meta_cursor) struct spa_meta_cursor *spa_meta_cursor)
@@ -583,9 +709,12 @@ meta_screen_cast_monitor_stream_src_class_init (MetaScreenCastMonitorStreamSrcCl
src_class->get_specs = meta_screen_cast_monitor_stream_src_get_specs; src_class->get_specs = meta_screen_cast_monitor_stream_src_get_specs;
src_class->enable = meta_screen_cast_monitor_stream_src_enable; src_class->enable = meta_screen_cast_monitor_stream_src_enable;
src_class->disable = meta_screen_cast_monitor_stream_src_disable; src_class->disable = meta_screen_cast_monitor_stream_src_disable;
src_class->record_frame = meta_screen_cast_monitor_stream_src_record_frame; src_class->record_to_buffer =
src_class->blit_to_framebuffer = meta_screen_cast_monitor_stream_src_record_to_buffer;
meta_screen_cast_monitor_stream_src_blit_to_framebuffer; src_class->record_to_framebuffer =
meta_screen_cast_monitor_stream_src_record_to_framebuffer;
src_class->record_follow_up =
meta_screen_cast_monitor_stream_record_follow_up;
src_class->set_cursor_metadata = src_class->set_cursor_metadata =
meta_screen_cast_monitor_stream_src_set_cursor_metadata; meta_screen_cast_monitor_stream_src_set_cursor_metadata;
} }

View File

@@ -110,6 +110,7 @@ meta_screen_cast_monitor_stream_new (MetaScreenCastSession *session,
MetaMonitor *monitor, MetaMonitor *monitor,
ClutterStage *stage, ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode, MetaScreenCastCursorMode cursor_mode,
MetaScreenCastFlag flags,
GError **error) GError **error)
{ {
MetaGpu *gpu = meta_monitor_get_gpu (monitor); MetaGpu *gpu = meta_monitor_get_gpu (monitor);
@@ -130,6 +131,7 @@ meta_screen_cast_monitor_stream_new (MetaScreenCastSession *session,
"session", session, "session", session,
"connection", connection, "connection", connection,
"cursor-mode", cursor_mode, "cursor-mode", cursor_mode,
"flags", flags,
"monitor", monitor, "monitor", monitor,
NULL); NULL);
if (!monitor_stream) if (!monitor_stream)

View File

@@ -40,6 +40,7 @@ MetaScreenCastMonitorStream * meta_screen_cast_monitor_stream_new (MetaScreenCas
MetaMonitor *monitor, MetaMonitor *monitor,
ClutterStage *stage, ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode, MetaScreenCastCursorMode cursor_mode,
MetaScreenCastFlag flags,
GError **error); GError **error);
ClutterStage * meta_screen_cast_monitor_stream_get_stage (MetaScreenCastMonitorStream *monitor_stream); ClutterStage * meta_screen_cast_monitor_stream_get_stage (MetaScreenCastMonitorStream *monitor_stream);

View File

@@ -310,6 +310,8 @@ handle_record_monitor (MetaDBusScreenCastSession *skeleton,
meta_backend_get_monitor_manager (backend); meta_backend_get_monitor_manager (backend);
MetaMonitor *monitor; MetaMonitor *monitor;
MetaScreenCastCursorMode cursor_mode; MetaScreenCastCursorMode cursor_mode;
gboolean is_recording;
MetaScreenCastFlag flags;
ClutterStage *stage; ClutterStage *stage;
GError *error = NULL; GError *error = NULL;
MetaScreenCastMonitorStream *monitor_stream; MetaScreenCastMonitorStream *monitor_stream;
@@ -356,13 +358,21 @@ handle_record_monitor (MetaDBusScreenCastSession *skeleton,
} }
} }
if (!g_variant_lookup (properties_variant, "is-recording", "b", &is_recording))
is_recording = FALSE;
stage = CLUTTER_STAGE (meta_backend_get_stage (backend)); stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
flags = META_SCREEN_CAST_FLAG_NONE;
if (is_recording)
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
monitor_stream = meta_screen_cast_monitor_stream_new (session, monitor_stream = meta_screen_cast_monitor_stream_new (session,
connection, connection,
monitor, monitor,
stage, stage,
cursor_mode, cursor_mode,
flags,
&error); &error);
if (!monitor_stream) if (!monitor_stream)
{ {
@@ -398,6 +408,8 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
GDBusConnection *connection; GDBusConnection *connection;
MetaWindow *window; MetaWindow *window;
MetaScreenCastCursorMode cursor_mode; MetaScreenCastCursorMode cursor_mode;
gboolean is_recording;
MetaScreenCastFlag flags;
GError *error = NULL; GError *error = NULL;
MetaDisplay *display; MetaDisplay *display;
GVariant *window_id_variant = NULL; GVariant *window_id_variant = NULL;
@@ -454,13 +466,21 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
} }
} }
if (!g_variant_lookup (properties_variant, "is-recording", "b", &is_recording))
is_recording = FALSE;
interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton); interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton);
connection = g_dbus_interface_skeleton_get_connection (interface_skeleton); connection = g_dbus_interface_skeleton_get_connection (interface_skeleton);
flags = META_SCREEN_CAST_FLAG_NONE;
if (is_recording)
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
window_stream = meta_screen_cast_window_stream_new (session, window_stream = meta_screen_cast_window_stream_new (session,
connection, connection,
window, window,
cursor_mode, cursor_mode,
flags,
&error); &error);
if (!window_stream) if (!window_stream)
{ {
@@ -501,6 +521,8 @@ handle_record_area (MetaDBusScreenCastSession *skeleton,
MetaBackend *backend; MetaBackend *backend;
ClutterStage *stage; ClutterStage *stage;
MetaScreenCastCursorMode cursor_mode; MetaScreenCastCursorMode cursor_mode;
gboolean is_recording;
MetaScreenCastFlag flags;
g_autoptr (GError) error = NULL; g_autoptr (GError) error = NULL;
MetaRectangle rect; MetaRectangle rect;
MetaScreenCastAreaStream *area_stream; MetaScreenCastAreaStream *area_stream;
@@ -530,11 +552,18 @@ handle_record_area (MetaDBusScreenCastSession *skeleton,
} }
} }
if (!g_variant_lookup (properties_variant, "is-recording", "b", &is_recording))
is_recording = FALSE;
interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton); interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton);
connection = g_dbus_interface_skeleton_get_connection (interface_skeleton); connection = g_dbus_interface_skeleton_get_connection (interface_skeleton);
backend = meta_screen_cast_get_backend (session->screen_cast); backend = meta_screen_cast_get_backend (session->screen_cast);
stage = CLUTTER_STAGE (meta_backend_get_stage (backend)); stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
flags = META_SCREEN_CAST_FLAG_NONE;
if (is_recording)
flags |= META_SCREEN_CAST_FLAG_IS_RECORDING;
rect = (MetaRectangle) { rect = (MetaRectangle) {
.x = x, .x = x,
.y = y, .y = y,
@@ -546,6 +575,7 @@ handle_record_area (MetaDBusScreenCastSession *skeleton,
&rect, &rect,
stage, stage,
cursor_mode, cursor_mode,
flags,
&error); &error);
if (!area_stream) if (!area_stream)
{ {
@@ -647,12 +677,37 @@ meta_screen_cast_session_class_init (MetaScreenCastSessionClass *klass)
object_class->finalize = meta_screen_cast_session_finalize; object_class->finalize = meta_screen_cast_session_finalize;
} }
static gboolean
meta_screen_cast_session_is_recording (MetaScreenCastSession *session)
{
GList *l;
if (!session->streams)
return FALSE;
for (l = session->streams; l; l = l->next)
{
MetaScreenCastStream *stream = l->data;
MetaScreenCastFlag flags;
flags = meta_screen_cast_stream_get_flags (stream);
if (!(flags & META_SCREEN_CAST_FLAG_IS_RECORDING))
return FALSE;
}
return TRUE;
}
static MetaScreenCastSessionHandle * static MetaScreenCastSessionHandle *
meta_screen_cast_session_handle_new (MetaScreenCastSession *session) meta_screen_cast_session_handle_new (MetaScreenCastSession *session)
{ {
MetaScreenCastSessionHandle *handle; MetaScreenCastSessionHandle *handle;
gboolean is_recording;
handle = g_object_new (META_TYPE_SCREEN_CAST_SESSION_HANDLE, NULL); is_recording = meta_screen_cast_session_is_recording (session);
handle = g_object_new (META_TYPE_SCREEN_CAST_SESSION_HANDLE,
"is-recording", is_recording,
NULL);
handle->session = session; handle->session = session;
return handle; return handle;

View File

@@ -91,7 +91,8 @@ typedef struct _MetaScreenCastStreamSrcPrivate
struct spa_video_info_raw video_format; struct spa_video_info_raw video_format;
int video_stride; int video_stride;
uint64_t last_frame_timestamp_us; int64_t last_frame_timestamp_us;
guint follow_up_frame_source_id;
GHashTable *dmabuf_handles; GHashTable *dmabuf_handles;
@@ -135,23 +136,34 @@ meta_screen_cast_stream_src_get_videocrop (MetaScreenCastStreamSrc *src,
} }
static gboolean static gboolean
meta_screen_cast_stream_src_record_frame (MetaScreenCastStreamSrc *src, meta_screen_cast_stream_src_record_to_buffer (MetaScreenCastStreamSrc *src,
uint8_t *data) uint8_t *data,
GError **error)
{ {
MetaScreenCastStreamSrcClass *klass = MetaScreenCastStreamSrcClass *klass =
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src); META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
return klass->record_frame (src, data); return klass->record_to_buffer (src, data, error);
} }
static gboolean static gboolean
meta_screen_cast_stream_src_blit_to_framebuffer (MetaScreenCastStreamSrc *src, meta_screen_cast_stream_src_record_to_framebuffer (MetaScreenCastStreamSrc *src,
CoglFramebuffer *framebuffer) CoglFramebuffer *framebuffer,
GError **error)
{ {
MetaScreenCastStreamSrcClass *klass = MetaScreenCastStreamSrcClass *klass =
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src); META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
return klass->blit_to_framebuffer (src, framebuffer); return klass->record_to_framebuffer (src, framebuffer, error);
}
static void
meta_screen_cast_stream_src_record_follow_up (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcClass *klass =
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
klass->record_follow_up (src);
} }
static void static void
@@ -409,9 +421,10 @@ maybe_record_cursor (MetaScreenCastStreamSrc *src,
} }
static gboolean static gboolean
do_record_frame (MetaScreenCastStreamSrc *src, do_record_frame (MetaScreenCastStreamSrc *src,
struct spa_buffer *spa_buffer, struct spa_buffer *spa_buffer,
uint8_t *data) uint8_t *data,
GError **error)
{ {
MetaScreenCastStreamSrcPrivate *priv = MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src); meta_screen_cast_stream_src_get_instance_private (src);
@@ -419,7 +432,7 @@ do_record_frame (MetaScreenCastStreamSrc *src,
if (spa_buffer->datas[0].data || if (spa_buffer->datas[0].data ||
spa_buffer->datas[0].type == SPA_DATA_MemFd) spa_buffer->datas[0].type == SPA_DATA_MemFd)
{ {
return meta_screen_cast_stream_src_record_frame (src, data); return meta_screen_cast_stream_src_record_to_buffer (src, data, error);
} }
else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf) else if (spa_buffer->datas[0].type == SPA_DATA_DmaBuf)
{ {
@@ -429,14 +442,56 @@ do_record_frame (MetaScreenCastStreamSrc *src,
CoglFramebuffer *dmabuf_fbo = CoglFramebuffer *dmabuf_fbo =
cogl_dma_buf_handle_get_framebuffer (dmabuf_handle); cogl_dma_buf_handle_get_framebuffer (dmabuf_handle);
return meta_screen_cast_stream_src_blit_to_framebuffer (src, dmabuf_fbo); return meta_screen_cast_stream_src_record_to_framebuffer (src,
dmabuf_fbo,
error);
} }
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Unknown SPA buffer type %u", spa_buffer->datas[0].type);
return FALSE; return FALSE;
} }
gboolean
meta_screen_cast_stream_src_pending_follow_up_frame (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
return priv->follow_up_frame_source_id != 0;
}
static gboolean
follow_up_frame_cb (gpointer user_data)
{
MetaScreenCastStreamSrc *src = user_data;
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
priv->follow_up_frame_source_id = 0;
meta_screen_cast_stream_src_record_follow_up (src);
return G_SOURCE_REMOVE;
}
static void
maybe_schedule_follow_up_frame (MetaScreenCastStreamSrc *src,
int64_t timeout_us)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
if (priv->follow_up_frame_source_id)
return;
priv->follow_up_frame_source_id = g_timeout_add (us2ms (timeout_us),
follow_up_frame_cb,
src);
}
void void
meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src) meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src,
MetaScreenCastRecordFlag flags)
{ {
MetaScreenCastStreamSrcPrivate *priv = MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src); meta_screen_cast_stream_src_get_instance_private (src);
@@ -445,14 +500,29 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
struct spa_buffer *spa_buffer; struct spa_buffer *spa_buffer;
uint8_t *data = NULL; uint8_t *data = NULL;
uint64_t now_us; uint64_t now_us;
g_autoptr (GError) error = NULL;
now_us = g_get_monotonic_time (); now_us = g_get_monotonic_time ();
if (priv->video_format.max_framerate.num > 0 && if (priv->video_format.max_framerate.num > 0 &&
priv->last_frame_timestamp_us != 0 && priv->last_frame_timestamp_us != 0)
(now_us - priv->last_frame_timestamp_us < {
((1000000 * priv->video_format.max_framerate.denom) / int64_t min_interval_us;
priv->video_format.max_framerate.num))) int64_t time_since_last_frame_us;
return;
min_interval_us =
((G_USEC_PER_SEC * priv->video_format.max_framerate.denom) /
priv->video_format.max_framerate.num);
time_since_last_frame_us = now_us - priv->last_frame_timestamp_us;
if (time_since_last_frame_us < min_interval_us)
{
int64_t timeout_us;
timeout_us = min_interval_us - time_since_last_frame_us;
maybe_schedule_follow_up_frame (src, timeout_us);
return;
}
}
if (!priv->pipewire_stream) if (!priv->pipewire_stream)
return; return;
@@ -470,34 +540,43 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
return; return;
} }
if (do_record_frame (src, spa_buffer, data)) if (!(flags & META_SCREEN_CAST_RECORD_FLAG_CURSOR_ONLY))
{ {
struct spa_meta_region *spa_meta_video_crop; g_clear_handle_id (&priv->follow_up_frame_source_id, g_source_remove);
if (do_record_frame (src, spa_buffer, data, &error))
spa_buffer->datas[0].chunk->size = spa_buffer->datas[0].maxsize;
spa_buffer->datas[0].chunk->stride = priv->video_stride;
/* Update VideoCrop if needed */
spa_meta_video_crop =
spa_buffer_find_meta_data (spa_buffer, SPA_META_VideoCrop,
sizeof (*spa_meta_video_crop));
if (spa_meta_video_crop)
{ {
if (meta_screen_cast_stream_src_get_videocrop (src, &crop_rect)) struct spa_meta_region *spa_meta_video_crop;
spa_buffer->datas[0].chunk->size = spa_buffer->datas[0].maxsize;
spa_buffer->datas[0].chunk->stride = priv->video_stride;
/* Update VideoCrop if needed */
spa_meta_video_crop =
spa_buffer_find_meta_data (spa_buffer, SPA_META_VideoCrop,
sizeof (*spa_meta_video_crop));
if (spa_meta_video_crop)
{ {
spa_meta_video_crop->region.position.x = crop_rect.x; if (meta_screen_cast_stream_src_get_videocrop (src, &crop_rect))
spa_meta_video_crop->region.position.y = crop_rect.y; {
spa_meta_video_crop->region.size.width = crop_rect.width; spa_meta_video_crop->region.position.x = crop_rect.x;
spa_meta_video_crop->region.size.height = crop_rect.height; spa_meta_video_crop->region.position.y = crop_rect.y;
} spa_meta_video_crop->region.size.width = crop_rect.width;
else spa_meta_video_crop->region.size.height = crop_rect.height;
{ }
spa_meta_video_crop->region.position.x = 0; else
spa_meta_video_crop->region.position.y = 0; {
spa_meta_video_crop->region.size.width = priv->stream_width; spa_meta_video_crop->region.position.x = 0;
spa_meta_video_crop->region.size.height = priv->stream_height; spa_meta_video_crop->region.position.y = 0;
spa_meta_video_crop->region.size.width = priv->stream_width;
spa_meta_video_crop->region.size.height = priv->stream_height;
}
} }
} }
else
{
g_warning ("Failed to record screen cast frame: %s", error->message);
spa_buffer->datas[0].chunk->size = 0;
}
} }
else else
{ {
@@ -539,6 +618,8 @@ meta_screen_cast_stream_src_disable (MetaScreenCastStreamSrc *src)
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src)->disable (src); META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src)->disable (src);
g_clear_handle_id (&priv->follow_up_frame_source_id, g_source_remove);
priv->is_enabled = FALSE; priv->is_enabled = FALSE;
} }
@@ -977,6 +1058,24 @@ meta_screen_cast_stream_src_get_stride (MetaScreenCastStreamSrc *src)
return priv->video_stride; return priv->video_stride;
} }
int
meta_screen_cast_stream_src_get_width (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
return priv->stream_width;
}
int
meta_screen_cast_stream_src_get_height (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
return priv->stream_height;
}
MetaScreenCastStream * MetaScreenCastStream *
meta_screen_cast_stream_src_get_stream (MetaScreenCastStreamSrc *src) meta_screen_cast_stream_src_get_stream (MetaScreenCastStreamSrc *src)
{ {
@@ -1020,7 +1119,7 @@ meta_screen_cast_stream_src_set_property (GObject *object,
{ {
case PROP_STREAM: case PROP_STREAM:
priv->stream = g_value_get_object (value); priv->stream = g_value_get_object (value);
break;; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
} }

View File

@@ -37,6 +37,12 @@
typedef struct _MetaScreenCastStream MetaScreenCastStream; typedef struct _MetaScreenCastStream MetaScreenCastStream;
typedef enum _MetaScreenCastRecordFlag
{
META_SCREEN_CAST_RECORD_FLAG_NONE = 0,
META_SCREEN_CAST_RECORD_FLAG_CURSOR_ONLY = 1 << 0,
} MetaScreenCastRecordFlag;
#define META_TYPE_SCREEN_CAST_STREAM_SRC (meta_screen_cast_stream_src_get_type ()) #define META_TYPE_SCREEN_CAST_STREAM_SRC (meta_screen_cast_stream_src_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaScreenCastStreamSrc, G_DECLARE_DERIVABLE_TYPE (MetaScreenCastStreamSrc,
meta_screen_cast_stream_src, meta_screen_cast_stream_src,
@@ -53,20 +59,31 @@ struct _MetaScreenCastStreamSrcClass
float *frame_rate); float *frame_rate);
void (* enable) (MetaScreenCastStreamSrc *src); void (* enable) (MetaScreenCastStreamSrc *src);
void (* disable) (MetaScreenCastStreamSrc *src); void (* disable) (MetaScreenCastStreamSrc *src);
gboolean (* record_frame) (MetaScreenCastStreamSrc *src, gboolean (* record_to_buffer) (MetaScreenCastStreamSrc *src,
uint8_t *data); uint8_t *data,
gboolean (* blit_to_framebuffer) (MetaScreenCastStreamSrc *src, GError **error);
CoglFramebuffer *framebuffer); gboolean (* record_to_framebuffer) (MetaScreenCastStreamSrc *src,
CoglFramebuffer *framebuffer,
GError **error);
void (* record_follow_up) (MetaScreenCastStreamSrc *src);
gboolean (* get_videocrop) (MetaScreenCastStreamSrc *src, gboolean (* get_videocrop) (MetaScreenCastStreamSrc *src,
MetaRectangle *crop_rect); MetaRectangle *crop_rect);
void (* set_cursor_metadata) (MetaScreenCastStreamSrc *src, void (* set_cursor_metadata) (MetaScreenCastStreamSrc *src,
struct spa_meta_cursor *spa_meta_cursor); struct spa_meta_cursor *spa_meta_cursor);
}; };
void meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src); void meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src,
MetaScreenCastRecordFlag flags);
gboolean meta_screen_cast_stream_src_pending_follow_up_frame (MetaScreenCastStreamSrc *src);
int meta_screen_cast_stream_src_get_stride (MetaScreenCastStreamSrc *src); int meta_screen_cast_stream_src_get_stride (MetaScreenCastStreamSrc *src);
int meta_screen_cast_stream_src_get_width (MetaScreenCastStreamSrc *src);
int meta_screen_cast_stream_src_get_height (MetaScreenCastStreamSrc *src);
MetaScreenCastStream * meta_screen_cast_stream_src_get_stream (MetaScreenCastStreamSrc *src); MetaScreenCastStream * meta_screen_cast_stream_src_get_stream (MetaScreenCastStreamSrc *src);
gboolean meta_screen_cast_stream_src_draw_cursor_into (MetaScreenCastStreamSrc *src, gboolean meta_screen_cast_stream_src_draw_cursor_into (MetaScreenCastStreamSrc *src,

View File

@@ -26,6 +26,8 @@
#include "backends/meta-screen-cast-session.h" #include "backends/meta-screen-cast-session.h"
#include "meta-private-enum-types.h"
#define META_SCREEN_CAST_STREAM_DBUS_IFACE "org.gnome.Mutter.ScreenCast.Stream" #define META_SCREEN_CAST_STREAM_DBUS_IFACE "org.gnome.Mutter.ScreenCast.Stream"
#define META_SCREEN_CAST_STREAM_DBUS_PATH "/org/gnome/Mutter/ScreenCast/Stream" #define META_SCREEN_CAST_STREAM_DBUS_PATH "/org/gnome/Mutter/ScreenCast/Stream"
@@ -36,6 +38,7 @@ enum
PROP_SESSION, PROP_SESSION,
PROP_CONNECTION, PROP_CONNECTION,
PROP_CURSOR_MODE, PROP_CURSOR_MODE,
PROP_FLAGS,
}; };
enum enum
@@ -55,6 +58,7 @@ typedef struct _MetaScreenCastStreamPrivate
char *object_path; char *object_path;
MetaScreenCastCursorMode cursor_mode; MetaScreenCastCursorMode cursor_mode;
MetaScreenCastFlag flags;
MetaScreenCastStreamSrc *src; MetaScreenCastStreamSrc *src;
} MetaScreenCastStreamPrivate; } MetaScreenCastStreamPrivate;
@@ -187,6 +191,15 @@ meta_screen_cast_stream_get_cursor_mode (MetaScreenCastStream *stream)
return priv->cursor_mode; return priv->cursor_mode;
} }
MetaScreenCastFlag
meta_screen_cast_stream_get_flags (MetaScreenCastStream *stream)
{
MetaScreenCastStreamPrivate *priv =
meta_screen_cast_stream_get_instance_private (stream);
return priv->flags;
}
static void static void
meta_screen_cast_stream_set_property (GObject *object, meta_screen_cast_stream_set_property (GObject *object,
guint prop_id, guint prop_id,
@@ -208,6 +221,9 @@ meta_screen_cast_stream_set_property (GObject *object,
case PROP_CURSOR_MODE: case PROP_CURSOR_MODE:
priv->cursor_mode = g_value_get_uint (value); priv->cursor_mode = g_value_get_uint (value);
break; break;
case PROP_FLAGS:
priv->flags = g_value_get_flags (value);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
} }
@@ -234,6 +250,9 @@ meta_screen_cast_stream_get_property (GObject *object,
case PROP_CURSOR_MODE: case PROP_CURSOR_MODE:
g_value_set_uint (value, priv->cursor_mode); g_value_set_uint (value, priv->cursor_mode);
break; break;
case PROP_FLAGS:
g_value_set_flags (value, priv->flags);
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
} }
@@ -337,6 +356,17 @@ meta_screen_cast_stream_class_init (MetaScreenCastStreamClass *klass)
G_PARAM_CONSTRUCT_ONLY | G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS)); G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_FLAGS,
g_param_spec_flags ("flags",
"flags",
"Screen cast flags",
META_TYPE_SCREEN_CAST_FLAG,
META_SCREEN_CAST_FLAG_NONE,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
signals[CLOSED] = g_signal_new ("closed", signals[CLOSED] = g_signal_new ("closed",
G_TYPE_FROM_CLASS (klass), G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_SIGNAL_RUN_LAST,

View File

@@ -67,4 +67,6 @@ void meta_screen_cast_stream_transform_position (MetaScreenCastStream *stream,
MetaScreenCastCursorMode meta_screen_cast_stream_get_cursor_mode (MetaScreenCastStream *stream); MetaScreenCastCursorMode meta_screen_cast_stream_get_cursor_mode (MetaScreenCastStream *stream);
MetaScreenCastFlag meta_screen_cast_stream_get_flags (MetaScreenCastStream *stream);
#endif /* META_SCREEN_CAST_STREAM_H */ #endif /* META_SCREEN_CAST_STREAM_H */

Some files were not shown because too many files have changed in this diff Show More