Compare commits

..

147 Commits

Author SHA1 Message Date
Ray Strode
625ea86672 MetaShapedTexture: save and restore textures on suspend
The proprietary nvidia driver garbles GPU memory on suspend.

In order to workaround that limitation, this commit copies all
textures to host memory on suspend and restores them on resume.

One complication comes from external textures (such as those
given to us by Xwayland for X clients).  We can't just restore
those textures, since they aren't writable.

This commit addresses that complication by keeping a local texture
around for those external textures, and using it instead for parts
of the window that haven't been redrawn since resume.
2019-01-15 11:54:58 -05:00
Ray Strode
395d463c08 background: purge all background textures on suspend
This commit makes sure all background textures get purged
on suspend, which is important for nvidia.
2019-01-15 11:37:54 -05:00
Ray Strode
2fc0652886 backends/native: update cursor on resume
As mentioned in a previous commit, the proprietary NVIDIA
driver garbles memory on suspend. That behavior, means that
the cursor gets corrupted on suspend.

This commit forces the cursor to redraw itself when the
logind session becomes active (on VT switch and resume).
2019-01-15 11:37:54 -05:00
Ray Strode
6ff42c2ab2 backends/native: update glyph cache on resume
As mentioned in a previous commit, the proprietary NVIDIA
driver garbles memory on suspend. That behavior, means that
clutter's glyph cache (which is stored in GPU memory) gets
corrupted on suspend.

This commit ensures the glyph cache is blown away when
the logind session becomes active (on VT switch and resume).
2019-01-15 11:37:53 -05:00
Ray Strode
f9907d1978 backends/native: emit gl-video-memory-purged when becoming active
The proprietary NVIDIA driver garbles memory on suspend.  In order
to work around that limitation, mutter needs to refresh all its
textures on resuem.

This commit lays the way toward doing that by emitting the
"gl-video-memory-purged" signal when the compositor becomes active
by logind (which happens on VT switch and on resume).
2019-01-15 11:37:39 -05:00
Ray Strode
45c5f557bd wayland: force X clients to redraw on resume
On nvidia, the textures backing Xwayland client window contents get
corrupted on suspend.  Xwayland currently doesn't handle this situation
itself.

For now, in order to work around this issue, send an empty output
change event to Xwayland.  This will cause it to force Expose events
to get sent to all clients and get them to redraw.
2019-01-15 11:37:08 -05:00
Ray Strode
53d63ea72b backend: add signals for reporting suspend and resume
This commit adds "suspending" and "resuming" signals
to MetaBackend.

It's preliminary work needed for tracking when to purge
and recreate all textures (needed by nvidia).
2019-01-15 11:35:08 -05:00
Ray Strode
f6e8e867b4 backend: switch to using generated logind proxy
Right now we listen to prepare-for-sleep using
raw gdbus calls.

This commit switches it over to use a generated
proxy, which will become useful in a future commit,
for adding suspending inhibitors.
2019-01-15 11:35:08 -05:00
Ray Strode
a566c6677c cogl: add new UNSTABLE_TEXTURES feature
The proprietary nvidia driver garbles texture memory on suspend.

Before we can address that, we need to be able to detect it.

This commit adds a new UNSTABLE_TEXTURES feature that gets set if
the proprietary nvidia driver is in use.
2019-01-15 11:35:08 -05:00
Ray Strode
cb06e1ef33 fixup! wayland: Don't crash if wl_output resource is destroyed after being removed 2019-01-14 15:44:18 -05:00
Ray Strode
a30c8fb83d Revert "window/wayland: Always update monitor for non-user ops"
This reverts commit e0db7d75c924a07da2b366c9c9e5075dd7bea6e6.
2019-01-14 10:08:04 -05:00
Ray Strode
e3a42dc873 screen-cast-cursor-side-channel.patch 2019-01-14 10:06:59 -05:00
Jonas Ådahl
efd7b8987f renderer/native: Make the EGLStreams operate in mailbox mode
This means eglSwapBuffers() wont dead lock if there is an old buffer pending
page flip. This could happen after e.g. mode changes or for other reasons.
2019-01-14 10:06:58 -05:00
Jonas Ådahl
c96aacabf7 renderer/native: Make EGLStream page flip errors non-fatal
Just continue rendering; we don't care if we were busy once, as it'll most
likely work when we flip the next time.
2019-01-14 10:06:58 -05:00
Ray Strode
af61b66953 shaped-texture-get-image-via-offscreen.patch 2019-01-14 10:06:58 -05:00
Jonas Ådahl
baf11d2471 window: Fix introspection warnings
(transfer none) was added for fundamental types, which can't be
transfered.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/356
(cherry picked from commit 781ec74fd2)
2019-01-14 10:06:57 -05:00
Olivier Fourdan
01c763470e window: Expose the client type in the API
We already have the enum exposed, but no accessor function.

Add `meta_window_get_client_type()` which returns the
`MetaWindowClientType` of a window.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit 7a5e0c7824)
2019-01-14 10:06:56 -05:00
Olivier Fourdan
c9065da442 screen-cast-session: Add window-id support
Use the "window-id" property to select the window to cast using
RecordWindow.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit c786b6c13c)
2019-01-14 10:06:56 -05:00
Olivier Fourdan
5f8a4f560f window: Add window id
Generate a unique 64bit window-id which is unrelated to any windowing
backend.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit bbcb66ddf4)
2019-01-14 10:06:56 -05:00
Olivier Fourdan
47577432e4 screen-cast-session: Add support for RecordWindow
Add support for the RecordWindow screencast method, casting the
currently focused window.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit ec25f3a6b7)
2019-01-14 10:06:56 -05:00
Olivier Fourdan
4ee9462fcd screen-cast-session: Add screen-cast window mode
Window mode will cast the content of a single window using the
`MetaScreenCastWindow` interface.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit dbe7279c7f)
2019-01-14 10:06:55 -05:00
Olivier Fourdan
c275c1de52 window-actor: Implement MetaScreenCastWindow interface
Implements the `MetaScreenCastWindow` interface for screen-cast
`RecordWindow` mode.

`meta_window_actor_capture_into()` implementation is still pretty crude
and doesn't take into account subsurfaces and O-R windows so menus,
popups and other tooltips won't show in the capture.

This is left as a future improvement for now.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit 931934511c)
2019-01-14 10:06:55 -05:00
Olivier Fourdan
a9965bb57a screen-cast: Add screen-cast-window interface
Typically, to stream the content of a window, we need a way to copy the
content of its window-actor into a buffer, transform relative input
coordinates to relative position within the window-actor and a mean to
get the window bounds within the buffer.

For this purpose, add a new GType interface `MetaScreenCastWindow` with
the methods needed for screen-cast window mode:

 * meta_screen_cast_window_get_buffer_bounds()
 * meta_screen_cast_window_get_frame_bounds()
 * meta_screen_cast_window_transform_relative_position()
 * meta_screen_cast_window_capture_into()

This interface is meant to be implemented by `MetaWindowActor` which has
access to all the necessary bits to implement them.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit 20c9ca25c0)
2019-01-14 10:06:55 -05:00
Olivier Fourdan
9cc2fa2526 screen-cast-src: Add VideoCrop support
To be able to cast windows, which by definition can change in size
dynamically, we need a way to specify the video crop meta to adjust to
the window size whenever it changes.

Add VideoCrop support with a new optional hook `get_videocrop()` in the
`ScreenCastStreamSrcClass` which, if defined, can let the child specify
a rectangle for the video cropping area.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/306
(cherry picked from commit f64eba57ce)
2019-01-14 10:06:55 -05:00
Olivier Fourdan
f439b0432d remote-desktop: Do not leak the virtual touchscreen
Virtual keyboard and pointer are freed on session close, but the
virtual touchscreen isn't.

Avoid a leak by freeing the virtual touchscreen along with the rest of
virtual devices.
2019-01-14 10:06:54 -05:00
Olivier Fourdan
ab39558506 clutter: Keep a device reference with events
If a device (virtual or real) is removed while there are remaining
events queued for that device, the event loop may try to access the
event freed memory.

To avoid the issue, add a reference to the device when the event is
created or copied, and remove the reference once the device is freed.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/393
2019-01-14 10:06:54 -05:00
Olivier Fourdan
9d72eeeb58 clutter/evdev: Use clutter_event_set_device()
Use the relevant clutter device API `clutter_event_set_device()` instead
of setting the device directly in the event field.
2019-01-14 10:06:54 -05:00
Jonas Ådahl
eea0a2b11d renderer/native: Use shadow fb on software GL if preferred
If a KMS device has the DRM_CAP_DUMB_PREFER_SHADOW and a software based
GL driver is used, always use a shadow fb. This will speed up read backs
in the llvmpipe OpenGL implementation, making blend operations faster.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/106
2019-01-14 10:06:53 -05:00
Jonas Ådahl
bcacaf4562 renderer/native: Also wrap flip closures for EGLStreams
When using the EGLStream backend, the MetaRendererNative passed a
GClosure to KMS when using EGLStreams, but KMS flip callback event
handler in meta-gpu-kms.c expected a closure wrapped in a closure
container, meaning it'd instead crash when using EGLStreams. Make the
flip handler get what it expects also when using EGLStreams by wrapping
the flip closure in the container before handing it over to EGL.

https://bugzilla.gnome.org/show_bug.cgi?id=790316
(cherry picked from commit 8ee14a7cb7)
2019-01-14 10:06:53 -05:00
Miguel A. Vico
5ae7a67b36 wayland: Create EGLStream-backed buffers through wl_eglstream_controller
One of the current limitations of EGLStreams is that there's no way to
resize a surface consumer without re-creating the entire stream.

Therefore, while resizing, clients will send wl_surface::attach requests
so the compositor can re-create its endpoint of the stream, but no
buffer will be available actually. If we proceed with the rest of the
attach operation we'll be presenting an empty buffer.

In order to fix this, a separate wl_eglstream_controller protocol has
been introduced that clients can use to request a stream re-creation
without overloading wl_surface::attach for that purpose.

This change adds the required logic to create the corresponding
wl_eglstream_controller global interface that clients can bind to.

Whenever a client requests a stream to be created, we just need to
create and realize the new EGLStream buffer. The same buffer resource
will be given at a later time to wl_surface::attach, whenever new
content is made available by the application, so we can proceed to
acquire the stream buffer and update the surface state.

https://bugzilla.gnome.org/show_bug.cgi?id=782575

(cherry picked from commit 435b3c4bdb)
2019-01-14 10:06:53 -05:00
Miguel A. Vico
7d8ff61069 wayland: Realize dmabuf buffers before trying to attach them
Commit 22723ca37 moved buffer realization to
meta_wayland_surface_commit() so that it wouldn't be part of
meta_wayland_buffer_attach().

However, creation of dmabuf buffers would call into
meta_wayland_buffer_attach() directly without realizing the buffer
first. attach() would then fail and mutter would effectively shut down
any clients using the zwp_linux_dmabuf protocol (note that if such
client was Xwayland, mutter itself would shut down as well).

Add the missing bit in order to make zwp_linux_dmabuf protocol work
again.

(cherry picked from commit 54709c16b5)
2019-01-14 10:06:53 -05:00
Miguel A. Vico
79b3f56bd3 wayland: Always realize buffers at surface commit time
Clients using EGLStream-backed buffers will expect the stream to be
functional after wl_surface::attach(). That means the compositor-side
stream must be created and a consumer attached to it.

To resolve the above, this change realizes buffers even when the attach
operation is deferred (e.g. synchronized subsurfaces).

https://bugzilla.gnome.org/show_bug.cgi?id=782575

(cherry picked from commit 22723ca371)
2019-01-14 10:06:52 -05:00
Miguel A. Vico
e371bacd7f wayland-buffer: Create EGLStream texture at buffer_realize time
When dealing with synchronized subsurfaces, we defer buffer attachments
until the parent surface state is applied.

That causes interaction issues with EGLStream backed buffers, as the
client expects the compositor-side stream to be functional after it
requests a wl_surface::attach.

By allowing the compositor to realize buffers without attaching them, we
could resolve the issue above if we define a realized EGLStream buffer
as a functional EGLStream (EGLStream + attached consumer).

This change moves the texture consumer creation part from the attach
function to the realize one.

https://bugzilla.gnome.org/show_bug.cgi?id=782575

(cherry picked from commit edd3634bb5)
2019-01-14 10:06:52 -05:00
Miguel A. Vico
62fd182272 renderer/native: Choose first EGL config for non-GBM backends
Commit 712ec30cd9 added the logic to only
choose EGL configs that match the GBM_FORMAT_XRGB8888 pixel format.
However, there won't be any EGL config satisfying such criteria for
non-GBM backends, such as EGLDevice.

This change will let us choose the first EGL config for the EGLDevice
backend, while still forcing GBM_FORMAT_XRGB8888 configs for the GBM
one.

Related to: https://gitlab.gnome.org/GNOME/mutter/issues/2

(cherry picked from commit 1bf2eb95b5)
2019-01-14 10:06:52 -05:00
Florian Müllner
f48c8c5824 xprops: Make sure text_property_to_utf8() returns UTF8
Commit 840378ae68 changed the code to use XmbTextPropertyToTextList()
instead of gdk_text_property_to_utf8_list_for_display(), but didn't
take into account that the replacement returns text in the current
locale's encoding, while any callers (rightfully) expect UTF8.

Fix this by converting the text if necessary.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/227
2019-01-14 10:06:52 -05:00
Florian Müllner
e3d7b3828e x11/window-props: Do not convert WM_NAME
The WM_NAME property is of type TEXT_PROPERTY, which is supposed to be
returned as UTF-8. Commit 840378ae68 broke that assumption, resulting
in crashes with non-UTF8 locales; however the "fix" of converting from
LATIN1 to UTF8 is wrong as well, as the conversion will spit out garbage
when the input encoding isn't actually LATIN1.

Now that the original issue in text_property_to_utf8() has been fixed,
we can simply revert the relevant bits of commit d62491f46e.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/227
2019-01-14 10:06:51 -05:00
Jonas Ådahl
6e14403ac8 wayland/gtk-shell: Handle requests after toplevel was unmanaged
As with xdg-toplevel, a gtk-surface can be unmanaged by the compositor
without the client knowing about it, meaning the client may still send
updates and make requests. Handle this gracefully by ignoring them. The
client needs to reset all the state anyway, if it wants to remap the
same surface.

https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit ca5b27baf5)
2019-01-14 10:06:51 -05:00
Jonas Ådahl
ec2471a356 wayland/legacy-xdg-shell: Handle requests after toplevel was unmanaged
As with xdg-toplevel proper, a legacy xdg-toplevel can be unmanaged by
the compositor without the client knowing about it, meaning the client
may still send updates and make requests. Handle this gracefully by
ignoring them. The client needs to reassign the surface the legacy
xdg-toplevel role again, if it wants to remap the same surface, meaning
all state would be reset anyway.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit 64df627688)
2019-01-14 10:06:51 -05:00
Jonas Ådahl
30820ab19e wayland/legacy-xdg-shell: Cache frame callbacks if toplevel is unmanaged
A toplevel window can be unmanaged without the client knowing it (e.g. a
modal dialog being unmapped together with its parent. When this has
happened, take frame callbacks queued on a commit and cache them on the
generic surface queue. If the toplevel is to be remapped because the
surface was reassigned the toplevel role, the cached frame callbacks
will be queued on the surface actor and dispatched accordingly.

https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit a740f50cd7)
2019-01-14 10:06:51 -05:00
Jonas Ådahl
58cc091134 wayland/xdg-shell: Handle requests after toplevel was unmanaged
A window can be unmanaged without asking the client to do it, for
example as a side effect of a parent window being unmanaged, if the
child window was a attached dialog.

This means that the client might still make requests post updates to it
after that it was unmapped. Handle this gracefully by NULL-checking the
surface's MetaWindow pointer. We're not loosing any state due to this,
as if the client wants to map the same surface again, it needs to either
reassign it the toplevel role, or reset the xdg-toplevel, both resulting
in all state being lost anyway.

https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit 5fd0f62a62)
2019-01-14 10:06:50 -05:00
Jonas Ådahl
0105dca586 wayland/xdg-shell: Cache frame callbacks if toplevel is unmanaged
A toplevel window can be unmanaged without the client knowing it (e.g. a
modal dialog being unmapped together with its parent. When this has
happened, take frame callbacks queued on a commit and cache them on the
generic surface queue. If the toplevel is to be remapped, either because
the surface was reassigned the toplevel role, or if it was reset and
remapped, the cached frame callbacks will be queued on the surface actor
and dispatched accordingly.

https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit 80d420ff43)
2019-01-14 10:06:50 -05:00
Jonas Ådahl
17dd4d32da wayland/xdg-shell: Cache pending frame callbacks on popup reset
A popup can be reset, and when that happens, window and actor are
destroyed, and won't be created again unless it is reassigned the
popup role.

If a client queued frame callbacks when resetting a popup, the frame
callbacks would be left in the pending state, as they were not queued on
the actor, meaning we'd hit an assert about the frame callbacks not
being handled. Fix this by caching them on the MetaWaylandSurface, so
that they either are cleaned up on destruction, or queued on the actor
would the surface be re-assigned the popup role.

https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit 407d62943c)
2019-01-14 10:06:50 -05:00
Jonas Ådahl
5b95f809ca wayland/surface: Add API to cache frame callbacks
Sometimes it may be useful for roles to put callbacks in the generic
surface frame callback queue. The surface frame callback queue will
either eventually be processed on the next surface role assignment that
places the frame callbacks in a role specific queue, processed at some
other point in time by a role, or cleaned up on surface destruction.

https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit 0ace58d05f)
2019-01-14 10:06:49 -05:00
Jonas Ådahl
3934793255 wayland/xdg-shell: Queue frame callbacks on new actor after resetting
When a xdg-toplevel is reset, the window and actor are recreated, and
all state is cleared. When this happened, we earlied out from the
xdg-toplevel commit handler, which would mean that if the client had
queued frame callbacks when resetting, they'd be left in the pending
commit state, later hitting an assert as they were not handled.

Fix this by queuing the frame callbacks no the new actor, so that they
are emitted whenever the actor is eventually painted.

https://gitlab.gnome.org/GNOME/mutter/issues/240
(cherry picked from commit d791710197)
2019-01-14 10:06:49 -05:00
Olivier Fourdan
f3655737bc window: unmanage dialog when clearing transient_for
On Wayland, xdg-foreign would leave a modal dialog managed even after
the imported surface is destroyed.

This is sub-optimal and this breaks the atomic relationship one would
expect between the parent and its modal dialog.

Make sure we unmanage the dialog if transient_for is unset even for
Wayland native windows.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/174
Related: https://gitlab.gnome.org/GNOME/mutter/issues/221

(cherry picked from commit b443bd42ac)
2019-01-14 10:06:49 -05:00
Florian Müllner
728ed4fe38 idle-monitor: Don't try to auto-start SessionManager
The interface is provided by gnome-session and not activatable.

https://gitlab.gnome.org/GNOME/mutter/issues/134

(cherry picked from commit 2319cd9c40)
2019-01-14 10:06:49 -05:00
Sebastian Keller
bcba6571f0 backends/x11: Only free cursor if it was created successfully
XcursorLibraryLoadCursor can return 'None' if the current cursor theme
is missing the requested icon. If XFreeCursor is then called on this
cursor, it generates a BadCursor error causing gnome-shell to crash.

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

(cherry picked from commit 1bfa20929b)
2019-01-14 10:06:48 -05:00
Sam Spilsbury
4525a74e59 window: Return -1 if meta_window_get_monitor is called on an unmanaged window
As opposed to crashing. In this case, letting the caller deal with
it is the best policy, since this is public API.

https://bugzilla.gnome.org/show_bug.cgi?id=788834

(cherry picked from commit 8626c69c2f)
2019-01-14 10:06:48 -05:00
Jonas Ådahl
0dd58540b2 wayland/keyboard: Create a separate keymap shm file per resource
By using the shm file when sending the keymap to all clients, we
effectively allows any client to change the keymap, as any client has
the ability to change the content of the file. Sending a read-only file
descriptor, or making the file itself read-only before unlinking, can
be worked around by the client by using chmod(2) and open(2) on
/proc/<pid>/<fd>.

Using memfd could potentially solve this issue, but as the usage of
mmap with MAP_SHARED is wide spread among clients, such a change can
not be introduced without causing wide spread compatibility issues.

So, to avoid allowing clients to interfere with each other, create a
separate shm file for each wl_keyboard resource when sending the
keymap. We could eventually do this per client, but in most cases,
there will only be one wl_keyboard resource per client anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=784206
2019-01-14 10:06:48 -05:00
Alex Villacís Lasso
ac27fca3ef renderer/native: Fallback to non-planar API if gbm_bo_get_handle_for_plane fails
Commit c0d9b08ef9 replaced the old GBM API calls
with the multi-plane GBM API. However, the call to gbm_bo_get_handle_for_plane
fails for some DRI drivers (in particular i915). Due to missing error checks,
the subsequent call to drmModeAddFB[2] fails and the screen output locks up.

This commit adds the missing error checks and falls back to the old GBM API
(non-planar) if necessary.

v5: test success of gbm_bo_get_handle_for_plane instead of errno

This commit adopts solution proposed by Daniel van Vugt to check the return
value of gbm_bo_get_handle_for_plane on plane 0 and fall back to old
non-planar method if the call fails. This removes the errno check (for
ENOSYS) that could abort if mesa ever sets a different value.

Related to: https://gitlab.gnome.org/GNOME/mutter/issues/127

(cherry picked from commit f7af32a3ea)
2019-01-14 10:06:48 -05:00
Iain Lane
99bbe001f5 monitor-manager-kms: Check if GPUs can have outputs
We need a way for mutter to exit if no available GPUs are going to work.
For example if gdm starts gnome-shell and we're using a DRM driver that
doesn't work with KMS then we should exit so that GDM can try with Xorg,
rather than operating in headless mode.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/223

(cherry picked from commit deb541ef5a)
2019-01-14 10:06:47 -05:00
Iain Lane
30c09c84c4 gpu-kms: Handle drmModeGetResources() failing
Avoid dereferencing the NULL return value if it fails. We still create
the MetaGpu, but we treat it as if it has no outputs.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/223

(cherry picked from commit 29cc526e2e)
2019-01-14 10:06:47 -05:00
Aaron Plattner
81c63df853 gpu-kms: Don't crash if drmModeGetResources returns NULL
DRM drivers can be opened by meta_launcher_open_restricted() even if they don't
implement modesetting. However, drmModeGetResources() will return NULL.

Check whether that happened in meta_gpu_kms_new() and return with an error
instead of crashing.

Fixes #223.
2019-01-14 10:06:47 -05:00
Jonas Ådahl
3104abba57 monitor: Use current monitor mode to check whether active
For historical reasons meta_monitor_is_active() checked whether it is
active by checking whether the main output have a CRTC assigned and
whether that CRTC has a current mode. At a later point, the MetaMonitor
got its own mode abstraction (MetaMonitorMode), but
meta_monitor_is_active() was never updated to use this.

An issue with checking the main output's CRTC state is that, if there is
some CRTC mode combination that for some reason isn't properly detected
by the MetaMonitorMode abstraction (e.g. some tiling configuration not
yet handled), meta_monitor_is_active() would return TRUE, even though no
(abstracted) mode was set. This would cause confusion here and there,
leading to NULL pointer dereferences due to the assumption that if a
monitor is active, it has an active mode.

Instead, change meta_monitor_is_active() to directly check the current
monitor mode, and log a warning if the main output still happen to have
a CRTC with a mode assigned to it. This way, when an not undrestood CRTC
mode combination is encountered, instead of dereferencing NULL pointers,
simply assume the monitor is not active, which means that it will not be
managed or rendered by mutter at all.

https://gitlab.gnome.org/GNOME/mutter/issues/130

(cherry picked from commit 4d465eac08)
2019-01-14 10:06:47 -05:00
Florian Müllner
13eb4f51c7 tests: Add "closed-transient" test
When a transient window is destroyed, the expected behavior is that
focus is passed to the ancestor if possible. This was broken for
quite a while until the previous commit, so add a test case to make
sure it doesn't happen again.

https://gitlab.gnome.org/GNOME/mutter/issues/15

(cherry-picked from commit 137f22236c)
2019-01-14 10:06:46 -05:00
Florian Müllner
7969c473ac window: Explicitly exclude unmanaging window from focus again
Since commit b3b9d9e16 we no longer have to pass the unmanaging window
to make sure we don't try to focus it again, however the parameter also
influences the focus policy by giving ancestors preference over the normal
stack order.

https://gitlab.gnome.org/GNOME/mutter/issues/15

(cherry picked from commit d99442d6e6)
2019-01-14 10:06:46 -05:00
Florian Müllner
a83e72d7c1 window: Don't refuse to move focus to the grab window
We refuse to move focus while a grab operation is in place. While this
generally makes sense, there's no reason why the window that owns the
grab shouldn't be given the regular input focus as well - we pretty
much assume that the grab window is also the focus window anyway.

In fact there's a strong reason for allowing the focus change here:
If the grab window isn't the focus window, it probably has a modal
transient that is focused instead, and a likely reason for the focus
request is that the transient is being unmanaged and we must move
the focus elsewhere.

https://gitlab.gnome.org/GNOME/mutter/issues/15

(cherry picked from commit 148da24f95)
2019-01-14 10:06:46 -05:00
Jonas Ådahl
910c4e9fe7 native/gpu: Handle drmModeSetCrtc() failing gracefully
If drmModeSetCrtc() is called with no fb, mode or connectors for some
CRTC it may still fail, and we should handle that gracefully instead of
assuming it failed to set a non-disabled state.

Closes https://gitlab.gnome.org/GNOME/mutter/issues/70

(cherry picked from commit 6e953e2725)
2019-01-14 10:06:45 -05:00
Olivier Fourdan
2fb5b65e94 wayland: Clean up xwayland grabs even if surface is gone
If the surface is gone before `meta_xwayland_keyboard_grab_end()` is
called, we would bail out early leaving an empty grab, which will cause
a segfault as soon as a key is pressed later on.

Make sure we clean up the keyboard grab even if the surface is gone.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/255
(cherry picked from commit 252dd52439)
2019-01-14 10:06:45 -05:00
Olivier Fourdan
e00d6c6273 wayland: No xdg-output events without a logical monitor
To avoid a known race condition in the wl_output protocol documented in
https://phabricator.freedesktop.org/T7722, mutter delays the `wl_output`
destruction but nullify the `logical_monitor` associated with the
`wl_output` and the binding routine `bind_output()` makes sure not to
send wl_output events if the `logical_monitor` is `NULL` (see commit
1923db97).

The binding routine for `xdg_output` however does not check for such a
condition, hence if the output configuration changes while a client is
binding to xdg-output (typically Xwayland at startup), mutter would
crash while trying to access the `logical_monitor` which was nullified
by the change in configuration.

Just like `bind_output()` does for wl_output, do not send xdg-output
events if there is no `logical_monitor` yet.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/194

(cherry picked from commit 68ec9ac017)
2019-01-14 10:06:45 -05:00
Olivier Fourdan
733ab3b2bc wayland: Nullify monitor resources when updating outputs
If a client asks for xdg-output before we have set the output's logical
monitor, we would end up crashing with a NULL pointer dereference.

Make sure we clear the resource's user data when marking an output as
inert on monitor change so that we don't end up with a Wayland output
without a logical monitor.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/194

(cherry picked from commit 48eaa36d41)
2019-01-14 10:06:45 -05:00
Jonas Ådahl
a208d7c33e window/wayland: Don't recursive indefinitely when updating monitor
When we update the main monitor, there is a rule that makes it so that
popup windows use the same main monitor as their parent. In the commit
f4d07caa38 the call that updates and
fetches the main monitor of the toplevel accidentally changed to update
from itself, causing a indefinite recursion eventually resulting in a
crash.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/279
(cherry picked from commit e191c21e04)
2019-01-14 10:06:44 -05:00
Ray Strode
37bbea649b 0002-window-Force-update-monitor-on-hot-plugs.patch 2019-01-14 10:06:44 -05:00
Ray Strode
4035955fc0 0001-window-Pass-flag-to-meta_window_update_monitor-inste.patch 2019-01-14 10:06:44 -05:00
Olivier Fourdan
a8db59908f window/wayland: Always update monitor for non-user ops
meta_window_wayland_update_main_monitor() would skip the monitor update
if the difference in scale between the old and the new monitor would
cause another monitor change.

While this is suitable when the monitor change results from a user
interactively moving the surface between monitors of different scales,
this can leave dangling pointers to freed monitors when this is
triggered by a change of monitor configuration.

Make sure we update the monitor unconditionally if not from a user
operation.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189

(cherry picked from commit a3da4b8d5b)
2019-01-14 10:06:43 -05:00
Olivier Fourdan
a477c73a97 window/wayland: Always update monitor for non-user ops
meta_window_wayland_update_main_monitor() would skip the monitor update
if the difference in scale between the old and the new monitor would
cause another monitor change.

While this is suitable when the monitor change results from a user
interactively moving the surface between monitors of different scales,
this can leave dangling pointers to freed monitors when this is
triggered by a change of monitor configuration.

Make sure we update the monitor unconditionally if not from a user
operation.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/189

(cherry picked from commit a3da4b8d5b)
2019-01-14 10:06:43 -05:00
Olivier Fourdan
ae228c0556 wayland: Allow Xwayland grabs on selected apps
Allow Xwayland grabs on a selected set of X11 applications.
2019-01-14 10:06:43 -05:00
Jonas Ådahl
978cb5b21c Add remote access controller API
Add API to let GNOME Shell have the ability to get notified about remote
access sessions (remote desktop, remote control and screen cast), and
with a way to close them.

This is done by adding an abstraction above the remote desktop and
screen cast session objects, to avoid exposing their objects to outside
of mutter. Doing that would result in external parts holding references
to the objects, complicating their lifetimes. By using separate wrapper
objects, we avoid this issue all together.
2019-01-14 10:06:43 -05:00
Jonas Ådahl
e792eca2f5 Make screen cast and remote desktop non-experimental
It's time to make this feature more accessible by not requiring editing
an array in gsettings.
2019-01-14 10:06:42 -05:00
Jonas Ådahl
b9614f0797 virtual-input/evdev: Translate from button codes internal to evdev
Sending button events to a ClutterVirtualInputDevice, the API expects
button codes to be of the internal clutter type. The evdev
implementation incorrectly assumed it was already prepared evdev event
codes, which was not the case. Fix the evdev implementation to translate
from the internal representation to evdev before passing it along to
ClutterSeatEvdev.
2019-01-14 10:06:42 -05:00
Ray Strode
6d7bbeddd7 mutter-pipewire-0_2-API.patch 2019-01-14 10:06:42 -05:00
Ray Strode
68570353fd mutter-search-for-libpipewire-0_2.patch 2019-01-14 10:06:42 -05:00
Jonas Ådahl
566cdcc94b renderer/native: Check calculated transform when creating view
The "backends: Move MetaOutput::crtc field into private struct"
accidentally changed the view transform calculation code to assume that
"MetaCrtc::transform" corresponds to the transform of the CRTC; so is
not the case yet; one must calculate the transform from the logical
monitor, and check whether it is supported by the CRTC using
meta_monitor_manager_is_transform_handled(). This commit restores the
old behaviour that doesn't use MetaCrtc::transform when calculating the
view transform.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/216
2019-01-14 10:04:23 -05:00
Ray Strode
37dc2e5b1b hw-cursor-on-demand-gnome-3-28.patch 2019-01-14 10:04:23 -05:00
Florian Müllner
66b9150771 gtk-shell: Work around non-working startup notifications
GNOME Shell relies on the MetaScreen::startup-sequence-changed signal,
which is tied to (lib)startup-notification and therefore X11. As a result,
when we remove the startup sequence of a wayland client, GNOME Shell will
not be notified about this until startup-notification's timeout is hit.
As a temporary stop-gap, go through XWayland even for wayland clients,
so that the signal is emitted when expected.

https://bugzilla.gnome.org/show_bug.cgi?id=768531
2019-01-14 10:04:01 -05:00
Florian Müllner
34f5bdeea3 Bump version to 3.28.3
Update NEWS.
2018-07-18 23:12:51 +02:00
Jonas Ådahl
ca71b0eb1a monitor-manager: Add back warning messages
For some reason "backends: Remove X11 idle-monitor backend" removed
unrelated warning messages for when generated monitor configurations
that should work didn't, which also made the unit tests fail.

This commit adds them back, which also makes the tests pass again.


(cherry picked from commit d9c18fd5bb)
2018-07-18 20:21:12 +00:00
Jonas Ådahl
ca4209d88a screen-cast-src: Allow negotiating the framerate
The framerate for screen cast sources was set to variable within 1 FPS
and the framerate of the monitor being screen casted. This meant that if
the sink didn't match the framerate (e.g. had a lower max framerate),
the formats would not match and a stream would not be established.

Allow letting the sink clamp the framerate range by setting it as
'unset', allowing it to be negotiated.
2018-07-13 14:39:43 +02:00
Olivier Fourdan
3288edf677 contraints: Do not constrain modals without parent
xdg-foreign clears the `transient_for` of a modal dialog when its
imported parent is destroyed, which would later cause a crash in
`constrain_modal_dialog()` because the transient `NULL`.

So in case a modal dialog has no parent, do not try to constrain it
against its parent.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/174
(cherry picked from commit 912a6f5e3f)
2018-07-10 17:03:20 +02:00
Jonas Ådahl
fe1616668e backends: Add logical monitor -> monitor -> output -> crtc ref chain
Make it so that each logical monitor has a reference to all the
monitors that are assigned to it.

All monitors has a reference to each output that belongs to it.

Each output has a reference to any CRTC it has been assigned.

https://bugzilla.gnome.org/show_bug.cgi?id=786929


(cherry picked from commit 768ec15ea0)
2018-06-28 11:52:10 +00:00
Jonas Ådahl
7d01aec48d backends: Move MetaOutput::crtc field into private struct
No functional changes. This is only done so that changes to reference
counting can done more reliably.

https://bugzilla.gnome.org/show_bug.cgi?id=786929


(cherry picked from commit 1200182d70)
2018-06-28 11:50:37 +00:00
Marco Trevisan (Treviño)
a41d84db00 renderer-native: Don't crash if the FB surface can't be locked
(cherry picked from commit 0332b7394e)
2018-05-29 22:14:31 +00:00
Marco Trevisan (Treviño)
e73b321c2e device-manager-evdev: Add main seat to seats by default
Treat the main seat as other seats, so we don't have to handle it differently
in specific places. This was already the case before when a real device
was plugged before the startup, but not applied when hotplugging a device.


(cherry picked from commit 15f41c9f68)
2018-05-29 10:48:56 +00:00
Marco Trevisan (Treviño)
b6dc2052c3 device-manager-evdev: Free the main seat on finalize
(cherry picked from commit 2a38601b42)
2018-05-29 10:47:20 +00:00
Marco Trevisan (Treviño)
72965aaaf0 device-manager-evdev: Set and unset the stage for the main seat too
When no input devices are available on startup the device manager might be fast
enough to be constructed so that no default stage is set yet, and thus when
main seat virtual devices are created they won't have a proper stage set.
If then we plug a real device, the events that an input manager could generate
won't be associated to any stage and thus won't be processed.

We need then ensure that when we update the stage for the device manager we
(un)associate it also to the main seat devices.


(cherry picked from commit d7bdc1591f)
2018-05-29 10:46:03 +00:00
Marco Trevisan (Treviño)
2a6782dc10 clutter-device-evdev: Get devices from main seat if no real seat is set
In devices such as ARM boards there could be no input devices connected on
startup, leading to a crash when we try to process artificial events that
could be queued (as gnome-shell does when syncing pointer).

Those events still should refer to a device and, in case we don't have one
provided by libinput we should still return the core devices defined in the
main seat.


(cherry picked from commit 3e85ac8131)
2018-05-29 10:43:41 +00:00
Marco Trevisan (Treviño)
5142c8c7e7 clutter-seat-evdev: Add function to get device by id
(cherry picked from commit 5f83d9a5c8)
2018-05-29 10:43:17 +00:00
Changwoo Ryu
abc7ad8e9f wayland: Don't reset input focus on text commit
Preedit text can be active even after text commit. Resetting the input
focus will lead to unintended commit of the preedit text.

https://gitlab.gnome.org/GNOME/mutter/issues/152

Closes: #152
2018-05-26 15:26:09 +02:00
Olivier Fourdan
1a3f9a3323 frames: Allow for unknown mouse buttons
Commit 47131b1d ("frames: Handle touch events") introduced an assert to
make sure that all mouse button actions are handled in mutter.

However, mice can have a more than 5 buttons, so simply ignore the
"other" actions instead of aborting.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/160
(cherry picked from commit 473bf38753)
2018-05-25 11:35:45 +02:00
Olivier Fourdan
235c35182b wayland: update enter/leave output after effects
Compositor effects change the actor size and position, which can lead to
inconsistent output enter/leave notifications, leaving clients' surfaces
without any output set.

Update output enter/leave notifications after all compositor effects are
completed so that we give clients accurate output location.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/104
(cherry picked from commit 17a745bf81)
2018-05-22 13:01:13 +02:00
Olivier Fourdan
e4661d7870 window-actor: add new signal "effects-completed"
When using plugins, the effects will affect the MetaWindowActor size
and position.

Add a new signal "effects-completed" wired to the corresponding
MetaWindowActor which is emitted when all effects are completed so that
derived objects can be notified when all effects are completed and use
the actual size and position.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/104
(cherry picked from commit 85bbd82ae8)
2018-05-22 13:01:05 +02:00
Georges Basile Stavracas Neto
9d4c7e4e75 wayland: Compare geometries after chaining up
After 20176d03, the Wayland backend only synchronizes with the
compositor after a geometry was set, and it was different from
the current geometry.

That commit was mistakenly comparing the geometry before chaining
up, which would yield a false negative on the case where the
client didn't call set_geometry() before commit().

Fix that by caching the old geometry locally, chain up (and thus
apply the new geometry rectangle), then comparing the old and
current geometry rectangles.

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


(cherry picked from commit cf734999fb)
2018-05-18 13:53:20 +00:00
Carlos Garnacho
47131b1dad frames: Handle touch events
This is just done on wayland as it'll break horribly on X11, we let
this happen through pointer emulated events in XISelectEvents evmask
instead.

Some things had to be made slightly more generic to accomodate touch
events. The MetaFrames shall lock onto a single touch at a time, we
don't allow crazy stuff like multi-window drag nor multi-edge resizes.

https://bugzilla.gnome.org/show_bug.cgi?id=770185
2018-05-15 16:07:07 +01:00
Carlos Garnacho
51c0130645 frames: Make 1st button/motion handlers take generic events
This will ease handling of touch events through these same handlers.

https://bugzilla.gnome.org/show_bug.cgi?id=770185
2018-05-15 16:06:59 +01:00
Olivier Fourdan
2dd9fc17c1 clutter/evdev: Don't ignore CAPS lock as modifier
Mark CAPS lock as a modifier (as it should) so that when using XKB
options to change the default behaviour of CAPS lock, the new assigned
key can by used as a sticky key as well.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/112
(cherry picked from commit 6df2b7af55)
2018-05-15 10:26:29 +02:00
Olivier Fourdan
c7a38c3139 clutter/evdev: ignore injected events from IM
Input method can inject key events, which leads to multiple reported key
press/release events for a single user action.

Ignore those events as this confuses keyboard accessibility.

(cherry picked from commit c01b099dbd)
2018-05-15 10:25:51 +02:00
Olivier Fourdan
7d52be0229 wayland: Use cursor position in logical monitor
When using two monitors size by side with different scales, once the
cursor moves from one output to another one, its size changes based on
the scale of the given output.

Changing the size of the cursor can cause the cursor area to change
output again if the hotspot is not exactly at the top left corner of the
area, causing the texture of the cursor to change, which will trigger
another output change, so on and so forth causing continuous surface
enter/leave event which flood the clients and eventually kill them.

Change the logic to use only the actual cursor position to determine if
its on the given logical monitor, so that it remains immune to scale
changes induced by output scale differences.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/83
(cherry picked from commit 67917db45f)
2018-05-14 16:08:16 +02:00
Florian Müllner
41303bc01b Bump version to 3.28.2
Update NEWS.
2018-05-07 22:29:42 +02:00
Florian Müllner
0d188c3898 build: Adjust to filename changes
The meta-stage and meta-window-group headers got split into a public
and private part, but the Makefiles still reference the old files.
2018-05-07 22:29:42 +02:00
Florian Müllner
28eff93143 build: Introspect some more types
While MetaStage, MetaWindowGroup and MetaDBusDisplayConfigSkeleton don't
appear explicitly in the public API, their gtypes are still exposed via
meta_get_stage_for_screen(), meta_get_*window_group_for_screen() and
MetaMonitorManager's parent type. Newer versions of gjs will warn about
undefined properties if it encounters a gtype without introspection
information, so expose those types to shut up the warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 22:06:02 +02:00
Florian Müllner
b380aa72aa window-group: Remove undefined function declaration
Ever since the function has been made public, its name has been
meta_actor_is_untransformed() ...

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 22:06:02 +02:00
Florian Müllner
920dc9e5a1 clutter: Don't reference invalid pc in gir
Cally is built into clutter itself rather than exposed as a separate
library.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 22:06:02 +02:00
Jonas Ådahl
32f02010ae screen-cast: Handle PipeWire errors more gracefully
Various code assumed PipeWire function calls would never fail. Some can
actually fail for real reasons, and some currently can only fail due to
OOM situations, but we should still not assume that will always be the
case.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/102


(cherry picked from commit 0f9c6aef99)
2018-05-07 19:28:27 +00:00
Jonas Ådahl
889c56c776 wayland/xdg-foreign: Fix child surface validation check
The role type should be either an xdg-shell toplevel, or a
xdg-shell unstable v6 toplevel.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/138


(cherry picked from commit 332d55f7f6)
2018-05-07 19:20:56 +00:00
Jonas Ådahl
67a4cd898e wayland/xdg-foreign: Send immediate destroy event to correct resource
The destroyed signal that was emitted if an imported surface was not
available when created, for example if the handle was invalid or
already unexported, was emitted on the wrong resource.


(cherry picked from commit 98d7024288)
2018-05-07 19:20:09 +00:00
Florian Müllner
43d6c0ea61 build: Don't fail immediately when logind is missing
We require logind for the native backend, but the backend itself is
optional. However since commit 06c357d78, we will always throw an
error if neither logind nor elogind are available, even when the
backend is disabled.

As we still support "auto" - that is, whether the native backend is
enabled depends on whether its dependencies are available - the
easiest option is to make sure we always include either elogind or
libsystemd in the dependency check rather than erring out explicitly
if neither is found.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/96


(cherry picked from commit 82564772dc)
2018-05-07 19:14:11 +00:00
Georges Basile Stavracas Neto
2872bb1f2a wayland: Check if state and size changed before calling move_resize()
The current implementation of the XdgSurface v6 protocol does not check
if the window changed before calling meta_window_wayland_move_resize().

The problem with this approach is that calling this function is a costly
operation since we enter the compositor side. In GNOME Shell case, it is
in JavaScript, which triggers a GJS trampoline. Calling this function on
every mouse movement is naturally as terrible as it could be - and is
exactly what happens now.

This commit adds the necessary checks to only call move_resize() when
the window actually changed, or when it needs to be updated.

https://bugzilla.gnome.org/show_bug.cgi?id=780292
Issue: #78
2018-05-04 15:57:57 -03:00
Georges Basile Stavracas Neto
1c00cd5ca3 wayland: Add function to query if window needs move or resize
This will be used by the next commit to determine when a window
geometry change should be ignored or not. Normally, it would be
enough to just check if the position and sizes changed.

The position, in this case, is relative to the client buffer, not
the global position. But because it is not global, there is one,
admitedly unlikely, situation where the window state is updated
while the client size and relative positions don't change.

One can trigger this by e.g. tiling the window to the half-left of
the monitor, then immediately tile it to half-right. In this case,
the window didn't change, just it's state, but nonetheless we need
to notify the compositor and run the full move/resize routines.

When that case happens, though, the MetaWindowWayland is tracking
the pending state change or a move. And this is what we need to
expose.

https://bugzilla.gnome.org/show_bug.cgi?id=780292
Issue: #78
2018-05-04 15:57:50 -03:00
Georges Basile Stavracas Neto
2919a7f25f window: Let implementations finish state changes
In the old, synchronous X.org world, we could assume that
a state change always meant a synchronizing the window
geometry right after. After firing an operation that
would change the window state, such as maximizing or
tiling the window,

With Wayland, however, this is not valid anymore, since
Wayland is asynchronous. In this scenario, we call
meta_window_move_resize_internal() twice: when the user
executes an state-changing operation, and when the server
ACKs this operation. This breaks the previous assumptions,
and as a consequence, it breaks the GNOME Shell animations
in Wayland.

The solution is giving the MetaWindow control over the time
when the window geometry is synchronized with the compositor.
That is done by introducing a new result flag. Wayland asks
for a compositor sync after receiving an ACK from the server,
while X11 asks for it right away.

Fixes #78
2018-05-04 15:57:43 -03:00
Olivier Fourdan
ca0d56a3a4 wayland: avoid a crash in is_effectively_synchronized()
To check if a subsurface is effectively synchronized, we walk the
subsurface hierarchy to look for a non-subsurface parent or a subsurface
being synchronized.

However, when client is closing, the parent surface might already be
gone, in which case we end up with a surface being NULL which causes a
NULL pointer dereference and a crash.

Check if the parent surface is NULL to avoid the crash, and consider
it's already synchronized if it is NULL to avoid further updates.

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


(cherry picked from commit 52fdd24467)
2018-05-03 17:49:26 +00:00
Jonas Ådahl
a89baa44ab native: Restore previous EGL state after blitting onto secondary GPU
Before we just set it to "none", but this was not enough since various
calls will depend on not just the context being active, but the main
rendering surface.

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


(cherry picked from commit ae26cd0774)
2018-04-25 15:24:14 +00:00
Marco Trevisan (Treviño)
7076a48bcf cogl: Do not unref a NULL object
Add return-if-fail statement to avoid deferencing NULL object


(cherry picked from commit 3104d697c0)
2018-04-25 09:09:04 +00:00
Jonas Ådahl
1b439c42d1 monitor-manager: Find active monitor when deriving global scale
When deriving the global scale directly from the current hardware state
(as done when using the X11 backend) we are inspecting the logical
state they had prior to the most recent hot plug. That means that a
primary monitor might have been disabled, and a new primary monitor may
not have been assigned yet.

Stop assuming a primary monitor has an active mode before having
reconstructed the logical state by finding some active monitor if the
old primary monitor was disabled. This avoids a crash when trying to
derive the global scale from a disabled monitor.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/130


(cherry picked from commit 0b3a1c9c31)
2018-04-25 08:58:15 +00:00
Carlos Garnacho
928a40f328 wayland: Let IM events go through
These paths implicitly relied on the forwarded IM key events having
a source_device backed by a real HW device. This assumption is no
longer held true since commit b5328c977.

Explicitly check the INPUT_METHOD flag so they are handled as they
should despite not being "real HW" events.
2018-04-24 23:59:21 +02:00
Mario Sanchez Prada
59397266ed backend: Don't center the pointers on monitor changes
As a follow up to the patch from a95cbd0a, we need to make sure
that the pointer is out of the way as well when monitors changed,
since that's the event that will prevail in some cases. Besides,
this is also consistent with what the code before a95cbd0a was,
which initialized the pointer position in the same way both in
this case and in the real_post_init() function.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/157
2018-04-24 23:14:38 +02:00
Mario Sanchez Prada
d0147591b3 backends: Don't center the pointer on initialization
Centering the pointer at startup causes undesired behaviour if
it ends up hovering over reactive elements, that might react
to that positioning, causing confusion. This is the case of
the login dialog when a list of different users is shown, as
centering the pointer at startup in that case will get the
user in the center of the screen pre-selected, which is not
the expected behaviour (i.e. pre-selecting the first one).

Fix this by simply moving the pointer out of the way, close
to the bottom-right corner, during initialization.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/157
2018-04-24 23:14:37 +02:00
Ray Strode
25c7e52ada xwayland: Don't abort if Xwayland crashes
Right now if Xwayland crashes, we crash, too.

On some level that makes sense, since we're supposed to control the
lifecycle of Xwayland, and by it crashing we've lost that control.

But practically speaking, the knock-on crash adds noise to the logs,
bug trackers, and retrace servers that only makes debugging harder.
And the crash isn't something mutter can "fix", since it's
ultimately from a bug in Xwayland anyway.

This commit makes mutter exit instead of crash if Xwayland goes away
unexpectedly.


(cherry picked from commit 2d80fd02e7)
2018-04-24 05:08:22 +00:00
Ray Strode
99d766c044 xwayland: use g_autoptr for GError in xserver_died
Right now we explicitly g_clear_error any error we find, but that
makes it tricky to return early from the function, which a
subsequent commit will want to to do.

This commit switches GError to use g_autoptr so the error clearing
happens automatically.


(cherry picked from commit bb65854065)
2018-04-24 05:07:41 +00:00
Marco Trevisan (Treviño)
fcd4c816c4 theme, frames: Use surface device scale instead of cairo_scale
Gtk now is caching the themed cairo surfaces, then as per
commit gtk@e36b629c the surface device scale is used to figure
out the current paint scaling.

Without this when using background-image's for window buttons
the -gtk-scaled icons isn't properly resized.

Fixes #99


(cherry picked from commit 4339b23dd0)
2018-04-22 20:45:29 +00:00
Carlos Garnacho
2a63a47d5a wayland: Do not reset frame list when merging pending state
In the synchronized subsurface case, the destination list may
contain other elements from previous wl_surface.commit calls.
Resetting the list will leave those dangling frame callbacks
that will lead to invalid writes when those get to be destroyed
(eg. on client shutdown).
2018-04-22 12:14:37 +02:00
Carlos Garnacho
c80e2c9ae5 clutter: Set slave=master in IM forwarded key events
The fix is twofold. On one hand, it makes sense not to relate IM (nor
any other) generated events to a HW device. On the other hand, if we
are unfortunate that an IM event is in flight when we are switching
to another TTY, it may arrive at a time when the source device is no
longer existent.
2018-04-22 12:14:37 +02:00
Bastien Nocera
d3d5eb8e1b idle-monitor: Add ResetIdletime API, for testing purposes
The ResetIdletime API can be used instead of an "XTest" binary to
programmatically reset the idle time, as if the user pressed a button on
a keyboard.

This is necessary since we stopped using the XSync extension to monitor
idletimes, as it didn't consider inhibitors as busy, and mutter's
clutter code ignores "Core Events" as generated by XTest.

This patch will require minimal changes to gnome-settings-daemon's power
test suite so that "key press" idletime resets are triggered through
this D-Bus interface rather than through XTest and a roundtrip through
the X server.

https://bugzilla.gnome.org/show_bug.cgi?id=705942
2018-04-16 16:03:56 +02:00
Bastien Nocera
4837cec89f backend: Reset idle when lid is opened or resuming from suspend
There's no particular reason for this code to only ever be triggered on
Wayland, and allows removing X11-specific work-arounds from
gnome-settings-daemon.

See https://bugs.freedesktop.org/show_bug.cgi?id=59576

https://bugzilla.gnome.org/show_bug.cgi?id=705942
2018-04-16 16:03:56 +02:00
Bastien Nocera
32329e6c00 idle-monitor: Take idle inhibition into account
Take idle inhibitions into account for when to fire idle watches as
requested by OS components.

This should stop gnome-session and gnome-settings-daemon considering
the session idle when they have been inhibited for longer than their
timeout, for example to avoid the screensaver activating, or the
computer suspending after watching a film.

https://bugzilla.gnome.org/show_bug.cgi?id=705942
2018-04-16 16:03:56 +02:00
Bastien Nocera
89261be556 x11: Allow XTest and core events to reset idletime
Now that we've removed the X11 specific backend of the idle monitor,
add back a cut-down version of it for the explicit purpose of being
told about idle time resets when XTest events are used.

XTest events are usually used by test suites and remote display software
to inject events into an X11 session. We should consider somebody moving
the mouse remotely to be just as "active" as somebody moving it locally.

https://bugzilla.gnome.org/show_bug.cgi?id=705942
2018-04-16 16:03:56 +02:00
Bastien Nocera
e3e76d658b backends: Remove X11 idle-monitor backend
And use the old "native" backend for both X11 and Wayland. This will
allow us to share fixes between implementations without having to delve
into the XSync X11 extension code.

https://bugzilla.gnome.org/show_bug.cgi?id=705942
2018-04-16 16:03:56 +02:00
Florian Müllner
34644b2133 Bump version to 3.28.1
Update NEWS.
2018-04-13 19:11:57 +02:00
Carlos Garnacho
7da4e8cf14 wayland: Plug surface pending state contents leak
When moving the pending state of an effectively synchronized subsurface
so it is applied together with the parent, perform a merge of the source
MetaWaylandPendingState into the destination one, instead of simply
overwriting the struct.

The other approach had 2 kind of leaks, one that would happen everytime
a wl_surface.commit happens on a sync subsurface (both surface/buffer
damage regions are leaked). The other more unlikely one would apply on
the rest of pending state data, happening whenever the compositor gets
>1 wl_surface.commit calls on the subsurface before the parent surface
gets its own.

The function has also been renamed to use the more descriptive "merge"
term.

Related: gnome-shell#64
2018-04-13 00:10:03 +02:00
Aleksandr Mezin
23c3f8bb18 monitor-manager: fix output ids returned by GetResources
Output ID is set equal to 'i' later in the loop. But 'i' was never
incremented, so all outputs were getting the same ID (equal to
the number of CRTCs, because 'i' was reused from the previous loop).
2018-04-11 17:55:41 +00:00
Jonas Ådahl
60866e0f85 native: Disable the use of KMS modifiers by default
Make it re-enable:able by a hidden "experimental feature". To enable,
add "kms-modifiers" to the org.gnome.mutter.experimental-features
GSettings entry.

https://gitlab.gnome.org/GNOME/mutter/issues/81
2018-04-11 16:34:59 +02:00
Matej Urbančič
45c02645f3 Updated Slovenian translation 2018-04-10 17:58:12 +02:00
Benjamin Otte
e515e37a7e screen-cast: Fix compile error
Credit goes to gcc for finding this typo.


(cherry picked from commit 98dfd5b887)
2018-04-10 12:10:19 +00:00
Marco Trevisan (Treviño)
957f4ec69d theme: Scale titlebar spacing when computing x
The value is not scaled by default so it needs to be adjusted
depending on the window scaling, as it's done in other places.

Fixes: #87


(cherry picked from commit deda7a5235)
2018-04-03 20:42:28 +00:00
Marco Trevisan (Treviño)
a98eb107be theme: add ".appmenu" class to the appmenu button
So it does gtk headerbar, so mutter should do.


(cherry picked from commit 96141e28f9)
2018-04-03 20:22:52 +00:00
Daniel Stone
1851fa2bd0 renderer-native: Fall back to non-modifier GBM surfaces
If we attempt GBM surface allocation with a set of modifiers but the
allocation fails, fall back to non-modifier allocations. This fixes
startup on Pineview-based Atom systems, where KMS provides us a set of
modifiers but the GBM implementation doesn't support modifier use.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/84


(cherry picked from commit e6109cfc22)
2018-04-03 18:18:31 +00:00
Carlos Garnacho
de7d7bbf3d clutter: Apply input hints/purpose on ClutterTextInputFocus focus in
And make the ClutterText-level properties independent from the input
focus, as those properties can be set anytime, not just when the
ClutterText actor is focused.

https://gitlab.gnome.org/GNOME/mutter/issues/66

Closes: #66


(cherry picked from commit 3684f6b0ac)
2018-04-03 15:00:01 +00:00
Alberts Muktupāvels
7ac551cd05 input-settings: Fix a typo in tap-and-drag setting
(cherry picked from commit 31b5059068)
2018-03-29 14:54:00 +00:00
Olivier Fourdan
8696a79477 cursor-renderer-native: take rotation into account
Rotating an output would show duplicate cursors when the pointer is
located over an area which would be within the output if not rotated.

Make sure to swap the width/height of the output when rotated.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/85


(cherry picked from commit ebff7fd7f4)
2018-03-29 06:49:14 +00:00
Daniel van Vugt
b2f9de98d0 renderer-native: Swap then await earlier flips.
Rendering the next frame (which mostly happens as part of the flush done
in swap buffers) is a task that the GPU can complete independently of
the CPU having to wait for previous page flips. So reverse their order
to get the GPU started earlier, with the aim of greater GPU-CPU
parallelism.


(cherry picked from commit 6e415353e3)
2018-03-29 05:41:02 +00:00
Georges Basile Stavracas Neto
2da2489da5 window: Fix a small memory leak
(cherry picked from commit 63e2c0329f)
2018-03-29 05:24:08 +00:00
Yussuf Khalil
31779404f0 clutter: Avoid unnecessary relayouts in ClutterText
We can save an unnecessary relayout if the required size to fully draw the text
is equal to the currently allocated size after the underlying text buffer or
attributes that only affect the PangoLayout have changed.
2018-03-22 23:35:27 +01:00
Rasmus Thomsen
b096c0ac33 mutter: allow building with elogind
This commit allows building mutter with elogind, which is
systemd-logind extracted into a standalone package. This
allows using mutter with its native-backend ( and consequently
wayland ) enabled on distros which use init systems other than
systemd.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/46
2018-03-21 23:07:46 +01:00
Carlos Garnacho
44a7f74dcd cogl: Read pixels as per the stored format
By the looks of it, commit 95e9fa10ef was taping over an Intel DRI bug
that would make it return post-swizzling pixel data on glReadPixels().
There's been reports over time of that commit resulting in wrong colors
on other drivers, and lately Mesa >17.3 started showing the same symptoms
on Intel.

But texture swizzling works by changing parameters before fragment shaders
and reading pixels from an already drawn FBO/texture doesn't involve those.
This should thus use pixel_format_to_gl_with_target(), which will result in
correctly requesting the same pixel format than the underlying texture,
while still considering it BGRA for the upper layers in the swizzling case.

https://gitlab.gnome.org/GNOME/mutter/issues/72

Closes: #72
2018-03-21 20:37:34 +01:00
Georges Basile Stavracas Neto
3832c6b607 gpu-kms: Ignore GPUs with no connectors
Mutter recently gained the ability to deal with multiple GPUs
rendering at different displays. These GPUs would have a display
connected to them, and Mutter was adapted in order to be aware
of different GPUs and their outputs.

However, one specific edge case appeared: PRIME systems. PRIME
systems have two GPUs:

 * The integrated GPU (iGPU), usually Intel, which has connectors
   and deals with the routine load.

 * The dedicated GPU (dGPU), usually AMD or NVidia, which has no
   connectors at all and are there just to aid heavy loads.

On those systems, the dGPU is aggressively put to sleep by the
kernel to avoid energy waste. Waking it up is a costly operation.

With Mutter's adaptation to deal with multiple GPUs, Mutter began
wakening the dGPU every time some rendering had to be done. This
was causing stuttering every time the dGPU was put to sleep, and
Mutter asked it to wake up again.

To fix this situation, this commit ignores GPUs with no connectors
attached.

Issue: #77
2018-03-21 18:50:14 +00:00
Georges Basile Stavracas Neto
14b7e79d3c gpu-kms: Return NULL, not FALSE
Another small mistake spotted while working on #77. This
function returns a pointer, thus we should return NULL,
not FALSE.

Issue: #77
2018-03-21 18:50:13 +00:00
Georges Basile Stavracas Neto
e99b0b9368 monitor-manager-kms: Don't add GPU if it fails
This is a small mistake spotted while working on a solution
for #77. When a GPU fails to initialize, we're adding them
anyway, which might have pretty bad consequences when trying
to use these NULL GPUs.

Issue: #77
2018-03-21 18:50:13 +00:00
Georges Basile Stavracas Neto
de294f34bb monitor-manager-kms: Use g_autoptr for error
A minor code cleanup.
2018-03-21 18:50:13 +00:00
228 changed files with 11112 additions and 9945 deletions

1
.gitignore vendored
View File

@@ -100,7 +100,6 @@ src/linux-dmabuf-unstable-v*-protocol.c
src/linux-dmabuf-unstable-v*-server-protocol.h
src/xdg-shell-protocol.c
src/xdg-shell-server-protocol.h
src/wayland-eglstream-controller-server-protocol.h
src/meta/meta-version.h
src/libmutter-*.pc
doc/reference/*.args

50
NEWS
View File

@@ -1,53 +1,43 @@
3.29.3
3.28.3
======
* Handle touch events on server-side titlebars [Carlos; #770185]
* Fix crash with unhandled mouse buttons on titlebars [Olivier; #160]
* Fix Korean Hangul support on wayland [Changwoo; #152]
* Improve support for proprietary Nvidia driver [Jonas; #790316]
* Only upload HW cursor sprite to the GPU that will display them [Jonas; #77]
* nvidia [Miguel; #2]
* nvidia [Miguel; #782575]
* Remove MetaScreen to prepare for non-mandatary X11 dependency
[Armin, Jonas; #759538]
* Misc. bug fixes [Olivier, Jonas, Sam; #160, !130, #786929, #788834]
* Fix crash when taking up from suspend [Jonas; #786929]
* Fix crash with parent-less modal dialogs [Olivier; #174]
* Misc. bug fixes [Olivier, Georges; #83, #112, #150, #104,
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Armin Krezović, Corentin Noël,
Changwoo Ryu, Sam Spilsbury, Daniel Stone, Marco Trevisan (Treviño),
Miguel A. Vico, Daniel van Vugt
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Georges Basile Stavracas Neto,
Changwoo Ryu, Marco Trevisan (Treviño)
Translators:
Yi-Jyun Pan [zh_TW], Jordi Mas [ca], Daniel Șerbănescu [ro], Fabio Tomat [fur]
3.29.2
3.28.2
======
* Fix size change animations on wayland [Georges; #780292]
* Handle touch events on server-side titlebars [Carlos; #770185]
* Misc. bug fixes [Florian, Olivier, Jonas, Georges; #134, #124, !96, #138,
!102, #781471, #150]
* Take inhibitors into account for monitoring idle [Bastien; #705942]
* Fix window animations on wayland [Georges; #780292]
* Misc. bug fixes [Mario, Jonas, Olivier, Florian; gnome-shell#157, #130,
#21, #124, !96, #138, !102, #781471]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Florian Müllner,
Georges Basile Stavracas Neto, Marco Trevisan (Treviño), Daniel van Vugt
Georges Basile Stavracas Neto, Bastien Nocera, Mario Sanchez Prada,
Ray Strode, Marco Trevisan (Treviño)
Translators:
Daniel Șerbănescu [ro], Marcos Lans [gl], Dz Chen [zh_CN]
3.29.1
3.28.1
======
* Fix various input-method regressions [Carlos, Olivier; #65, #74, #66, #112]
* Fix various input-method regressions [Carlos; #65, #74, #66]
* Fix wayland build on FreeBSD [Ting-Wei; #792280, #792717]
* Fix swapped colors in screenshots (again) [Carlos; #72]
* Allow building with elogind [Rasmus; !46]
* Consider display rotation for cursor [Olivier; #85]
* Fall back to non-modifier GBM surfaces [Daniel; #84]
* Take inhibitors into account for monitoring idle [Bastien; #705942]
* Misc. bug fixes [handsome-feng, Olivier, Mario, Jonas; !45, #83, #104,
gnome-shell#157, #130, #21]
* Disable KMS modifiers by default [Jonas; #81]
* Misc bug fixes [handsome-feng; !45]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, handsome-feng, Yussuf Khalil,
Ting-Wei Lan, Aleksandr Mezin, Alberts Muktupāvels,
Georges Basile Stavracas Neto, Bastien Nocera, Benjamin Otte,
Mario Sanchez Prada, Daniel Stone, Ray Strode, Rasmus Thomsen,
Georges Basile Stavracas Neto, Benjamin Otte, Daniel Stone, Rasmus Thomsen,
Marco Trevisan (Treviño), Daniel van Vugt
Translators:

View File

@@ -214,8 +214,6 @@ cally_util_simulate_snooper_install (void)
G_CALLBACK (cally_util_stage_added_cb), cally_key_snooper);
g_signal_connect (G_OBJECT (stage_manager), "stage-removed",
G_CALLBACK (cally_util_stage_removed_cb), cally_key_snooper);
g_slist_free (stage_list);
}
static void

View File

@@ -2821,7 +2821,7 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self,
/* Note: we pass NULL as the ancestor because we don't just want the modelview
* that gets us to stage coordinates, we want to go all the way to eye
* coordinates */
_clutter_actor_get_relative_transformation_matrix (self, NULL, &modelview);
_clutter_actor_apply_relative_transformation_matrix (self, NULL, &modelview);
/* Fetch the projection and viewport */
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (stage), &projection);

View File

@@ -1095,7 +1095,7 @@ clutter_event_set_device (ClutterEvent *event,
{
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
real_event->device = device;
g_set_object (&real_event->device, device);
}
switch (event->type)
@@ -1364,8 +1364,8 @@ clutter_event_copy (const ClutterEvent *event)
{
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
new_real_event->device = real_event->device;
new_real_event->source_device = real_event->source_device;
g_set_object (&new_real_event->device, real_event->device);
g_set_object (&new_real_event->source_device, real_event->source_device);
new_real_event->delta_x = real_event->delta_x;
new_real_event->delta_y = real_event->delta_y;
new_real_event->is_pointer_emulated = real_event->is_pointer_emulated;
@@ -1435,6 +1435,14 @@ clutter_event_free (ClutterEvent *event)
{
_clutter_backend_free_event_data (clutter_get_default_backend (), event);
if (is_event_allocated (event))
{
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
g_clear_object (&real_event->device);
g_clear_object (&real_event->source_device);
}
switch (event->type)
{
case CLUTTER_BUTTON_PRESS:
@@ -1689,7 +1697,7 @@ clutter_event_set_source_device (ClutterEvent *event,
return;
real_event = (ClutterEventPrivate *) event;
real_event->source_device = device;
g_set_object (&real_event->source_device, device);
}
/**

View File

@@ -3722,6 +3722,17 @@ clutter_stage_ensure_redraw (ClutterStage *stage)
_clutter_master_clock_start_running (master_clock);
}
/**
* clutter_stage_is_redraw_queued: (skip)
*/
gboolean
clutter_stage_is_redraw_queued (ClutterStage *stage)
{
ClutterStagePrivate *priv = stage->priv;
return priv->redraw_pending;
}
/**
* clutter_stage_queue_redraw:
* @stage: the #ClutterStage

View File

@@ -250,6 +250,9 @@ void clutter_stage_ensure_viewport (ClutterStage
CLUTTER_AVAILABLE_IN_ALL
void clutter_stage_ensure_redraw (ClutterStage *stage);
CLUTTER_AVAILABLE_IN_ALL
gboolean clutter_stage_is_redraw_queued (ClutterStage *stage);
#ifdef CLUTTER_ENABLE_EXPERIMENTAL_API
CLUTTER_AVAILABLE_IN_1_14
void clutter_stage_set_sync_delay (ClutterStage *stage,

View File

@@ -324,7 +324,6 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
_clutter_evdev_event_set_time_usec (event, time_us);
event->motion.time = us2ms (time_us);
event->motion.stage = stage;
event->motion.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x;
event->motion.y = y;
@@ -332,6 +331,7 @@ new_absolute_motion_event (ClutterInputDevice *input_device,
&event->motion.x,
&event->motion.y);
event->motion.axes = axes;
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);
if (clutter_input_device_get_device_type (input_device) == CLUTTER_TABLET_DEVICE)
@@ -519,7 +519,6 @@ notify_proximity (ClutterInputDevice *input_device,
event->proximity.time = us2ms (time_us);
event->proximity.stage = CLUTTER_STAGE (stage);
event->proximity.device = seat->core_pointer;
clutter_event_set_device_tool (event, device_evdev->last_tool);
clutter_event_set_device (event, seat->core_pointer);
clutter_event_set_source_device (event, input_device);

View File

@@ -385,7 +385,6 @@ new_absolute_motion_event (ClutterSeatEvdev *seat,
_clutter_evdev_event_set_time_usec (event, time_us);
event->motion.time = us2ms (time_us);
event->motion.stage = stage;
event->motion.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->motion.x = x;
event->motion.y = y;
@@ -631,7 +630,6 @@ notify_scroll (ClutterInputDevice *input_device,
_clutter_evdev_event_set_time_usec (event, time_us);
event->scroll.time = us2ms (time_us);
event->scroll.stage = CLUTTER_STAGE (stage);
event->scroll.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
/* libinput pointer axis events are in pointer motion coordinate space.
@@ -684,7 +682,6 @@ notify_discrete_scroll (ClutterInputDevice *input_device,
_clutter_evdev_event_set_time_usec (event, time_us);
event->scroll.time = us2ms (time_us);
event->scroll.stage = CLUTTER_STAGE (stage);
event->scroll.device = seat->core_pointer;
_clutter_xkb_translate_state (event, seat->xkb, seat->button_state);
event->scroll.direction = direction;
@@ -813,7 +810,6 @@ clutter_seat_evdev_notify_touch_event (ClutterSeatEvdev *seat,
_clutter_evdev_event_set_time_usec (event, time_us);
event->touch.time = us2ms (time_us);
event->touch.stage = CLUTTER_STAGE (stage);
event->touch.device = seat->core_pointer;
event->touch.x = x;
event->touch.y = y;
clutter_input_device_evdev_translate_coordinates (input_device, stage,

View File

@@ -185,6 +185,22 @@ clutter_virtual_input_device_evdev_notify_absolute_motion (ClutterVirtualInputDe
NULL);
}
static int
translate_to_evdev_button (int button)
{
switch (button)
{
case CLUTTER_BUTTON_PRIMARY:
return BTN_LEFT;
case CLUTTER_BUTTON_SECONDARY:
return BTN_RIGHT;
case CLUTTER_BUTTON_MIDDLE:
return BTN_MIDDLE;
default:
return button + (BTN_LEFT - 1) - 4;
}
}
static void
clutter_virtual_input_device_evdev_notify_button (ClutterVirtualInputDevice *virtual_device,
uint64_t time_us,
@@ -194,30 +210,33 @@ clutter_virtual_input_device_evdev_notify_button (ClutterVirtualInputDevice *vir
ClutterVirtualInputDeviceEvdev *virtual_evdev =
CLUTTER_VIRTUAL_INPUT_DEVICE_EVDEV (virtual_device);
int button_count;
int evdev_button;
if (time_us == CLUTTER_CURRENT_TIME)
time_us = g_get_monotonic_time ();
if (get_button_type (button) != EVDEV_BUTTON_TYPE_BUTTON)
evdev_button = translate_to_evdev_button (button);
if (get_button_type (evdev_button) != EVDEV_BUTTON_TYPE_BUTTON)
{
g_warning ("Unknown/invalid virtual device button 0x%x pressed",
button);
evdev_button);
return;
}
button_count = update_button_count (virtual_evdev, button, button_state);
button_count = update_button_count (virtual_evdev, evdev_button, button_state);
if (button_count < 0 || button_count > 1)
{
g_warning ("Received multiple virtual 0x%x button %s (ignoring)", button,
g_warning ("Received multiple virtual 0x%x button %s (ignoring)", evdev_button,
button_state == CLUTTER_BUTTON_STATE_PRESSED ? "presses" : "releases");
update_button_count (virtual_evdev, button, 1 - button_state);
update_button_count (virtual_evdev, evdev_button, 1 - button_state);
return;
}
clutter_seat_evdev_notify_button (virtual_evdev->seat,
virtual_evdev->device,
time_us,
button,
evdev_button,
button_state);
}

View File

@@ -76,12 +76,12 @@ _clutter_key_event_new_from_evdev (ClutterInputDevice *device,
else
sym = XKB_KEY_NoSymbol;
event->key.device = core_device;
event->key.stage = stage;
event->key.time = _time;
_clutter_xkb_translate_state (event, xkb_state, button_state);
event->key.hardware_keycode = key;
event->key.keyval = sym;
clutter_event_set_device (event, core_device);
clutter_event_set_source_device (event, device);
n = xkb_keysym_to_utf8 (sym, buffer, sizeof (buffer));

View File

@@ -110,8 +110,7 @@ clutter_input_device_xi2_finalize (GObject *object)
if (device_xi2->wacom_device)
libwacom_destroy (device_xi2->wacom_device);
if (device_xi2->group_modes)
g_array_unref (device_xi2->group_modes);
g_array_unref (device_xi2->group_modes);
#endif
G_OBJECT_CLASS (clutter_input_device_xi2_parent_class)->finalize (object);

View File

@@ -92,9 +92,9 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
event2->crossing.source = stage;
event2->crossing.x = 10;
event2->crossing.y = 10;
event2->crossing.device = device;
event2->crossing.related = NULL;
clutter_event_set_device (event2, device);
clutter_input_device_update_from_event (device, event2, TRUE);
clutter_event_put (event2);
@@ -104,7 +104,7 @@ static gboolean perf_fake_mouse_cb (gpointer stage)
clutter_actor_get_size (stage, &w, &h);
event->motion.stage = stage;
event->motion.device = device;
clutter_event_set_device (event, device);
/* called about every 60fps, and do 10 picks per stage */
for (i = 0; i < 10; i++)

View File

@@ -1043,5 +1043,6 @@ cogl_atlas_texture_vtable =
_cogl_atlas_texture_get_gl_format,
_cogl_atlas_texture_get_type,
NULL, /* is_foreign */
NULL /* set_auto_mipmap */
NULL, /* set_auto_mipmap */
NULL /* is_get_data_supported */
};

View File

@@ -263,6 +263,7 @@ typedef enum _CoglFeatureID
COGL_FEATURE_ID_TEXTURE_RG,
COGL_FEATURE_ID_BUFFER_AGE,
COGL_FEATURE_ID_TEXTURE_EGL_IMAGE_EXTERNAL,
COGL_FEATURE_ID_UNSTABLE_TEXTURES,
/*< private >*/
_COGL_N_FEATURE_IDS /*< skip >*/

View File

@@ -210,6 +210,9 @@ struct _CoglDriverVtable
int rowstride,
uint8_t *data);
CoglBool
(* texture_2d_is_get_data_supported) (CoglTexture2D *tex_2d);
/* Prepares for drawing by flushing the journal, framebuffer state,
* pipeline state and attribute state.
*/

View File

@@ -454,6 +454,14 @@ _cogl_sub_texture_get_type (CoglTexture *tex)
return _cogl_texture_get_type (sub_tex->full_texture);
}
static CoglBool
_cogl_sub_texture_is_get_data_supported (CoglTexture *tex)
{
CoglSubTexture *sub_tex = COGL_SUB_TEXTURE (tex);
return cogl_texture_is_get_data_supported (sub_tex->full_texture);
}
static const CoglTextureVtable
cogl_sub_texture_vtable =
{
@@ -476,5 +484,6 @@ cogl_sub_texture_vtable =
_cogl_sub_texture_get_gl_format,
_cogl_sub_texture_get_type,
NULL, /* is_foreign */
NULL /* set_auto_mipmap */
NULL, /* set_auto_mipmap */
_cogl_sub_texture_is_get_data_supported
};

View File

@@ -1542,5 +1542,6 @@ cogl_texture_2d_sliced_vtable =
_cogl_texture_2d_sliced_get_gl_format,
_cogl_texture_2d_sliced_get_type,
_cogl_texture_2d_sliced_is_foreign,
NULL /* set_auto_mipmap */
NULL, /* set_auto_mipmap */
NULL /* is_get_data_supported */
};

View File

@@ -94,6 +94,15 @@ _cogl_texture_2d_set_auto_mipmap (CoglTexture *tex,
tex_2d->auto_mipmap = value;
}
static CoglBool
_cogl_texture_2d_is_get_data_supported (CoglTexture *tex)
{
CoglTexture2D *tex_2d = COGL_TEXTURE_2D (tex);
CoglContext *ctx = tex->context;
return ctx->driver_vtable->texture_2d_is_get_data_supported (tex_2d);
}
CoglTexture2D *
_cogl_texture_2d_create_base (CoglContext *ctx,
int width,
@@ -693,5 +702,6 @@ cogl_texture_2d_vtable =
_cogl_texture_2d_get_gl_format,
_cogl_texture_2d_get_type,
_cogl_texture_2d_is_foreign,
_cogl_texture_2d_set_auto_mipmap
_cogl_texture_2d_set_auto_mipmap,
_cogl_texture_2d_is_get_data_supported
};

View File

@@ -755,5 +755,6 @@ cogl_texture_3d_vtable =
_cogl_texture_3d_get_gl_format,
_cogl_texture_3d_get_type,
NULL, /* is_foreign */
_cogl_texture_3d_set_auto_mipmap
_cogl_texture_3d_set_auto_mipmap,
NULL /* is_get_data_supported */
};

View File

@@ -149,6 +149,8 @@ struct _CoglTextureVtable
/* Only needs to be implemented if is_primitive == TRUE */
void (* set_auto_mipmap) (CoglTexture *texture,
CoglBool value);
CoglBool (* is_get_data_supported) (CoglTexture *texture);
};
typedef enum _CoglTextureSoureType {

View File

@@ -773,5 +773,6 @@ cogl_texture_rectangle_vtable =
_cogl_texture_rectangle_get_gl_format,
_cogl_texture_rectangle_get_type,
_cogl_texture_rectangle_is_foreign,
_cogl_texture_rectangle_set_auto_mipmap
_cogl_texture_rectangle_set_auto_mipmap,
NULL /* is_get_data_supported */
};

View File

@@ -205,6 +205,15 @@ _cogl_texture_is_foreign (CoglTexture *texture)
return FALSE;
}
CoglBool
cogl_texture_is_get_data_supported (CoglTexture *texture)
{
if (texture->vtable->is_get_data_supported)
return texture->vtable->is_get_data_supported (texture);
else
return TRUE;
}
unsigned int
cogl_texture_get_width (CoglTexture *texture)
{

View File

@@ -511,6 +511,12 @@ CoglBool
cogl_texture_allocate (CoglTexture *texture,
CoglError **error);
/**
* cogl_texture_is_get_data_supported: (skip)
*/
CoglBool
cogl_texture_is_get_data_supported (CoglTexture *texture);
COGL_END_DECLS
#endif /* __COGL_TEXTURE_H__ */

View File

@@ -398,6 +398,8 @@ typedef enum { /*< prefix=COGL_PIXEL_FORMAT >*/
* supported with CoglBufferAccess including write support.
* @COGL_FEATURE_DEPTH_TEXTURE: Whether #CoglFramebuffer support rendering the
* depth buffer to a texture.
* @COGL_FEATURE_UNSTABLE_TEXTURES: Whether textures require redrawing on
* resume or not.
*
* Flags for the supported features.
*
@@ -428,7 +430,8 @@ typedef enum
COGL_FEATURE_MAP_BUFFER_FOR_READ = (1 << 21),
COGL_FEATURE_MAP_BUFFER_FOR_WRITE = (1 << 22),
COGL_FEATURE_ONSCREEN_MULTIPLE = (1 << 23),
COGL_FEATURE_DEPTH_TEXTURE = (1 << 24)
COGL_FEATURE_DEPTH_TEXTURE = (1 << 24),
COGL_FEATURE_UNSTABLE_TEXTURES = (1 << 25)
} CoglFeatureFlags;
/**

View File

@@ -116,4 +116,7 @@ _cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d,
int rowstride,
uint8_t *data);
CoglBool
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d);
#endif /* _COGL_TEXTURE_2D_GL_PRIVATE_H_ */

View File

@@ -470,7 +470,12 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
{
CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context;
CoglPixelFormat internal_format = loader->src.egl_image_external.format;
CoglPixelFormat external_format;
CoglPixelFormat internal_format;
external_format = loader->src.egl_image_external.format;
internal_format = _cogl_texture_determine_internal_format (tex,
external_format);
_cogl_gl_util_clear_gl_errors (ctx);
@@ -854,13 +859,22 @@ _cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d,
width,
bpp);
_cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
_cogl_bind_gl_texture_transient (tex_2d->gl_target,
tex_2d->gl_texture,
tex_2d->is_foreign);
ctx->texture_driver->gl_get_tex_image (ctx,
GL_TEXTURE_2D,
tex_2d->gl_target,
gl_format,
gl_type,
data);
}
CoglBool
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d)
{
if (tex_2d->gl_target == GL_TEXTURE_EXTERNAL_OES)
return FALSE;
else
return TRUE;
}

View File

@@ -714,6 +714,7 @@ _cogl_driver_gl =
_cogl_texture_2d_gl_generate_mipmap,
_cogl_texture_2d_gl_copy_from_bitmap,
_cogl_texture_2d_gl_get_data,
_cogl_texture_2d_gl_is_get_data_supported,
_cogl_gl_flush_attributes_state,
_cogl_clip_stack_gl_flush,
_cogl_buffer_gl_create,

View File

@@ -493,6 +493,7 @@ _cogl_driver_gles =
_cogl_texture_2d_gl_generate_mipmap,
_cogl_texture_2d_gl_copy_from_bitmap,
NULL, /* texture_2d_get_data */
NULL, /* texture_2d_is_get_data_supported */
_cogl_gl_flush_attributes_state,
_cogl_clip_stack_gl_flush,
_cogl_buffer_gl_create,

View File

@@ -82,6 +82,7 @@ _cogl_driver_nop =
_cogl_texture_2d_nop_generate_mipmap,
_cogl_texture_2d_nop_copy_from_bitmap,
NULL, /* texture_2d_get_data */
NULL, /* texture_2d_is_get_data_supported */
_cogl_nop_flush_attributes_state,
_cogl_clip_stack_nop_flush,
};

View File

@@ -1180,5 +1180,6 @@ cogl_texture_pixmap_x11_vtable =
_cogl_texture_pixmap_x11_get_gl_format,
_cogl_texture_pixmap_x11_get_type,
NULL, /* is_foreign */
NULL /* set_auto_mipmap */
NULL, /* set_auto_mipmap */
NULL /* is_get_data_supported */
};

View File

@@ -502,6 +502,7 @@ _cogl_winsys_context_init (CoglContext *context, CoglError **error)
CoglRenderer *renderer = context->display->renderer;
CoglDisplayEGL *egl_display = context->display->winsys;
CoglRendererEGL *egl_renderer = renderer->winsys;
CoglGpuInfo *info;
context->winsys = g_new0 (CoglContextEGL, 1);
@@ -514,6 +515,16 @@ _cogl_winsys_context_init (CoglContext *context, CoglError **error)
if (!_cogl_context_update_features (context, error))
return FALSE;
info = &context->gpu;
if (info->vendor == COGL_GPU_INFO_VENDOR_NVIDIA)
{
context->feature_flags |= COGL_FEATURE_UNSTABLE_TEXTURES;
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_UNSTABLE_TEXTURES,
TRUE);
}
if (egl_renderer->private_features & COGL_EGL_WINSYS_FEATURE_SWAP_REGION)
{
COGL_FLAGS_SET (context->winsys_features,

View File

@@ -832,12 +832,15 @@ update_winsys_features (CoglContext *context, CoglError **error)
{
CoglGLXDisplay *glx_display = context->display->winsys;
CoglGLXRenderer *glx_renderer = context->display->renderer->winsys;
CoglGpuInfo *info;
_COGL_RETURN_VAL_IF_FAIL (glx_display->glx_context, FALSE);
if (!_cogl_context_update_features (context, error))
return FALSE;
info = &context->gpu;
memcpy (context->winsys_features,
glx_renderer->base_winsys_features,
sizeof (context->winsys_features));
@@ -850,7 +853,6 @@ update_winsys_features (CoglContext *context, CoglError **error)
if (glx_renderer->glXCopySubBuffer || context->glBlitFramebuffer)
{
CoglGpuInfo *info = &context->gpu;
CoglGpuInfoArchitecture arch = info->architecture;
COGL_FLAGS_SET (context->winsys_features, COGL_WINSYS_FEATURE_SWAP_REGION, TRUE);
@@ -899,7 +901,6 @@ update_winsys_features (CoglContext *context, CoglError **error)
}
else
{
CoglGpuInfo *info = &context->gpu;
if (glx_display->have_vblank_counter &&
context->display->renderer->xlib_enable_threaded_swap_wait &&
info->vendor == COGL_GPU_INFO_VENDOR_NVIDIA)
@@ -921,6 +922,14 @@ update_winsys_features (CoglContext *context, CoglError **error)
}
}
if (info->vendor == COGL_GPU_INFO_VENDOR_NVIDIA)
{
context->feature_flags |= COGL_FEATURE_UNSTABLE_TEXTURES;
COGL_FLAGS_SET (context->features,
COGL_FEATURE_ID_UNSTABLE_TEXTURES,
TRUE);
}
/* We'll manually handle queueing dirty events in response to
* Expose events from X */
COGL_FLAGS_SET (context->private_features,

View File

@@ -1,7 +1,7 @@
AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [29])
m4_define([mutter_minor_version], [28])
m4_define([mutter_micro_version], [3])
m4_define([mutter_version],
@@ -9,7 +9,7 @@ m4_define([mutter_version],
m4_define([mutter_plugin_api_version], [3])
m4_define([libmutter_api_version], [3])
m4_define([libmutter_api_version], [2])
AC_INIT([mutter], [mutter_version],
[http://bugzilla.gnome.org/enter_bug.cgi?product=mutter])
@@ -245,7 +245,7 @@ AC_ARG_ENABLE(remote-desktop,
enable_remote_desktop=no
)
AS_IF([test "$enable_remote_desktop" = "yes"], [
MUTTER_PC_MODULES="$MUTTER_PC_MODULES libpipewire-0.1 >= 0.1.8"
MUTTER_PC_MODULES="$MUTTER_PC_MODULES libpipewire-0.2 >= 0.2.5"
AC_DEFINE([HAVE_REMOTE_DESKTOP],[1], [Defined if screen cast and remote desktop support is enabled])
])
AM_CONDITIONAL([HAVE_REMOTE_DESKTOP],[test "$enable_remote_desktop" = "yes"])

View File

@@ -60,7 +60,7 @@
gettext-domain="@GETTEXT_DOMAIN@">
<key name="xwayland-allow-grabs" type="b">
<default>false</default>
<default>true</default>
<summary>Allow grabs with Xwayland</summary>
<description>
Allow keyboard grabs issued by X11 applications running in Xwayland
@@ -73,7 +73,7 @@
</key>
<key name="xwayland-grab-access-rules" type="as">
<default>[]</default>
<default>['@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@']</default>
<summary>Xwayland applications allowed to issue keyboard grabs</summary>
<description>
List the resource names or resource class of X11 windows either

View File

@@ -14,18 +14,18 @@ src/compositor/meta-background.c
src/core/bell.c
src/core/core.c
src/core/display.c
src/core/errors.c
src/core/keybindings.c
src/core/main.c
src/core/meta-close-dialog-default.c
src/core/mutter.c
src/core/prefs.c
src/core/screen.c
src/core/util.c
src/core/window.c
src/ui/frames.c
src/ui/theme.c
src/wayland/meta-wayland-tablet-pad.c
src/x11/meta-x11-display.c
src/x11/meta-x11-errors.c
src/x11/session.c
src/x11/window-props.c
src/x11/xprops.c

208
po/ca.po
View File

@@ -11,9 +11,10 @@
msgid ""
msgstr ""
"Project-Id-Version: metacity 2.24\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
"PO-Revision-Date: 2018-06-17 10:25+0200\n"
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-08-29 16:09+0000\n"
"PO-Revision-Date: 2017-08-25 13:23+0200\n"
"Last-Translator: Jordi Mas <jmas@softcatala.org>\n"
"Language-Team: Catalan <tradgnome@softcatala.org>\n"
"Language: ca\n"
@@ -21,7 +22,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Poedit 2.0.6\n"
"X-Generator: Poedit 2.0.1\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -48,118 +49,134 @@ msgid "Move window to last workspace"
msgstr "Mou la finestra a l'últim espai de treball"
#: data/50-mutter-navigation.xml:24
msgid "Move window one workspace to the left"
msgstr "Mou la finestra un espai de treball a l'esquerra"
#: data/50-mutter-navigation.xml:27
msgid "Move window one workspace to the right"
msgstr "Mou la finestra un espai de treball a la dreta"
#: data/50-mutter-navigation.xml:30
msgid "Move window one workspace up"
msgstr "Mou la finestra un espai de treball amunt"
#: data/50-mutter-navigation.xml:27
#: data/50-mutter-navigation.xml:33
msgid "Move window one workspace down"
msgstr "Mou la finestra un espai de treball avall"
#: data/50-mutter-navigation.xml:30
#: data/50-mutter-navigation.xml:36
msgid "Move window one monitor to the left"
msgstr "Mou la finestra un monitor a l'esquerra"
#: data/50-mutter-navigation.xml:33
#: data/50-mutter-navigation.xml:39
msgid "Move window one monitor to the right"
msgstr "Mou la finestra un monitor a la dreta"
#: data/50-mutter-navigation.xml:36
#: data/50-mutter-navigation.xml:42
msgid "Move window one monitor up"
msgstr "Mou la finestra un monitor amunt"
#: data/50-mutter-navigation.xml:39
#: data/50-mutter-navigation.xml:45
msgid "Move window one monitor down"
msgstr "Mou la finestra un monitor avall"
#: data/50-mutter-navigation.xml:43
#: data/50-mutter-navigation.xml:49
msgid "Switch applications"
msgstr "Canvia d'aplicacions"
#: data/50-mutter-navigation.xml:48
#: data/50-mutter-navigation.xml:54
msgid "Switch to previous application"
msgstr "Canvia a l'aplicació anterior"
#: data/50-mutter-navigation.xml:52
#: data/50-mutter-navigation.xml:58
msgid "Switch windows"
msgstr "Canvia de finestres"
#: data/50-mutter-navigation.xml:57
#: data/50-mutter-navigation.xml:63
msgid "Switch to previous window"
msgstr "Canvia a la finestra anterior"
#: data/50-mutter-navigation.xml:61
#: data/50-mutter-navigation.xml:67
msgid "Switch windows of an application"
msgstr "Canvia entre les finestres d'una aplicació"
#: data/50-mutter-navigation.xml:66
#: data/50-mutter-navigation.xml:72
msgid "Switch to previous window of an application"
msgstr "Canvia a la finestra anterior d'una aplicació"
#: data/50-mutter-navigation.xml:70
#: data/50-mutter-navigation.xml:76
msgid "Switch system controls"
msgstr "Canvia els controls del sistema"
#: data/50-mutter-navigation.xml:75
#: data/50-mutter-navigation.xml:81
msgid "Switch to previous system control"
msgstr "Canvia al control del sistema anterior"
#: data/50-mutter-navigation.xml:79
#: data/50-mutter-navigation.xml:85
msgid "Switch windows directly"
msgstr "Canvia immediatament entre finestres"
#: data/50-mutter-navigation.xml:84
#: data/50-mutter-navigation.xml:90
msgid "Switch directly to previous window"
msgstr "Canvia immediatament a la finestra anterior"
#: data/50-mutter-navigation.xml:88
#: data/50-mutter-navigation.xml:94
msgid "Switch windows of an app directly"
msgstr "Canvia immediatament entre les finestres d'una aplicació"
#: data/50-mutter-navigation.xml:93
#: data/50-mutter-navigation.xml:99
msgid "Switch directly to previous window of an app"
msgstr "Canvia immediatament a la finestra anterior d'una aplicació"
#: data/50-mutter-navigation.xml:97
#: data/50-mutter-navigation.xml:103
msgid "Switch system controls directly"
msgstr "Canvia immediatament entre els controls del sistema"
#: data/50-mutter-navigation.xml:102
#: data/50-mutter-navigation.xml:108
msgid "Switch directly to previous system control"
msgstr "Canvia immediatament al control del sistema anterior"
#: data/50-mutter-navigation.xml:105
#: data/50-mutter-navigation.xml:111
msgid "Hide all normal windows"
msgstr "Oculta totes les finestres normals"
#: data/50-mutter-navigation.xml:108
#: data/50-mutter-navigation.xml:114
msgid "Switch to workspace 1"
msgstr "Canvia a l'espai de treball 1"
#: data/50-mutter-navigation.xml:111
#: data/50-mutter-navigation.xml:117
msgid "Switch to workspace 2"
msgstr "Canvia a l'espai de treball 2"
#: data/50-mutter-navigation.xml:114
#: data/50-mutter-navigation.xml:120
msgid "Switch to workspace 3"
msgstr "Canvia a l'espai de treball 3"
#: data/50-mutter-navigation.xml:117
#: data/50-mutter-navigation.xml:123
msgid "Switch to workspace 4"
msgstr "Canvia a l'espai de treball 4"
#: data/50-mutter-navigation.xml:120
#: data/50-mutter-navigation.xml:126
msgid "Switch to last workspace"
msgstr "Canvia a l'últim espai de treball"
#: data/50-mutter-navigation.xml:123
#: data/50-mutter-navigation.xml:129
msgid "Move to workspace left"
msgstr "Mou a l'espai de treball de l'esquerra"
#: data/50-mutter-navigation.xml:132
msgid "Move to workspace right"
msgstr "Mou a l'espai de treball de la dreta"
#: data/50-mutter-navigation.xml:135
msgid "Move to workspace above"
msgstr "Mou a l'espai de treball de sobre"
#: data/50-mutter-navigation.xml:126
#: data/50-mutter-navigation.xml:138
msgid "Move to workspace below"
msgstr "Mou a l'espai de treball de sota"
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
#: data/50-mutter-system.xml:6
msgid "System"
msgstr "Sistema"
@@ -171,10 +188,6 @@ msgstr "Mostra l'indicador d'execució d'aplicacions"
msgid "Show the activities overview"
msgstr "Mostra la vista general d'activitats"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Restaura les dreceres de teclat"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Finestres"
@@ -200,52 +213,56 @@ msgid "Restore window"
msgstr "Restaura la finestra"
#: data/50-mutter-windows.xml:18
msgid "Toggle shaded state"
msgstr "Canvia l'estat d'ombrejat"
#: data/50-mutter-windows.xml:20
msgid "Close window"
msgstr "Tanca la finestra"
#: data/50-mutter-windows.xml:20
#: data/50-mutter-windows.xml:22
msgid "Hide window"
msgstr "Oculta la finestra"
#: data/50-mutter-windows.xml:22
#: data/50-mutter-windows.xml:24
msgid "Move window"
msgstr "Mou la finestra"
#: data/50-mutter-windows.xml:24
#: data/50-mutter-windows.xml:26
msgid "Resize window"
msgstr "Redimensiona la finestra"
#: data/50-mutter-windows.xml:27
#: data/50-mutter-windows.xml:29
msgid "Toggle window on all workspaces or one"
msgstr ""
"Canvia la funció que fa que la finestra estigui en tots els espais de "
"treball o només en un"
#: data/50-mutter-windows.xml:29
#: data/50-mutter-windows.xml:31
msgid "Raise window if covered, otherwise lower it"
msgstr "Alça la finestra si està coberta per una altra; altrament, baixa-la"
#: data/50-mutter-windows.xml:31
#: data/50-mutter-windows.xml:33
msgid "Raise window above other windows"
msgstr "Alça la finestra per damunt de les altres"
#: data/50-mutter-windows.xml:33
#: data/50-mutter-windows.xml:35
msgid "Lower window below other windows"
msgstr "Baixa la finestra sota les altres"
#: data/50-mutter-windows.xml:35
#: data/50-mutter-windows.xml:37
msgid "Maximize window vertically"
msgstr "Maximitza la finestra verticalment"
#: data/50-mutter-windows.xml:37
#: data/50-mutter-windows.xml:39
msgid "Maximize window horizontally"
msgstr "Maximitza la finestra horitzontalment"
#: data/50-mutter-windows.xml:41
#: data/50-mutter-windows.xml:43
msgid "View split on left"
msgstr "Mostra la partició a l'esquerra"
#: data/50-mutter-windows.xml:45
#: data/50-mutter-windows.xml:47
msgid "View split on right"
msgstr "Mostra la partició a la dreta"
@@ -407,22 +424,25 @@ msgid ""
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
"mutter default to layout logical monitors in a logical pixel coordinate "
"space, while scaling monitor framebuffers instead of window content, to "
"manage HiDPI monitors. Does not require a restart."
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
"enables remote desktop support. To support remote desktop with screen "
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
"screen cast support."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:141
#: data/org.gnome.mutter.gschema.xml.in:145
msgid "Select window from tab popup"
msgstr "Selecció de finestra entre les emergents d'una pestanya"
#: data/org.gnome.mutter.gschema.xml.in:146
#: data/org.gnome.mutter.gschema.xml.in:150
msgid "Cancel tab popup"
msgstr "Cancel·lació de les finestres emergents a les pestanyes"
#: data/org.gnome.mutter.gschema.xml.in:151
#: data/org.gnome.mutter.gschema.xml.in:155
msgid "Switch monitor configurations"
msgstr "Canvia configuracions de monitor"
#: data/org.gnome.mutter.gschema.xml.in:156
#: data/org.gnome.mutter.gschema.xml.in:160
msgid "Rotates the built-in monitor configuration"
msgstr "Gira la configuració del monitor integrada"
@@ -478,41 +498,10 @@ msgstr "Canvia al terminal virtual 12"
msgid "Re-enable shortcuts"
msgstr "Torna a habilitar les dreceres"
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
msgid "Allow grabs with Xwayland"
msgstr "Permetre la captura amb Xwayland"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
msgid ""
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
"taken into account. 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”."
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr "Les aplicacions Xwayland poden capturar el teclat"
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
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”."
msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2325
#: src/backends/meta-input-settings.c:2151
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Mode de commutació (grup %d)"
@@ -520,11 +509,11 @@ msgstr "Mode de commutació (grup %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2348
#: src/backends/meta-input-settings.c:2174
msgid "Switch monitor"
msgstr "Commuta el monitor"
#: src/backends/meta-input-settings.c:2350
#: src/backends/meta-input-settings.c:2176
msgid "Show on-screen help"
msgstr "Mostra l'ajuda en pantalla"
@@ -550,7 +539,7 @@ msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: src/compositor/compositor.c:481
#: src/compositor/compositor.c:476
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -568,31 +557,31 @@ msgid "Failed to open X Window System display “%s”\n"
msgstr ""
"S'ha produït un error en obrir la pantalla del sistema de finestres X «%s»\n"
#: src/core/main.c:190
#: src/core/main.c:189
msgid "Disable connection to session manager"
msgstr "Inhabilita la connexió al gestor de sessions"
#: src/core/main.c:196
#: src/core/main.c:195
msgid "Replace the running window manager"
msgstr "Reemplaça el gestor de finestres en execució"
#: src/core/main.c:202
#: src/core/main.c:201
msgid "Specify session management ID"
msgstr "Especifica l'ID de gestió de sessió"
#: src/core/main.c:207
#: src/core/main.c:206
msgid "X Display to use"
msgstr "Visualització X per usar"
#: src/core/main.c:213
#: src/core/main.c:212
msgid "Initialize session from savefile"
msgstr "Inicialitza la sessió des del fitxer desat"
#: src/core/main.c:219
#: src/core/main.c:218
msgid "Make X calls synchronous"
msgstr "Fes que les crides a l'X siguin síncrones"
#: src/core/main.c:226
#: src/core/main.c:225
msgid "Run as a wayland compositor"
msgstr "Funciona com a compositor de Wayland"
@@ -601,18 +590,14 @@ msgstr "Funciona com a compositor de Wayland"
#
# Camins:
# ../src/core/main.c:223
#: src/core/main.c:232
#: src/core/main.c:231
msgid "Run as a nested compositor"
msgstr "Funciona com a compositor imbricat"
#: src/core/main.c:240
#: src/core/main.c:239
msgid "Run as a full display server, rather than nested"
msgstr "Funciona com a servidor de pantalla completa, en comptes d'imbricat"
#: src/core/main.c:246
msgid "Run with X11 backend"
msgstr "Executa amb un rerefons X11"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:147
#, c-format
@@ -668,7 +653,7 @@ msgstr "Connector del Mutter a utilitzar"
msgid "Workspace %d"
msgstr "Espai de treball %d"
#: src/core/screen.c:583
#: src/core/screen.c:580
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -677,7 +662,7 @@ msgstr ""
"La pantalla «%s» ja té un gestor de finestres; proveu l'opció --replace per "
"reemplaçar el gestor de finestres actual."
#: src/core/screen.c:668
#: src/core/screen.c:665
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "El monitor %d en la pantalla '%s' no és vàlida\n"
@@ -686,12 +671,12 @@ msgstr "El monitor %d en la pantalla '%s' no és vàlida\n"
msgid "Mutter was compiled without support for verbose mode\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:563
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Mode de commutació: mode %d"
#: src/x11/session.c:1818
#: src/x11/session.c:1815
msgid ""
"These windows do not support “save current setup” and will have to be "
"restarted manually next time you log in."
@@ -704,21 +689,6 @@ msgstr ""
msgid "%s (on %s)"
msgstr "%s (a %s)"
#~ msgid "Move window one workspace to the left"
#~ msgstr "Mou la finestra un espai de treball a l'esquerra"
#~ msgid "Move window one workspace to the right"
#~ msgstr "Mou la finestra un espai de treball a la dreta"
#~ msgid "Move to workspace left"
#~ msgstr "Mou a l'espai de treball de l'esquerra"
#~ msgid "Move to workspace right"
#~ msgstr "Mou a l'espai de treball de la dreta"
#~ msgid "Toggle shaded state"
#~ msgstr "Canvia l'estat d'ombrejat"
#~ msgid "Failed to scan themes directory: %s\n"
#~ msgstr "No s'ha pogut analitzar el directori de temes: %s\n"

View File

@@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
"PO-Revision-Date: 2018-06-29 15:33+0200\n"
"POT-Creation-Date: 2018-02-06 04:14+0000\n"
"PO-Revision-Date: 2018-02-06 22:43+0100\n"
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
"Language-Team: Friulian <fur@li.org>\n"
"Language: fur\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.0.8\n"
"X-Generator: Poedit 2.0.3\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -391,7 +391,10 @@ msgid ""
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
"mutter default to layout logical monitors in a logical pixel coordinate "
"space, while scaling monitor framebuffers instead of window content, to "
"manage HiDPI monitors. Does not require a restart."
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
"enables remote desktop support. To support remote desktop with screen "
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
"screen cast support."
msgstr ""
"Par abilitâ lis funzionalitâts sperimentâls, zonte la peraule clâf de "
"funzionalitât ae liste. Il fat che la funzionalitât e vedi bisugne di tornâ "
@@ -402,21 +405,25 @@ msgstr ""
"“scale-monitor-framebuffer” — al rint come predefinît par mutter, la "
"disposizion logjiche dai visôrs intun spazi logjic di coordenadis di pixel, "
"in plui si fâs il scjalâ dai framebuffer dai visôrs invezit che il contignût "
"dal barcon; dut chest par gjestî i visôrs HiDPI. Nol covente tornâ a inviâ."
"dal barcon; dut chest par gjestî i visôrs HiDPI. Nol covente tornâ a inviâ. "
"• “remote-desktop” — al abilite il supuart pal scritori rimot. Par podê "
"supuartâ il scritori rimot cun la condivision dal schermi si scugne abilitâ "
"ancje “screen-cast”. • “screen-cast” — al abilite il supuart pe trasmission "
"dal schermi."
#: data/org.gnome.mutter.gschema.xml.in:141
#: data/org.gnome.mutter.gschema.xml.in:145
msgid "Select window from tab popup"
msgstr "Selezione barcon dal tab popup"
#: data/org.gnome.mutter.gschema.xml.in:146
#: data/org.gnome.mutter.gschema.xml.in:150
msgid "Cancel tab popup"
msgstr "Anule tab popup"
#: data/org.gnome.mutter.gschema.xml.in:151
#: data/org.gnome.mutter.gschema.xml.in:155
msgid "Switch monitor configurations"
msgstr "Cambie configurazions visôr"
#: data/org.gnome.mutter.gschema.xml.in:156
#: data/org.gnome.mutter.gschema.xml.in:160
msgid "Rotates the built-in monitor configuration"
msgstr "Al volte la configurazion dal visôr integrât"
@@ -522,7 +529,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2325
#: src/backends/meta-input-settings.c:2260
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Cambie mût (Grup %d)"
@@ -530,30 +537,30 @@ msgstr "Cambie mût (Grup %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2348
#: src/backends/meta-input-settings.c:2283
msgid "Switch monitor"
msgstr "Cambie visôr"
#: src/backends/meta-input-settings.c:2350
#: src/backends/meta-input-settings.c:2285
msgid "Show on-screen help"
msgstr "Mostre jutori a schermi"
#: src/backends/meta-monitor-manager.c:903
#: src/backends/meta-monitor-manager.c:900
msgid "Built-in display"
msgstr "Display integrât"
#: src/backends/meta-monitor-manager.c:926
#: src/backends/meta-monitor-manager.c:923
msgid "Unknown"
msgstr "No cognossût"
#: src/backends/meta-monitor-manager.c:928
#: src/backends/meta-monitor-manager.c:925
msgid "Unknown Display"
msgstr "Display no cognossût"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: src/backends/meta-monitor-manager.c:936
#: src/backends/meta-monitor-manager.c:933
#, c-format
msgid "%s %s"
msgstr "%s %s"
@@ -689,7 +696,7 @@ msgstr "Schermi %d su display “%s” no valit\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"
#: src/wayland/meta-wayland-tablet-pad.c:567
#: src/wayland/meta-wayland-tablet-pad.c:563
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Cambie mût: mût %d"

View File

@@ -14,16 +14,16 @@ msgid ""
msgstr ""
"Project-Id-Version: gl\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-03-03 13:19+0000\n"
"PO-Revision-Date: 2018-05-07 19:37+0200\n"
"Last-Translator: marcos <marcoslansgarza@gmail.com>\n"
"POT-Creation-Date: 2018-03-01 10:47+0000\n"
"PO-Revision-Date: 2018-03-03 14:18+0200\n"
"Last-Translator: Fran Dieguez <frandieguez@gnome.org>\n"
"Language-Team: Galician\n"
"Language: gl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n"
"X-Generator: Virtaal 0.7.1\n"
"X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6
@@ -100,7 +100,7 @@ msgstr "Cambia á xanela anterior dun aplicativo"
#: data/50-mutter-navigation.xml:70
msgid "Switch system controls"
msgstr "Cambiar entre os controis do sistema"
msgstr "Cambiar entre os controles do sistema"
#: data/50-mutter-navigation.xml:75
msgid "Switch to previous system control"
@@ -124,7 +124,7 @@ msgstr "Cambia directamente á xanela anterior do aplicativo"
#: data/50-mutter-navigation.xml:97
msgid "Switch system controls directly"
msgstr "Cambiar entre os controis do sistema directamente"
msgstr "Cambiar entre os controles do sistema directamente"
#: data/50-mutter-navigation.xml:102
msgid "Switch directly to previous system control"

555
po/ro.po
View File

@@ -4,15 +4,15 @@
# Mugurel Tudor <mugurelu@gnome.ro>, 2002-2004, 2005, 2006, 2007.
# Adi Roiban https://launchpad.net/~adiroiban, 2008, 2009
# Lucian Adrian Grijincu <lucian.grijincu@gmail.com>, 2011.
# Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>, 2015, 2018.
# Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>, 2015.
msgid ""
msgstr ""
"Project-Id-Version: metacity.HEAD.ro\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
"PO-Revision-Date: 2018-06-17 21:51+0300\n"
"Last-Translator: Florentina Mușat <florentina.musat.28 [at] gmail [dot] "
"com>\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=mutter&"
"keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2015-10-21 11:43+0000\n"
"PO-Revision-Date: 2015-10-22 19:10+0200\n"
"Last-Translator: Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>\n"
"Language-Team: Gnome Romanian Translation Team\n"
"Language: ro\n"
"MIME-Version: 1.0\n"
@@ -20,259 +20,275 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2);;\n"
"X-Generator: Poedit 2.0.8\n"
"X-Generator: Virtaal 0.7.1\n"
"X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6
#: ../data/50-mutter-navigation.xml.in.h:1
msgid "Navigation"
msgstr "Navigare"
#: data/50-mutter-navigation.xml:9
#: ../data/50-mutter-navigation.xml.in.h:2
msgid "Move window to workspace 1"
msgstr "Mută fereastra pe spațiul de lucru 1"
#: data/50-mutter-navigation.xml:12
#: ../data/50-mutter-navigation.xml.in.h:3
msgid "Move window to workspace 2"
msgstr "Mută fereastra pe spațiul de lucru 2"
#: data/50-mutter-navigation.xml:15
#: ../data/50-mutter-navigation.xml.in.h:4
msgid "Move window to workspace 3"
msgstr "Mută fereastra pe spațiul de lucru 3"
#: data/50-mutter-navigation.xml:18
#: ../data/50-mutter-navigation.xml.in.h:5
msgid "Move window to workspace 4"
msgstr "Mută fereastra pe spațiul de lucru 4"
#: data/50-mutter-navigation.xml:21
#: ../data/50-mutter-navigation.xml.in.h:6
msgid "Move window to last workspace"
msgstr "Mută fereastra pe spațiul de lucru anterior"
#: data/50-mutter-navigation.xml:24
#: ../data/50-mutter-navigation.xml.in.h:7
msgid "Move window one workspace to the left"
msgstr "Mută fereastra pe spațiul de lucru de la stânga"
#: ../data/50-mutter-navigation.xml.in.h:8
msgid "Move window one workspace to the right"
msgstr "Mută fereastra pe spațiul de lucru de la dreapta"
#: ../data/50-mutter-navigation.xml.in.h:9
msgid "Move window one workspace up"
msgstr "Mută fereastra pe spațiul de lucru de mai sus"
#: data/50-mutter-navigation.xml:27
#: ../data/50-mutter-navigation.xml.in.h:10
msgid "Move window one workspace down"
msgstr "Mută fereastra pe spațiul de lucru de mai jos"
#: data/50-mutter-navigation.xml:30
#: ../data/50-mutter-navigation.xml.in.h:11
msgid "Move window one monitor to the left"
msgstr "Mută fereastra cu un monitor la stânga"
#: data/50-mutter-navigation.xml:33
#: ../data/50-mutter-navigation.xml.in.h:12
msgid "Move window one monitor to the right"
msgstr "Mută fereastra un monitor la dreapta"
#: data/50-mutter-navigation.xml:36
#: ../data/50-mutter-navigation.xml.in.h:13
msgid "Move window one monitor up"
msgstr "Mută fereastra cu un monitor mai sus"
#: data/50-mutter-navigation.xml:39
#: ../data/50-mutter-navigation.xml.in.h:14
msgid "Move window one monitor down"
msgstr "Mută fereastra cu un monitor mai jos"
#: data/50-mutter-navigation.xml:43
#: ../data/50-mutter-navigation.xml.in.h:15
msgid "Switch applications"
msgstr "Comută aplicațiile"
#: data/50-mutter-navigation.xml:48
#: ../data/50-mutter-navigation.xml.in.h:16
msgid "Switch to previous application"
msgstr "Schimbă la aplicația anterioară"
#: data/50-mutter-navigation.xml:52
#: ../data/50-mutter-navigation.xml.in.h:17
msgid "Switch windows"
msgstr "Schimbă ferestre"
#: data/50-mutter-navigation.xml:57
#: ../data/50-mutter-navigation.xml.in.h:18
msgid "Switch to previous window"
msgstr "Schimbă la fereastra anterioară"
#: data/50-mutter-navigation.xml:61
#: ../data/50-mutter-navigation.xml.in.h:19
msgid "Switch windows of an application"
msgstr "Schimbă ferestrele unei aplicații"
#: data/50-mutter-navigation.xml:66
#: ../data/50-mutter-navigation.xml.in.h:20
msgid "Switch to previous window of an application"
msgstr "Schimbă la fereastra anterioară a unei aplicații"
#: data/50-mutter-navigation.xml:70
#: ../data/50-mutter-navigation.xml.in.h:21
msgid "Switch system controls"
msgstr "Schimbă comenzile de sistem"
#: data/50-mutter-navigation.xml:75
#: ../data/50-mutter-navigation.xml.in.h:22
msgid "Switch to previous system control"
msgstr "Schimbă la comanda de control anterioară"
#: data/50-mutter-navigation.xml:79
#: ../data/50-mutter-navigation.xml.in.h:23
msgid "Switch windows directly"
msgstr "Schimbă ferestrele în mod direct"
#: data/50-mutter-navigation.xml:84
#: ../data/50-mutter-navigation.xml.in.h:24
msgid "Switch directly to previous window"
msgstr "Schimbă la fereastra anterioară în mod direct"
#: data/50-mutter-navigation.xml:88
#: ../data/50-mutter-navigation.xml.in.h:25
msgid "Switch windows of an app directly"
msgstr "Comută direct ferestrele unei aplicații"
msgstr "Schimbă în mod direct ferestrele uneui aplicații "
#: data/50-mutter-navigation.xml:93
#: ../data/50-mutter-navigation.xml.in.h:26
msgid "Switch directly to previous window of an app"
msgstr "Schimbă în mod direct la fereastra anterioară a unei aplicații"
#: data/50-mutter-navigation.xml:97
#: ../data/50-mutter-navigation.xml.in.h:27
msgid "Switch system controls directly"
msgstr "Schimbă comenzile de sistem în mod direct"
#: data/50-mutter-navigation.xml:102
#: ../data/50-mutter-navigation.xml.in.h:28
msgid "Switch directly to previous system control"
msgstr "Schimbă în mod direct la o comandă de sistem anterioară"
#: data/50-mutter-navigation.xml:105
#: ../data/50-mutter-navigation.xml.in.h:29
msgid "Hide all normal windows"
msgstr "Ascunde toate ferestrele normale"
msgstr "Ascunde toate ferestrele normale "
#: data/50-mutter-navigation.xml:108
#: ../data/50-mutter-navigation.xml.in.h:30
msgid "Switch to workspace 1"
msgstr "Comută la spațiul de lucru 1"
#: data/50-mutter-navigation.xml:111
#: ../data/50-mutter-navigation.xml.in.h:31
msgid "Switch to workspace 2"
msgstr "Comută la spațiul de lucru 2"
#: data/50-mutter-navigation.xml:114
#: ../data/50-mutter-navigation.xml.in.h:32
msgid "Switch to workspace 3"
msgstr "Comută la spațiul de lucru 3"
#: data/50-mutter-navigation.xml:117
#: ../data/50-mutter-navigation.xml.in.h:33
msgid "Switch to workspace 4"
msgstr "Comută la spațiul de lucru 4"
#: data/50-mutter-navigation.xml:120
#: ../data/50-mutter-navigation.xml.in.h:34
msgid "Switch to last workspace"
msgstr "Comută la ultimul spațiu de lucru"
msgstr "Comută la ultimul spațiu de lucru "
#: data/50-mutter-navigation.xml:123
#: ../data/50-mutter-navigation.xml.in.h:35
msgid "Move to workspace left"
msgstr "Mută pe spațiul de lucru din stânga"
#: ../data/50-mutter-navigation.xml.in.h:36
msgid "Move to workspace right"
msgstr "Mută pe spațiul de lucru din dreapta"
#: ../data/50-mutter-navigation.xml.in.h:37
msgid "Move to workspace above"
msgstr "Mută pe spațiul de lucru deasupra"
#: data/50-mutter-navigation.xml:126
#: ../data/50-mutter-navigation.xml.in.h:38
msgid "Move to workspace below"
msgstr "Mută pe spațiul de lucru de jos"
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
#: ../data/50-mutter-system.xml.in.h:1
msgid "System"
msgstr "Sistem"
#: data/50-mutter-system.xml:8
#: ../data/50-mutter-system.xml.in.h:2
msgid "Show the run command prompt"
msgstr "Arată prompterul de comandă al comenzii run (rulează)"
#: data/50-mutter-system.xml:10
#: ../data/50-mutter-system.xml.in.h:3
msgid "Show the activities overview"
msgstr "Arată prezentarea generală a activităților"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Restaurează scurtăturile de tastatură"
#: data/50-mutter-windows.xml:6
#: ../data/50-mutter-windows.xml.in.h:1
msgid "Windows"
msgstr "Ferestre"
#: data/50-mutter-windows.xml:8
#: ../data/50-mutter-windows.xml.in.h:2
msgid "Activate the window menu"
msgstr "Activează meniul ferestrei"
#: data/50-mutter-windows.xml:10
#: ../data/50-mutter-windows.xml.in.h:3
msgid "Toggle fullscreen mode"
msgstr "Comută modul pe tot ecranul"
#: data/50-mutter-windows.xml:12
#: ../data/50-mutter-windows.xml.in.h:4
msgid "Toggle maximization state"
msgstr "Comută starea de maximizare"
#: data/50-mutter-windows.xml:14
#: ../data/50-mutter-windows.xml.in.h:5
msgid "Maximize window"
msgstr "Maximizează fereastra"
#: data/50-mutter-windows.xml:16
#: ../data/50-mutter-windows.xml.in.h:6
msgid "Restore window"
msgstr "Restabilește fereastra"
#: data/50-mutter-windows.xml:18
#: ../data/50-mutter-windows.xml.in.h:7
msgid "Toggle shaded state"
msgstr "Comută starea de umbrire"
#: ../data/50-mutter-windows.xml.in.h:8
msgid "Close window"
msgstr "Închide fereastra"
#: data/50-mutter-windows.xml:20
#: ../data/50-mutter-windows.xml.in.h:9
msgid "Hide window"
msgstr "Ascunde fereastra"
#: data/50-mutter-windows.xml:22
#: ../data/50-mutter-windows.xml.in.h:10
msgid "Move window"
msgstr "Mută fereastra"
#: data/50-mutter-windows.xml:24
#: ../data/50-mutter-windows.xml.in.h:11
msgid "Resize window"
msgstr "Redimensionează fereastra"
#: data/50-mutter-windows.xml:27
#: ../data/50-mutter-windows.xml.in.h:12
msgid "Toggle window on all workspaces or one"
msgstr "Comută fereastra pe toate spațiile de lucru sau doar pe unul"
#: data/50-mutter-windows.xml:29
#: ../data/50-mutter-windows.xml.in.h:13
msgid "Raise window if covered, otherwise lower it"
msgstr "Ridică fereastra dacă este acoperită, altfel, coboar-o"
#: data/50-mutter-windows.xml:31
#: ../data/50-mutter-windows.xml.in.h:14
msgid "Raise window above other windows"
msgstr "Ridică fereastra deasupra celorlalte ferestre"
#: data/50-mutter-windows.xml:33
#: ../data/50-mutter-windows.xml.in.h:15
msgid "Lower window below other windows"
msgstr "Coboară fereastra sub alte ferestre"
#: data/50-mutter-windows.xml:35
#: ../data/50-mutter-windows.xml.in.h:16
msgid "Maximize window vertically"
msgstr "Maximizează fereastra pe verticală"
#: data/50-mutter-windows.xml:37
#: ../data/50-mutter-windows.xml.in.h:17
msgid "Maximize window horizontally"
msgstr "Maximizează fereastra pe orizontală"
#: data/50-mutter-windows.xml:41
#: ../data/50-mutter-windows.xml.in.h:18
msgid "View split on left"
msgstr "Împarte în stânga"
#: data/50-mutter-windows.xml:45
#: ../data/50-mutter-windows.xml.in.h:19
msgid "View split on right"
msgstr "Împarte în dreapta"
#: data/mutter.desktop.in:4
#: ../data/mutter.desktop.in.h:1
msgid "Mutter"
msgstr "Mutter"
#: data/org.gnome.mutter.gschema.xml.in:7
#: ../data/org.gnome.mutter.gschema.xml.in.h:1
msgid "Modifier to use for extended window management operations"
msgstr ""
"Modificatorul folosit pentru operațiile extinse de management al ferestrelor"
#: data/org.gnome.mutter.gschema.xml.in:8
#: ../data/org.gnome.mutter.gschema.xml.in.h:2
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. Its expected that this binding either the default or "
"set to the empty string."
"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."
msgstr ""
"Această cheie va iniția „suprapunerea”, care este o combinație între o "
"privire de ansamblu a ferestrelor și un sistem de lansare de aplicații. "
"Implicit este tasta „Windows” pe hardware PC. Este de așteptat ca această "
"legătură să fie ori stabilită la implicit sau la șirul vid."
"Această cheie va iniția „overlay”-ul, care este o combinație între o privire "
"de ansamblu a ferestrelor și un sistemul de lansare de aplicații. Implicit "
"este testa „Windows” pe hardware PC. Este de așteptat ca această cheie să "
"fie sau implicit sau setat la șirul vid."
#: data/org.gnome.mutter.gschema.xml.in:20
#: ../data/org.gnome.mutter.gschema.xml.in.h:3
msgid "Attach modal dialogs"
msgstr "Atașează dialogurile modale"
#: data/org.gnome.mutter.gschema.xml.in:21
#: ../data/org.gnome.mutter.gschema.xml.in.h:4
msgid ""
"When true, instead of having independent titlebars, modal dialogs appear "
"attached to the titlebar of the parent window and are moved together with "
@@ -282,12 +298,13 @@ msgstr ""
"modale apar atașate la bara de titlu a ferestrei părinte și sunt mutate "
"împreună cu fereastra părinte."
#: data/org.gnome.mutter.gschema.xml.in:30
#: ../data/org.gnome.mutter.gschema.xml.in.h:5
#, fuzzy
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
"Activează mozaicul de margine la plasarea ferestrelor pe marginile ecranului"
"Activează mozaicul lateral la plasarea ferestrelor pe marginile ecranului"
#: data/org.gnome.mutter.gschema.xml.in:31
#: ../data/org.gnome.mutter.gschema.xml.in.h:6
msgid ""
"If enabled, dropping windows on vertical screen edges maximizes them "
"vertically and resizes them horizontally to cover half of the available "
@@ -298,25 +315,25 @@ msgstr ""
"pentru a acoperi jumătate din suprafața disponibilă. Plasarea ferestrelor pe "
"marginea de sus a ecranului le maximizează complet."
#: data/org.gnome.mutter.gschema.xml.in:40
#: ../data/org.gnome.mutter.gschema.xml.in.h:7
msgid "Workspaces are managed dynamically"
msgstr "Spațiile de lucru sunt gestionate în mod dinamic"
#: data/org.gnome.mutter.gschema.xml.in:41
#: ../data/org.gnome.mutter.gschema.xml.in.h:8
msgid ""
"Determines whether workspaces are managed dynamically or whether theres a "
"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)."
msgstr ""
"Determină dacă spațiile de lucru sunt administrate dinamic sau dacă există "
"un număr static de spații de lucru (determinat de cheia num-workspaces din "
"org.gnome.desktop.wm.preferences)"
"Determină dacă spațiile de lucru sunt gestionate în mod dinamic sau dacă "
"există un număr static de spații de lucru (determinată de cheia num-"
"workspaces” din ”org.gnome.desktop.wm.preferences)"
#: data/org.gnome.mutter.gschema.xml.in:50
#: ../data/org.gnome.mutter.gschema.xml.in.h:9
msgid "Workspaces only on primary"
msgstr "Spații de lucru doar pe ecranul principal"
#: data/org.gnome.mutter.gschema.xml.in:51
#: ../data/org.gnome.mutter.gschema.xml.in.h:10
msgid ""
"Determines whether workspace switching should happen for windows on all "
"monitors or only for windows on the primary monitor."
@@ -325,11 +342,11 @@ msgstr ""
"ferestrele de pe toate monitoarele sau doar pentru ferestrele de pe "
"monitorul principal."
#: data/org.gnome.mutter.gschema.xml.in:59
#: ../data/org.gnome.mutter.gschema.xml.in.h:11
msgid "No tab popup"
msgstr "Fără popup pentru tab"
#: data/org.gnome.mutter.gschema.xml.in:60
#: ../data/org.gnome.mutter.gschema.xml.in.h:12
msgid ""
"Determines whether the use of popup and highlight frame should be disabled "
"for window cycling."
@@ -337,40 +354,42 @@ msgstr ""
"Determină dacă utilizarea unui popup sau a unui cadrul evidențiat ar trebui "
"să fie dezactivată pentru rotirea ferestrelor."
#: data/org.gnome.mutter.gschema.xml.in:68
#: ../data/org.gnome.mutter.gschema.xml.in.h:13
msgid "Delay focus changes until the pointer stops moving"
msgstr ""
"Întârzie schimbările de focalizare până când cursorul încetează să se miște"
#: data/org.gnome.mutter.gschema.xml.in:69
#: ../data/org.gnome.mutter.gschema.xml.in.h:14
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."
"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."
msgstr ""
"Dacă este stabilit ca adevărat, iar modul de focalizare este ori „neglijent” "
"ori „maus”, atunci focalizarea nu va fi schimbată imediat la intrarea într-o "
"fereastră, ci doar după ce indicatorul nu se mai mișcă."
"Dacă este activat iar modul de focalizare este „alunecos” sau „maus”, "
"focalizarea nu va fi schimbată imediat după intrarea în câmpul unei "
"ferestre, ci doar după ce pointerul încetează să se miște."
#: data/org.gnome.mutter.gschema.xml.in:79
#: ../data/org.gnome.mutter.gschema.xml.in.h:15
#, fuzzy
msgid "Draggable border width"
msgstr "Lățimea marginii ce poate fi plasată"
msgstr "Lățimea margini ce poate fi acționată"
#: data/org.gnome.mutter.gschema.xml.in:80
#: ../data/org.gnome.mutter.gschema.xml.in.h:16
#, fuzzy
msgid ""
"The amount of total draggable borders. If the themes visible borders are "
"The amount of total draggable borders. If the theme's visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
"Numărul total de margini ce pot fi plasate. Dacă marginile vizibile ale "
"temei nu sunt suficiente, vor fi adăugate margini invizibile pentru a "
"respecta această valoare."
"Numărul marginilor ce pot fi acționate. Dacă marginile vizibile ale temei "
"sunt insuficiente vor fi adăugate margini invizibile pentru a completa "
"aceast număr."
#: data/org.gnome.mutter.gschema.xml.in:89
#: ../data/org.gnome.mutter.gschema.xml.in.h:17
msgid "Auto maximize nearly monitor sized windows"
msgstr ""
"Maximizează automat ferestrele de dimensiune apropiată de cea a monitorului"
#: data/org.gnome.mutter.gschema.xml.in:90
#: ../data/org.gnome.mutter.gschema.xml.in.h:18
msgid ""
"If enabled, new windows that are initially the size of the monitor "
"automatically get maximized."
@@ -378,11 +397,11 @@ msgstr ""
"Dacă este activată, ferestrele noi care sunt inițial de mărimea monitorului "
"sunt maximizate în mod automat."
#: data/org.gnome.mutter.gschema.xml.in:98
#: ../data/org.gnome.mutter.gschema.xml.in.h:19
msgid "Place new windows in the center"
msgstr "Plasează ferestre noi în centru"
#: data/org.gnome.mutter.gschema.xml.in:99
#: ../data/org.gnome.mutter.gschema.xml.in.h:20
msgid ""
"When true, the new windows will always be put in the center of the active "
"screen of the monitor."
@@ -390,256 +409,107 @@ msgstr ""
"Când este adevărat, ferestrele noi vor fi plasate în centrul ecranului activ "
"al monitorului."
#: data/org.gnome.mutter.gschema.xml.in:107
msgid "Enable experimental features"
msgstr "Activează funcționalitățile experimentale"
#: data/org.gnome.mutter.gschema.xml.in:108
msgid ""
"To enable experimental features, add the feature keyword to the list. "
"Whether the feature requires restarting the compositor depends on the given "
"feature. Any experimental feature is not required to still be available, or "
"configurable. Dont expect adding anything in this setting to be future "
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
"mutter default to layout logical monitors in a logical pixel coordinate "
"space, while scaling monitor framebuffers instead of window content, to "
"manage HiDPI monitors. Does not require a restart."
msgstr ""
"Pentru a activa funcționalitățile experimentale, adăugați cuvântul cheie al "
"funcționalității la listă. Dacă funcționalitatea necesită sau nu repornirea "
"compunătorului depinde de funcționalitatea dată. Nu este necesar ca "
"funcționalitatea experimentală să fie încă disponibilă, sau configurabilă. "
"Nu vă așteptați să adăugați ceva la această configurare care va rezista "
"timpului. Cuvintele cheie posibile în mod curent: • „scale-monitor-"
"framebuffer” — face ca mutter să treacă implicit la aranjarea monitoarelor "
"logice într-un spațiu logic de coordonate pixel, în timpul scalării de "
"framebuffer-uri de monitor în locul conținutului ferestrei, pentru a "
"gestiona monitoare HiDPI. Nu necesită o repornire."
#: data/org.gnome.mutter.gschema.xml.in:141
#: ../data/org.gnome.mutter.gschema.xml.in.h:21
msgid "Select window from tab popup"
msgstr "Selectează fereastra din popup-ul tabului"
#: data/org.gnome.mutter.gschema.xml.in:146
#: ../data/org.gnome.mutter.gschema.xml.in.h:22
msgid "Cancel tab popup"
msgstr "Elimină popup-ul pentru tab"
#: data/org.gnome.mutter.gschema.xml.in:151
msgid "Switch monitor configurations"
msgstr "Comută configurațiile de monitor"
#: data/org.gnome.mutter.gschema.xml.in:156
msgid "Rotates the built-in monitor configuration"
msgstr "Rotește configurarea de monitor integrat"
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
msgid "Switch to VT 1"
msgstr "Comută la terminalul virtual 1"
#: data/org.gnome.mutter.wayland.gschema.xml.in:10
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
msgid "Switch to VT 2"
msgstr "Comută la terminalul virtual 2"
#: data/org.gnome.mutter.wayland.gschema.xml.in:14
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
msgid "Switch to VT 3"
msgstr "Comută la terminalul virtual 3"
#: data/org.gnome.mutter.wayland.gschema.xml.in:18
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
msgid "Switch to VT 4"
msgstr "Comută la terminalul virtual 4"
#: data/org.gnome.mutter.wayland.gschema.xml.in:22
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
msgid "Switch to VT 5"
msgstr "Comută la terminalul virtual 5"
#: data/org.gnome.mutter.wayland.gschema.xml.in:26
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
msgid "Switch to VT 6"
msgstr "Comută la terminalul virtual 6"
#: data/org.gnome.mutter.wayland.gschema.xml.in:30
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
msgid "Switch to VT 7"
msgstr "Comută la terminalul virtual 7"
#: data/org.gnome.mutter.wayland.gschema.xml.in:34
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:8
msgid "Switch to VT 8"
msgstr "Comută la terminalul virtual 8"
#: data/org.gnome.mutter.wayland.gschema.xml.in:38
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:9
msgid "Switch to VT 9"
msgstr "Comută la terminalul virtual 9"
#: data/org.gnome.mutter.wayland.gschema.xml.in:42
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:10
msgid "Switch to VT 10"
msgstr "Comută la terminalul virtual 10"
#: data/org.gnome.mutter.wayland.gschema.xml.in:46
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:11
msgid "Switch to VT 11"
msgstr "Comută la terminalul virtual 11"
#: data/org.gnome.mutter.wayland.gschema.xml.in:50
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:12
msgid "Switch to VT 12"
msgstr "Comută la terminalul virtual 12"
#: data/org.gnome.mutter.wayland.gschema.xml.in:54
msgid "Re-enable shortcuts"
msgstr "Reactivează scurtăturile"
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
msgid "Allow grabs with Xwayland"
msgstr "Permite capturi de tastatură cu Xwayland"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
msgid ""
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
"taken into account. 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”."
msgstr ""
"Permite capturile de tastatură emise de aplicațiile X11 care rulează în "
"Xwayland să fie luate în considerare. Pentru ca o captură X11 să fie luată "
"în considerare în Wayland, clientul trebuie ori să trimită un mesaj specific "
"ClientMessage X11 la fereastra root ori să se numere printre aplicațiile "
"permise în cheia „xwayland-grab-access-rules”."
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr "Aplicațiile Xwayland sunt permise de a emite capturi de tastatură"
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
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”."
msgstr ""
"Listează numele resurselor sau clasa resurselor ale ferestrelor X11 permise "
"sau nepermise să emită capturi de tastatură X11 în Xwayland. Numele resursei "
"sau clasa resursei a unei ferestre X11 date pot fi obținute utilizând "
"comanda „xprop WM_CLASS*. Metacaracterele „*” și jokerii „?” în valori sunt "
"suportați. Valorile care încep cu „!” sunt adăugate în lista de interziceri, "
"care are prioritate peste lista de permisiuni, pentru a revoca aplicații din "
"lista de sistem implicită. Lista de sistem implicită include următoarele "
"aplicații: „@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Utilizatorii pot să "
"întrerupă o captură existentă prin utilizarea scurtăturii de tastatură "
"specifice definite de tasta de stabilire a combinațiilor de taste „restore-"
"shortcuts”."
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2325
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Comutator de mod (grupul %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2348
msgid "Switch monitor"
msgstr "Comută monitorul"
#: src/backends/meta-input-settings.c:2350
msgid "Show on-screen help"
msgstr "Arată ajutorul virtual"
#: src/backends/meta-monitor-manager.c:903
#: ../src/backends/meta-monitor-manager.c:500
msgid "Built-in display"
msgstr "Afișaj integrat"
#: src/backends/meta-monitor-manager.c:926
#: ../src/backends/meta-monitor-manager.c:526
msgid "Unknown"
msgstr "Necunoscut"
#: src/backends/meta-monitor-manager.c:928
#: ../src/backends/meta-monitor-manager.c:528
msgid "Unknown Display"
msgstr "Afișaj necunoscut"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: src/backends/meta-monitor-manager.c:936
#: ../src/backends/meta-monitor-manager.c:536
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: src/compositor/compositor.c:481
#: ../src/compositor/compositor.c:456
#, c-format
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 ""
"Un alt administrator de ferestre de compunere rulează deja pe ecranul %i pe "
"Un alt administrator de ferestre compozit rulează deja pe ecranul %i pe "
"afișajul „%s”."
#: src/core/bell.c:194
#: ../src/core/bell.c:185
msgid "Bell event"
msgstr "Eveniment sonor"
#: src/core/display.c:608
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Nu s-a putut deschide afișajul sistemului de ferestre X „%s”\n"
#: src/core/main.c:190
msgid "Disable connection to session manager"
msgstr "Dezactivează conexiunea la administratorul de sesiune"
#: src/core/main.c:196
msgid "Replace the running window manager"
msgstr "Înlocuiește administratorul de ferestre curent"
#: src/core/main.c:202
msgid "Specify session management ID"
msgstr "Specifică ID-ul administrării de sesiune"
#: src/core/main.c:207
msgid "X Display to use"
msgstr "Ecranul X ce va fi folosit"
#: src/core/main.c:213
msgid "Initialize session from savefile"
msgstr "Inițializează sesiunea din fișierul salvat"
#: src/core/main.c:219
msgid "Make X calls synchronous"
msgstr "Realizează apelurile X sincron"
#: src/core/main.c:226
msgid "Run as a wayland compositor"
msgstr "Rulează ca un compunător wayland"
#: src/core/main.c:232
msgid "Run as a nested compositor"
msgstr "Rulează ca un compunător imbricat"
#: src/core/main.c:240
msgid "Run as a full display server, rather than nested"
msgstr "Rulează ca server de afișare și nu ca server imbricat"
#: src/core/main.c:246
msgid "Run with X11 backend"
msgstr "Rulează cu backend X11"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:147
#: ../src/core/delete.c:127
#, c-format
msgid "“%s” is not responding."
msgstr "„%s” nu răspunde."
#: src/core/meta-close-dialog-default.c:149
#: ../src/core/delete.c:129
msgid "Application is not responding."
msgstr "Aplicația nu răspunde."
#: src/core/meta-close-dialog-default.c:154
#: ../src/core/delete.c:134
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
@@ -647,95 +517,112 @@ msgstr ""
"Puteți alege între a aștepta pentru câteva secunde ca aplicația să continue "
"sau a forța terminarea aplicației."
#: src/core/meta-close-dialog-default.c:161
msgid "_Force Quit"
msgstr "_Forțează închiderea"
#: src/core/meta-close-dialog-default.c:161
#: ../src/core/delete.c:141
msgid "_Wait"
msgstr "_Așteaptă"
#: src/core/mutter.c:39
#: ../src/core/delete.c:141
msgid "_Force Quit"
msgstr "_Forțează închiderea"
#: ../src/core/display.c:563
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Nu s-a putut deschide afișajul X Window System „%s”\n"
#: ../src/core/main.c:176
msgid "Disable connection to session manager"
msgstr "Dezactivează conexiunea la administratorul de sesiune"
#: ../src/core/main.c:182
msgid "Replace the running window manager"
msgstr "Înlocuiește administratorul de ferestre curent"
#: ../src/core/main.c:188
msgid "Specify session management ID"
msgstr "Specifică ID-ul administrării de sesiune"
#: ../src/core/main.c:193
msgid "X Display to use"
msgstr "Ecranul X ce va fi folosit"
#: ../src/core/main.c:199
msgid "Initialize session from savefile"
msgstr "Inițializează sesiunea din fișierul salvat"
#: ../src/core/main.c:205
msgid "Make X calls synchronous"
msgstr "Realizează apelurile X sincron"
#: ../src/core/main.c:212
msgid "Run as a wayland compositor"
msgstr "Rulează ca compozitor wayland"
#: ../src/core/main.c:220
msgid "Run as a full display server, rather than nested"
msgstr "Rulează ca server de afișare și nu ca server imbricat"
#: ../src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\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"
msgstr ""
"mutter %s\n"
"Drepturi de autor (C) 2001-%d Havoc Pennington, Red Hat, Inc., și alții\n"
"Drepturi de autor (C) 2001--%d Havoc Pennington, Red Hat, Inc., și alții\n"
"Acesta este software liber; consultați codul sursă pentru condițiile de "
"copiere.\n"
"Nu există NICIO garanție; nici pentru COMERCIALIZARE sau UTILIZAREA ÎNTR-UN "
"Nu există NICI O garanție; nici pentru COMERCIALIZARE sau UTILIZAREA ÎNTR-UN "
"SCOP ANUME.\n"
#: src/core/mutter.c:53
#: ../src/core/mutter.c:53
msgid "Print version"
msgstr "Afișează versiunea"
#: src/core/mutter.c:59
#: ../src/core/mutter.c:59
msgid "Mutter plugin to use"
msgstr "Modul Mutter de utilizat"
#: src/core/prefs.c:1997
#: ../src/core/prefs.c:2050
#, c-format
msgid "Workspace %d"
msgstr "Spațiu de lucru %d"
#: src/core/screen.c:583
#: ../src/core/screen.c:526
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
"replace the current window manager."
"Display \"%s\" already has a window manager; try using the --replace option "
"to replace the current window manager."
msgstr ""
"Afișajul „%s” are deja un administrator de ferestre; încercați să utilizați "
"Afișajul „%s” are deja un administrator de ferestre; încercați să folosiți "
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
"ferestre curent."
"ferestre actual."
#: src/core/screen.c:668
#: ../src/core/screen.c:608
#, c-format
msgid "Screen %d on display %s is invalid\n"
msgstr "Ecranul %d de pe afișajul „%s” nu este valid\n"
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Ecranul %d pe afișajul „%s” este invalid\n"
#: src/core/util.c:120
#: ../src/core/util.c:118
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter a fost compilat fără suport pentru modul detaliat\n"
#: src/wayland/meta-wayland-tablet-pad.c:567
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Comutator de mod: modul %d"
#: src/x11/session.c:1818
#: ../src/x11/session.c:1815
msgid ""
"These windows do not support save current setup and will have to be "
"restarted manually next time you log in."
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
msgstr ""
"Aceste ferestre nu suportă „salvează configurarea curentă” și vor trebui "
"repornite manual următoarea dată când vă veți autentifica."
#: src/x11/window-props.c:559
#: ../src/x11/window-props.c:549
#, c-format
msgid "%s (on %s)"
msgstr "%s (pe %s)"
#~ msgid "Move window one workspace to the left"
#~ msgstr "Mută fereastra pe spațiul de lucru de la stânga"
#~ msgid "Move window one workspace to the right"
#~ msgstr "Mută fereastra pe spațiul de lucru de la dreapta"
#~ msgid "Move to workspace left"
#~ msgstr "Mută pe spațiul de lucru din stânga"
#~ msgid "Move to workspace right"
#~ msgstr "Mută pe spațiul de lucru din dreapta"
#~ msgid "Toggle shaded state"
#~ msgstr "Comută starea de umbrire"
#~ msgid "Switch to workspace on the left of the current workspace"
#~ msgstr "Schimbă cu spațiul de lucru din stânga celui actual"

View File

@@ -1,6 +1,6 @@
# translation of mutter.po to zh_CN
# Simplified Chinese translation of mutter.
# Copyright (C) 2012-2018 mutter's COPYRIGHT HOLDER
# This file is distributed under the same license as the mutter package.
# Copyright (C) 2002, 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
# Sun G11n <gnome_int_l10n@ireland.sun.com>, 2002.
# He Qiangqiang <carton@linux.net.cn>, 2002
# Xiong Jiang <jxiong@offtopic.org>, 2003
@@ -11,24 +11,22 @@
# Lele Long <schemacs@gmail.com>, 2011.
# YunQiang Su <wzssyqa@gmail.com>, 2011, 2012.
# Tong Hui <tonghuix@gmail.com>, 2014.
# Mandy Wang <wangmychn@gmail.com>, 2017.
# Mingcong Bai <jeffbai@aosc.xyz>, 2017.
# Dingzhong Chen <wsxy162@gmail.com>, 2017, 2018.
#
msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-02-09 13:01+0000\n"
"PO-Revision-Date: 2018-02-16 22:22+0800\n"
"Last-Translator: Dingzhong Chen <wsxy162@gmail.com>\n"
"Language-Team: Chinese (China) <i18n-zh@googlegroups.com>\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-02-03 10:06+0000\n"
"PO-Revision-Date: 2017-01-04 21:52+0800\n"
"Last-Translator: Mandy Wang <wangmychn@gmail.com>\n"
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Gtranslator 2.91.7\n"
"X-Generator: Poedit 1.8.7.1\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -55,118 +53,134 @@ msgid "Move window to last workspace"
msgstr "将窗口移到最后一个工作区"
#: data/50-mutter-navigation.xml:24
msgid "Move window one workspace to the left"
msgstr "将窗口左移一个工作区"
#: data/50-mutter-navigation.xml:27
msgid "Move window one workspace to the right"
msgstr "将窗口右移一个工作区"
#: data/50-mutter-navigation.xml:30
msgid "Move window one workspace up"
msgstr "将窗口上移一个工作区"
#: data/50-mutter-navigation.xml:27
#: data/50-mutter-navigation.xml:33
msgid "Move window one workspace down"
msgstr "将窗口下移一个工作区"
#: data/50-mutter-navigation.xml:30
#: data/50-mutter-navigation.xml:36
msgid "Move window one monitor to the left"
msgstr "将窗口左移一个显示器"
#: data/50-mutter-navigation.xml:33
#: data/50-mutter-navigation.xml:39
msgid "Move window one monitor to the right"
msgstr "将窗口右移一个显示器"
#: data/50-mutter-navigation.xml:36
#: data/50-mutter-navigation.xml:42
msgid "Move window one monitor up"
msgstr "将窗口上移一个显示器"
#: data/50-mutter-navigation.xml:39
#: data/50-mutter-navigation.xml:45
msgid "Move window one monitor down"
msgstr "将窗口下移一个显示器"
#: data/50-mutter-navigation.xml:43
#: data/50-mutter-navigation.xml:49
msgid "Switch applications"
msgstr "切换应用程序"
#: data/50-mutter-navigation.xml:48
#: data/50-mutter-navigation.xml:54
msgid "Switch to previous application"
msgstr "切换到前一个应用程序"
#: data/50-mutter-navigation.xml:52
#: data/50-mutter-navigation.xml:58
msgid "Switch windows"
msgstr "切换窗口"
#: data/50-mutter-navigation.xml:57
#: data/50-mutter-navigation.xml:63
msgid "Switch to previous window"
msgstr "切换到前一个窗口"
#: data/50-mutter-navigation.xml:61
#: data/50-mutter-navigation.xml:67
msgid "Switch windows of an application"
msgstr "在应用程序的窗口之间切换窗口"
#: data/50-mutter-navigation.xml:66
#: data/50-mutter-navigation.xml:72
msgid "Switch to previous window of an application"
msgstr "切换到一个应用程序的前一个窗口"
#: data/50-mutter-navigation.xml:70
#: data/50-mutter-navigation.xml:76
msgid "Switch system controls"
msgstr "切换系统控制"
#: data/50-mutter-navigation.xml:75
#: data/50-mutter-navigation.xml:81
msgid "Switch to previous system control"
msgstr "切换到前一个系统控制"
#: data/50-mutter-navigation.xml:79
#: data/50-mutter-navigation.xml:85
msgid "Switch windows directly"
msgstr "直接切换窗口"
#: data/50-mutter-navigation.xml:84
#: data/50-mutter-navigation.xml:90
msgid "Switch directly to previous window"
msgstr "直接切换到前一个窗口"
#: data/50-mutter-navigation.xml:88
#: data/50-mutter-navigation.xml:94
msgid "Switch windows of an app directly"
msgstr "在应用程序窗口间直接移动焦点"
#: data/50-mutter-navigation.xml:93
#: data/50-mutter-navigation.xml:99
msgid "Switch directly to previous window of an app"
msgstr "直接切换到一个应用程序的前一个窗口"
#: data/50-mutter-navigation.xml:97
#: data/50-mutter-navigation.xml:103
msgid "Switch system controls directly"
msgstr "直接切换系统控制"
#: data/50-mutter-navigation.xml:102
#: data/50-mutter-navigation.xml:108
msgid "Switch directly to previous system control"
msgstr "直接切换到前一个系统控制"
#: data/50-mutter-navigation.xml:105
#: data/50-mutter-navigation.xml:111
msgid "Hide all normal windows"
msgstr "隐藏所有正常窗口"
#: data/50-mutter-navigation.xml:108
#: data/50-mutter-navigation.xml:114
msgid "Switch to workspace 1"
msgstr "切换到工作区 1"
#: data/50-mutter-navigation.xml:111
#: data/50-mutter-navigation.xml:117
msgid "Switch to workspace 2"
msgstr "切换到工作区 2"
#: data/50-mutter-navigation.xml:114
#: data/50-mutter-navigation.xml:120
msgid "Switch to workspace 3"
msgstr "切换到工作区 3"
#: data/50-mutter-navigation.xml:117
#: data/50-mutter-navigation.xml:123
msgid "Switch to workspace 4"
msgstr "切换到工作区 4"
#: data/50-mutter-navigation.xml:120
#: data/50-mutter-navigation.xml:126
msgid "Switch to last workspace"
msgstr "切换到最后一个工作区"
#: data/50-mutter-navigation.xml:123
#: data/50-mutter-navigation.xml:129
msgid "Move to workspace left"
msgstr "移动到左侧工作区"
#: data/50-mutter-navigation.xml:132
msgid "Move to workspace right"
msgstr "移动到右侧工作区"
#: data/50-mutter-navigation.xml:135
msgid "Move to workspace above"
msgstr "移动到上层工作区"
#: data/50-mutter-navigation.xml:126
#: data/50-mutter-navigation.xml:138
msgid "Move to workspace below"
msgstr "移动到下层工作区"
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
#: data/50-mutter-system.xml:6
msgid "System"
msgstr "系统"
@@ -176,11 +190,7 @@ msgstr "显示运行命令提示符"
#: data/50-mutter-system.xml:10
msgid "Show the activities overview"
msgstr "显示活动视图"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "还原键盘快捷键"
msgstr "显示活动大纲"
#: data/50-mutter-windows.xml:6
msgid "Windows"
@@ -207,50 +217,54 @@ msgid "Restore window"
msgstr "恢复窗口"
#: data/50-mutter-windows.xml:18
msgid "Toggle shaded state"
msgstr "切换卷起状态"
#: data/50-mutter-windows.xml:20
msgid "Close window"
msgstr "关闭窗口"
#: data/50-mutter-windows.xml:20
#: data/50-mutter-windows.xml:22
msgid "Hide window"
msgstr "隐藏窗口"
#: data/50-mutter-windows.xml:22
#: data/50-mutter-windows.xml:24
msgid "Move window"
msgstr "移动窗口"
#: data/50-mutter-windows.xml:24
#: data/50-mutter-windows.xml:26
msgid "Resize window"
msgstr "改变窗口大小"
#: data/50-mutter-windows.xml:27
#: data/50-mutter-windows.xml:29
msgid "Toggle window on all workspaces or one"
msgstr "在位于所有或仅一个工作区的窗口间切换"
#: data/50-mutter-windows.xml:29
#: data/50-mutter-windows.xml:31
msgid "Raise window if covered, otherwise lower it"
msgstr "如果窗口被其他窗口遮盖,则提升它,否则降低它"
#: data/50-mutter-windows.xml:31
#: data/50-mutter-windows.xml:33
msgid "Raise window above other windows"
msgstr "将窗口提升到其它窗口之上"
#: data/50-mutter-windows.xml:33
#: data/50-mutter-windows.xml:35
msgid "Lower window below other windows"
msgstr "将窗口降低到其它窗口之下"
#: data/50-mutter-windows.xml:35
#: data/50-mutter-windows.xml:37
msgid "Maximize window vertically"
msgstr "垂直最大化窗口"
#: data/50-mutter-windows.xml:37
#: data/50-mutter-windows.xml:39
msgid "Maximize window horizontally"
msgstr "水平最大化窗口"
#: data/50-mutter-windows.xml:41
#: data/50-mutter-windows.xml:43
msgid "View split on left"
msgstr "在左侧查看分割"
#: data/50-mutter-windows.xml:45
#: data/50-mutter-windows.xml:47
msgid "View split on right"
msgstr "在右侧查看分割"
@@ -264,10 +278,10 @@ msgstr "用于修改窗口点击动作的修饰键 met"
#: 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. Its expected that this binding either the default or "
"set to the empty string."
"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."
msgstr ""
"这个键指出的“覆盖”是一种混合窗口概述和应用程序运行的系统。默认要求使用 "
"“Super 键”。可能使用默认或者空白。"
@@ -304,12 +318,12 @@ msgstr "动态管理工作区"
#: data/org.gnome.mutter.gschema.xml.in:41
msgid ""
"Determines whether workspaces are managed dynamically or whether theres a "
"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)."
msgstr ""
"决定工作区动态管理还是静态数量的工作区由 org.gnome.desktop.wm.preferences "
"的 num-workspaces 键确定。"
"决定工作区动态管理还是静态数量的工作区(由 org.gnome.desktop.wm.preferences "
"的 num-workspaces 键确定)。"
# 或者 只在主显示器上显示工作区
#: data/org.gnome.mutter.gschema.xml.in:50
@@ -339,9 +353,9 @@ msgstr "将焦点改变推迟到光标停止移动之后"
#: 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."
"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."
msgstr ""
"如果为 true而聚焦模式为“sloppy”或“mouse”那么进入某个窗口时焦点将不会立即"
"改变,而是等到光标停止移动之后。"
@@ -352,7 +366,7 @@ msgstr "可拖拽的边界宽度"
#: data/org.gnome.mutter.gschema.xml.in:80
msgid ""
"The amount of total draggable borders. If the themes visible borders are "
"The amount of total draggable borders. If the theme's visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
"可拖拽的边界总数。如果主题的可见边界不足,将添加不可见的边界来满足此值。"
@@ -377,50 +391,14 @@ msgid ""
"screen of the monitor."
msgstr "为 true 时,新窗口将总是置于此显示器已激活屏幕的中央。"
#: data/org.gnome.mutter.gschema.xml.in:107
msgid "Enable experimental features"
msgstr "开启实验性特性"
#: data/org.gnome.mutter.gschema.xml.in:108
msgid ""
"To enable experimental features, add the feature keyword to the list. "
"Whether the feature requires restarting the compositor depends on the given "
"feature. Any experimental feature is not required to still be available, or "
"configurable. Dont expect adding anything in this setting to be future "
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
"mutter default to layout logical monitors in a logical pixel coordinate "
"space, while scaling monitor framebuffers instead of window content, to "
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
"enables remote desktop support. To support remote desktop with screen "
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
"screen cast support."
msgstr ""
"要启用实验性特性,请将如下特性关键字添加到列表中。特性是否要求重启合成器取决"
"于特性本身。实验性特性不需启用即可配置和使用。请不要将实验性特性作为未来保障"
"的基础。当前可用的关键字:• “monitor-config-manager” — 使用新的监视器配置系"
"统,用于替代老的系统。启用此特性将打开一个上级配置 API 以用于配置应用程序,并"
"可提供基于每屏幕的逻辑缩放功能。• “scale-monitor-framebuffer” — 让 Mutter 默"
"认基于像素座标排布多屏幕,并同时缩放监视器帧缓冲器而不是窗口内容,以便管理 "
"HiDPI 监视器。该特性不需要重启来生效。• “remote-desktop” — 启用远程桌面支持。"
"要支持远程桌面共享还需要设置“screen-cast”。 • “screen-cast” — 启用屏幕广播"
"支持。"
#: data/org.gnome.mutter.gschema.xml.in:145
#: data/org.gnome.mutter.gschema.xml.in:120
msgid "Select window from tab popup"
msgstr "从 Tab 轮换弹出界面选择窗口"
#: data/org.gnome.mutter.gschema.xml.in:150
#: data/org.gnome.mutter.gschema.xml.in:125
msgid "Cancel tab popup"
msgstr "取消 Tab 轮换弹出"
#: data/org.gnome.mutter.gschema.xml.in:155
msgid "Switch monitor configurations"
msgstr "切换显示器配置"
#: data/org.gnome.mutter.gschema.xml.in:160
msgid "Rotates the built-in monitor configuration"
msgstr "旋转内置显示器配置"
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
msgid "Switch to VT 1"
msgstr "切换到 VT 1"
@@ -469,183 +447,127 @@ msgstr "切换到 VT 11"
msgid "Switch to VT 12"
msgstr "切换到 VT 12"
#: data/org.gnome.mutter.wayland.gschema.xml.in:54
msgid "Re-enable shortcuts"
msgstr "重新启用快捷键"
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
msgid "Allow grabs with Xwayland"
msgstr "允许用 Xwayland 捕获"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
msgid ""
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
"taken into account. 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”."
msgstr ""
"允许考虑运行在 Xwayland 中的 X11 应用程序发起的键盘捕获。在 Wayland 下,为了"
"将 X11 捕获考虑在内,客户端也必须发送一个指定的 X11 ClientMessage 到根窗口,"
"或是包含进“xwayland-grab-access-rules”键成为其中一个白名单应用程序。"
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr "允许发起键盘捕获的 Xwayland 应用程序"
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
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”."
msgstr ""
"Xwayland 下允许或不允许发起 X11 键盘捕获的 X11 窗口,其资源名或资源类的列表。"
"给定 X11 窗口的资源名或资源类可以使用“xprop WM_CLASS”命令获取。支持在键值中使"
"用通配符“*”和“?”。以“!”开头的键值会列入黑名单,它们的优先级高于白名单,用来撤"
"销默认系统列表中的应用程序。默认系统列表包含了下列应用程"
"序:“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” 用户可以使用键绑定键“restore-"
"shortcuts”定义的键盘快捷键来中断进行中的捕获。"
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2260
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "模式切换(组别 %d"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2283
#: src/backends/meta-input-settings.c:1861
msgid "Switch monitor"
msgstr "切换显示器"
#: src/backends/meta-input-settings.c:2285
#: src/backends/meta-input-settings.c:1863
msgid "Show on-screen help"
msgstr "显示在屏帮助"
#: src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:515
msgid "Built-in display"
msgstr "内置显示器"
#: src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:538
msgid "Unknown"
msgstr "未知"
#: src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:540
msgid "Unknown Display"
msgstr "未知的 Display"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: src/backends/meta-monitor-manager.c:933
#: src/backends/meta-monitor-manager.c:548
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: src/compositor/compositor.c:481
#: src/compositor/compositor.c:471
#, c-format
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 "显示器 %2$s 的屏幕 %1$i 上已有另外一个混成窗口管理器正在运行。"
#: src/core/bell.c:194
msgid "Bell event"
msgstr "响铃事件"
#: src/core/display.c:608
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "无法打开 X Window System 显示器“%s”\n"
#: src/core/main.c:190
msgid "Disable connection to session manager"
msgstr "禁止连接到会话管理器"
#: src/core/main.c:196
msgid "Replace the running window manager"
msgstr "替换正在运行的窗口管理器"
#: src/core/main.c:202
msgid "Specify session management ID"
msgstr "指定会话管理 ID"
#: src/core/main.c:207
msgid "X Display to use"
msgstr "要使用的 X Display"
#: src/core/main.c:213
msgid "Initialize session from savefile"
msgstr "从保存文件中初始化会话"
#: src/core/main.c:219
msgid "Make X calls synchronous"
msgstr "使 X 调用同步"
#: src/core/main.c:226
msgid "Run as a wayland compositor"
msgstr "作为 wayland 混成管理器运行"
#: src/core/main.c:232
msgid "Run as a nested compositor"
msgstr "作为嵌套混成器运行"
#: src/core/main.c:240
msgid "Run as a full display server, rather than nested"
msgstr "以完整显示服务器方式运行,而不是以嵌套方式"
#: src/core/main.c:246
msgid "Run with X11 backend"
msgstr "以 X11 后端运行"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:147
#: src/core/delete.c:127
#, c-format
msgid "“%s” is not responding."
msgstr "“%s” 未响应。"
#: src/core/meta-close-dialog-default.c:149
#: src/core/delete.c:129
msgid "Application is not responding."
msgstr "应用程序未响应。"
#: src/core/meta-close-dialog-default.c:154
#: src/core/delete.c:134
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr "您可以选择稍等一会儿,或者强制退出该应用程序。"
#: src/core/meta-close-dialog-default.c:161
#: src/core/delete.c:141
msgid "_Wait"
msgstr "等待(_W)"
#: src/core/delete.c:141
msgid "_Force Quit"
msgstr "强制退出(_F)"
#: src/core/meta-close-dialog-default.c:161
msgid "_Wait"
msgstr "等待(_W)"
#: src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "无法打开 X Window System 显示器“%s”\n"
#: src/core/main.c:182
msgid "Disable connection to session manager"
msgstr "禁止连接到会话管理器"
#: src/core/main.c:188
msgid "Replace the running window manager"
msgstr "替换正在运行的窗口管理器"
#: src/core/main.c:194
msgid "Specify session management ID"
msgstr "指定会话管理 ID"
#: src/core/main.c:199
msgid "X Display to use"
msgstr "要使用的 X Display"
#: src/core/main.c:205
msgid "Initialize session from savefile"
msgstr "从保存文件中初始化会话"
#: src/core/main.c:211
msgid "Make X calls synchronous"
msgstr "使 X 调用同步"
#: src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr "作为 wayland 混成管理器运行"
#: src/core/main.c:224
msgid "Run as a nested compositor"
msgstr "作为嵌套混成器运行"
#: src/core/main.c:232
msgid "Run as a full display server, rather than nested"
msgstr "以完整显示服务器方式运行,而不是以嵌套方式"
#: src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\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"
msgstr ""
"mutter %s\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
"本软件为自由软件版权条款请参见源码\n"
"不存在任何保证即便是对商业性或者特定目的的适应性也不作保证。\n"
"版权所有 (C) 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
"本软件为自由软件版权条款请参见源码\n"
"不存在任何保证即便是对商业性或者特定目的的适应性也不作保证。\n"
#: src/core/mutter.c:53
msgid "Print version"
@@ -660,54 +582,41 @@ msgstr "要使用的 Mutter 插件"
msgid "Workspace %d"
msgstr "工作区 %d"
#: src/core/screen.c:583
#: src/core/screen.c:521
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
"replace the current window manager."
"Display \"%s\" already has a window manager; try using the --replace option "
"to replace the current window manager."
msgstr ""
"Display“%s”已经有一个窗口管理器请尝试使用 --replace 选项替换当前的窗口管理"
"器。"
#: src/core/screen.c:668
#: src/core/screen.c:606
#, c-format
msgid "Screen %d on display %s is invalid\n"
msgid "Screen %d on display '%s' is invalid\n"
msgstr "显示“%2$s”上的屏幕 %1$d 无效\n"
#: src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter 编译的时候没有加入详细模式的支持\n"
#: src/wayland/meta-wayland-tablet-pad.c:567
#: src/wayland/meta-wayland-tablet-pad.c:595
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "模式切换:%d 模式"
#: src/x11/session.c:1818
#: src/x11/session.c:1815
msgid ""
"These windows do not support save current setup and will have to be "
"restarted manually next time you log in."
msgstr "这些窗口不支持“保存当前设置”,并且在您下次登录时,必须手动重启它们。"
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
msgstr ""
"这些窗口不支持 &quot;保存当前设置 &quot; 您在下次登录时,必须手动重启动它"
"们。"
#: src/x11/window-props.c:559
#: src/x11/window-props.c:548
#, c-format
msgid "%s (on %s)"
msgstr "%s于 %s"
#~ msgid "Move window one workspace to the left"
#~ msgstr "将窗口左移一个工作区"
#~ msgid "Move window one workspace to the right"
#~ msgstr "将窗口右移一个工作区"
#~ msgid "Move to workspace left"
#~ msgstr "移动到左侧工作区"
#~ msgid "Move to workspace right"
#~ msgstr "移动到右侧工作区"
#~ msgid "Toggle shaded state"
#~ msgstr "切换卷起状态"
msgstr "%s (于 %s)"
#~ msgid "Failed to scan themes directory: %s\n"
#~ msgstr "扫描主题目录失败:%s\n"

View File

@@ -9,8 +9,8 @@ msgid ""
msgstr ""
"Project-Id-Version: metacity 3.3.4\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
"PO-Revision-Date: 2018-06-09 11:26+0800\n"
"POT-Creation-Date: 2018-03-01 18:57+0000\n"
"PO-Revision-Date: 2018-03-03 15:20+0800\n"
"Last-Translator: Cheng-Chia Tseng <pswo10680@gmail.com>\n"
"Language-Team: Chinese (Taiwan) <zh-l10n@lists.linux.org.tw>\n"
"Language: zh_TW\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Poedit 2.0.8\n"
"X-Generator: Poedit 2.0.6\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -379,27 +379,32 @@ msgid ""
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
"mutter default to layout logical monitors in a logical pixel coordinate "
"space, while scaling monitor framebuffers instead of window content, to "
"manage HiDPI monitors. Does not require a restart."
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
"enables remote desktop support. To support remote desktop with screen "
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
"screen cast support."
msgstr ""
"若要啟用實驗性功能,請將功能關鍵字加入列表中。置於該功能是否須要重新啟動混成"
"器則視給予的功能而定。任何實驗性功能不一定能用、或是可以調整設定。請不要預期"
"在此設定中加入的任何東西未來都能存在。目前可用的關鍵字有: • “scale-monitor-"
"framebuffer” — 讓 mutter 預設採用邏輯像素座標空間的配置邏輯螢幕,而縮放螢幕 "
"framebuffer 則取代視窗內容以管理 HiDPI 螢幕。不須要重新啟動。"
"framebuffer 則取代視窗內容以管理 HiDPI 螢幕。不須要重新啟動。 • “remote-"
"desktop” — 啟用遠端桌面支援。若要支援遠端桌面的螢幕分享則必須也啟用“screen-"
"cast”。• “screen-cast” — 啟用螢幕投放支援。"
#: data/org.gnome.mutter.gschema.xml.in:141
#: data/org.gnome.mutter.gschema.xml.in:145
msgid "Select window from tab popup"
msgstr "從分頁彈出項選擇視窗"
#: data/org.gnome.mutter.gschema.xml.in:146
#: data/org.gnome.mutter.gschema.xml.in:150
msgid "Cancel tab popup"
msgstr "取消分頁彈出項"
#: data/org.gnome.mutter.gschema.xml.in:151
#: data/org.gnome.mutter.gschema.xml.in:155
msgid "Switch monitor configurations"
msgstr "切換螢幕組態"
#: data/org.gnome.mutter.gschema.xml.in:156
#: data/org.gnome.mutter.gschema.xml.in:160
msgid "Rotates the built-in monitor configuration"
msgstr "旋轉切換內建螢幕組態"
@@ -515,22 +520,22 @@ msgstr "切換螢幕"
msgid "Show on-screen help"
msgstr "顯示螢幕求助"
#: src/backends/meta-monitor-manager.c:903
#: src/backends/meta-monitor-manager.c:900
msgid "Built-in display"
msgstr "內建顯示"
#: src/backends/meta-monitor-manager.c:926
#: src/backends/meta-monitor-manager.c:923
msgid "Unknown"
msgstr "不明"
#: src/backends/meta-monitor-manager.c:928
#: src/backends/meta-monitor-manager.c:925
msgid "Unknown Display"
msgstr "不明的顯示器"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: src/backends/meta-monitor-manager.c:936
#: src/backends/meta-monitor-manager.c:933
#, c-format
msgid "%s %s"
msgstr "%s %s"

View File

@@ -11,13 +11,14 @@ test_programs = \
if BUILDOPT_INSTALL_TESTS
stackingdir = $(pkgdatadir)/tests/stacking
dist_stacking_DATA = \
$(srcdir)/tests/stacking/basic-x11.metatest \
$(srcdir)/tests/stacking/basic-wayland.metatest \
$(srcdir)/tests/stacking/minimized.metatest \
$(srcdir)/tests/stacking/mixed-windows.metatest \
$(srcdir)/tests/stacking/set-parent.metatest \
$(srcdir)/tests/stacking/override-redirect.metatest
dist_stacking_DATA = \
tests/stacking/basic-x11.metatest \
tests/stacking/basic-wayland.metatest \
tests/stacking/closed-transient.metatest \
tests/stacking/minimized.metatest \
tests/stacking/mixed-windows.metatest \
tests/stacking/set-parent.metatest \
tests/stacking/override-redirect.metatest
mutter-all.test: tests/mutter-all.test.in
$(AM_V_GEN) sed -e "s|@libexecdir[@]|$(libexecdir)|g" $< > $@.tmp && mv $@.tmp $@
@@ -72,9 +73,6 @@ mutter_test_headless_start_test_LDADD = $(MUTTER_LIBS) libmutter-$(LIBMUTTER_API
.PHONY: run-tests run-test-runner-tests run-unit-tests run-headless-start-test
export G_TEST_SRCDIR = $(abs_srcdir)
export G_TEST_BUILDDIR = $(abs_builddir)
run-test-runner-tests: mutter-test-client mutter-test-runner
./mutter-test-runner $(dist_stacking_DATA)

View File

@@ -159,6 +159,8 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-output.h \
backends/meta-pointer-constraint.c \
backends/meta-pointer-constraint.h \
backends/meta-screen-cast-window.c \
backends/meta-screen-cast-window.h \
backends/meta-settings.c \
backends/meta-settings-private.h \
backends/meta-stage-private.h \
@@ -167,6 +169,9 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-renderer.h \
backends/meta-renderer-view.c \
backends/meta-renderer-view.h \
backends/meta-remote-access-controller.c \
backends/meta-remote-access-controller-private.h \
meta/meta-remote-access-controller.h \
backends/edid-parse.c \
backends/edid.h \
backends/gsm-inhibitor-flag.h \
@@ -289,13 +294,12 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
core/edge-resistance.h \
core/events.c \
core/events.h \
core/errors.c \
meta/errors.h \
core/frame.c \
core/frame.h \
core/meta-gesture-tracker.c \
core/meta-gesture-tracker-private.h \
core/meta-workspace-manager.c \
core/meta-workspace-manager-private.h \
meta/meta-workspace-manager.h \
core/keybindings.c \
core/keybindings-private.h \
core/main-private.h \
@@ -304,6 +308,9 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
core/place.h \
core/prefs.c \
meta/prefs.h \
core/screen.c \
core/screen-private.h \
meta/screen.h \
core/startup-notification.c \
core/startup-notification-private.h \
meta/types.h \
@@ -330,11 +337,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
ui/theme-private.h \
ui/ui.c \
x11/atomnames.h \
x11/meta-x11-display.c \
x11/meta-x11-display-private.h \
meta/meta-x11-display.h \
x11/meta-x11-errors.c \
meta/meta-x11-errors.h \
x11/events.c \
x11/events.h \
x11/group-private.h \
@@ -370,6 +372,10 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
backends/meta-screen-cast-monitor-stream.h \
backends/meta-screen-cast-monitor-stream-src.c \
backends/meta-screen-cast-monitor-stream-src.h \
backends/meta-screen-cast-window-stream-src.c \
backends/meta-screen-cast-window-stream-src.h \
backends/meta-screen-cast-window-stream.c \
backends/meta-screen-cast-window-stream.h \
backends/meta-screen-cast-session.c \
backends/meta-screen-cast-session.h \
backends/meta-screen-cast-stream.c \
@@ -539,6 +545,7 @@ libmutterinclude_headers = \
meta/compositor-mutter.h \
meta/compositor.h \
meta/display.h \
meta/errors.h \
meta/group.h \
meta/keybindings.h \
meta/main.h \
@@ -554,6 +561,7 @@ libmutterinclude_headers = \
meta/meta-idle-monitor.h \
meta/meta-plugin.h \
meta/meta-monitor-manager.h \
meta/meta-remote-access-controller.h \
meta/meta-settings.h \
meta/meta-shaped-texture.h \
meta/meta-shadow-factory.h \
@@ -561,10 +569,8 @@ libmutterinclude_headers = \
meta/meta-window-actor.h \
meta/meta-window-group.h \
meta/meta-window-shape.h \
meta/meta-workspace-manager.h \
meta/meta-x11-display.h \
meta/meta-x11-errors.h \
meta/prefs.h \
meta/screen.h \
meta/theme.h \
meta/types.h \
meta/util.h \

View File

@@ -35,10 +35,12 @@
#include "backends/x11/meta-backend-x11.h"
#include "meta-cursor-tracker-private.h"
#include "meta-stage-private.h"
#include "meta-dbus-login1.h"
#ifdef HAVE_REMOTE_DESKTOP
#include "backends/meta-dbus-session-watcher.h"
#include "backends/meta-screen-cast.h"
#include "backends/meta-remote-access-controller-private.h"
#include "backends/meta-remote-desktop.h"
#endif
@@ -58,7 +60,8 @@ enum
KEYMAP_CHANGED,
KEYMAP_LAYOUT_GROUP_CHANGED,
LAST_DEVICE_CHANGED,
SUSPENDING,
RESUMING,
N_SIGNALS
};
@@ -92,6 +95,7 @@ struct _MetaBackendPrivate
MetaEgl *egl;
MetaSettings *settings;
#ifdef HAVE_REMOTE_DESKTOP
MetaRemoteAccessController *remote_access_controller;
MetaDbusSessionWatcher *dbus_session_watcher;
MetaScreenCast *screen_cast;
MetaRemoteDesktop *remote_desktop;
@@ -112,15 +116,21 @@ struct _MetaBackendPrivate
MetaDnd *dnd;
UpClient *up_client;
guint sleep_signal_id;
GCancellable *cancellable;
GDBusConnection *system_bus;
Login1Manager *logind_proxy;
int inhibit_sleep_fd;
};
typedef struct _MetaBackendPrivate MetaBackendPrivate;
static void
initable_iface_init (GInitableIface *initable_iface);
static void prepare_for_sleep_cb (MetaBackend *backend,
gboolean suspending);
G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaBackend, meta_backend, G_TYPE_OBJECT,
G_ADD_PRIVATE (MetaBackend)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
@@ -139,11 +149,10 @@ meta_backend_finalize (GObject *object)
g_clear_object (&priv->remote_desktop);
g_clear_object (&priv->screen_cast);
g_clear_object (&priv->dbus_session_watcher);
g_clear_object (&priv->remote_access_controller);
#endif
g_object_unref (priv->up_client);
if (priv->sleep_signal_id)
g_dbus_connection_signal_unsubscribe (priv->system_bus, priv->sleep_signal_id);
g_cancellable_cancel (priv->cancellable);
g_clear_object (&priv->cancellable);
g_clear_object (&priv->system_bus);
@@ -450,8 +459,11 @@ meta_backend_real_post_init (MetaBackend *backend)
priv->input_settings = meta_backend_create_input_settings (backend);
#ifdef HAVE_REMOTE_DESKTOP
priv->remote_access_controller =
g_object_new (META_TYPE_REMOTE_ACCESS_CONTROLLER, NULL);
priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER, NULL);
priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
priv->screen_cast = meta_screen_cast_new (backend,
priv->dbus_session_watcher);
priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
#endif /* HAVE_REMOTE_DESKTOP */
@@ -539,6 +551,20 @@ meta_backend_class_init (MetaBackendClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_INT);
signals[SUSPENDING] =
g_signal_new ("suspending",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
signals[RESUMING] =
g_signal_new ("resuming",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
mutter_stage_views = g_getenv ("MUTTER_STAGE_VIEWS");
stage_views_disabled = g_strcmp0 (mutter_stage_views, "0") == 0;
@@ -574,28 +600,81 @@ lid_is_closed_changed_cb (UpClient *client,
}
static void
prepare_for_sleep_cb (GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parameters,
gpointer user_data)
inhibit_sleep (MetaBackend *backend)
{
gboolean suspending;
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
g_autoptr (GVariant) fd_variant = NULL;
g_autoptr (GError) error = NULL;
g_variant_get (parameters, "(b)", &suspending);
if (suspending)
if (priv->inhibit_sleep_fd >= 0)
return;
if (!login1_manager_call_inhibit_sync (priv->logind_proxy,
"sleep",
"Display Server",
"Prepare for suspend",
"delay",
&fd_variant,
priv->cancellable,
&error))
{
g_warning ("Failed to inhibit sleep: %s", error->message);
return;
}
priv->inhibit_sleep_fd = g_variant_get_handle (fd_variant);
}
static void
uninhibit_sleep (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
close (priv->inhibit_sleep_fd);
priv->inhibit_sleep_fd = -1;
}
static void
prepare_for_sleep_cb (MetaBackend *backend,
gboolean suspending)
{
if (suspending) {
g_signal_emit (backend, signals[SUSPENDING], 0);
uninhibit_sleep (backend);
return;
}
inhibit_sleep (backend);
g_signal_emit (backend, signals[RESUMING], 0);
meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
}
static Login1Manager *
get_logind_proxy (GCancellable *cancellable,
GError **error)
{
Login1Manager *proxy;
proxy =
login1_manager_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
"org.freedesktop.login1",
"/org/freedesktop/login1",
cancellable, error);
if (!proxy)
g_prefix_error (error, "Could not get logind proxy: ");
return proxy;
}
static void
system_bus_gotten_cb (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
MetaBackend *backend = META_BACKEND (user_data);
MetaBackendPrivate *priv;
g_autoptr (GError) error = NULL;
GDBusConnection *bus;
bus = g_bus_get_finish (res, NULL);
@@ -604,17 +683,22 @@ system_bus_gotten_cb (GObject *object,
priv = meta_backend_get_instance_private (user_data);
priv->system_bus = bus;
priv->sleep_signal_id =
g_dbus_connection_signal_subscribe (priv->system_bus,
"org.freedesktop.login1",
"org.freedesktop.login1.Manager",
"PrepareForSleep",
"/org/freedesktop/login1",
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
prepare_for_sleep_cb,
NULL,
NULL);
priv->logind_proxy = get_logind_proxy (priv->cancellable, &error);
priv->inhibit_sleep_fd = -1;
if (!priv->logind_proxy)
{
g_warning ("Failed to get logind proxy: %s", error->message);
}
else
{
inhibit_sleep (backend);
g_signal_connect_object (priv->logind_proxy,
"prepare-for-sleep",
G_CALLBACK (prepare_for_sleep_cb),
user_data,
G_CONNECT_SWAPPED);
}
}
static gboolean
@@ -777,6 +861,24 @@ meta_backend_get_remote_desktop (MetaBackend *backend)
}
#endif /* HAVE_REMOTE_DESKTOP */
/**
* meta_backend_get_remote_access_controller:
* @backend: A #MetaBackend
*
* Return Value: (transfer none): The #MetaRemoteAccessController
*/
MetaRemoteAccessController *
meta_backend_get_remote_access_controller (MetaBackend *backend)
{
#ifdef HAVE_REMOTE_DESKTOP
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
return priv->remote_access_controller;
#else
return NULL;
#endif
}
/**
* meta_backend_grab_device: (skip)
*/

View File

@@ -35,6 +35,9 @@
#include "meta-stage-private.h"
G_DEFINE_INTERFACE (MetaHwCursorInhibitor, meta_hw_cursor_inhibitor,
G_TYPE_OBJECT)
struct _MetaCursorRendererPrivate
{
float current_x;
@@ -44,6 +47,8 @@ struct _MetaCursorRendererPrivate
MetaOverlay *stage_overlay;
gboolean handled_by_backend;
guint post_paint_func_id;
GList *hw_cursor_inhibitors;
};
typedef struct _MetaCursorRendererPrivate MetaCursorRendererPrivate;
@@ -55,6 +60,21 @@ static guint signals[LAST_SIGNAL];
G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRenderer, meta_cursor_renderer, G_TYPE_OBJECT);
static gboolean
meta_hw_cursor_inhibitor_is_cursor_sprite_inhibited (MetaHwCursorInhibitor *inhibitor,
MetaCursorSprite *cursor_sprite)
{
MetaHwCursorInhibitorInterface *iface =
META_HW_CURSOR_INHIBITOR_GET_IFACE (inhibitor);
return iface->is_cursor_sprite_inhibited (inhibitor, cursor_sprite);
}
static void
meta_hw_cursor_inhibitor_default_init (MetaHwCursorInhibitorInterface *iface)
{
}
void
meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
@@ -283,3 +303,45 @@ meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer)
return priv->displayed_cursor;
}
void
meta_cursor_renderer_add_hw_cursor_inhibitor (MetaCursorRenderer *renderer,
MetaHwCursorInhibitor *inhibitor)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
priv->hw_cursor_inhibitors = g_list_prepend (priv->hw_cursor_inhibitors,
inhibitor);
}
void
meta_cursor_renderer_remove_hw_cursor_inhibitor (MetaCursorRenderer *renderer,
MetaHwCursorInhibitor *inhibitor)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
priv->hw_cursor_inhibitors = g_list_remove (priv->hw_cursor_inhibitors,
inhibitor);
}
gboolean
meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
GList *l;
for (l = priv->hw_cursor_inhibitors; l; l = l->next)
{
MetaHwCursorInhibitor *inhibitor = l->data;
if (meta_hw_cursor_inhibitor_is_cursor_sprite_inhibited (inhibitor,
cursor_sprite))
return TRUE;
}
return FALSE;
}

View File

@@ -27,8 +27,21 @@
#include <glib-object.h>
#include <meta/screen.h>
#include "meta-cursor.h"
#define META_TYPE_HW_CURSOR_INHIBITOR (meta_hw_cursor_inhibitor_get_type ())
G_DECLARE_INTERFACE (MetaHwCursorInhibitor, meta_hw_cursor_inhibitor,
META, HW_CURSOR_INHIBITOR, GObject)
struct _MetaHwCursorInhibitorInterface
{
GTypeInterface parent_iface;
gboolean (* is_cursor_sprite_inhibited) (MetaHwCursorInhibitor *inhibitor,
MetaCursorSprite *cursor_sprite);
};
#define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaCursorRenderer, meta_cursor_renderer,
META, CURSOR_RENDERER, GObject);
@@ -54,6 +67,15 @@ void meta_cursor_renderer_force_update (MetaCursorRenderer *renderer);
MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer);
void meta_cursor_renderer_add_hw_cursor_inhibitor (MetaCursorRenderer *renderer,
MetaHwCursorInhibitor *inhibitor);
void meta_cursor_renderer_remove_hw_cursor_inhibitor (MetaCursorRenderer *renderer,
MetaHwCursorInhibitor *inhibitor);
gboolean meta_cursor_renderer_is_hw_cursors_inhibited (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);
ClutterRect meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);

View File

@@ -1,292 +0,0 @@
/*
* Copyright 2013, 2018 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#include "config.h"
#include "backends/meta-cursor-sprite-xcursor.h"
#include "backends/meta-cursor.h"
#include "backends/meta-cursor-renderer.h"
#include "clutter/clutter.h"
#include "cogl/cogl.h"
#include "meta/prefs.h"
struct _MetaCursorSpriteXcursor
{
MetaCursorSprite parent;
MetaCursor cursor;
int current_frame;
XcursorImages *xcursor_images;
int theme_scale;
gboolean theme_dirty;
};
G_DEFINE_TYPE (MetaCursorSpriteXcursor, meta_cursor_sprite_xcursor,
META_TYPE_CURSOR_SPRITE)
static const char *
translate_meta_cursor (MetaCursor cursor)
{
switch (cursor)
{
case META_CURSOR_DEFAULT:
return "left_ptr";
case META_CURSOR_NORTH_RESIZE:
return "top_side";
case META_CURSOR_SOUTH_RESIZE:
return "bottom_side";
case META_CURSOR_WEST_RESIZE:
return "left_side";
case META_CURSOR_EAST_RESIZE:
return "right_side";
case META_CURSOR_SE_RESIZE:
return "bottom_right_corner";
case META_CURSOR_SW_RESIZE:
return "bottom_left_corner";
case META_CURSOR_NE_RESIZE:
return "top_right_corner";
case META_CURSOR_NW_RESIZE:
return "top_left_corner";
case META_CURSOR_MOVE_OR_RESIZE_WINDOW:
return "fleur";
case META_CURSOR_BUSY:
return "watch";
case META_CURSOR_DND_IN_DRAG:
return "dnd-none";
case META_CURSOR_DND_MOVE:
return "dnd-move";
case META_CURSOR_DND_COPY:
return "dnd-copy";
case META_CURSOR_DND_UNSUPPORTED_TARGET:
return "dnd-none";
case META_CURSOR_POINTING_HAND:
return "hand2";
case META_CURSOR_CROSSHAIR:
return "crosshair";
case META_CURSOR_IBEAM:
return "xterm";
case META_CURSOR_NONE:
case META_CURSOR_LAST:
break;
}
g_assert_not_reached ();
return NULL;
}
MetaCursor
meta_cursor_sprite_xcursor_get_cursor (MetaCursorSpriteXcursor *sprite_xcursor)
{
return sprite_xcursor->cursor;
}
Cursor
meta_create_x_cursor (Display *xdisplay,
MetaCursor cursor)
{
return XcursorLibraryLoadCursor (xdisplay, translate_meta_cursor (cursor));
}
static XcursorImages *
load_cursor_on_client (MetaCursor cursor, int scale)
{
return XcursorLibraryLoadImages (translate_meta_cursor (cursor),
meta_prefs_get_cursor_theme (),
meta_prefs_get_cursor_size () * scale);
}
static void
load_from_current_xcursor_image (MetaCursorSpriteXcursor *sprite_xcursor)
{
MetaCursorSprite *sprite = META_CURSOR_SPRITE (sprite_xcursor);
XcursorImage *xc_image;
int width, height, rowstride;
CoglPixelFormat cogl_format;
ClutterBackend *clutter_backend;
CoglContext *cogl_context;
CoglTexture2D *texture;
CoglError *error = NULL;
g_assert (!meta_cursor_sprite_get_cogl_texture (sprite));
xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor);
width = (int) xc_image->width;
height = (int) xc_image->height;
rowstride = width * 4;
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
cogl_format = COGL_PIXEL_FORMAT_BGRA_8888;
#else
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888;
#endif
clutter_backend = clutter_get_default_backend ();
cogl_context = clutter_backend_get_cogl_context (clutter_backend);
texture = cogl_texture_2d_new_from_data (cogl_context,
width, height,
cogl_format,
rowstride,
(uint8_t *) xc_image->pixels,
&error);
if (!texture)
{
g_warning ("Failed to allocate cursor texture: %s\n", error->message);
cogl_error_free (error);
}
meta_cursor_sprite_set_texture (sprite,
COGL_TEXTURE (texture),
xc_image->xhot, xc_image->yhot);
g_clear_pointer (&texture, cogl_object_unref);
}
void
meta_cursor_sprite_xcursor_set_theme_scale (MetaCursorSpriteXcursor *sprite_xcursor,
int theme_scale)
{
if (sprite_xcursor->theme_scale != theme_scale)
sprite_xcursor->theme_dirty = TRUE;
sprite_xcursor->theme_scale = theme_scale;
}
static gboolean
meta_cursor_sprite_xcursor_is_animated (MetaCursorSprite *sprite)
{
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
return (sprite_xcursor->xcursor_images &&
sprite_xcursor->xcursor_images->nimage > 1);
}
XcursorImage *
meta_cursor_sprite_xcursor_get_current_image (MetaCursorSpriteXcursor *sprite_xcursor)
{
return sprite_xcursor->xcursor_images->images[sprite_xcursor->current_frame];
}
static void
meta_cursor_sprite_xcursor_tick_frame (MetaCursorSprite *sprite)
{
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
if (!meta_cursor_sprite_is_animated (sprite))
return;
sprite_xcursor->current_frame++;
if (sprite_xcursor->current_frame >= sprite_xcursor->xcursor_images->nimage)
sprite_xcursor->current_frame = 0;
meta_cursor_sprite_clear_texture (sprite);
load_from_current_xcursor_image (sprite_xcursor);
}
static unsigned int
meta_cursor_sprite_xcursor_get_current_frame_time (MetaCursorSprite *sprite)
{
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
XcursorImages *xcursor_images;
g_return_val_if_fail (meta_cursor_sprite_is_animated (sprite), 0);
xcursor_images = sprite_xcursor->xcursor_images;
return xcursor_images->images[sprite_xcursor->current_frame]->delay;
}
static void
load_cursor_from_theme (MetaCursorSprite *sprite)
{
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
g_assert (sprite_xcursor->cursor != META_CURSOR_NONE);
sprite_xcursor->theme_dirty = FALSE;
/* We might be reloading with a different scale. If so clear the old data. */
if (sprite_xcursor->xcursor_images)
{
meta_cursor_sprite_clear_texture (sprite);
XcursorImagesDestroy (sprite_xcursor->xcursor_images);
}
sprite_xcursor->current_frame = 0;
sprite_xcursor->xcursor_images =
load_cursor_on_client (sprite_xcursor->cursor,
sprite_xcursor->theme_scale);
if (!sprite_xcursor->xcursor_images)
g_error ("Could not find cursor. Perhaps set XCURSOR_PATH?");
load_from_current_xcursor_image (sprite_xcursor);
}
static void
meta_cursor_sprite_xcursor_realize_texture (MetaCursorSprite *sprite)
{
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
if (sprite_xcursor->theme_dirty)
load_cursor_from_theme (sprite);
}
MetaCursorSpriteXcursor *
meta_cursor_sprite_xcursor_new (MetaCursor cursor)
{
MetaCursorSpriteXcursor *sprite_xcursor;
sprite_xcursor = g_object_new (META_TYPE_CURSOR_SPRITE_XCURSOR, NULL);
sprite_xcursor->cursor = cursor;
return sprite_xcursor;
}
static void
meta_cursor_sprite_xcursor_finalize (GObject *object)
{
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (object);
g_clear_pointer (&sprite_xcursor->xcursor_images,
XcursorImagesDestroy);
G_OBJECT_CLASS (meta_cursor_sprite_xcursor_parent_class)->finalize (object);
}
static void
meta_cursor_sprite_xcursor_init (MetaCursorSpriteXcursor *sprite_xcursor)
{
sprite_xcursor->theme_dirty = TRUE;
}
static void
meta_cursor_sprite_xcursor_class_init (MetaCursorSpriteXcursorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
MetaCursorSpriteClass *cursor_sprite_class = META_CURSOR_SPRITE_CLASS (klass);
object_class->finalize = meta_cursor_sprite_xcursor_finalize;
cursor_sprite_class->realize_texture =
meta_cursor_sprite_xcursor_realize_texture;
cursor_sprite_class->is_animated = meta_cursor_sprite_xcursor_is_animated;
cursor_sprite_class->tick_frame = meta_cursor_sprite_xcursor_tick_frame;
cursor_sprite_class->get_current_frame_time =
meta_cursor_sprite_xcursor_get_current_frame_time;
}

View File

@@ -1,43 +0,0 @@
/*
* Copyright 2013, 2018 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef META_CURSOR_SPRITE_XCURSOR_H
#define META_CURSOR_SPRITE_XCURSOR_H
#include <glib-object.h>
#include <X11/Xcursor/Xcursor.h>
#include "backends/meta-cursor.h"
#define META_TYPE_CURSOR_SPRITE_XCURSOR meta_cursor_sprite_xcursor_get_type ()
G_DECLARE_FINAL_TYPE (MetaCursorSpriteXcursor, meta_cursor_sprite_xcursor,
META, CURSOR_SPRITE_XCURSOR, MetaCursorSprite)
MetaCursorSpriteXcursor * meta_cursor_sprite_xcursor_new (MetaCursor cursor);
void meta_cursor_sprite_xcursor_set_theme_scale (MetaCursorSpriteXcursor *sprite_xcursor,
int scale);
MetaCursor meta_cursor_sprite_xcursor_get_cursor (MetaCursorSpriteXcursor *sprite_xcusror);
XcursorImage * meta_cursor_sprite_xcursor_get_current_image (MetaCursorSpriteXcursor *sprite_xcursor);
Cursor meta_create_x_cursor (Display *xdisplay,
MetaCursor cursor);
#endif /* META_CURSOR_SPRITE_XCURSOR_H */

View File

@@ -33,7 +33,7 @@
#include <string.h>
#include <meta/main.h>
#include <meta/util.h>
#include <meta/meta-x11-errors.h>
#include <meta/errors.h>
#include <cogl/cogl.h>
#include <clutter/clutter.h>
@@ -43,12 +43,12 @@
#include "meta-backend-private.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
#include "x11/meta-x11-display-private.h"
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
enum {
CURSOR_CHANGED,
CURSOR_MOVED,
LAST_SIGNAL
};
@@ -118,11 +118,15 @@ change_cursor_renderer (MetaCursorTracker *tracker)
static void
sync_cursor (MetaCursorTracker *tracker)
{
if (update_displayed_cursor (tracker))
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
gboolean cursor_changed = FALSE;
cursor_changed = update_displayed_cursor (tracker);
if (update_effective_cursor (tracker))
change_cursor_renderer (tracker);
if (cursor_changed)
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
}
static void
@@ -159,18 +163,27 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
signals[CURSOR_MOVED] = g_signal_new ("cursor-moved",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 2,
G_TYPE_FLOAT,
G_TYPE_FLOAT);
}
/**
* meta_cursor_tracker_get_for_display:
* @display: the #MetaDisplay
* meta_cursor_tracker_get_for_screen:
* @screen: the #MetaScreen
*
* Retrieves the cursor tracker object for @display.
* Retrieves the cursor tracker object for @screen.
*
* Returns: (transfer none):
*/
MetaCursorTracker *
meta_cursor_tracker_get_for_display (MetaDisplay *display)
meta_cursor_tracker_get_for_screen (MetaScreen *screen)
{
MetaBackend *backend = meta_get_backend ();
MetaCursorTracker *tracker = meta_backend_get_cursor_tracker (backend);
@@ -196,13 +209,13 @@ gboolean
meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
XEvent *xevent)
{
MetaX11Display *x11_display = meta_get_display ()->x11_display;
MetaDisplay *display = meta_get_display ();
XFixesCursorNotifyEvent *notify_event;
if (meta_is_wayland_compositor ())
return FALSE;
if (xevent->xany.type != x11_display->xfixes_event_base + XFixesCursorNotify)
if (xevent->xany.type != display->xfixes_event_base + XFixesCursorNotify)
return FALSE;
notify_event = (XFixesCursorNotifyEvent *)xevent;
@@ -335,6 +348,8 @@ meta_cursor_tracker_update_position (MetaCursorTracker *tracker,
g_assert (meta_is_wayland_compositor ());
meta_cursor_renderer_set_position (cursor_renderer, new_x, new_y);
g_signal_emit (tracker, signals[CURSOR_MOVED], 0, new_x, new_y);
}
static void

View File

@@ -24,7 +24,7 @@
gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
MetaCompositor *compositor,
Display *xdisplay,
MetaDisplay *display,
XEvent *xev);
#ifdef HAVE_WAYLAND

View File

@@ -263,11 +263,8 @@ meta_idle_monitor_init (MetaIdleMonitor *monitor)
v = g_dbus_proxy_get_cached_property (monitor->session_proxy,
"InhibitedActions");
if (v)
{
monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
g_variant_unref (v);
}
monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
g_variant_unref (v);
}
/**

View File

@@ -279,34 +279,34 @@ meta_logical_monitor_class_init (MetaLogicalMonitorClass *klass)
}
gboolean
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitor *neighbor,
MetaDisplayDirection neighbor_direction)
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitor *neighbor,
MetaScreenDirection neighbor_direction)
{
switch (neighbor_direction)
{
case META_DISPLAY_RIGHT:
case META_SCREEN_RIGHT:
if (neighbor->rect.x == (logical_monitor->rect.x +
logical_monitor->rect.width) &&
meta_rectangle_vert_overlap (&neighbor->rect,
&logical_monitor->rect))
return TRUE;
break;
case META_DISPLAY_LEFT:
case META_SCREEN_LEFT:
if (logical_monitor->rect.x == (neighbor->rect.x +
neighbor->rect.width) &&
meta_rectangle_vert_overlap (&neighbor->rect,
&logical_monitor->rect))
return TRUE;
break;
case META_DISPLAY_UP:
case META_SCREEN_UP:
if (logical_monitor->rect.y == (neighbor->rect.y +
neighbor->rect.height) &&
meta_rectangle_horiz_overlap (&neighbor->rect,
&logical_monitor->rect))
return TRUE;
break;
case META_DISPLAY_DOWN:
case META_SCREEN_DOWN:
if (neighbor->rect.y == (logical_monitor->rect.y +
logical_monitor->rect.height) &&
meta_rectangle_horiz_overlap (&neighbor->rect,

View File

@@ -90,9 +90,9 @@ MetaRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monit
GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor);
gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitor *neighbor,
MetaDisplayDirection neighbor_dir);
gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitor *neighbor,
MetaScreenDirection neighbor_dir);
void meta_logical_monitor_foreach_crtc (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitorCrtcFunc func,

View File

@@ -40,6 +40,7 @@
#include <libupower-glib/upower.h>
#include "display-private.h"
#include <meta/screen.h>
#include "stack-tracker.h"
#include <meta/meta-monitor-manager.h>
@@ -278,9 +279,9 @@ MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_at (MetaMonitorMana
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
MetaRectangle *rect);
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaDisplayDirection direction);
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaScreenDirection direction);
MetaMonitor * meta_monitor_manager_get_primary_monitor (MetaMonitorManager *manager);

View File

@@ -34,7 +34,7 @@
#include <meta/main.h>
#include "util-private.h"
#include <meta/meta-x11-errors.h>
#include <meta/errors.h>
#include "edid.h"
#include "backends/meta-crtc.h"
#include "backends/meta-logical-monitor.h"
@@ -2492,9 +2492,9 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
}
MetaLogicalMonitor *
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaDisplayDirection direction)
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaScreenDirection direction)
{
GList *l;

View File

@@ -203,13 +203,9 @@ meta_monitor_get_main_output (MetaMonitor *monitor)
gboolean
meta_monitor_is_active (MetaMonitor *monitor)
{
MetaOutput *output;
MetaCrtc *crtc;
MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor);
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
return crtc && crtc->current_mode;
return !!priv->current_mode;
}
gboolean
@@ -1411,6 +1407,18 @@ meta_monitor_get_current_mode (MetaMonitor *monitor)
return priv->current_mode;
}
static gboolean
is_current_mode_known (MetaMonitor *monitor)
{
MetaOutput *output;
MetaCrtc *crtc;
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
return meta_monitor_is_active (monitor) == (crtc && crtc->current_mode);
}
void
meta_monitor_derive_current_mode (MetaMonitor *monitor)
{
@@ -1430,6 +1438,8 @@ meta_monitor_derive_current_mode (MetaMonitor *monitor)
}
priv->current_mode = current_mode;
g_warn_if_fail (is_current_mode_known (monitor));
}
void

View File

@@ -1,7 +1,5 @@
/*
* Wayland Support
*
* Copyright (C) 2016 Red Hat, Inc.
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
@@ -17,27 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#ifndef META_REMOTE_ACCESS_CONTROLLER_PRIVATE_H
#define META_REMOTE_ACCESS_CONTROLLER_PRIVATE_H
#include "meta-wayland-tablet-cursor-surface.h"
#include "meta/meta-remote-access-controller.h"
struct _MetaWaylandTabletCursorSurface
{
MetaWaylandCursorSurface parent;
};
void meta_remote_access_controller_notify_new_handle (MetaRemoteAccessController *controller,
MetaRemoteAccessHandle *handle);
G_DEFINE_TYPE (MetaWaylandTabletCursorSurface,
meta_wayland_tablet_cursor_surface,
META_TYPE_WAYLAND_CURSOR_SURFACE)
void meta_remote_access_handle_notify_stopped (MetaRemoteAccessHandle *handle);
static void
meta_wayland_tablet_cursor_surface_init (MetaWaylandTabletCursorSurface *role)
{
}
static void
meta_wayland_tablet_cursor_surface_class_init (MetaWaylandTabletCursorSurfaceClass *klass)
{
}
#endif /* META_REMOTE_ACCESS_CONTROLLER_PRIVATE_H */

View File

@@ -0,0 +1,130 @@
/*
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#include "backends/meta-remote-access-controller-private.h"
enum
{
HANDLE_STOPPED,
N_HANDLE_SIGNALS
};
static int handle_signals[N_HANDLE_SIGNALS];
enum
{
CONTROLLER_NEW_HANDLE,
N_CONTROLLER_SIGNALS
};
static int controller_signals[N_CONTROLLER_SIGNALS];
typedef struct _MetaRemoteAccessHandlePrivate
{
gboolean has_stopped;
} MetaRemoteAccessHandlePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaRemoteAccessHandle,
meta_remote_access_handle,
G_TYPE_OBJECT)
struct _MetaRemoteAccessController
{
GObject parent;
};
G_DEFINE_TYPE (MetaRemoteAccessController,
meta_remote_access_controller,
G_TYPE_OBJECT)
/**
* meta_remote_access_handle_stop:
* @handle: A #MetaRemoteAccessHandle
*
* Stop the associated remote access session.
*/
void
meta_remote_access_handle_stop (MetaRemoteAccessHandle *handle)
{
MetaRemoteAccessHandlePrivate *priv =
meta_remote_access_handle_get_instance_private (handle);
if (priv->has_stopped)
return;
META_REMOTE_ACCESS_HANDLE_GET_CLASS (handle)->stop (handle);
}
void
meta_remote_access_handle_notify_stopped (MetaRemoteAccessHandle *handle)
{
MetaRemoteAccessHandlePrivate *priv =
meta_remote_access_handle_get_instance_private (handle);
priv->has_stopped = TRUE;
g_signal_emit (handle, handle_signals[HANDLE_STOPPED], 0);
}
void
meta_remote_access_controller_notify_new_handle (MetaRemoteAccessController *controller,
MetaRemoteAccessHandle *handle)
{
g_signal_emit (controller, controller_signals[CONTROLLER_NEW_HANDLE], 0,
handle);
}
static void
meta_remote_access_handle_init (MetaRemoteAccessHandle *handle)
{
}
static void
meta_remote_access_handle_class_init (MetaRemoteAccessHandleClass *klass)
{
handle_signals[HANDLE_STOPPED] =
g_signal_new ("stopped",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
static void
meta_remote_access_controller_init (MetaRemoteAccessController *controller)
{
}
static void
meta_remote_access_controller_class_init (MetaRemoteAccessControllerClass *klass)
{
controller_signals[CONTROLLER_NEW_HANDLE] =
g_signal_new ("new-handle",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1,
META_TYPE_REMOTE_ACCESS_HANDLE);
}

View File

@@ -30,10 +30,12 @@
#include "backends/meta-dbus-session-watcher.h"
#include "backends/meta-screen-cast-session.h"
#include "backends/meta-remote-access-controller-private.h"
#include "backends/native/meta-backend-native.h"
#include "backends/x11/meta-backend-x11.h"
#include "cogl/cogl.h"
#include "meta/meta-backend.h"
#include "meta/errors.h"
#include "meta-dbus-remote-desktop.h"
#define META_REMOTE_DESKTOP_SESSION_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop/Session"
@@ -58,6 +60,8 @@ struct _MetaRemoteDesktopSession
ClutterVirtualInputDevice *virtual_pointer;
ClutterVirtualInputDevice *virtual_keyboard;
ClutterVirtualInputDevice *virtual_touchscreen;
MetaRemoteDesktopSessionHandle *handle;
};
static void
@@ -74,12 +78,41 @@ G_DEFINE_TYPE_WITH_CODE (MetaRemoteDesktopSession,
G_IMPLEMENT_INTERFACE (META_TYPE_DBUS_SESSION,
meta_dbus_session_init_iface))
struct _MetaRemoteDesktopSessionHandle
{
MetaRemoteAccessHandle parent;
MetaRemoteDesktopSession *session;
};
G_DEFINE_TYPE (MetaRemoteDesktopSessionHandle,
meta_remote_desktop_session_handle,
META_TYPE_REMOTE_ACCESS_HANDLE)
static MetaRemoteDesktopSessionHandle *
meta_remote_desktop_session_handle_new (MetaRemoteDesktopSession *session);
static gboolean
meta_remote_desktop_session_is_running (MetaRemoteDesktopSession *session)
{
return !!session->virtual_pointer;
}
static void
init_remote_access_handle (MetaRemoteDesktopSession *session)
{
MetaBackend *backend = meta_get_backend ();
MetaRemoteAccessController *remote_access_controller;
MetaRemoteAccessHandle *remote_access_handle;
session->handle = meta_remote_desktop_session_handle_new (session);
remote_access_controller = meta_backend_get_remote_access_controller (backend);
remote_access_handle = META_REMOTE_ACCESS_HANDLE (session->handle);
meta_remote_access_controller_notify_new_handle (remote_access_controller,
remote_access_handle);
}
static gboolean
meta_remote_desktop_session_start (MetaRemoteDesktopSession *session,
GError **error)
@@ -106,6 +139,8 @@ meta_remote_desktop_session_start (MetaRemoteDesktopSession *session,
clutter_device_manager_create_virtual_device (device_manager,
CLUTTER_TOUCHSCREEN_DEVICE);
init_remote_access_handle (session);
return TRUE;
}
@@ -125,11 +160,20 @@ meta_remote_desktop_session_close (MetaRemoteDesktopSession *session)
g_clear_object (&session->virtual_pointer);
g_clear_object (&session->virtual_keyboard);
g_clear_object (&session->virtual_touchscreen);
meta_dbus_session_notify_closed (META_DBUS_SESSION (session));
meta_dbus_remote_desktop_session_emit_closed (skeleton);
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (session));
if (session->handle)
{
MetaRemoteAccessHandle *remote_access_handle =
META_REMOTE_ACCESS_HANDLE (session->handle);
meta_remote_access_handle_notify_stopped (remote_access_handle);
}
g_object_unref (session);
}
@@ -728,6 +772,7 @@ meta_remote_desktop_session_finalize (GObject *object)
g_assert (!meta_remote_desktop_session_is_running (session));
g_clear_object (&session->handle);
g_free (session->peer_name);
g_free (session->session_id);
g_free (session->object_path);
@@ -762,3 +807,40 @@ meta_remote_desktop_session_class_init (MetaRemoteDesktopSessionClass *klass)
object_class->finalize = meta_remote_desktop_session_finalize;
}
static MetaRemoteDesktopSessionHandle *
meta_remote_desktop_session_handle_new (MetaRemoteDesktopSession *session)
{
MetaRemoteDesktopSessionHandle *handle;
handle = g_object_new (META_TYPE_REMOTE_DESKTOP_SESSION_HANDLE, NULL);
handle->session = session;
return handle;
}
static void
meta_remote_desktop_session_handle_stop (MetaRemoteAccessHandle *handle)
{
MetaRemoteDesktopSession *session;
session = META_REMOTE_DESKTOP_SESSION_HANDLE (handle)->session;
if (!session)
return;
meta_remote_desktop_session_close (session);
}
static void
meta_remote_desktop_session_handle_init (MetaRemoteDesktopSessionHandle *handle)
{
}
static void
meta_remote_desktop_session_handle_class_init (MetaRemoteDesktopSessionHandleClass *klass)
{
MetaRemoteAccessHandleClass *remote_access_handle_class =
META_REMOTE_ACCESS_HANDLE_CLASS (klass);
remote_access_handle_class->stop = meta_remote_desktop_session_handle_stop;
}

View File

@@ -33,6 +33,12 @@ G_DECLARE_FINAL_TYPE (MetaRemoteDesktopSession, meta_remote_desktop_session,
META, REMOTE_DESKTOP_SESSION,
MetaDBusRemoteDesktopSessionSkeleton)
#define META_TYPE_REMOTE_DESKTOP_SESSION_HANDLE (meta_remote_desktop_session_handle_get_type ())
G_DECLARE_FINAL_TYPE (MetaRemoteDesktopSessionHandle,
meta_remote_desktop_session_handle,
META, REMOTE_DESKTOP_SESSION_HANDLE,
MetaRemoteAccessHandle)
char * meta_remote_desktop_session_get_object_path (MetaRemoteDesktopSession *session);
char * meta_remote_desktop_session_get_session_id (MetaRemoteDesktopSession *session);

View File

@@ -37,6 +37,7 @@
#include "backends/meta-cursor-renderer.h"
#include "backends/meta-remote-desktop-session.h"
#include "backends/native/meta-cursor-renderer-native.h"
#include "meta/errors.h"
#include "meta/meta-backend.h"
#define META_REMOTE_DESKTOP_DBUS_SERVICE "org.gnome.Mutter.RemoteDesktop"

View File

@@ -94,6 +94,24 @@ meta_renderer_get_views (MetaRenderer *renderer)
return priv->views;
}
MetaRendererView *
meta_renderer_get_view_from_logical_monitor (MetaRenderer *renderer,
MetaLogicalMonitor *logical_monitor)
{
GList *l;
for (l = meta_renderer_get_views (renderer); l; l = l->next)
{
MetaRendererView *view = l->data;
if (meta_renderer_view_get_logical_monitor (view) ==
logical_monitor)
return view;
}
return NULL;
}
static void
meta_renderer_finalize (GObject *object)
{

View File

@@ -53,4 +53,7 @@ void meta_renderer_set_legacy_view (MetaRenderer *renderer,
GList * meta_renderer_get_views (MetaRenderer *renderer);
MetaRendererView * meta_renderer_get_view_from_logical_monitor (MetaRenderer *renderer,
MetaLogicalMonitor *logical_monitor);
#endif /* META_RENDERER_H */

View File

@@ -24,23 +24,38 @@
#include "backends/meta-screen-cast-monitor-stream-src.h"
#include <spa/buffer/meta.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-cursor-tracker-private.h"
#include "backends/meta-screen-cast-monitor-stream.h"
#include "backends/meta-screen-cast-session.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor.h"
#include "clutter/clutter.h"
#include "clutter/clutter-mutter.h"
#include "core/boxes-private.h"
struct _MetaScreenCastMonitorStreamSrc
{
MetaScreenCastStreamSrc parent;
gulong stage_painted_handler_id;
gboolean cursor_bitmap_invalid;
gulong actors_painted_handler_id;
gulong paint_handler_id;
gulong cursor_moved_handler_id;
gulong cursor_changed_handler_id;
};
G_DEFINE_TYPE (MetaScreenCastMonitorStreamSrc,
meta_screen_cast_monitor_stream_src,
META_TYPE_SCREEN_CAST_STREAM_SRC)
static void
hw_cursor_inhibitor_iface_init (MetaHwCursorInhibitorInterface *iface);
G_DEFINE_TYPE_WITH_CODE (MetaScreenCastMonitorStreamSrc,
meta_screen_cast_monitor_stream_src,
META_TYPE_SCREEN_CAST_STREAM_SRC,
G_IMPLEMENT_INTERFACE (META_TYPE_HW_CURSOR_INHIBITOR,
hw_cursor_inhibitor_iface_init))
static ClutterStage *
get_stage (MetaScreenCastMonitorStreamSrc *monitor_src)
@@ -102,18 +117,164 @@ stage_painted (ClutterActor *actor,
meta_screen_cast_stream_src_maybe_record_frame (src);
}
static MetaBackend *
get_backend (MetaScreenCastMonitorStreamSrc *monitor_src)
{
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src);
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
MetaScreenCastSession *session = meta_screen_cast_stream_get_session (stream);
MetaScreenCast *screen_cast =
meta_screen_cast_session_get_screen_cast (session);
return meta_screen_cast_get_backend (screen_cast);
}
static gboolean
is_cursor_in_stream (MetaScreenCastMonitorStreamSrc *monitor_src)
{
MetaBackend *backend = get_backend (monitor_src);
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
MetaMonitor *monitor;
MetaLogicalMonitor *logical_monitor;
MetaRectangle logical_monitor_layout;
ClutterRect logical_monitor_rect;
MetaCursorSprite *cursor_sprite;
monitor = get_monitor (monitor_src);
logical_monitor = meta_monitor_get_logical_monitor (monitor);
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor_layout);
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
if (cursor_sprite)
{
ClutterRect cursor_rect;
cursor_rect = meta_cursor_renderer_calculate_rect (cursor_renderer,
cursor_sprite);
return clutter_rect_intersection (&cursor_rect,
&logical_monitor_rect,
NULL);
}
else
{
ClutterPoint cursor_position;
cursor_position = meta_cursor_renderer_get_position (cursor_renderer);
return clutter_rect_contains_point (&logical_monitor_rect,
&cursor_position);
}
}
static void
sync_cursor_state (MetaScreenCastMonitorStreamSrc *monitor_src)
{
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src);
ClutterStage *stage = get_stage (monitor_src);
if (!is_cursor_in_stream (monitor_src))
return;
if (clutter_stage_is_redraw_queued (stage))
return;
meta_screen_cast_stream_src_maybe_record_frame (src);
}
static void
cursor_moved (MetaCursorTracker *cursor_tracker,
float x,
float y,
MetaScreenCastMonitorStreamSrc *monitor_src)
{
sync_cursor_state (monitor_src);
}
static void
cursor_changed (MetaCursorTracker *cursor_tracker,
MetaScreenCastMonitorStreamSrc *monitor_src)
{
monitor_src->cursor_bitmap_invalid = TRUE;
sync_cursor_state (monitor_src);
}
static MetaCursorRenderer *
get_cursor_renderer (MetaScreenCastMonitorStreamSrc *monitor_src)
{
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (monitor_src);
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
MetaScreenCastSession *session = meta_screen_cast_stream_get_session (stream);
MetaScreenCast *screen_cast =
meta_screen_cast_session_get_screen_cast (session);
MetaBackend *backend = meta_screen_cast_get_backend (screen_cast);
return meta_backend_get_cursor_renderer (backend);
}
static void
inhibit_hw_cursor (MetaScreenCastMonitorStreamSrc *monitor_src)
{
MetaCursorRenderer *cursor_renderer;
MetaHwCursorInhibitor *inhibitor;
cursor_renderer = get_cursor_renderer (monitor_src);
inhibitor = META_HW_CURSOR_INHIBITOR (monitor_src);
meta_cursor_renderer_add_hw_cursor_inhibitor (cursor_renderer, inhibitor);
}
static void
uninhibit_hw_cursor (MetaScreenCastMonitorStreamSrc *monitor_src)
{
MetaCursorRenderer *cursor_renderer;
MetaHwCursorInhibitor *inhibitor;
cursor_renderer = get_cursor_renderer (monitor_src);
inhibitor = META_HW_CURSOR_INHIBITOR (monitor_src);
meta_cursor_renderer_remove_hw_cursor_inhibitor (cursor_renderer, inhibitor);
}
static void
meta_screen_cast_monitor_stream_src_enable (MetaScreenCastStreamSrc *src)
{
MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
MetaBackend *backend = get_backend (monitor_src);
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
ClutterStage *stage;
MetaScreenCastStream *stream;
stream = meta_screen_cast_stream_src_get_stream (src);
stage = get_stage (monitor_src);
monitor_src->stage_painted_handler_id =
g_signal_connect_after (stage, "paint",
G_CALLBACK (stage_painted),
monitor_src);
switch (meta_screen_cast_stream_get_cursor_mode (stream))
{
case META_SCREEN_CAST_CURSOR_MODE_METADATA:
monitor_src->cursor_moved_handler_id =
g_signal_connect_after (cursor_tracker, "cursor-moved",
G_CALLBACK (cursor_moved),
monitor_src);
monitor_src->cursor_changed_handler_id =
g_signal_connect_after (cursor_tracker, "cursor-changed",
G_CALLBACK (cursor_changed),
monitor_src);
/* Intentional fall-through */
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
monitor_src->actors_painted_handler_id =
g_signal_connect (stage, "actors-painted",
G_CALLBACK (stage_painted),
monitor_src);
break;
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
inhibit_hw_cursor (monitor_src);
monitor_src->paint_handler_id =
g_signal_connect_after (stage, "paint",
G_CALLBACK (stage_painted),
monitor_src);
break;
}
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
}
@@ -122,14 +283,43 @@ meta_screen_cast_monitor_stream_src_disable (MetaScreenCastStreamSrc *src)
{
MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
MetaBackend *backend = get_backend (monitor_src);
MetaCursorTracker *cursor_tracker = meta_backend_get_cursor_tracker (backend);
ClutterStage *stage;
stage = get_stage (monitor_src);
g_signal_handler_disconnect (stage, monitor_src->stage_painted_handler_id);
monitor_src->stage_painted_handler_id = 0;
if (monitor_src->actors_painted_handler_id)
{
g_signal_handler_disconnect (stage,
monitor_src->actors_painted_handler_id);
monitor_src->actors_painted_handler_id = 0;
}
if (monitor_src->paint_handler_id)
{
g_signal_handler_disconnect (stage,
monitor_src->paint_handler_id);
monitor_src->paint_handler_id = 0;
uninhibit_hw_cursor (monitor_src);
}
if (monitor_src->cursor_moved_handler_id)
{
g_signal_handler_disconnect (cursor_tracker,
monitor_src->cursor_moved_handler_id);
monitor_src->cursor_moved_handler_id = 0;
}
if (monitor_src->cursor_changed_handler_id)
{
g_signal_handler_disconnect (cursor_tracker,
monitor_src->cursor_changed_handler_id);
monitor_src->cursor_changed_handler_id = 0;
}
}
static void
static gboolean
meta_screen_cast_monitor_stream_src_record_frame (MetaScreenCastStreamSrc *src,
uint8_t *data)
{
@@ -140,9 +330,226 @@ meta_screen_cast_monitor_stream_src_record_frame (MetaScreenCastStreamSrc *src,
MetaLogicalMonitor *logical_monitor;
stage = get_stage (monitor_src);
if (!clutter_stage_is_redraw_queued (stage))
return FALSE;
monitor = get_monitor (monitor_src);
logical_monitor = meta_monitor_get_logical_monitor (monitor);
clutter_stage_capture_into (stage, FALSE, &logical_monitor->rect, data);
return TRUE;
}
static gboolean
draw_cursor_sprite_via_offscreen (MetaScreenCastMonitorStreamSrc *monitor_src,
CoglTexture *cursor_texture,
int bitmap_width,
int bitmap_height,
uint32_t *bitmap_data,
GError **error)
{
MetaBackend *backend = get_backend (monitor_src);
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
CoglContext *cogl_context =
clutter_backend_get_cogl_context (clutter_backend);
CoglTexture2D *bitmap_texture;
CoglOffscreen *offscreen;
CoglFramebuffer *fb;
CoglPipeline *pipeline;
CoglColor clear_color;
bitmap_texture = cogl_texture_2d_new_with_size (cogl_context,
bitmap_width, bitmap_height);
cogl_primitive_texture_set_auto_mipmap (COGL_PRIMITIVE_TEXTURE (bitmap_texture),
FALSE);
if (!cogl_texture_allocate (COGL_TEXTURE (bitmap_texture), error))
{
cogl_object_unref (bitmap_texture);
return FALSE;
}
offscreen = cogl_offscreen_new_with_texture (COGL_TEXTURE (bitmap_texture));
fb = COGL_FRAMEBUFFER (offscreen);
cogl_object_unref (bitmap_texture);
if (!cogl_framebuffer_allocate (fb, error))
{
cogl_object_unref (fb);
return FALSE;
}
pipeline = cogl_pipeline_new (cogl_context);
cogl_pipeline_set_layer_texture (pipeline, 0, cursor_texture);
cogl_pipeline_set_layer_filters (pipeline, 0,
COGL_PIPELINE_FILTER_LINEAR,
COGL_PIPELINE_FILTER_LINEAR);
cogl_color_init_from_4ub (&clear_color, 0, 0, 0, 0);
cogl_framebuffer_clear (fb, COGL_BUFFER_BIT_COLOR, &clear_color);
cogl_framebuffer_draw_rectangle (fb, pipeline,
-1, 1, 1, -1);
cogl_object_unref (pipeline);
cogl_framebuffer_read_pixels (fb,
0, 0,
bitmap_width, bitmap_height,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
(uint8_t *) bitmap_data);
cogl_object_unref (fb);
return TRUE;
}
static void
meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *src,
struct spa_meta_cursor *spa_meta_cursor)
{
MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (src);
MetaBackend *backend = get_backend (monitor_src);
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaSpaType *spa_type = meta_screen_cast_stream_src_get_spa_type (src);
GError *error = NULL;
MetaCursorSprite *cursor_sprite;
CoglTexture *cursor_texture;
MetaMonitor *monitor;
MetaLogicalMonitor *logical_monitor;
MetaRectangle logical_monitor_layout;
ClutterRect logical_monitor_rect;
MetaRendererView *view;
float view_scale;
ClutterPoint cursor_position;
struct spa_meta_bitmap *spa_meta_bitmap;
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
if (cursor_sprite)
cursor_texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
else
cursor_texture = NULL;
if (!is_cursor_in_stream (monitor_src))
{
spa_meta_cursor->id = 0;
return;
}
monitor = get_monitor (monitor_src);
logical_monitor = meta_monitor_get_logical_monitor (monitor);
logical_monitor_layout = meta_logical_monitor_get_layout (logical_monitor);
logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor_layout);
view = meta_renderer_get_view_from_logical_monitor (renderer,
logical_monitor);
if (view)
view_scale = clutter_stage_view_get_scale (CLUTTER_STAGE_VIEW (view));
else
view_scale = 1.0;
cursor_position = meta_cursor_renderer_get_position (cursor_renderer);
cursor_position.x -= logical_monitor_rect.origin.x;
cursor_position.y -= logical_monitor_rect.origin.y;
cursor_position.x *= view_scale;
cursor_position.y *= view_scale;
spa_meta_cursor->id = 1;
spa_meta_cursor->position.x = (int32_t) roundf (cursor_position.x);
spa_meta_cursor->position.y = (int32_t) roundf (cursor_position.y);
if (!monitor_src->cursor_bitmap_invalid)
{
spa_meta_cursor->hotspot.x = 0;
spa_meta_cursor->hotspot.y = 0;
spa_meta_cursor->bitmap_offset = 0;
return;
}
monitor_src->cursor_bitmap_invalid = FALSE;
spa_meta_cursor->bitmap_offset = sizeof (struct spa_meta_cursor);
spa_meta_bitmap = SPA_MEMBER (spa_meta_cursor,
spa_meta_cursor->bitmap_offset,
struct spa_meta_bitmap);
spa_meta_bitmap->format = spa_type->video_format.RGBA;
spa_meta_bitmap->offset = sizeof (struct spa_meta_bitmap);
if (cursor_texture)
{
float cursor_scale;
float bitmap_scale;
int hotspot_x, hotspot_y;
int texture_width, texture_height;
int bitmap_width, bitmap_height;
uint32_t *bitmap_data;
cursor_scale = meta_cursor_sprite_get_texture_scale (cursor_sprite);
bitmap_scale = view_scale * cursor_scale;
meta_cursor_sprite_get_hotspot (cursor_sprite, &hotspot_x, &hotspot_y);
spa_meta_cursor->hotspot.x = (int32_t) roundf (hotspot_x * bitmap_scale);
spa_meta_cursor->hotspot.y = (int32_t) roundf (hotspot_y * bitmap_scale);
texture_width = cogl_texture_get_width (cursor_texture);
texture_height = cogl_texture_get_height (cursor_texture);
bitmap_width = texture_width * bitmap_scale;
bitmap_height = texture_height * bitmap_scale;
spa_meta_bitmap->size.width = bitmap_width;
spa_meta_bitmap->size.height = bitmap_height;
spa_meta_bitmap->stride = bitmap_width * 4;
bitmap_data = SPA_MEMBER (spa_meta_bitmap,
spa_meta_bitmap->offset,
uint32_t);
if (texture_width == bitmap_width &&
texture_height == bitmap_height)
{
cogl_texture_get_data (cursor_texture,
COGL_PIXEL_FORMAT_RGBA_8888_PRE,
texture_width * 4,
(uint8_t *) bitmap_data);
}
else
{
if (!draw_cursor_sprite_via_offscreen (monitor_src,
cursor_texture,
bitmap_width,
bitmap_height,
bitmap_data,
&error))
{
g_warning ("Failed to draw cursor via offscreen: %s",
error->message);
g_error_free (error);
spa_meta_cursor->id = 0;
}
}
}
else
{
spa_meta_cursor->hotspot.x = 0;
spa_meta_cursor->hotspot.y = 0;
*spa_meta_bitmap = (struct spa_meta_bitmap) { 0 };
}
}
static gboolean
meta_screen_cast_monitor_stream_src_is_cursor_sprite_inhibited (MetaHwCursorInhibitor *inhibitor,
MetaCursorSprite *cursor_sprite)
{
MetaScreenCastMonitorStreamSrc *monitor_src =
META_SCREEN_CAST_MONITOR_STREAM_SRC (inhibitor);
return is_cursor_in_stream (monitor_src);
}
static void
hw_cursor_inhibitor_iface_init (MetaHwCursorInhibitorInterface *iface)
{
iface->is_cursor_sprite_inhibited =
meta_screen_cast_monitor_stream_src_is_cursor_sprite_inhibited;
}
MetaScreenCastMonitorStreamSrc *
@@ -157,6 +564,7 @@ meta_screen_cast_monitor_stream_src_new (MetaScreenCastMonitorStream *monitor_s
static void
meta_screen_cast_monitor_stream_src_init (MetaScreenCastMonitorStreamSrc *monitor_src)
{
monitor_src->cursor_bitmap_invalid = TRUE;
}
static void
@@ -169,4 +577,6 @@ meta_screen_cast_monitor_stream_src_class_init (MetaScreenCastMonitorStreamSrcCl
src_class->enable = meta_screen_cast_monitor_stream_src_enable;
src_class->disable = meta_screen_cast_monitor_stream_src_disable;
src_class->record_frame = meta_screen_cast_monitor_stream_src_record_frame;
src_class->set_cursor_metadata =
meta_screen_cast_monitor_stream_src_set_cursor_metadata;
}

View File

@@ -105,12 +105,15 @@ meta_screen_cast_monitor_stream_get_monitor (MetaScreenCastMonitorStream *monito
}
MetaScreenCastMonitorStream *
meta_screen_cast_monitor_stream_new (GDBusConnection *connection,
MetaMonitorManager *monitor_manager,
MetaMonitor *monitor,
ClutterStage *stage,
GError **error)
meta_screen_cast_monitor_stream_new (MetaScreenCastSession *session,
GDBusConnection *connection,
MetaMonitor *monitor,
ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode,
GError **error)
{
MetaGpu *gpu = meta_monitor_get_gpu (monitor);
MetaMonitorManager *monitor_manager = meta_gpu_get_monitor_manager (gpu);
MetaScreenCastMonitorStream *monitor_stream;
if (!meta_monitor_is_active (monitor))
@@ -122,7 +125,9 @@ meta_screen_cast_monitor_stream_new (GDBusConnection *connection,
monitor_stream = g_initable_new (META_TYPE_SCREEN_CAST_MONITOR_STREAM,
NULL,
error,
"session", session,
"connection", connection,
"cursor-mode", cursor_mode,
"monitor", monitor,
NULL);
if (!monitor_stream)

View File

@@ -27,6 +27,7 @@
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-screen-cast-stream.h"
#include "backends/meta-screen-cast.h"
#define META_TYPE_SCREEN_CAST_MONITOR_STREAM (meta_screen_cast_monitor_stream_get_type ())
G_DECLARE_FINAL_TYPE (MetaScreenCastMonitorStream,
@@ -34,11 +35,12 @@ G_DECLARE_FINAL_TYPE (MetaScreenCastMonitorStream,
META, SCREEN_CAST_MONITOR_STREAM,
MetaScreenCastStream)
MetaScreenCastMonitorStream * meta_screen_cast_monitor_stream_new (GDBusConnection *connection,
MetaMonitorManager *monitor_manager,
MetaMonitor *monitor,
ClutterStage *stage,
GError **error);
MetaScreenCastMonitorStream * meta_screen_cast_monitor_stream_new (MetaScreenCastSession *session,
GDBusConnection *connection,
MetaMonitor *monitor,
ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode,
GError **error);
ClutterStage * meta_screen_cast_monitor_stream_get_stage (MetaScreenCastMonitorStream *monitor_stream);

View File

@@ -26,8 +26,11 @@
#include "backends/meta-backend-private.h"
#include "backends/meta-dbus-session-watcher.h"
#include "backends/meta-remote-access-controller-private.h"
#include "backends/meta-screen-cast-monitor-stream.h"
#include "backends/meta-screen-cast-stream.h"
#include "backends/meta-screen-cast-window-stream.h"
#include "core/display-private.h"
#define META_SCREEN_CAST_SESSION_DBUS_PATH "/org/gnome/Mutter/ScreenCast/Session"
@@ -35,12 +38,16 @@ struct _MetaScreenCastSession
{
MetaDBusScreenCastSessionSkeleton parent;
MetaScreenCast *screen_cast;
char *peer_name;
MetaScreenCastSessionType session_type;
char *object_path;
GList *streams;
MetaScreenCastSessionHandle *handle;
};
static void
@@ -57,6 +64,35 @@ G_DEFINE_TYPE_WITH_CODE (MetaScreenCastSession,
G_IMPLEMENT_INTERFACE (META_TYPE_DBUS_SESSION,
meta_dbus_session_init_iface))
struct _MetaScreenCastSessionHandle
{
MetaRemoteAccessHandle parent;
MetaScreenCastSession *session;
};
G_DEFINE_TYPE (MetaScreenCastSessionHandle,
meta_screen_cast_session_handle,
META_TYPE_REMOTE_ACCESS_HANDLE)
static MetaScreenCastSessionHandle *
meta_screen_cast_session_handle_new (MetaScreenCastSession *session);
static void
init_remote_access_handle (MetaScreenCastSession *session)
{
MetaBackend *backend = meta_get_backend ();
MetaRemoteAccessController *remote_access_controller;
MetaRemoteAccessHandle *remote_access_handle;
session->handle = meta_screen_cast_session_handle_new (session);
remote_access_controller = meta_backend_get_remote_access_controller (backend);
remote_access_handle = META_REMOTE_ACCESS_HANDLE (session->handle);
meta_remote_access_controller_notify_new_handle (remote_access_controller,
remote_access_handle);
}
gboolean
meta_screen_cast_session_start (MetaScreenCastSession *session,
GError **error)
@@ -71,6 +107,8 @@ meta_screen_cast_session_start (MetaScreenCastSession *session,
return FALSE;
}
init_remote_access_handle (session);
return TRUE;
}
@@ -94,6 +132,14 @@ meta_screen_cast_session_close (MetaScreenCastSession *session)
g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (session));
if (session->handle)
{
MetaRemoteAccessHandle *remote_access_handle =
META_REMOTE_ACCESS_HANDLE (session->handle);
meta_remote_access_handle_notify_stopped (remote_access_handle);
}
g_object_unref (session);
}
@@ -115,6 +161,12 @@ meta_screen_cast_session_get_stream (MetaScreenCastSession *session,
return NULL;
}
MetaScreenCast *
meta_screen_cast_session_get_screen_cast (MetaScreenCastSession *session)
{
return session->screen_cast;
}
char *
meta_screen_cast_session_get_object_path (MetaScreenCastSession *session)
{
@@ -210,6 +262,20 @@ on_stream_closed (MetaScreenCastStream *stream,
meta_screen_cast_session_close (session);
}
static gboolean
is_valid_cursor_mode (MetaScreenCastCursorMode cursor_mode)
{
switch (cursor_mode)
{
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
case META_SCREEN_CAST_CURSOR_MODE_METADATA:
return TRUE;
}
return FALSE;
}
static gboolean
handle_record_monitor (MetaDBusScreenCastSession *skeleton,
GDBusMethodInvocation *invocation,
@@ -223,6 +289,7 @@ handle_record_monitor (MetaDBusScreenCastSession *skeleton,
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
MetaMonitor *monitor;
MetaScreenCastCursorMode cursor_mode;
ClutterStage *stage;
GError *error = NULL;
MetaScreenCastMonitorStream *monitor_stream;
@@ -254,12 +321,28 @@ handle_record_monitor (MetaDBusScreenCastSession *skeleton,
return TRUE;
}
if (!g_variant_lookup (properties_variant, "cursor-mode", "u", &cursor_mode))
{
cursor_mode = META_SCREEN_CAST_CURSOR_MODE_HIDDEN;
}
else
{
if (!is_valid_cursor_mode (cursor_mode))
{
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Unknown cursor mode");
return TRUE;
}
}
stage = CLUTTER_STAGE (meta_backend_get_stage (backend));
monitor_stream = meta_screen_cast_monitor_stream_new (connection,
monitor_manager,
monitor_stream = meta_screen_cast_monitor_stream_new (session,
connection,
monitor,
stage,
cursor_mode,
&error);
if (!monitor_stream)
{
@@ -291,6 +374,15 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
GVariant *properties_variant)
{
MetaScreenCastSession *session = META_SCREEN_CAST_SESSION (skeleton);
GDBusInterfaceSkeleton *interface_skeleton;
GDBusConnection *connection;
MetaWindow *window;
GError *error = NULL;
MetaDisplay *display;
GVariant *window_id_variant = NULL;
MetaScreenCastWindowStream *window_stream;
MetaScreenCastStream *stream;
char *stream_path;
if (!check_permission (session, invocation))
{
@@ -300,9 +392,60 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
return TRUE;
}
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Recording a window not yet supported");
if (properties_variant)
window_id_variant = g_variant_lookup_value (properties_variant,
"window-id",
G_VARIANT_TYPE ("t"));
display = meta_get_display ();
if (window_id_variant)
{
uint64_t window_id;
g_variant_get (window_id_variant, "t", &window_id);
window = meta_display_get_window_from_id (display, window_id);
}
else
{
window = meta_display_get_focus_window (display);
}
if (!window)
{
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Window not found");
return TRUE;
}
interface_skeleton = G_DBUS_INTERFACE_SKELETON (skeleton);
connection = g_dbus_interface_skeleton_get_connection (interface_skeleton);
window_stream = meta_screen_cast_window_stream_new (session,
connection,
window,
&error);
if (!window_stream)
{
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Failed to record window: %s",
error->message);
g_error_free (error);
return TRUE;
}
stream = META_SCREEN_CAST_STREAM (window_stream);
stream_path = meta_screen_cast_stream_get_object_path (stream);
session->streams = g_list_append (session->streams, stream);
g_signal_connect (stream, "closed", G_CALLBACK (on_stream_closed), session);
meta_dbus_screen_cast_session_complete_record_window (skeleton,
invocation,
stream_path);
return TRUE;
}
@@ -339,6 +482,7 @@ meta_screen_cast_session_new (MetaScreenCast *screen_cast,
static unsigned int global_session_number = 0;
session = g_object_new (META_TYPE_SCREEN_CAST_SESSION, NULL);
session->screen_cast = screen_cast;
session->session_type = session_type;
session->peer_name = g_strdup (peer_name);
session->object_path =
@@ -361,6 +505,7 @@ meta_screen_cast_session_finalize (GObject *object)
{
MetaScreenCastSession *session = META_SCREEN_CAST_SESSION (object);
g_clear_object (&session->handle);
g_free (session->peer_name);
g_free (session->object_path);
@@ -379,3 +524,40 @@ meta_screen_cast_session_class_init (MetaScreenCastSessionClass *klass)
object_class->finalize = meta_screen_cast_session_finalize;
}
static MetaScreenCastSessionHandle *
meta_screen_cast_session_handle_new (MetaScreenCastSession *session)
{
MetaScreenCastSessionHandle *handle;
handle = g_object_new (META_TYPE_SCREEN_CAST_SESSION_HANDLE, NULL);
handle->session = session;
return handle;
}
static void
meta_screen_cast_session_handle_stop (MetaRemoteAccessHandle *handle)
{
MetaScreenCastSession *session;
session = META_SCREEN_CAST_SESSION_HANDLE (handle)->session;
if (!session)
return;
meta_screen_cast_session_close (session);
}
static void
meta_screen_cast_session_handle_init (MetaScreenCastSessionHandle *handle)
{
}
static void
meta_screen_cast_session_handle_class_init (MetaScreenCastSessionHandleClass *klass)
{
MetaRemoteAccessHandleClass *remote_access_handle_class =
META_REMOTE_ACCESS_HANDLE_CLASS (klass);
remote_access_handle_class->stop = meta_screen_cast_session_handle_stop;
}

View File

@@ -26,6 +26,7 @@
#include "backends/meta-screen-cast.h"
#include "backends/meta-screen-cast-stream.h"
#include "meta/meta-remote-access-controller.h"
typedef enum _MetaScreenCastSessionType
{
@@ -38,6 +39,12 @@ G_DECLARE_FINAL_TYPE (MetaScreenCastSession, meta_screen_cast_session,
META, SCREEN_CAST_SESSION,
MetaDBusScreenCastSessionSkeleton)
#define META_TYPE_SCREEN_CAST_SESSION_HANDLE (meta_screen_cast_session_handle_get_type ())
G_DECLARE_FINAL_TYPE (MetaScreenCastSessionHandle,
meta_screen_cast_session_handle,
META, SCREEN_CAST_SESSION_HANDLE,
MetaRemoteAccessHandle)
char * meta_screen_cast_session_get_object_path (MetaScreenCastSession *session);
MetaScreenCastSession * meta_screen_cast_session_new (MetaScreenCast *screen_cast,
@@ -53,4 +60,6 @@ void meta_screen_cast_session_close (MetaScreenCastSession *session);
MetaScreenCastStream * meta_screen_cast_session_get_stream (MetaScreenCastSession *session,
const char *path);
MetaScreenCast * meta_screen_cast_session_get_screen_cast (MetaScreenCastSession *session);
#endif /* META_SCREEN_CAST_SESSION_H */

View File

@@ -40,6 +40,10 @@
#define PRIVATE_OWNER_FROM_FIELD(TypeName, field_ptr, field_name) \
(TypeName *)((guint8 *)(field_ptr) - G_PRIVATE_OFFSET (TypeName, field_name))
#define CURSOR_META_SIZE(width, height) \
(sizeof (struct spa_meta_cursor) + \
sizeof (struct spa_meta_bitmap) + width * height * 4)
enum
{
PROP_0,
@@ -57,14 +61,6 @@ enum
static guint signals[N_SIGNALS];
typedef struct _MetaSpaType
{
struct spa_type_media_type media_type;
struct spa_type_media_subtype media_subtype;
struct spa_type_format_video format_video;
struct spa_type_video_format video_format;
} MetaSpaType;
typedef struct _MetaPipeWireSource
{
GSource base;
@@ -91,6 +87,9 @@ typedef struct _MetaScreenCastStreamSrcPrivate
struct spa_video_info_raw video_format;
uint64_t last_frame_timestamp_us;
int stream_width;
int stream_height;
} MetaScreenCastStreamSrcPrivate;
static void
@@ -117,14 +116,81 @@ meta_screen_cast_stream_src_get_specs (MetaScreenCastStreamSrc *src,
klass->get_specs (src, width, height, frame_rate);
}
static void
static gboolean
meta_screen_cast_stream_src_get_videocrop (MetaScreenCastStreamSrc *src,
MetaRectangle *crop_rect)
{
MetaScreenCastStreamSrcClass *klass =
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
if (klass->get_videocrop)
return klass->get_videocrop (src, crop_rect);
return FALSE;
}
static gboolean
meta_screen_cast_stream_src_record_frame (MetaScreenCastStreamSrc *src,
uint8_t *data)
{
MetaScreenCastStreamSrcClass *klass =
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
klass->record_frame (src, data);
return klass->record_frame (src, data);
}
static void
meta_screen_cast_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc *src,
struct spa_meta_cursor *spa_meta_cursor)
{
MetaScreenCastStreamSrcClass *klass =
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
if (klass->set_cursor_metadata)
klass->set_cursor_metadata (src, spa_meta_cursor);
}
MetaSpaType *
meta_screen_cast_stream_src_get_spa_type (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
return &priv->spa_type;
}
static void
add_cursor_metadata (MetaScreenCastStreamSrc *src,
struct spa_buffer *spa_buffer)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
MetaSpaType *spa_type = &priv->spa_type;
struct spa_meta_cursor *spa_meta_cursor;
spa_meta_cursor = spa_buffer_find_meta (spa_buffer, spa_type->meta_cursor);
if (spa_meta_cursor)
meta_screen_cast_stream_src_set_cursor_metadata (src, spa_meta_cursor);
}
static void
maybe_record_cursor (MetaScreenCastStreamSrc *src,
struct spa_buffer *spa_buffer,
uint8_t *data)
{
MetaScreenCastStream *stream = meta_screen_cast_stream_src_get_stream (src);
switch (meta_screen_cast_stream_get_cursor_mode (stream))
{
case META_SCREEN_CAST_CURSOR_MODE_HIDDEN:
case META_SCREEN_CAST_CURSOR_MODE_EMBEDDED:
return;
case META_SCREEN_CAST_CURSOR_MODE_METADATA:
add_cursor_metadata (src, spa_buffer);
return;
}
g_assert_not_reached ();
}
void
@@ -132,8 +198,9 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
uint32_t buffer_id;
struct spa_buffer *buffer;
MetaRectangle crop_rect;
struct pw_buffer *buffer;
struct spa_buffer *spa_buffer;
uint8_t *map = NULL;
uint8_t *data;
uint64_t now_us;
@@ -148,22 +215,24 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
if (!priv->pipewire_stream)
return;
buffer_id = pw_stream_get_empty_buffer (priv->pipewire_stream);
if (buffer_id == SPA_ID_INVALID)
return;
buffer = pw_stream_peek_buffer (priv->pipewire_stream, buffer_id);
buffer = pw_stream_dequeue_buffer (priv->pipewire_stream);
if (!buffer)
{
g_warning ("Failed to peek at PipeWire buffer");
g_warning ("Failed to dequeue at PipeWire buffer");
return;
}
if (buffer->datas[0].type == priv->pipewire_type->data.MemFd)
spa_buffer = buffer->buffer;
if (spa_buffer->datas[0].data)
{
map = mmap (NULL, buffer->datas[0].maxsize + buffer->datas[0].mapoffset,
data = spa_buffer->datas[0].data;
}
else if (spa_buffer->datas[0].type == priv->pipewire_type->data.MemFd)
{
map = mmap (NULL, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset,
PROT_READ | PROT_WRITE, MAP_SHARED,
buffer->datas[0].fd, 0);
spa_buffer->datas[0].fd, 0);
if (map == MAP_FAILED)
{
g_warning ("Failed to mmap pipewire stream buffer: %s\n",
@@ -171,26 +240,54 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
return;
}
data = SPA_MEMBER (map, buffer->datas[0].mapoffset, uint8_t);
}
else if (buffer->datas[0].type == priv->pipewire_type->data.MemPtr)
{
data = buffer->datas[0].data;
data = SPA_MEMBER (map, spa_buffer->datas[0].mapoffset, uint8_t);
}
else
{
g_warning ("Unhandled spa buffer type: %d", spa_buffer->datas[0].type);
return;
}
meta_screen_cast_stream_src_record_frame (src, data);
if (meta_screen_cast_stream_src_record_frame (src, data))
{
struct spa_meta_video_crop *spa_meta_video_crop;
spa_buffer->datas[0].chunk->size = spa_buffer->datas[0].maxsize;
/* Update VideoCrop if needed */
spa_meta_video_crop =
spa_buffer_find_meta (spa_buffer, priv->pipewire_type->meta.VideoCrop);
if (spa_meta_video_crop)
{
if (meta_screen_cast_stream_src_get_videocrop (src, &crop_rect))
{
spa_meta_video_crop->x = crop_rect.x;
spa_meta_video_crop->y = crop_rect.y;
spa_meta_video_crop->width = crop_rect.width;
spa_meta_video_crop->height = crop_rect.height;
}
else
{
spa_meta_video_crop->x = 0;
spa_meta_video_crop->y = 0;
spa_meta_video_crop->width = priv->stream_width;
spa_meta_video_crop->height = priv->stream_height;
}
}
}
else
{
spa_buffer->datas[0].chunk->size = 0;
}
maybe_record_cursor (src, spa_buffer, data);
priv->last_frame_timestamp_us = now_us;
if (map)
munmap (map, buffer->datas[0].maxsize + buffer->datas[0].mapoffset);
munmap (map, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset);
buffer->datas[0].chunk->size = buffer->datas[0].maxsize;
pw_stream_send_buffer (priv->pipewire_stream, buffer_id);
pw_stream_queue_buffer (priv->pipewire_stream, buffer);
}
static gboolean
@@ -266,8 +363,8 @@ on_stream_state_changed (void *data,
}
static void
on_stream_format_changed (void *data,
struct spa_pod *format)
on_stream_format_changed (void *data,
const struct spa_pod *format)
{
MetaScreenCastStreamSrc *src = data;
MetaScreenCastStreamSrcPrivate *priv =
@@ -276,7 +373,7 @@ on_stream_format_changed (void *data,
uint8_t params_buffer[1024];
int32_t width, height, stride, size;
struct spa_pod_builder pod_builder;
struct spa_pod *params[1];
const struct spa_pod *params[3];
const int bpp = 4;
if (!format)
@@ -304,6 +401,18 @@ on_stream_format_changed (void *data,
":", pipewire_type->param_buffers.buffers, "iru", 16, PROP_RANGE (2, 16),
":", pipewire_type->param_buffers.align, "i", 16);
params[1] = spa_pod_builder_object (
&pod_builder,
pipewire_type->param.idMeta, pipewire_type->param_meta.Meta,
":", pipewire_type->param_meta.type, "I", pipewire_type->meta.VideoCrop,
":", pipewire_type->param_meta.size, "i", sizeof (struct spa_meta_video_crop));
params[2] = spa_pod_builder_object (
&pod_builder,
pipewire_type->param.idMeta, pipewire_type->param_meta.Meta,
":", pipewire_type->param_meta.type, "I", priv->spa_type.meta_cursor,
":", pipewire_type->param_meta.size, "i", CURSOR_META_SIZE (64, 64));
pw_stream_finish_format (priv->pipewire_stream, 0,
params, G_N_ELEMENTS (params));
}
@@ -326,7 +435,6 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
SPA_POD_BUILDER_INIT (buffer, sizeof (buffer));
MetaSpaType *spa_type = &priv->spa_type;
struct pw_type *pipewire_type = priv->pipewire_type;
int width, height;
float frame_rate;
MetaFraction frame_rate_fraction;
struct spa_fraction max_framerate;
@@ -345,7 +453,10 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
return NULL;
}
meta_screen_cast_stream_src_get_specs (src, &width, &height, &frame_rate);
meta_screen_cast_stream_src_get_specs (src,
&priv->stream_width,
&priv->stream_height,
&frame_rate);
frame_rate_fraction = meta_fraction_from_double (frame_rate);
min_framerate = SPA_FRACTION (1, 1);
@@ -358,11 +469,12 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
"I", spa_type->media_type.video,
"I", spa_type->media_subtype.raw,
":", spa_type->format_video.format, "I", spa_type->video_format.BGRx,
":", spa_type->format_video.size, "R", &SPA_RECTANGLE (width, height),
":", spa_type->format_video.size, "R", &SPA_RECTANGLE (priv->stream_width,
priv->stream_height),
":", spa_type->format_video.framerate, "F", &SPA_FRACTION (0, 1),
":", spa_type->format_video.max_framerate, "Fr", &max_framerate,
PROP_RANGE (&min_framerate,
&max_framerate));
":", spa_type->format_video.max_framerate, "Fru", &max_framerate,
PROP_RANGE (&min_framerate,
&max_framerate));
pw_stream_add_listener (pipewire_stream,
&priv->pipewire_stream_listener,
@@ -372,7 +484,8 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
result = pw_stream_connect (pipewire_stream,
PW_DIRECTION_OUTPUT,
NULL,
PW_STREAM_FLAG_NONE,
(PW_STREAM_FLAG_DRIVER |
PW_STREAM_FLAG_MAP_BUFFERS),
params, G_N_ELEMENTS (params));
if (result != 0)
{
@@ -469,6 +582,7 @@ init_spa_type (MetaSpaType *type,
spa_type_media_subtype_map (map, &type->media_subtype);
spa_type_format_video_map (map, &type->format_video);
spa_type_video_format_map (map, &type->video_format);
type->meta_cursor = spa_type_map_get_id(map, SPA_TYPE_META__Cursor);
}
static MetaPipeWireSource *

View File

@@ -24,8 +24,25 @@
#define META_SCREEN_CAST_STREAM_SRC_H
#include <glib-object.h>
#include <spa/param/video/format-utils.h>
#include <spa/buffer/meta.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-cursor-renderer.h"
#include "backends/meta-cursor.h"
#include "backends/meta-renderer.h"
#include "clutter/clutter.h"
#include "cogl/cogl.h"
#include "meta/boxes.h"
typedef struct _MetaSpaType
{
struct spa_type_media_type media_type;
struct spa_type_media_subtype media_subtype;
struct spa_type_format_video format_video;
struct spa_type_video_format video_format;
uint32_t meta_cursor;
} MetaSpaType;
typedef struct _MetaScreenCastStream MetaScreenCastStream;
@@ -45,12 +62,18 @@ struct _MetaScreenCastStreamSrcClass
float *frame_rate);
void (* enable) (MetaScreenCastStreamSrc *src);
void (* disable) (MetaScreenCastStreamSrc *src);
void (* record_frame) (MetaScreenCastStreamSrc *src,
uint8_t *data);
gboolean (* record_frame) (MetaScreenCastStreamSrc *src,
uint8_t *data);
gboolean (* get_videocrop) (MetaScreenCastStreamSrc *src,
MetaRectangle *crop_rect);
void (* set_cursor_metadata) (MetaScreenCastStreamSrc *src,
struct spa_meta_cursor *spa_meta_cursor);
};
void meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src);
MetaScreenCastStream * meta_screen_cast_stream_src_get_stream (MetaScreenCastStreamSrc *src);
MetaSpaType * meta_screen_cast_stream_src_get_spa_type (MetaScreenCastStreamSrc *src);
#endif /* META_SCREEN_CAST_STREAM_SRC_H */

View File

@@ -24,13 +24,17 @@
#include "backends/meta-screen-cast-stream.h"
#include "backends/meta-screen-cast-session.h"
#define META_SCREEN_CAST_STREAM_DBUS_PATH "/org/gnome/Mutter/ScreenCast/Stream"
enum
{
PROP_0,
PROP_SESSION,
PROP_CONNECTION,
PROP_CURSOR_MODE,
};
enum
@@ -44,9 +48,13 @@ static guint signals[N_SIGNALS];
typedef struct _MetaScreenCastStreamPrivate
{
MetaScreenCastSession *session;
GDBusConnection *connection;
char *object_path;
MetaScreenCastCursorMode cursor_mode;
MetaScreenCastStreamSrc *src;
} MetaScreenCastStreamPrivate;
@@ -97,6 +105,15 @@ on_stream_src_ready (MetaScreenCastStreamSrc *src,
meta_dbus_screen_cast_stream_emit_pipewire_stream_added (skeleton, node_id);
}
MetaScreenCastSession *
meta_screen_cast_stream_get_session (MetaScreenCastStream *stream)
{
MetaScreenCastStreamPrivate *priv =
meta_screen_cast_stream_get_instance_private (stream);
return priv->session;
}
gboolean
meta_screen_cast_stream_start (MetaScreenCastStream *stream,
GError **error)
@@ -150,6 +167,15 @@ meta_screen_cast_stream_transform_position (MetaScreenCastStream *stream,
y);
}
MetaScreenCastCursorMode
meta_screen_cast_stream_get_cursor_mode (MetaScreenCastStream *stream)
{
MetaScreenCastStreamPrivate *priv =
meta_screen_cast_stream_get_instance_private (stream);
return priv->cursor_mode;
}
static void
meta_screen_cast_stream_set_property (GObject *object,
guint prop_id,
@@ -162,9 +188,15 @@ meta_screen_cast_stream_set_property (GObject *object,
switch (prop_id)
{
case PROP_SESSION:
priv->session = g_value_get_object (value);
break;
case PROP_CONNECTION:
priv->connection = g_value_get_object (value);
break;
case PROP_CURSOR_MODE:
priv->cursor_mode = g_value_get_uint (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -182,9 +214,15 @@ meta_screen_cast_stream_get_property (GObject *object,
switch (prop_id)
{
case PROP_SESSION:
g_value_set_object (value, priv->session);
break;
case PROP_CONNECTION:
g_value_set_object (value, priv->connection);
break;
case PROP_CURSOR_MODE:
g_value_set_uint (value, priv->cursor_mode);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
@@ -256,6 +294,16 @@ meta_screen_cast_stream_class_init (MetaScreenCastStreamClass *klass)
object_class->set_property = meta_screen_cast_stream_set_property;
object_class->get_property = meta_screen_cast_stream_get_property;
g_object_class_install_property (object_class,
PROP_SESSION,
g_param_spec_object ("session",
"session",
"MetaScreenSession",
META_TYPE_SCREEN_CAST_SESSION,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_CONNECTION,
g_param_spec_object ("connection",
@@ -266,6 +314,18 @@ meta_screen_cast_stream_class_init (MetaScreenCastStreamClass *klass)
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
g_object_class_install_property (object_class,
PROP_CURSOR_MODE,
g_param_spec_uint ("cursor-mode",
"cursor-mode",
"Cursor mode",
META_SCREEN_CAST_CURSOR_MODE_HIDDEN,
META_SCREEN_CAST_CURSOR_MODE_METADATA,
META_SCREEN_CAST_CURSOR_MODE_HIDDEN,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
signals[CLOSED] = g_signal_new ("closed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,

View File

@@ -26,8 +26,12 @@
#include <glib-object.h>
#include "backends/meta-screen-cast-stream-src.h"
#include "backends/meta-screen-cast.h"
#include "meta-dbus-screen-cast.h"
typedef struct _MetaScreenCastSession MetaScreenCastSession;
#define META_TYPE_SCREEN_CAST_STREAM (meta_screen_cast_stream_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaScreenCastStream, meta_screen_cast_stream,
META, SCREEN_CAST_STREAM,
@@ -48,6 +52,8 @@ struct _MetaScreenCastStreamClass
double *y);
};
MetaScreenCastSession * meta_screen_cast_stream_get_session (MetaScreenCastStream *stream);
gboolean meta_screen_cast_stream_start (MetaScreenCastStream *stream,
GError **error);
@@ -61,4 +67,6 @@ void meta_screen_cast_stream_transform_position (MetaScreenCastStream *stream,
double *x,
double *y);
MetaScreenCastCursorMode meta_screen_cast_stream_get_cursor_mode (MetaScreenCastStream *stream);
#endif /* META_SCREEN_CAST_STREAM_H */

View File

@@ -0,0 +1,247 @@
/*
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#include "backends/meta-screen-cast-window-stream-src.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-screen-cast-window.h"
#include "backends/meta-screen-cast-window-stream.h"
#include "compositor/meta-window-actor-private.h"
struct _MetaScreenCastWindowStreamSrc
{
MetaScreenCastStreamSrc parent;
MetaWindowActor *window_actor;
unsigned long actor_painted_handler_id;
unsigned long actor_destroyed_handler_id;
};
G_DEFINE_TYPE (MetaScreenCastWindowStreamSrc,
meta_screen_cast_window_stream_src,
META_TYPE_SCREEN_CAST_STREAM_SRC)
static MetaScreenCastWindowStream *
get_window_stream (MetaScreenCastWindowStreamSrc *window_src)
{
MetaScreenCastStreamSrc *src;
MetaScreenCastStream *stream;
src = META_SCREEN_CAST_STREAM_SRC (window_src);
stream = meta_screen_cast_stream_src_get_stream (src);
return META_SCREEN_CAST_WINDOW_STREAM (stream);
}
static MetaWindow *
get_window (MetaScreenCastWindowStreamSrc *window_src)
{
MetaScreenCastWindowStream *window_stream;
window_stream = get_window_stream (window_src);
return meta_screen_cast_window_stream_get_window (window_stream);
}
static int
get_stream_width (MetaScreenCastWindowStreamSrc *window_src)
{
MetaScreenCastWindowStream *window_stream;
window_stream = get_window_stream (window_src);
return meta_screen_cast_window_stream_get_width (window_stream);
}
static int
get_stream_height (MetaScreenCastWindowStreamSrc *window_src)
{
MetaScreenCastWindowStream *window_stream;
window_stream = get_window_stream (window_src);
return meta_screen_cast_window_stream_get_height (window_stream);
}
static gboolean
capture_into (MetaScreenCastWindowStreamSrc *window_src,
uint8_t *data)
{
MetaRectangle stream_rect;
MetaScreenCastWindow *screen_cast_window;
stream_rect.x = 0;
stream_rect.y = 0;
stream_rect.width = get_stream_width (window_src);
stream_rect.height = get_stream_height (window_src);
screen_cast_window = META_SCREEN_CAST_WINDOW (window_src->window_actor);
meta_screen_cast_window_capture_into (screen_cast_window, &stream_rect, data);
return TRUE;
}
static void
meta_screen_cast_window_stream_src_get_specs (MetaScreenCastStreamSrc *src,
int *width,
int *height,
float *frame_rate)
{
MetaScreenCastWindowStreamSrc *window_src =
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
*width = get_stream_width (window_src);
*height = get_stream_height (window_src);
*frame_rate = 60.0f;
}
static gboolean
meta_screen_cast_window_stream_src_get_videocrop (MetaScreenCastStreamSrc *src,
MetaRectangle *crop_rect)
{
MetaScreenCastWindowStreamSrc *window_src =
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
MetaScreenCastWindow *screen_cast_window;
MetaRectangle stream_rect;
screen_cast_window = META_SCREEN_CAST_WINDOW (window_src->window_actor);
meta_screen_cast_window_get_frame_bounds (screen_cast_window, crop_rect);
stream_rect.x = 0;
stream_rect.y = 0;
stream_rect.width = get_stream_width (window_src);
stream_rect.height = get_stream_height (window_src);
meta_rectangle_intersect (crop_rect, &stream_rect, crop_rect);
return TRUE;
}
static void
meta_screen_cast_window_stream_src_stop (MetaScreenCastWindowStreamSrc *window_src)
{
if (!window_src->window_actor)
return;
if (window_src->actor_painted_handler_id)
g_signal_handler_disconnect (window_src->window_actor,
window_src->actor_painted_handler_id);
window_src->actor_painted_handler_id = 0;
if (window_src->actor_destroyed_handler_id)
g_signal_handler_disconnect (window_src->window_actor,
window_src->actor_destroyed_handler_id);
window_src->actor_destroyed_handler_id = 0;
}
static void
window_actor_painted (MetaWindowActor *actor,
MetaScreenCastWindowStreamSrc *window_src)
{
MetaScreenCastStreamSrc *src = META_SCREEN_CAST_STREAM_SRC (window_src);
meta_screen_cast_stream_src_maybe_record_frame (src);
}
static void
window_actor_destroyed (MetaWindowActor *actor,
MetaScreenCastWindowStreamSrc *window_src)
{
meta_screen_cast_window_stream_src_stop (window_src);
window_src->window_actor = NULL;
}
static void
meta_screen_cast_window_stream_src_enable (MetaScreenCastStreamSrc *src)
{
MetaScreenCastWindowStreamSrc *window_src =
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
MetaWindowActor *window_actor;
window_actor = meta_window_actor_from_window (get_window (window_src));
if (!window_actor)
return;
window_src->window_actor = window_actor;
window_src->actor_painted_handler_id =
g_signal_connect_after (window_src->window_actor,
"paint",
G_CALLBACK (window_actor_painted),
window_src);
window_src->actor_destroyed_handler_id =
g_signal_connect (window_src->window_actor,
"destroy",
G_CALLBACK (window_actor_destroyed),
window_src);
}
static void
meta_screen_cast_window_stream_src_disable (MetaScreenCastStreamSrc *src)
{
MetaScreenCastWindowStreamSrc *window_src =
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
meta_screen_cast_window_stream_src_stop (window_src);
}
static gboolean
meta_screen_cast_window_stream_src_record_frame (MetaScreenCastStreamSrc *src,
uint8_t *data)
{
MetaScreenCastWindowStreamSrc *window_src =
META_SCREEN_CAST_WINDOW_STREAM_SRC (src);
capture_into (window_src, data);
return TRUE;
}
MetaScreenCastWindowStreamSrc *
meta_screen_cast_window_stream_src_new (MetaScreenCastWindowStream *window_stream,
GError **error)
{
return g_initable_new (META_TYPE_SCREEN_CAST_WINDOW_STREAM_SRC, NULL, error,
"stream", window_stream,
NULL);
}
static void
meta_screen_cast_window_stream_src_init (MetaScreenCastWindowStreamSrc *window_src)
{
}
static void
meta_screen_cast_window_stream_src_class_init (MetaScreenCastWindowStreamSrcClass *klass)
{
MetaScreenCastStreamSrcClass *src_class =
META_SCREEN_CAST_STREAM_SRC_CLASS (klass);
src_class->get_specs = meta_screen_cast_window_stream_src_get_specs;
src_class->enable = meta_screen_cast_window_stream_src_enable;
src_class->disable = meta_screen_cast_window_stream_src_disable;
src_class->record_frame = meta_screen_cast_window_stream_src_record_frame;
src_class->get_videocrop = meta_screen_cast_window_stream_src_get_videocrop;
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_SCREEN_CAST_WINDOW_STREAM_SRC_H
#define META_SCREEN_CAST_WINDOW_STREAM_SRC_H
#include "backends/meta-screen-cast-stream-src.h"
typedef struct _MetaScreenCastWindowStream MetaScreenCastWindowStream;
#define META_TYPE_SCREEN_CAST_WINDOW_STREAM_SRC (meta_screen_cast_window_stream_src_get_type ())
G_DECLARE_FINAL_TYPE (MetaScreenCastWindowStreamSrc,
meta_screen_cast_window_stream_src,
META, SCREEN_CAST_WINDOW_STREAM_SRC,
MetaScreenCastStreamSrc)
MetaScreenCastWindowStreamSrc * meta_screen_cast_window_stream_src_new (MetaScreenCastWindowStream *window_stream,
GError **error);
#endif /* META_SCREEN_CAST_WINDOW_STREAM_SRC_H */

View File

@@ -0,0 +1,272 @@
/*
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#include "backends/meta-screen-cast-window-stream.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-screen-cast-window.h"
#include "backends/meta-screen-cast-window-stream-src.h"
#include "compositor/meta-window-actor-private.h"
#include "core/window-private.h"
enum
{
PROP_0,
PROP_WINDOW,
};
struct _MetaScreenCastWindowStream
{
MetaScreenCastStream parent;
MetaWindow *window;
int stream_width;
int stream_height;
unsigned long window_unmanaged_handler_id;
};
G_DEFINE_TYPE (MetaScreenCastWindowStream,
meta_screen_cast_window_stream,
META_TYPE_SCREEN_CAST_STREAM)
MetaWindow *
meta_screen_cast_window_stream_get_window (MetaScreenCastWindowStream *window_stream)
{
return window_stream->window;
}
int
meta_screen_cast_window_stream_get_width (MetaScreenCastWindowStream *window_stream)
{
return window_stream->stream_width;
}
int
meta_screen_cast_window_stream_get_height (MetaScreenCastWindowStream *window_stream)
{
return window_stream->stream_height;
}
MetaScreenCastWindowStream *
meta_screen_cast_window_stream_new (MetaScreenCastSession *session,
GDBusConnection *connection,
MetaWindow *window,
GError **error)
{
MetaScreenCastWindowStream *window_stream;
MetaLogicalMonitor *logical_monitor;
int scale;
logical_monitor = meta_window_get_main_logical_monitor (window);
if (!logical_monitor)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Main logical monitor not found");
return NULL;
}
window_stream = g_initable_new (META_TYPE_SCREEN_CAST_WINDOW_STREAM,
NULL,
error,
"session", session,
"connection", connection,
"window", window,
NULL);
if (!window_stream)
return NULL;
window_stream->window = window;
/* We cannot set the stream size to the exact size of the window, because
* windows can be resized, whereas streams cannot.
* So we set a size equals to the size of the logical monitor for the window.
*/
scale = (int) ceil (meta_logical_monitor_get_scale (logical_monitor));
window_stream->stream_width = logical_monitor->rect.width * scale;
window_stream->stream_height = logical_monitor->rect.height * scale;
return window_stream;
}
static MetaScreenCastStreamSrc *
meta_screen_cast_window_stream_create_src (MetaScreenCastStream *stream,
GError **error)
{
MetaScreenCastWindowStream *window_stream =
META_SCREEN_CAST_WINDOW_STREAM (stream);
MetaScreenCastWindowStreamSrc *window_stream_src;
window_stream_src = meta_screen_cast_window_stream_src_new (window_stream,
error);
if (!window_stream_src)
return NULL;
return META_SCREEN_CAST_STREAM_SRC (window_stream_src);
}
static void
meta_screen_cast_window_stream_set_parameters (MetaScreenCastStream *stream,
GVariantBuilder *parameters_builder)
{
MetaScreenCastWindowStream *window_stream =
META_SCREEN_CAST_WINDOW_STREAM (stream);
MetaScreenCastWindow *screen_cast_window =
META_SCREEN_CAST_WINDOW (meta_window_actor_from_window (window_stream->window));
MetaRectangle bounds;
meta_screen_cast_window_get_buffer_bounds (screen_cast_window, &bounds);
g_variant_builder_add (parameters_builder, "{sv}",
"position",
g_variant_new ("(ii)",
bounds.x, bounds.y));
g_variant_builder_add (parameters_builder, "{sv}",
"size",
g_variant_new ("(ii)",
bounds.width,
bounds.height));
}
static void
meta_screen_cast_window_stream_transform_position (MetaScreenCastStream *stream,
double stream_x,
double stream_y,
double *x,
double *y)
{
MetaScreenCastWindowStream *window_stream =
META_SCREEN_CAST_WINDOW_STREAM (stream);
MetaScreenCastWindow *screen_cast_window =
META_SCREEN_CAST_WINDOW (meta_window_actor_from_window (window_stream->window));
meta_screen_cast_window_transform_relative_position (screen_cast_window,
stream_x,
stream_y,
x,
y);
}
static void
on_window_unmanaged (MetaScreenCastWindowStream *window_stream)
{
meta_screen_cast_stream_close (META_SCREEN_CAST_STREAM (window_stream));
}
static void
meta_screen_cast_window_stream_constructed (GObject *object)
{
MetaScreenCastWindowStream *window_stream =
META_SCREEN_CAST_WINDOW_STREAM (object);
window_stream->window_unmanaged_handler_id =
g_signal_connect_swapped (window_stream->window, "unmanaged",
G_CALLBACK (on_window_unmanaged),
window_stream);
G_OBJECT_CLASS (meta_screen_cast_window_stream_parent_class)->constructed (object);
}
static void
meta_screen_cast_window_stream_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaScreenCastWindowStream *window_stream =
META_SCREEN_CAST_WINDOW_STREAM (object);
switch (prop_id)
{
case PROP_WINDOW:
window_stream->window = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
meta_screen_cast_window_stream_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaScreenCastWindowStream *window_stream =
META_SCREEN_CAST_WINDOW_STREAM (object);
switch (prop_id)
{
case PROP_WINDOW:
g_value_set_object (value, window_stream->window);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
meta_screen_cast_window_stream_finalize (GObject *object)
{
MetaScreenCastWindowStream *window_stream =
META_SCREEN_CAST_WINDOW_STREAM (object);
g_signal_handler_disconnect (window_stream->window,
window_stream->window_unmanaged_handler_id);
G_OBJECT_CLASS (meta_screen_cast_window_stream_parent_class)->finalize (object);
}
static void
meta_screen_cast_window_stream_init (MetaScreenCastWindowStream *window_stream)
{
}
static void
meta_screen_cast_window_stream_class_init (MetaScreenCastWindowStreamClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
MetaScreenCastStreamClass *stream_class =
META_SCREEN_CAST_STREAM_CLASS (klass);
object_class->constructed = meta_screen_cast_window_stream_constructed;
object_class->set_property = meta_screen_cast_window_stream_set_property;
object_class->get_property = meta_screen_cast_window_stream_get_property;
object_class->finalize = meta_screen_cast_window_stream_finalize;
stream_class->create_src = meta_screen_cast_window_stream_create_src;
stream_class->set_parameters = meta_screen_cast_window_stream_set_parameters;
stream_class->transform_position = meta_screen_cast_window_stream_transform_position;
g_object_class_install_property (object_class,
PROP_WINDOW,
g_param_spec_object ("window",
"window",
"MetaWindow",
META_TYPE_WINDOW,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
}

View File

@@ -0,0 +1,44 @@
/*
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_SCREEN_CAST_WINDOW_STREAM_H
#define META_SCREEN_CAST_WINDOW_STREAM_H
#include <glib-object.h>
#include "backends/meta-screen-cast-stream.h"
#include "meta/window.h"
#define META_TYPE_SCREEN_CAST_WINDOW_STREAM (meta_screen_cast_window_stream_get_type ())
G_DECLARE_FINAL_TYPE (MetaScreenCastWindowStream,
meta_screen_cast_window_stream,
META, SCREEN_CAST_WINDOW_STREAM,
MetaScreenCastStream)
MetaScreenCastWindowStream * meta_screen_cast_window_stream_new (MetaScreenCastSession *session,
GDBusConnection *connection,
MetaWindow *window,
GError **error);
MetaWindow * meta_screen_cast_window_stream_get_window (MetaScreenCastWindowStream *window_stream);
int meta_screen_cast_window_stream_get_width (MetaScreenCastWindowStream *window_stream);
int meta_screen_cast_window_stream_get_height (MetaScreenCastWindowStream *window_stream);
#endif /* META_SCREEN_CAST_WINDOW_STREAM_H */

View File

@@ -0,0 +1,71 @@
/*
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#include "backends/meta-screen-cast-window.h"
G_DEFINE_INTERFACE (MetaScreenCastWindow, meta_screen_cast_window, G_TYPE_OBJECT)
static void
meta_screen_cast_window_default_init (MetaScreenCastWindowInterface *iface)
{
}
void
meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds)
{
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->get_buffer_bounds (screen_cast_window,
bounds);
}
void
meta_screen_cast_window_get_frame_bounds (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds)
{
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->get_frame_bounds (screen_cast_window,
bounds);
}
void
meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *screen_cast_window,
double x,
double y,
double *x_out,
double *y_out)
{
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->transform_relative_position (screen_cast_window,
x,
y,
x_out,
y_out);
}
void
meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds,
uint8_t *data)
{
META_SCREEN_CAST_WINDOW_GET_IFACE (screen_cast_window)->capture_into (screen_cast_window,
bounds,
data);
}

View File

@@ -0,0 +1,74 @@
/*
* Copyright (C) 2018 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_SCREEN_CAST_WINDOW_H
#define META_SCREEN_CAST_WINDOW_H
#include <stdint.h>
#include <glib-object.h>
#include "meta/boxes.h"
G_BEGIN_DECLS
#define META_TYPE_SCREEN_CAST_WINDOW (meta_screen_cast_window_get_type ())
G_DECLARE_INTERFACE (MetaScreenCastWindow, meta_screen_cast_window,
META, SCREEN_CAST_WINDOW, GObject)
struct _MetaScreenCastWindowInterface
{
GTypeInterface parent_iface;
void (*get_buffer_bounds) (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds);
void (*get_frame_bounds) (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds);
void (*transform_relative_position) (MetaScreenCastWindow *screen_cast_window,
double x,
double y,
double *x_out,
double *y_out);
void (*capture_into) (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds,
uint8_t *data);
};
void meta_screen_cast_window_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds);
void meta_screen_cast_window_get_frame_bounds (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds);
void meta_screen_cast_window_transform_relative_position (MetaScreenCastWindow *screen_cast_window,
double x,
double y,
double *x_out,
double *y_out);
void meta_screen_cast_window_capture_into (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds,
uint8_t *data);
G_END_DECLS
#endif /* META_SCREEN_CAST_WINDOW_H */

View File

@@ -43,6 +43,7 @@ struct _MetaScreenCast
GList *sessions;
MetaDbusSessionWatcher *session_watcher;
MetaBackend *backend;
};
static void
@@ -62,12 +63,20 @@ meta_screen_cast_get_connection (MetaScreenCast *screen_cast)
return g_dbus_interface_skeleton_get_connection (interface_skeleton);
}
MetaBackend *
meta_screen_cast_get_backend (MetaScreenCast *screen_cast)
{
return screen_cast->backend;
}
static gboolean
register_remote_desktop_screen_cast_session (MetaScreenCastSession *session,
const char *remote_desktop_session_id,
GError **error)
{
MetaBackend *backend = meta_get_backend ();
MetaScreenCast *screen_cast =
meta_screen_cast_session_get_screen_cast (session);
MetaBackend *backend = meta_screen_cast_get_backend (screen_cast);
MetaRemoteDesktop *remote_desktop = meta_backend_get_remote_desktop (backend);
MetaRemoteDesktopSession *remote_desktop_session;
@@ -244,11 +253,13 @@ meta_screen_cast_finalize (GObject *object)
}
MetaScreenCast *
meta_screen_cast_new (MetaDbusSessionWatcher *session_watcher)
meta_screen_cast_new (MetaBackend *backend,
MetaDbusSessionWatcher *session_watcher)
{
MetaScreenCast *screen_cast;
screen_cast = g_object_new (META_TYPE_SCREEN_CAST, NULL);
screen_cast->backend = backend;
screen_cast->session_watcher = session_watcher;
return screen_cast;

View File

@@ -25,9 +25,17 @@
#include <glib-object.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-dbus-session-watcher.h"
#include "meta-dbus-screen-cast.h"
typedef enum _MetaScreenCastCursorMode
{
META_SCREEN_CAST_CURSOR_MODE_HIDDEN = 0,
META_SCREEN_CAST_CURSOR_MODE_EMBEDDED = 1,
META_SCREEN_CAST_CURSOR_MODE_METADATA = 2,
} MetaScreenCastCursorMode;
#define META_TYPE_SCREEN_CAST (meta_screen_cast_get_type ())
G_DECLARE_FINAL_TYPE (MetaScreenCast, meta_screen_cast,
META, SCREEN_CAST,
@@ -35,6 +43,9 @@ G_DECLARE_FINAL_TYPE (MetaScreenCast, meta_screen_cast,
GDBusConnection * meta_screen_cast_get_connection (MetaScreenCast *screen_cast);
MetaScreenCast * meta_screen_cast_new (MetaDbusSessionWatcher *session_watcher);
MetaBackend * meta_screen_cast_get_backend (MetaScreenCast *screen_cast);
MetaScreenCast * meta_screen_cast_new (MetaBackend *backend,
MetaDbusSessionWatcher *session_watcher);
#endif /* META_SCREEN_CAST_H */

View File

@@ -260,6 +260,7 @@ experimental_features_handler (GVariant *features_variant,
g_variant_iter_init (&features_iter, features_variant);
while (g_variant_iter_loop (&features_iter, "s", &feature))
{
/* So far no experimental features defined. */
if (g_str_equal (feature, "scale-monitor-framebuffer"))
features |= META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER;
else if (g_str_equal (feature, "kms-modifiers"))

View File

@@ -30,7 +30,17 @@
#include "backends/meta-backend-private.h"
#include "clutter/clutter-mutter.h"
struct _MetaOverlay {
enum
{
ACTORS_PAINTED,
N_SIGNALS
};
static guint signals[N_SIGNALS];
struct _MetaOverlay
{
gboolean enabled;
CoglPipeline *pipeline;
@@ -140,6 +150,8 @@ meta_stage_paint (ClutterActor *actor)
CLUTTER_ACTOR_CLASS (meta_stage_parent_class)->paint (actor);
g_signal_emit (stage, signals[ACTORS_PAINTED], 0);
for (l = priv->overlays; l; l = l->next)
meta_overlay_paint (l->data);
}
@@ -179,6 +191,13 @@ meta_stage_class_init (MetaStageClass *klass)
stage_class->activate = meta_stage_activate;
stage_class->deactivate = meta_stage_deactivate;
signals[ACTORS_PAINTED] = g_signal_new ("actors-painted",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}
static void

View File

@@ -212,7 +212,7 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
MetaLogicalMonitor *cur = current;
float x = cur_x, y = cur_y;
float dx = *dx_inout, dy = *dy_inout;
MetaDisplayDirection direction = -1;
MetaScreenDirection direction = -1;
while (cur)
{
@@ -240,18 +240,18 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
{ cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
};
if (direction != META_DISPLAY_RIGHT &&
if (direction != META_SCREEN_RIGHT &&
meta_line2_intersects_with (&motion, &left, &intersection))
direction = META_DISPLAY_LEFT;
else if (direction != META_DISPLAY_LEFT &&
direction = META_SCREEN_LEFT;
else if (direction != META_SCREEN_LEFT &&
meta_line2_intersects_with (&motion, &right, &intersection))
direction = META_DISPLAY_RIGHT;
else if (direction != META_DISPLAY_DOWN &&
direction = META_SCREEN_RIGHT;
else if (direction != META_SCREEN_DOWN &&
meta_line2_intersects_with (&motion, &top, &intersection))
direction = META_DISPLAY_UP;
else if (direction != META_DISPLAY_UP &&
direction = META_SCREEN_UP;
else if (direction != META_SCREEN_UP &&
meta_line2_intersects_with (&motion, &bottom, &intersection))
direction = META_DISPLAY_DOWN;
direction = META_SCREEN_DOWN;
else
{
/* We reached the dest logical monitor */
@@ -645,9 +645,20 @@ void meta_backend_native_resume (MetaBackendNative *native)
meta_backend_get_monitor_manager (backend);
MetaMonitorManagerKms *monitor_manager_kms =
META_MONITOR_MANAGER_KMS (monitor_manager);
MetaDisplay *display = meta_get_display ();
ClutterBackend *clutter_backend = clutter_get_default_backend ();
CoglContext *cogl_context =
clutter_backend_get_cogl_context (clutter_backend);
ClutterActor *stage;
MetaIdleMonitor *idle_monitor;
if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_UNSTABLE_TEXTURES))
{
clutter_clear_glyph_cache ();
meta_screen_update_cursor (display->screen);
g_signal_emit_by_name (display, "gl-video-memory-purged");
}
meta_monitor_manager_kms_resume (monitor_manager_kms);
clutter_evdev_reclaim_devices ();

View File

@@ -587,6 +587,10 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
if (!cursor_sprite)
return FALSE;
if (meta_cursor_renderer_is_hw_cursors_inhibited (renderer,
cursor_sprite))
return FALSE;
for (l = gpus; l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
@@ -1071,6 +1075,18 @@ realize_cursor_sprite_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite)
{
#ifdef HAVE_WAYLAND
if (META_IS_CURSOR_SPRITE_WAYLAND (cursor_sprite))
{
MetaCursorSpriteWayland *sprite_wayland =
META_CURSOR_SPRITE_WAYLAND (cursor_sprite);
realize_cursor_sprite_from_wl_buffer_for_gpu (renderer,
gpu_kms,
sprite_wayland);
}
else
#endif
if (META_IS_CURSOR_SPRITE_XCURSOR (cursor_sprite))
{
MetaCursorSpriteXcursor *sprite_xcursor =
@@ -1080,17 +1096,6 @@ realize_cursor_sprite_for_gpu (MetaCursorRenderer *renderer,
gpu_kms,
sprite_xcursor);
}
#ifdef HAVE_WAYLAND
else if (META_IS_CURSOR_SPRITE_WAYLAND (cursor_sprite))
{
MetaCursorSpriteWayland *sprite_wayland =
META_CURSOR_SPRITE_WAYLAND (cursor_sprite);
realize_cursor_sprite_from_wl_buffer_for_gpu (renderer,
gpu_kms,
sprite_wayland);
}
#endif
}
static void

View File

@@ -26,7 +26,6 @@
#define META_CURSOR_RENDERER_NATIVE_H
#include "meta-cursor-renderer.h"
#include "meta/meta-backend.h"
#define META_TYPE_CURSOR_RENDERER_NATIVE (meta_cursor_renderer_native_get_type ())
G_DECLARE_FINAL_TYPE (MetaCursorRendererNative, meta_cursor_renderer_native,

View File

@@ -68,8 +68,11 @@ struct _MetaGpuKms
int max_buffer_height;
gboolean page_flips_not_supported;
gboolean resources_init_failed_before;
};
G_DEFINE_QUARK (MetaGpuKmsError, meta_gpu_kms_error)
G_DEFINE_TYPE (MetaGpuKms, meta_gpu_kms, META_TYPE_GPU)
static gboolean
@@ -148,7 +151,10 @@ meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
connectors, n_connectors,
mode) != 0)
{
g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
if (mode)
g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
else
g_warning ("Failed to disable CRTC");
g_free (connectors);
return FALSE;
}
@@ -723,20 +729,34 @@ init_outputs (MetaGpuKms *gpu_kms,
setup_output_clones (gpu);
}
static void
meta_kms_resources_init (MetaKmsResources *resources,
int fd)
static gboolean
meta_kms_resources_init (MetaKmsResources *resources,
int fd,
GError **error)
{
drmModeRes *drm_resources;
unsigned int i;
drm_resources = drmModeGetResources (fd);
if (!drm_resources)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_FAILED,
"Calling drmModeGetResources() failed");
return FALSE;
}
resources->resources = drm_resources;
resources->n_encoders = (unsigned int) drm_resources->count_encoders;
resources->encoders = g_new (drmModeEncoder *, resources->n_encoders);
for (i = 0; i < resources->n_encoders; i++)
resources->encoders[i] = drmModeGetEncoder (fd, drm_resources->encoders[i]);
return TRUE;
}
static void
@@ -748,7 +768,7 @@ meta_kms_resources_release (MetaKmsResources *resources)
drmModeFreeEncoder (resources->encoders[i]);
g_free (resources->encoders);
drmModeFreeResources (resources->resources);
g_clear_pointer (&resources->resources, drmModeFreeResources);
}
static gboolean
@@ -759,8 +779,18 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
MetaMonitorManager *monitor_manager =
meta_gpu_get_monitor_manager (gpu);
MetaKmsResources resources;
g_autoptr (GError) local_error = NULL;
meta_kms_resources_init (&resources, gpu_kms->fd);
if (!meta_kms_resources_init (&resources, gpu_kms->fd, &local_error))
{
if (!gpu_kms->resources_init_failed_before)
{
g_warning ("meta_kms_resources_init failed: %s, assuming we have no outputs",
local_error->message);
gpu_kms->resources_init_failed_before = TRUE;
}
return TRUE;
}
gpu_kms->max_buffer_width = resources.resources->max_width;
gpu_kms->max_buffer_height = resources.resources->max_height;
@@ -773,6 +803,8 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
are freed by the platform-independent layer. */
free_resources (gpu_kms);
g_assert (resources.resources->count_connectors > 0);
init_connectors (gpu_kms, resources.resources);
init_modes (gpu_kms, resources.resources);
init_crtcs (gpu_kms, &resources);
@@ -783,6 +815,12 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
return TRUE;
}
gboolean
meta_gpu_kms_can_have_outputs (MetaGpuKms *gpu_kms)
{
return gpu_kms->n_connectors > 0;
}
MetaGpuKms *
meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
const char *kms_file_path,
@@ -796,12 +834,47 @@ meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
GSource *source;
MetaKmsSource *kms_source;
MetaGpuKms *gpu_kms;
drmModeRes *drm_resources;
guint n_connectors;
int kms_fd;
kms_fd = meta_launcher_open_restricted (launcher, kms_file_path, error);
if (kms_fd == -1)
return NULL;
/* Some GPUs might have no connectors, for example dedicated GPUs on PRIME (hybrid) laptops.
* These GPUs cannot render anything on separate screens, and they are aggressively switched
* off by the kernel.
*
* If we add these PRIME GPUs to the GPU list anyway, Mutter keeps awakening the secondary GPU,
* and doing this causes a considerable stuttering. These GPUs are usually put to sleep again
* after ~2s without a workload.
*
* For now, to avoid this situation, only create the MetaGpuKms when the GPU has any connectors.
*/
drm_resources = drmModeGetResources (kms_fd);
if (!drm_resources)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "No resources");
meta_launcher_close_restricted (launcher, kms_fd);
return NULL;
}
n_connectors = drm_resources->count_connectors;
drmModeFreeResources (drm_resources);
if (n_connectors == 0)
{
g_set_error (error,
META_GPU_KMS_ERROR,
META_GPU_KMS_ERROR_NO_CONNECTORS,
"No connectors available in this GPU. This is probably a dedicated GPU in a hybrid setup.");
meta_launcher_close_restricted (launcher, kms_fd);
return NULL;
}
gpu_kms = g_object_new (META_TYPE_GPU_KMS,
"monitor-manager", monitor_manager_kms,
NULL);
@@ -811,6 +884,8 @@ meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
drmSetClientCap (gpu_kms->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
meta_gpu_kms_read_current (META_GPU (gpu_kms), NULL);
source = g_source_new (&kms_event_funcs, sizeof (MetaKmsSource));
kms_source = (MetaKmsSource *) source;
kms_source->fd_tag = g_source_add_unix_fd (source,

View File

@@ -29,6 +29,14 @@
#include "backends/meta-gpu.h"
#include "backends/native/meta-monitor-manager-kms.h"
typedef enum
{
META_GPU_KMS_ERROR_NO_CONNECTORS,
} MetaGpuKmsError;
#define META_GPU_KMS_ERROR (meta_gpu_kms_error_quark ())
GQuark meta_gpu_kms_error_quark (void);
#define META_TYPE_GPU_KMS (meta_gpu_kms_get_type ())
G_DECLARE_FINAL_TYPE (MetaGpuKms, meta_gpu_kms, META, GPU_KMS, MetaGpu)
@@ -53,6 +61,8 @@ gboolean meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
int y,
uint32_t fb_id);
gboolean meta_gpu_kms_can_have_outputs (MetaGpuKms *gpu_kms);
gboolean meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
MetaCrtc *crtc);

View File

@@ -62,156 +62,20 @@ meta_launcher_get_seat_id (MetaLauncher *launcher)
return launcher->seat_id;
}
static gboolean
find_systemd_session (gchar **session_id,
GError **error)
{
const gchar * const graphical_session_types[] = { "wayland", "x11", "mir", NULL };
const gchar * const active_states[] = { "active", "online", NULL };
g_autofree gchar *class = NULL;
g_autofree gchar *local_session_id = NULL;
g_autofree gchar *type = NULL;
g_autofree gchar *state = NULL;
g_auto (GStrv) sessions = NULL;
int n_sessions;
int saved_errno;
g_assert (session_id != NULL);
g_assert (error == NULL || *error == NULL);
saved_errno = sd_uid_get_display (getuid (), &local_session_id);
if (saved_errno < 0)
{
/* no session, maybe there's a greeter session */
if (saved_errno == -ENODATA)
{
n_sessions = sd_uid_get_sessions (getuid (), 1, &sessions);
if (n_sessions < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Failed to get all sessions for user %d (%m)",
getuid ());
return FALSE;
}
if (n_sessions == 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"User %d has no sessions",
getuid ());
return FALSE;
}
for (int i = 0; i < n_sessions; ++i)
{
saved_errno = sd_session_get_class (sessions[i], &class);
if (saved_errno < 0)
{
g_warning ("Couldn't get class for session '%d': %s",
i,
g_strerror (-saved_errno));
continue;
}
if (g_strcmp0 (class, "greeter") == 0)
{
local_session_id = g_strdup (sessions[i]);
break;
}
}
if (!local_session_id)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't find a session or a greeter session for user %d",
getuid ());
return FALSE;
}
}
else
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't get display for user %d: %s",
getuid (),
g_strerror (-saved_errno));
return FALSE;
}
}
/* sd_uid_get_display will return any session if there is no graphical
* one, so let's check it really is graphical. */
saved_errno = sd_session_get_type (local_session_id, &type);
if (saved_errno < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't get type for session '%s': %s",
local_session_id,
g_strerror (-saved_errno));
return FALSE;
}
if (!g_strv_contains (graphical_session_types, type))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Session '%s' is not a graphical session (type: '%s')",
local_session_id,
type);
return FALSE;
}
/* and display sessions can be 'closing' if they are logged out but
* some processes are lingering; we shouldn't consider these */
saved_errno = sd_session_get_state (local_session_id, &state);
if (saved_errno < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't get state for session '%s': %s",
local_session_id,
g_strerror (-saved_errno));
return FALSE;
}
if (!g_strv_contains (active_states, state))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Session '%s' is not active",
local_session_id);
return FALSE;
}
*session_id = g_steal_pointer (&local_session_id);
return TRUE;
}
static Login1Session *
get_session_proxy (GCancellable *cancellable,
GError **error)
{
g_autofree char *proxy_path = NULL;
g_autofree char *session_id = NULL;
g_autoptr (GError) local_error = NULL;
Login1Session *session_proxy;
if (!find_systemd_session (&session_id, &local_error))
if (sd_pid_get_session (getpid (), &session_id) < 0)
{
g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get session ID: %m");
return NULL;
}
@@ -438,14 +302,17 @@ on_active_changed (Login1Session *session,
static gchar *
get_seat_id (GError **error)
{
g_autoptr (GError) local_error = NULL;
g_autofree char *session_id = NULL;
char *seat_id = NULL;
int r;
if (!find_systemd_session (&session_id, &local_error))
r = sd_pid_get_session (0, &session_id);
if (r < 0)
{
g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get session for PID: %s", g_strerror (-r));
return NULL;
}

View File

@@ -34,6 +34,7 @@
#include "meta-crtc-kms.h"
#include "meta-gpu-kms.h"
#include "meta-output-kms.h"
#include "wayland/meta-wayland-outputs.h"
#include <string.h>
#include <stdlib.h>
@@ -46,7 +47,7 @@
#include <unistd.h>
#include <meta/main.h>
#include <meta/meta-x11-errors.h>
#include <meta/errors.h>
#include <gudev/gudev.h>
@@ -415,9 +416,15 @@ void
meta_monitor_manager_kms_resume (MetaMonitorManagerKms *manager_kms)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_kms);
ClutterBackend *clutter_backend = clutter_get_default_backend ();
CoglContext *cogl_context =
clutter_backend_get_cogl_context (clutter_backend);
meta_monitor_manager_kms_connect_uevent_handler (manager_kms);
handle_hotplug_event (manager);
if (cogl_has_feature (cogl_context, COGL_FEATURE_ID_UNSTABLE_TEXTURES))
meta_wayland_outputs_redraw (meta_wayland_compositor_get_default ());
}
static gboolean
@@ -642,10 +649,12 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
GError **error)
{
MetaMonitorManagerKms *manager_kms = META_MONITOR_MANAGER_KMS (initable);
MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_kms);
const char *subsystems[2] = { "drm", NULL };
GList *gpu_paths;
g_autofree char *primary_gpu_path = NULL;
GList *l;
gboolean can_have_outputs;
manager_kms->udev = g_udev_client_new (subsystems);
@@ -681,8 +690,11 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
gpu_kms = meta_gpu_kms_new (manager_kms, gpu_path, &secondary_error);
if (!gpu_kms)
{
g_warning ("Failed to open secondary gpu '%s': %s",
gpu_path, secondary_error->message);
if (g_error_matches (secondary_error, META_GPU_KMS_ERROR, META_GPU_KMS_ERROR_NO_CONNECTORS))
g_message ("Ignoring GPU %s due to the lack of connectors", gpu_path);
else
g_warning ("Failed to open secondary gpu '%s': %s", gpu_path, secondary_error->message);
continue;
}
@@ -691,6 +703,24 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
}
g_list_free_full (gpu_paths, g_free);
can_have_outputs = FALSE;
for (l = meta_monitor_manager_get_gpus (manager); l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
if (meta_gpu_kms_can_have_outputs (gpu_kms))
{
can_have_outputs = TRUE;
break;
}
}
if (!can_have_outputs)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND,
"No GPUs with outputs found");
return FALSE;
}
return TRUE;
}

View File

@@ -96,13 +96,13 @@ typedef struct _MetaRendererNativeGpuData
#ifdef HAVE_EGL_DEVICE
struct {
EGLDeviceEXT device;
gboolean no_egl_output_drm_flip_event;
} egl;
#endif
MetaRendererNativeMode mode;
gboolean no_add_fb2;
EGLDisplay egl_display;
/*
@@ -1291,8 +1291,6 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
renderer_gpu_data =
meta_renderer_native_get_gpu_data (onscreen_native->renderer_native,
onscreen_native->render_gpu);
if (renderer_gpu_data->egl.no_egl_output_drm_flip_event)
return FALSE;
closure_container =
meta_gpu_kms_wrap_flip_closure (onscreen_native->render_gpu, flip_closure);
@@ -1313,9 +1311,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
if (error->domain != META_EGL_ERROR ||
error->code != EGL_RESOURCE_BUSY_EXT)
{
g_warning ("Failed to flip EGL stream (%s), relying on clock from "
"now on", error->message);
renderer_gpu_data->egl.no_egl_output_drm_flip_event = TRUE;
g_warning ("Failed to flip EGL stream: %s", error->message);
}
g_error_free (error);
meta_gpu_kms_flip_closure_container_free (closure_container);
@@ -1625,12 +1621,23 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
return FALSE;
}
for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
if (gbm_bo_get_handle_for_plane (next_bo, 0).s32 == -1)
{
strides[i] = gbm_bo_get_stride_for_plane (next_bo, i);
handles[i] = gbm_bo_get_handle_for_plane (next_bo, i).u32;
offsets[i] = gbm_bo_get_offset (next_bo, i);
modifiers[i] = gbm_bo_get_modifier (next_bo);
/* Failed to fetch handle to plane, falling back to old method */
strides[0] = gbm_bo_get_stride (next_bo);
handles[0] = gbm_bo_get_handle (next_bo).u32;
offsets[0] = 0;
modifiers[0] = DRM_FORMAT_MOD_INVALID;
}
else
{
for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
{
strides[i] = gbm_bo_get_stride_for_plane (next_bo, i);
handles[i] = gbm_bo_get_handle_for_plane (next_bo, i).u32;
offsets[i] = gbm_bo_get_offset (next_bo, i);
modifiers[i] = gbm_bo_get_modifier (next_bo);
}
}
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
@@ -2115,7 +2122,7 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
EGLOutputLayerEXT output_layer;
EGLAttrib output_attribs[3];
EGLint stream_attribs[] = {
EGL_STREAM_FIFO_LENGTH_KHR, 1,
EGL_STREAM_FIFO_LENGTH_KHR, 0,
EGL_CONSUMER_AUTO_ACQUIRE_EXT, EGL_FALSE,
EGL_NONE
};
@@ -2196,15 +2203,14 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
uint32_t format,
GError **error)
{
MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
MetaRendererNativeGpuData *renderer_gpu_data;
struct drm_mode_create_dumb create_arg;
struct drm_mode_destroy_dumb destroy_arg;
struct drm_mode_map_dumb map_arg;
uint32_t fb_id = 0;
void *map;
int kms_fd;
uint32_t handles[4] = { 0, };
uint32_t pitches[4] = { 0, };
uint32_t offsets[4] = { 0, };
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
@@ -2222,18 +2228,25 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
goto err_ioctl;
}
handles[0] = create_arg.handle;
pitches[0] = create_arg.pitch;
if (drmModeAddFB2 (kms_fd, width, height, format,
handles, pitches, offsets,
&fb_id, 0) != 0)
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
gpu_kms);
if (!renderer_gpu_data->no_add_fb2)
{
g_debug ("drmModeAddFB2 failed (%s), falling back to drmModeAddFB",
g_strerror (errno));
uint32_t handles[4] = { create_arg.handle, };
uint32_t pitches[4] = { create_arg.pitch, };
uint32_t offsets[4] = { 0 };
if (drmModeAddFB2 (kms_fd, width, height, format,
handles, pitches, offsets,
&fb_id, 0) != 0)
{
g_warning ("drmModeAddFB2 failed (%s), falling back to drmModeAddFB",
g_strerror (errno));
renderer_gpu_data->no_add_fb2 = TRUE;
}
}
if (fb_id == 0)
if (renderer_gpu_data->no_add_fb2)
{
if (drmModeAddFB (kms_fd, width, height,
24 /* depth of RGBX8888 */,
@@ -2732,9 +2745,14 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
MetaMonitor *main_monitor;
MetaOutput *main_output;
MetaCrtc *crtc;
MetaMonitorTransform crtc_transform;
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
main_output = meta_monitor_get_main_output (main_monitor);
crtc = meta_output_get_assigned_crtc (main_output);
crtc_transform =
meta_monitor_logical_to_crtc_transform (main_monitor,
logical_monitor->transform);
/*
* Pick any monitor and output and check; all CRTCs of a logical monitor will
@@ -2743,10 +2761,64 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
if (meta_monitor_manager_is_transform_handled (monitor_manager,
crtc,
crtc->transform))
crtc_transform))
return META_MONITOR_TRANSFORM_NORMAL;
else
return crtc->transform;
return crtc_transform;
}
static CoglContext *
cogl_context_from_renderer_native (MetaRendererNative *renderer_native)
{
MetaMonitorManager *monitor_manager =
META_MONITOR_MANAGER (renderer_native->monitor_manager_kms);
MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
return clutter_backend_get_cogl_context (clutter_backend);
}
static gboolean
should_force_shadow_fb (MetaRendererNative *renderer_native,
MetaGpuKms *primary_gpu)
{
CoglContext *cogl_context =
cogl_context_from_renderer_native (renderer_native);
CoglGpuInfo *info = &cogl_context->gpu;
int kms_fd;
uint64_t prefer_shadow = 0;
switch (info->architecture)
{
case COGL_GPU_INFO_ARCHITECTURE_UNKNOWN:
case COGL_GPU_INFO_ARCHITECTURE_SANDYBRIDGE:
case COGL_GPU_INFO_ARCHITECTURE_SGX:
case COGL_GPU_INFO_ARCHITECTURE_MALI:
return FALSE;
case COGL_GPU_INFO_ARCHITECTURE_LLVMPIPE:
case COGL_GPU_INFO_ARCHITECTURE_SOFTPIPE:
case COGL_GPU_INFO_ARCHITECTURE_SWRAST:
break;
}
kms_fd = meta_gpu_kms_get_fd (primary_gpu);
if (drmGetCap (kms_fd, DRM_CAP_DUMB_PREFER_SHADOW, &prefer_shadow) == 0)
{
if (prefer_shadow)
{
static gboolean logged_once = FALSE;
if (!logged_once)
{
g_message ("Forcing shadow framebuffer");
logged_once = TRUE;
}
return TRUE;
}
}
return FALSE;
}
static MetaRendererView *
@@ -2758,10 +2830,8 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
renderer_native->monitor_manager_kms;
MetaMonitorManager *monitor_manager =
META_MONITOR_MANAGER (monitor_manager_kms);
MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
CoglContext *cogl_context =
clutter_backend_get_cogl_context (clutter_backend);
cogl_context_from_renderer_native (renderer_native);
CoglDisplay *cogl_display = cogl_context_get_display (cogl_context);
MetaGpuKms *primary_gpu;
CoglDisplayEGL *cogl_display_egl;
@@ -2796,7 +2866,8 @@ meta_renderer_native_create_view (MetaRenderer *renderer,
if (!onscreen)
g_error ("Failed to allocate onscreen framebuffer: %s", error->message);
if (view_transform != META_MONITOR_TRANSFORM_NORMAL)
if (view_transform != META_MONITOR_TRANSFORM_NORMAL ||
should_force_shadow_fb (renderer_native, primary_gpu))
{
offscreen = meta_renderer_native_create_offscreen (renderer_native,
cogl_context,

View File

@@ -1,231 +0,0 @@
/*
* Copyright 2013, 2018 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#include "config.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
#include <X11/extensions/Xfixes.h>
#include "core/display-private.h"
#include "meta/meta-x11-display.h"
enum
{
PROP_0,
PROP_DISPLAY,
N_PROPS
};
static GParamSpec *obj_props[N_PROPS];
struct _MetaCursorSpriteXfixes
{
MetaCursorSprite parent;
MetaDisplay *display;
};
static void
meta_screen_cast_xfixes_init_initable_iface (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (MetaCursorSpriteXfixes,
meta_cursor_sprite_xfixes,
META_TYPE_CURSOR_SPRITE,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
meta_screen_cast_xfixes_init_initable_iface))
static void
meta_cursor_sprite_xfixes_realize_texture (MetaCursorSprite *sprite)
{
}
static gboolean
meta_cursor_sprite_xfixes_is_animated (MetaCursorSprite *sprite)
{
return FALSE;
}
static void
meta_cursor_sprite_xfixes_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaCursorSpriteXfixes *sprite_xfixes = META_CURSOR_SPRITE_XFIXES (object);
switch (prop_id)
{
case PROP_DISPLAY:
g_value_set_object (value, sprite_xfixes->display);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
meta_cursor_sprite_xfixes_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaCursorSpriteXfixes *sprite_xfixes = META_CURSOR_SPRITE_XFIXES (object);
switch (prop_id)
{
case PROP_DISPLAY:
sprite_xfixes->display = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
MetaCursorSpriteXfixes *
meta_cursor_sprite_xfixes_new (MetaDisplay *display,
GError **error)
{
return g_initable_new (META_TYPE_CURSOR_SPRITE_XFIXES,
NULL, error,
"display", display,
NULL);
}
static gboolean
meta_cursor_sprite_xfixes_initable_init (GInitable *initable,
GCancellable *cancellable,
GError **error)
{
MetaCursorSpriteXfixes *sprite_xfixes =
META_CURSOR_SPRITE_XFIXES (initable);
MetaCursorSprite *sprite = META_CURSOR_SPRITE (sprite_xfixes);
MetaX11Display *x11_display;
Display *xdisplay;
XFixesCursorImage *cursor_image;
CoglTexture2D *texture;
uint8_t *cursor_data;
gboolean free_cursor_data;
ClutterBackend *clutter_backend;
CoglContext *cogl_context;
x11_display = meta_display_get_x11_display (sprite_xfixes->display);
xdisplay = meta_x11_display_get_xdisplay (x11_display);
cursor_image = XFixesGetCursorImage (xdisplay);
if (!cursor_image)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to get cursor image");
return FALSE;
}
/*
* Like all X APIs, XFixesGetCursorImage() returns arrays of 32-bit
* quantities as arrays of long; we need to convert on 64 bit
*/
if (sizeof (long) == 4)
{
cursor_data = (uint8_t *) cursor_image->pixels;
free_cursor_data = FALSE;
}
else
{
int i, j;
uint32_t *cursor_words;
unsigned long *p;
uint32_t *q;
cursor_words = g_new (uint32_t,
cursor_image->width * cursor_image->height);
cursor_data = (uint8_t *) cursor_words;
p = cursor_image->pixels;
q = cursor_words;
for (j = 0; j < cursor_image->height; j++)
{
for (i = 0; i < cursor_image->width; i++)
*(q++) = *(p++);
}
free_cursor_data = TRUE;
}
clutter_backend = clutter_get_default_backend ();
cogl_context = clutter_backend_get_cogl_context (clutter_backend);
texture = cogl_texture_2d_new_from_data (cogl_context,
cursor_image->width,
cursor_image->height,
CLUTTER_CAIRO_FORMAT_ARGB32,
cursor_image->width * 4, /* stride */
cursor_data,
error);
if (free_cursor_data)
g_free (cursor_data);
if (!sprite)
return FALSE;
meta_cursor_sprite_set_texture (sprite,
COGL_TEXTURE (texture),
cursor_image->xhot,
cursor_image->yhot);
cogl_object_unref (texture);
XFree (cursor_image);
return TRUE;
}
static void
meta_screen_cast_xfixes_init_initable_iface (GInitableIface *iface)
{
iface->init = meta_cursor_sprite_xfixes_initable_init;
}
static void
meta_cursor_sprite_xfixes_init (MetaCursorSpriteXfixes *sprite_xfixes)
{
}
static void
meta_cursor_sprite_xfixes_class_init (MetaCursorSpriteXfixesClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
MetaCursorSpriteClass *cursor_sprite_class = META_CURSOR_SPRITE_CLASS (klass);
object_class->get_property = meta_cursor_sprite_xfixes_get_property;
object_class->set_property = meta_cursor_sprite_xfixes_set_property;
cursor_sprite_class->realize_texture =
meta_cursor_sprite_xfixes_realize_texture;
cursor_sprite_class->is_animated = meta_cursor_sprite_xfixes_is_animated;
obj_props[PROP_DISPLAY] =
g_param_spec_object ("display",
"display",
"MetaDisplay",
META_TYPE_DISPLAY,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPS, obj_props);
}

View File

@@ -1,36 +0,0 @@
/*
* Copyright 2013, 2018 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program 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
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef META_CURSOR_SPRITE_XFIXES_H
#define META_CURSOR_SPRITE_XFIXES_H
#include <glib-object.h>
#include "backends/meta-cursor.h"
#include "meta/types.h"
#define META_TYPE_CURSOR_SPRITE_XFIXES (meta_cursor_sprite_xfixes_get_type ())
G_DECLARE_FINAL_TYPE (MetaCursorSpriteXfixes,
meta_cursor_sprite_xfixes,
META, CURSOR_SPRITE_XFIXES,
MetaCursorSprite)
MetaCursorSpriteXfixes * meta_cursor_sprite_xfixes_new (MetaDisplay *display,
GError **error);
#endif /* META_CURSOR_SPRITE_XFIXES_H */

View File

@@ -176,7 +176,7 @@ translate_device_event (MetaBackendX11 *x11,
meta_backend_x11_translate_device_event (x11, device_event);
if (!device_event->send_event && device_event->time != META_CURRENT_TIME)
if (!device_event->send_event && device_event->time != CurrentTime)
{
if (XSERVER_TIME_IS_BEFORE (device_event->time, priv->latest_evtime))
{
@@ -332,7 +332,7 @@ handle_host_xevent (MetaBackend *backend,
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
bypass_clutter = TRUE;
if (meta_dnd_handle_xdnd_event (backend, compositor, priv->xdisplay, event))
if (meta_dnd_handle_xdnd_event (backend, compositor, display, event))
bypass_clutter = TRUE;
}
}
@@ -547,7 +547,7 @@ meta_backend_x11_grab_device (MetaBackend *backend,
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
int ret;
if (timestamp != META_CURRENT_TIME)
if (timestamp != CurrentTime)
timestamp = MAX (timestamp, priv->latest_evtime);
XISetMask (mask.mask, XI_ButtonPress);
@@ -802,13 +802,3 @@ meta_backend_x11_get_xwindow (MetaBackendX11 *x11)
ClutterActor *stage = meta_backend_get_stage (META_BACKEND (x11));
return clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
}
void
meta_backend_x11_reload_cursor (MetaBackendX11 *x11)
{
MetaBackend *backend = META_BACKEND (x11);
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
meta_cursor_renderer_force_update (cursor_renderer);
}

View File

@@ -57,6 +57,4 @@ void meta_backend_x11_handle_event (MetaBackendX11 *x11,
uint8_t meta_backend_x11_get_xkb_event_base (MetaBackendX11 *x11);
void meta_backend_x11_reload_cursor (MetaBackendX11 *x11);
#endif /* META_BACKEND_X11_H */

View File

@@ -40,7 +40,6 @@
#include <meta/barrier.h>
#include "backends/x11/meta-barrier-x11.h"
#include "display-private.h"
#include "x11/meta-x11-display-private.h"
struct _MetaBarrierImplX11Private
{
@@ -69,11 +68,10 @@ _meta_barrier_impl_x11_release (MetaBarrierImpl *impl,
MetaBarrierImplX11Private *priv =
meta_barrier_impl_x11_get_instance_private (self);
MetaDisplay *display = priv->barrier->priv->display;
Display *dpy = meta_x11_display_get_xdisplay (display->x11_display);
if (META_X11_DISPLAY_HAS_XINPUT_23 (display->x11_display))
if (META_DISPLAY_HAS_XINPUT_23 (display))
{
XIBarrierReleasePointer (dpy,
XIBarrierReleasePointer (display->xdisplay,
META_VIRTUAL_CORE_POINTER_ID,
priv->xbarrier, event->event_id);
}
@@ -91,13 +89,13 @@ _meta_barrier_impl_x11_destroy (MetaBarrierImpl *impl)
if (display == NULL)
return;
dpy = meta_x11_display_get_xdisplay (display->x11_display);
dpy = display->xdisplay;
if (!meta_barrier_is_active (priv->barrier))
return;
XFixesDestroyPointerBarrier (dpy, priv->xbarrier);
g_hash_table_remove (display->x11_display->xids, &priv->xbarrier);
g_hash_table_remove (display->xids, &priv->xbarrier);
priv->xbarrier = 0;
}
@@ -121,7 +119,7 @@ meta_barrier_impl_x11_new (MetaBarrier *barrier)
priv = meta_barrier_impl_x11_get_instance_private (self);
priv->barrier = barrier;
dpy = meta_x11_display_get_xdisplay (display->x11_display);
dpy = display->xdisplay;
root = DefaultRootWindow (dpy);
allowed_motion_dirs =
@@ -134,7 +132,7 @@ meta_barrier_impl_x11_new (MetaBarrier *barrier)
allowed_motion_dirs,
0, NULL);
g_hash_table_insert (display->x11_display->xids, &priv->xbarrier, barrier);
g_hash_table_insert (display->xids, &priv->xbarrier, barrier);
return META_BARRIER_IMPL (self);
}
@@ -174,8 +172,8 @@ meta_barrier_fire_xevent (MetaBarrier *barrier,
}
gboolean
meta_x11_display_process_barrier_xevent (MetaX11Display *x11_display,
XIEvent *event)
meta_display_process_barrier_xevent (MetaDisplay *display,
XIEvent *event)
{
MetaBarrier *barrier;
XIBarrierEvent *xev;
@@ -193,7 +191,7 @@ meta_x11_display_process_barrier_xevent (MetaX11Display *x11_display,
}
xev = (XIBarrierEvent *) event;
barrier = g_hash_table_lookup (x11_display->xids, &xev->barrier);
barrier = g_hash_table_lookup (display->xids, &xev->barrier);
if (barrier != NULL)
{
meta_barrier_fire_xevent (barrier, xev);

View File

@@ -35,7 +35,7 @@
#include <gudev/gudev.h>
#endif
#include <meta/meta-x11-errors.h>
#include <meta/errors.h>
#include "backends/meta-logical-monitor.h"
typedef struct _MetaInputSettingsX11Private
@@ -63,9 +63,9 @@ device_free_xdevice (gpointer user_data)
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
XDevice *xdev = user_data;
meta_x11_error_trap_push (display->x11_display);
meta_error_trap_push (display);
XCloseDevice (xdisplay, xdev);
meta_x11_error_trap_pop (display->x11_display);
meta_error_trap_pop (display);
}
static XDevice *
@@ -81,9 +81,9 @@ device_ensure_xdevice (ClutterInputDevice *device)
if (xdev)
return xdev;
meta_x11_error_trap_push (display->x11_display);
meta_error_trap_push (display);
xdev = XOpenDevice (xdisplay, device_id);
meta_x11_error_trap_pop (display->x11_display);
meta_error_trap_pop (display);
if (xdev)
{
@@ -586,7 +586,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
return;
/* Grab the puke bucket! */
meta_x11_error_trap_push (display->x11_display);
meta_error_trap_push (display);
xdev = device_ensure_xdevice (device);
if (xdev)
{
@@ -595,7 +595,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
Absolute : Relative);
}
if (meta_x11_error_trap_pop_with_return (display->x11_display))
if (meta_error_trap_pop_with_return (display))
{
g_warning ("Could not set tablet mapping for %s",
clutter_input_device_get_device_name (device));
@@ -782,6 +782,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
return;
/* Grab the puke bucket! */
meta_error_trap_push (display);
xdev = device_ensure_xdevice (device);
if (xdev)
{
@@ -799,7 +800,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
XSetDeviceButtonMapping (xdisplay, xdev, map, G_N_ELEMENTS (map));
}
if (meta_x11_error_trap_pop_with_return (display->x11_display))
if (meta_error_trap_pop_with_return (display))
{
g_warning ("Could not set stylus button map for %s",
clutter_input_device_get_device_name (device));

View File

@@ -39,7 +39,7 @@
#include "meta-backend-x11.h"
#include <meta/main.h>
#include <meta/meta-x11-errors.h>
#include <meta/errors.h>
#include "backends/meta-crtc.h"
#include "backends/meta-monitor-config-manager.h"
#include "backends/meta-logical-monitor.h"

View File

@@ -51,10 +51,14 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
MetaMonitor *main_monitor;
MetaOutput *main_output;
MetaCrtc *crtc;
MetaMonitorTransform crtc_transform;
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
main_output = meta_monitor_get_main_output (main_monitor);
crtc = meta_output_get_assigned_crtc (main_output);
crtc_transform =
meta_monitor_logical_to_crtc_transform (main_monitor,
logical_monitor->transform);
/*
* Pick any monitor and output and check; all CRTCs of a logical monitor will
* always have the same transform assigned to them.
@@ -62,10 +66,10 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
if (meta_monitor_manager_is_transform_handled (monitor_manager,
crtc,
crtc->transform))
crtc_transform))
return META_MONITOR_TRANSFORM_NORMAL;
else
return crtc->transform;
return crtc_transform;
}
static MetaRendererView *

View File

@@ -143,7 +143,8 @@ meta_actor_is_untransformed (ClutterActor *actor,
* transform.
*/
gboolean
meta_actor_painting_untransformed (int paint_width,
meta_actor_painting_untransformed (CoglFramebuffer *fb,
int paint_width,
int paint_height,
int *x_origin,
int *y_origin)
@@ -153,8 +154,8 @@ meta_actor_painting_untransformed (int paint_width,
float viewport[4];
int i;
cogl_get_modelview_matrix (&modelview);
cogl_get_projection_matrix (&projection);
cogl_framebuffer_get_modelview_matrix (fb, &modelview);
cogl_framebuffer_get_projection_matrix (fb, &projection);
cogl_matrix_multiply (&modelview_projection,
&projection,
@@ -173,7 +174,7 @@ meta_actor_painting_untransformed (int paint_width,
vertices[3].y = paint_height;
vertices[3].z = 0;
cogl_get_viewport (viewport);
cogl_framebuffer_get_viewport4fv (fb, viewport);
for (i = 0; i < 4; i++)
{

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