Compare commits

..

87 Commits

Author SHA1 Message Date
255a7afe73 core: Avoid queueing resizes while changing workspace during window drag
We already have a user move/resize going on, so avoid botching it with
window resizes with flags & META_MOVE_RESIZE_USER_ACTION == 0 that will
trigger unintended constraints.

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

Closes: #192
2018-06-14 21:10:05 +02:00
3649795108 wayland: Detach MetaWaylandActorSurface from its actor on dispose
And ensure the actor is no longer reactive even though it might live longer
because of close effects, GCs, and whatnot. This ensures the actor is not
eligible for pointer picking within the destruction of its surface.

Closes: #188
2018-06-14 14:05:10 +02:00
36b9551f92 Update Chinese (Taiwan) translation 2018-06-13 08:36:21 +00:00
6abe4703c7 core: Hide close dialog before destroying
The MetaCloseDialog implementation object may stay artifically alive
for a longer period. This was usually fine till gnome-shell commit
b03bcc85aad, as the check_alive() timeout will keep running even
though the window went unmanaged/destroyed, leading to crashes.

In order to fix this, forcibly hide the dialog if it is visible and
the window is being unmanaged, so the timeout is stopped in time.
2018-06-08 17:41:34 +02:00
69ca584168 wayland: Handle get_subsurface() with a role-less parent surface
The order of role creation is undetermined, so we can't account that
the parent surface will have a role (and an actor) at the time of
creating the wl_subsurface role for a child surface.

So we must do it both ways, add the subsurface as a child on
get_subsurface() if the parent already got a role, and lazily add
child subsurface actors to the current one if the parent surface got
it at a later point.

Related: #132
2018-06-08 17:31:25 +02:00
8ee14a7cb7 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
2018-06-07 22:14:05 +02:00
909dbafd67 settings: Remove confused comment
It got lost, lets help it find the way out.
2018-06-07 12:57:52 +00:00
d5203f170e 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.
2018-06-07 12:57:51 +00:00
2a45b7de7c clutter-input-device-xi2: Check for null group_modes before unref 2018-06-07 12:54:56 +01:00
62c67be4c8 clutter-actor: Fix uninitialized matrix multiply
`modelview` is uninitialized and the `apply` function just multiplies it.
What we really want is to initialize `modelview` so replace `apply` with
`get`.

Who knows what bugs this may have caused...
2018-05-31 15:43:27 +08:00
0332b7394e renderer-native: Don't crash if the FB surface can't be locked 2018-05-29 22:13:03 +00:00
15f41c9f68 device-manager-evdev: Add main seat to seats by default
Treat the main seat as other seats, so we don't have to handle it differently
in specific places. This was already the case before when a real device
was plugged before the startup, but not applied when hotplugging a device.
2018-05-29 10:35:51 +00:00
2a38601b42 device-manager-evdev: Free the main seat on finalize 2018-05-29 10:35:51 +00:00
d7bdc1591f 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.
2018-05-29 10:35:51 +00:00
bd36764b4d 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 18:58:42 +09:00
473bf38753 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
2018-05-25 09:20:36 +00:00
f7747e4d4f Bump version to 3.29.2
Update NEWS.
2018-05-24 17:12:55 +02:00
e8dc2acfca Update Chinese (China) translation 2018-05-21 16:18:26 +00:00
cf734999fb 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
2018-05-18 13:09:10 +00:00
c9c3283540 shaped-texture: Disable mipmapping during animation
This avoids overwhelming the GPU with trying to update mipmaps at a high
rate. Because doing so could easily cause a reduction in the compositor
frame rate and thus actually reduce visual quality.

In the case of a window that is constantly animating in the overview,
this reduces mutter's render time by around 20%-30%.
2018-05-18 16:45:26 +08:00
d2a8cdfd7c Update Galician translation 2018-05-15 22:33:40 +00:00
3e85ac8131 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.
2018-05-15 12:09:59 +01:00
5f83d9a5c8 clutter-seat-evdev: Add function to get device by id 2018-05-15 12:05:39 +01:00
ac20bf2000 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-14 17:11:57 +01:00
3561082aba 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-14 13:44:03 +01:00
e34c330f66 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:41:01 +02:00
7655e09d00 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 21:44:47 +02:00
be069fb8ae 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 21:44:47 +02:00
a30166a547 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 21:44:47 +02:00
0f9c6aef99 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
2018-05-07 19:24:47 +00:00
332d55f7f6 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
2018-05-07 19:16:40 +00:00
98d7024288 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.
2018-05-07 19:16:39 +00:00
82564772dc 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
2018-05-07 19:50:20 +02:00
33c2a38ff7 main: Fix typo 2018-05-04 20:15:33 +02:00
52fdd24467 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
2018-05-03 11:39:33 +02:00
2319cd9c40 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
2018-04-30 13:55:41 +00:00
3b4319a87c Update Romanian translation 2018-04-30 05:56:32 +00:00
20176d0395 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-04-25 23:33:41 -03:00
762a3f89a9 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-04-25 21:55:05 -03:00
822c2666f5 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-04-25 21:55:05 -03:00
b412e6c493 Bump version to 3.29.1
Update NEWS.
2018-04-25 20:25:43 +02:00
ae26cd0774 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
2018-04-25 17:22:24 +02:00
3104d697c0 cogl: Do not unref a NULL object
Add return-if-fail statement to avoid deferencing NULL object
2018-04-25 09:03:58 +00:00
0b3a1c9c31 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
2018-04-25 10:50:50 +02:00
423c5f8e77 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:48:01 +02:00
3bbff94878 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 21:58:38 +01:00
4ef886f51e wayland: Avoid actor updates non actor_surface role wl_surface.commit
We used to maintain an actor for cursors, even though we would possibly
use hw overlays or even some other overlay actor for those. This happens
no more, so check whether we are dealing with an actor-backed surface role
before fiddling with it.
2018-04-23 21:31:19 +02:00
22485ba36f wayland: Refactor surface actor into MetaWaylandActorSurface
All surface roles that do need a backing actor inherit from this
class, it makes sense to move actor management there. This also
means the MetaWaylandActorSurface is in charge of emitting
::geometry-changed on the MetaWaylandSurface.
2018-04-23 21:31:19 +02:00
8df2a1452c wayland: Notify actively of xwayland window/surface associations
Instead of scheduling a meta_later, keep track of the unassociated
windows, and look for matches as soon as the MetaWaylandSurface is
created on our side.

This will ensure the surface is given the Xwayland role before receiving
the first wl_surface.commit.
2018-04-23 21:31:19 +02:00
b12c92e206 wayland: Add MetaWaylandSurface::geometry-changed signal
Abstract this instead of having callers connect to notify:: signals
on the surface actor.
2018-04-23 21:31:19 +02:00
70036429bd wayland: Abstract access to the actor corresponding to a wl_surface
The actor itself will be shuffled around, abstract all external
access to it behind a function to make that easier later on.
2018-04-23 12:24:46 +02:00
44502be560 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 00:52:48 +02:00
8cf42cd06c clutter: Plug minor leak
clutter_stage_manager_list_stages() returns a copied list, which
should be freed.
2018-04-22 00:52:19 +02:00
b5328c977e 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 00:52:05 +02:00
4339b23dd0 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
2018-04-20 14:38:57 +00:00
a95cbd0aca 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-18 19:14:26 +00:00
6df2b7af55 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
2018-04-18 17:07:21 +02:00
c01b099dbd 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.
2018-04-18 17:07:21 +02:00
2d80fd02e7 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.
2018-04-17 11:14:00 -04:00
bb65854065 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.
2018-04-17 11:14:00 -04:00
bc05e49eba 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-04-16 16:30:21 +02:00
773b8384fa 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-04-16 16:30:21 +02:00
7fdac6d310 monitor-manager-kms: Use g_autoptr for error
A minor code cleanup.
2018-04-16 16:30:21 +02:00
f6cd87734d 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.
2018-04-16 16:29:38 +02:00
01a0fa9437 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 13:28:03 +02:00
657417a578 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 13:28:03 +02:00
4af00ae296 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 13:28:03 +02:00
84e575be77 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 13:28:03 +02:00
7945ee5beb 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 13:28:03 +02:00
b6f5bab212 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-12 23:35:20 +02:00
5ad34e0efb 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).


(cherry picked from commit 23c3f8bb18)
2018-04-11 17:57:25 +00:00
a1c34aad09 Updated Slovenian translation 2018-04-10 17:58:55 +02:00
98dfd5b887 screen-cast: Fix compile error
Credit goes to gcc for finding this typo.
2018-04-10 13:02:51 +02:00
17a745bf81 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
2018-04-09 10:19:26 +02:00
85bbd82ae8 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
2018-04-09 10:19:26 +02:00
deda7a5235 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
2018-04-03 20:27:21 +00:00
96141e28f9 theme: add ".appmenu" class to the appmenu button
So it does gtk headerbar, so mutter should do.
2018-04-03 20:16:15 +00:00
e6109cfc22 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
2018-04-03 18:17:04 +00:00
3684f6b0ac 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
2018-04-03 14:55:17 +00:00
31b5059068 input-settings: Fix a typo in tap-and-drag setting 2018-03-29 09:51:32 -05:00
ebff7fd7f4 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
2018-03-29 06:34:37 +00:00
6e415353e3 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.
2018-03-29 13:35:59 +08:00
67917db45f 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
2018-03-23 15:12:37 +01:00
8286557a05 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 21:21:43 +01:00
63e2c0329f window: Fix a small memory leak 2018-03-21 21:16:23 -03:00
06c357d781 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 21:42:37 +01:00
2f260edf19 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 18:45:20 +00:00
158 changed files with 2574 additions and 5459 deletions

39
NEWS
View File

@ -1,43 +1,34 @@
3.28.3
3.29.2
======
* Fix size change animations on wayland [Georges; #780292]
* 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]
* 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, Georges Basile Stavracas Neto,
Changwoo Ryu, Marco Trevisan (Treviño)
3.28.2
======
* 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]
* Misc. bug fixes [Florian, Olivier, Jonas, Georges; #134, #124, !96, #138,
!102, #781471, #150]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Florian Müllner,
Georges Basile Stavracas Neto, Bastien Nocera, Mario Sanchez Prada,
Ray Strode, Marco Trevisan (Treviño)
Georges Basile Stavracas Neto, Marco Trevisan (Treviño), Daniel van Vugt
3.28.1
Translators:
Daniel Șerbănescu [ro], Marcos Lans [gl], Dz Chen [zh_CN]
3.29.1
======
* Fix various input-method regressions [Carlos; #65, #74, #66]
* Fix various input-method regressions [Carlos, Olivier; #65, #74, #66, #112]
* 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]
* Disable KMS modifiers by default [Jonas; #81]
* Misc bug fixes [handsome-feng; !45]
* 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]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, handsome-feng, Yussuf Khalil,
Ting-Wei Lan, Aleksandr Mezin, Alberts Muktupāvels,
Georges Basile Stavracas Neto, Benjamin Otte, Daniel Stone, Rasmus Thomsen,
Georges Basile Stavracas Neto, Bastien Nocera, Benjamin Otte,
Mario Sanchez Prada, Daniel Stone, Ray Strode, Rasmus Thomsen,
Marco Trevisan (Treviño), Daniel van Vugt
Translators:

View File

@ -214,6 +214,8 @@ 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_apply_relative_transformation_matrix (self, NULL, &modelview);
_clutter_actor_get_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;
g_set_object (&real_event->device, device);
real_event->device = device;
}
switch (event->type)
@ -1364,8 +1364,8 @@ clutter_event_copy (const ClutterEvent *event)
{
ClutterEventPrivate *real_event = (ClutterEventPrivate *) event;
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->device = real_event->device;
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,14 +1435,6 @@ 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:
@ -1697,7 +1689,7 @@ clutter_event_set_source_device (ClutterEvent *event,
return;
real_event = (ClutterEventPrivate *) event;
g_set_object (&real_event->source_device, device);
real_event->source_device = device;
}
/**

View File

@ -3722,17 +3722,6 @@ 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,9 +250,6 @@ 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,6 +324,7 @@ 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;
@ -331,7 +332,6 @@ 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,6 +519,7 @@ 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,6 +385,7 @@ 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;
@ -630,6 +631,7 @@ 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.
@ -682,6 +684,7 @@ 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;
@ -810,6 +813,7 @@ 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,22 +185,6 @@ 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,
@ -210,33 +194,30 @@ 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 ();
evdev_button = translate_to_evdev_button (button);
if (get_button_type (evdev_button) != EVDEV_BUTTON_TYPE_BUTTON)
if (get_button_type (button) != EVDEV_BUTTON_TYPE_BUTTON)
{
g_warning ("Unknown/invalid virtual device button 0x%x pressed",
evdev_button);
button);
return;
}
button_count = update_button_count (virtual_evdev, evdev_button, button_state);
button_count = update_button_count (virtual_evdev, button, button_state);
if (button_count < 0 || button_count > 1)
{
g_warning ("Received multiple virtual 0x%x button %s (ignoring)", evdev_button,
g_warning ("Received multiple virtual 0x%x button %s (ignoring)", button,
button_state == CLUTTER_BUTTON_STATE_PRESSED ? "presses" : "releases");
update_button_count (virtual_evdev, evdev_button, 1 - button_state);
update_button_count (virtual_evdev, button, 1 - button_state);
return;
}
clutter_seat_evdev_notify_button (virtual_evdev->seat,
virtual_evdev->device,
time_us,
evdev_button,
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,7 +110,8 @@ clutter_input_device_xi2_finalize (GObject *object)
if (device_xi2->wacom_device)
libwacom_destroy (device_xi2->wacom_device);
g_array_unref (device_xi2->group_modes);
if (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;
clutter_event_set_device (event, device);
event->motion.device = device;
/* called about every 60fps, and do 10 picks per stage */
for (i = 0; i < 10; i++)

View File

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

View File

@ -263,7 +263,6 @@ 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,9 +210,6 @@ 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,14 +454,6 @@ _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 =
{
@ -484,6 +476,5 @@ cogl_sub_texture_vtable =
_cogl_sub_texture_get_gl_format,
_cogl_sub_texture_get_type,
NULL, /* is_foreign */
NULL, /* set_auto_mipmap */
_cogl_sub_texture_is_get_data_supported
NULL /* set_auto_mipmap */
};

View File

@ -1542,6 +1542,5 @@ 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 /* is_get_data_supported */
NULL /* set_auto_mipmap */
};

View File

@ -94,15 +94,6 @@ _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,
@ -702,6 +693,5 @@ 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_is_get_data_supported
_cogl_texture_2d_set_auto_mipmap
};

View File

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

View File

@ -149,8 +149,6 @@ 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,6 +773,5 @@ 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,
NULL /* is_get_data_supported */
_cogl_texture_rectangle_set_auto_mipmap
};

View File

@ -205,15 +205,6 @@ _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,12 +511,6 @@ 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,8 +398,6 @@ 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.
*
@ -430,8 +428,7 @@ 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_UNSTABLE_TEXTURES = (1 << 25)
COGL_FEATURE_DEPTH_TEXTURE = (1 << 24)
} CoglFeatureFlags;
/**

View File

@ -116,7 +116,4 @@ _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,12 +470,7 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
{
CoglTexture *tex = COGL_TEXTURE (tex_2d);
CoglContext *ctx = tex->context;
CoglPixelFormat external_format;
CoglPixelFormat internal_format;
external_format = loader->src.egl_image_external.format;
internal_format = _cogl_texture_determine_internal_format (tex,
external_format);
CoglPixelFormat internal_format = loader->src.egl_image_external.format;
_cogl_gl_util_clear_gl_errors (ctx);
@ -859,22 +854,13 @@ _cogl_texture_2d_gl_get_data (CoglTexture2D *tex_2d,
width,
bpp);
_cogl_bind_gl_texture_transient (tex_2d->gl_target,
_cogl_bind_gl_texture_transient (GL_TEXTURE_2D,
tex_2d->gl_texture,
tex_2d->is_foreign);
ctx->texture_driver->gl_get_tex_image (ctx,
tex_2d->gl_target,
GL_TEXTURE_2D,
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,7 +714,6 @@ _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,7 +493,6 @@ _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,7 +82,6 @@ _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,6 +1180,5 @@ 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 /* is_get_data_supported */
NULL /* set_auto_mipmap */
};

View File

@ -502,7 +502,6 @@ _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);
@ -515,16 +514,6 @@ _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,15 +832,12 @@ 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));
@ -853,6 +850,7 @@ 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);
@ -901,6 +899,7 @@ 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)
@ -922,14 +921,6 @@ 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,8 +1,8 @@
AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [28])
m4_define([mutter_micro_version], [3])
m4_define([mutter_minor_version], [29])
m4_define([mutter_micro_version], [2])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])
@ -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.2 >= 0.2.5"
MUTTER_PC_MODULES="$MUTTER_PC_MODULES libpipewire-0.1 >= 0.1.8"
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"])
@ -290,24 +290,13 @@ AS_IF([test "$have_native_backend" = "yes"], [
])
AM_CONDITIONAL([HAVE_NATIVE_BACKEND],[test "$have_native_backend" = "yes"])
MUTTER_WAYLAND_EGLSTREAM_MODULES="wayland-eglstream-protocols"
AC_ARG_ENABLE(egl-device,
AS_HELP_STRING([--enable-egl-device], [enable support for EGLDevice on top of KMS]),,
enable_egl_device=no
have_wayland_eglstream=no
)
AS_IF([test "$enable_egl_device" = "yes"], [
AC_DEFINE([HAVE_EGL_DEVICE],[1], [Defined if EGLDevice support is enabled])
PKG_CHECK_EXISTS([$MUTTER_WAYLAND_EGLSTREAM_MODULES], [have_wayland_eglstream=yes], [have_wayland_eglstream=no])
])
AS_IF([test "$have_wayland_eglstream" = "yes"], [
AC_DEFINE([HAVE_WAYLAND_EGLSTREAM],[1],[Defined if Wayland EGLStream protocols are available])
PKG_CHECK_MODULES(WAYLAND_EGLSTREAM, [$MUTTER_WAYLAND_EGLSTREAM_MODULES],
[ac_wayland_eglstream_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir $MUTTER_WAYLAND_EGLSTREAM_MODULES`])
AC_SUBST(WAYLAND_EGLSTREAM_DATADIR, $ac_wayland_eglstream_pkgdatadir)
])
AM_CONDITIONAL([HAVE_WAYLAND_EGLSTREAM],[test "$have_wayland_eglstream" = "yes"])
MUTTER_WAYLAND_MODULES="wayland-server >= 1.13.0"
@ -560,7 +549,6 @@ mutter-$VERSION
Introspection: ${found_introspection}
Session management: ${found_sm}
Wayland: ${have_wayland}
Wayland EGLStream: ${have_wayland_eglstream}
Native (KMS) backend: ${have_native_backend}
EGLDevice: ${enable_egl_device}
Remote desktop: ${enable_remote_desktop}

View File

@ -60,7 +60,7 @@
gettext-domain="@GETTEXT_DOMAIN@">
<key name="xwayland-allow-grabs" type="b">
<default>true</default>
<default>false</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>['@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@']</default>
<default>[]</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,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-01 10:47+0000\n"
"PO-Revision-Date: 2018-03-03 14:18+0200\n"
"Last-Translator: Fran Dieguez <frandieguez@gnome.org>\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"
"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: Virtaal 0.7.1\n"
"X-Generator: Poedit 2.0.6\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 controles do sistema"
msgstr "Cambiar entre os controis 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 controles do sistema directamente"
msgstr "Cambiar entre os controis do sistema directamente"
#: data/50-mutter-navigation.xml:102
msgid "Switch directly to previous system control"

554
po/ro.po
View File

@ -4,14 +4,13 @@
# 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.
# Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>, 2015, 2018.
msgid ""
msgstr ""
"Project-Id-Version: metacity.HEAD.ro\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"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-04-26 07:32+0000\n"
"PO-Revision-Date: 2018-04-30 07:54+0200\n"
"Last-Translator: Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>\n"
"Language-Team: Gnome Romanian Translation Team\n"
"Language: ro\n"
@ -23,272 +22,256 @@ msgstr ""
"X-Generator: Virtaal 0.7.1\n"
"X-Project-Style: gnome\n"
#: ../data/50-mutter-navigation.xml.in.h:1
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
msgstr "Navigare"
#: ../data/50-mutter-navigation.xml.in.h:2
#: data/50-mutter-navigation.xml:9
msgid "Move window to workspace 1"
msgstr "Mută fereastra pe spațiul de lucru 1"
#: ../data/50-mutter-navigation.xml.in.h:3
#: data/50-mutter-navigation.xml:12
msgid "Move window to workspace 2"
msgstr "Mută fereastra pe spațiul de lucru 2"
#: ../data/50-mutter-navigation.xml.in.h:4
#: data/50-mutter-navigation.xml:15
msgid "Move window to workspace 3"
msgstr "Mută fereastra pe spațiul de lucru 3"
#: ../data/50-mutter-navigation.xml.in.h:5
#: data/50-mutter-navigation.xml:18
msgid "Move window to workspace 4"
msgstr "Mută fereastra pe spațiul de lucru 4"
#: ../data/50-mutter-navigation.xml.in.h:6
#: data/50-mutter-navigation.xml:21
msgid "Move window to last workspace"
msgstr "Mută fereastra pe spațiul de lucru anterior"
#: ../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
#: data/50-mutter-navigation.xml:24
msgid "Move window one workspace up"
msgstr "Mută fereastra pe spațiul de lucru de mai sus"
#: ../data/50-mutter-navigation.xml.in.h:10
#: data/50-mutter-navigation.xml:27
msgid "Move window one workspace down"
msgstr "Mută fereastra pe spațiul de lucru de mai jos"
#: ../data/50-mutter-navigation.xml.in.h:11
#: data/50-mutter-navigation.xml:30
msgid "Move window one monitor to the left"
msgstr "Mută fereastra cu un monitor la stânga"
#: ../data/50-mutter-navigation.xml.in.h:12
#: data/50-mutter-navigation.xml:33
msgid "Move window one monitor to the right"
msgstr "Mută fereastra un monitor la dreapta"
#: ../data/50-mutter-navigation.xml.in.h:13
#: data/50-mutter-navigation.xml:36
msgid "Move window one monitor up"
msgstr "Mută fereastra cu un monitor mai sus"
#: ../data/50-mutter-navigation.xml.in.h:14
#: data/50-mutter-navigation.xml:39
msgid "Move window one monitor down"
msgstr "Mută fereastra cu un monitor mai jos"
#: ../data/50-mutter-navigation.xml.in.h:15
#: data/50-mutter-navigation.xml:43
msgid "Switch applications"
msgstr "Comută aplicațiile"
#: ../data/50-mutter-navigation.xml.in.h:16
#: data/50-mutter-navigation.xml:48
msgid "Switch to previous application"
msgstr "Schimbă la aplicația anterioară"
#: ../data/50-mutter-navigation.xml.in.h:17
#: data/50-mutter-navigation.xml:52
msgid "Switch windows"
msgstr "Schimbă ferestre"
#: ../data/50-mutter-navigation.xml.in.h:18
#: data/50-mutter-navigation.xml:57
msgid "Switch to previous window"
msgstr "Schimbă la fereastra anterioară"
#: ../data/50-mutter-navigation.xml.in.h:19
#: data/50-mutter-navigation.xml:61
msgid "Switch windows of an application"
msgstr "Schimbă ferestrele unei aplicații"
#: ../data/50-mutter-navigation.xml.in.h:20
#: data/50-mutter-navigation.xml:66
msgid "Switch to previous window of an application"
msgstr "Schimbă la fereastra anterioară a unei aplicații"
#: ../data/50-mutter-navigation.xml.in.h:21
#: data/50-mutter-navigation.xml:70
msgid "Switch system controls"
msgstr "Schimbă comenzile de sistem"
#: ../data/50-mutter-navigation.xml.in.h:22
#: data/50-mutter-navigation.xml:75
msgid "Switch to previous system control"
msgstr "Schimbă la comanda de control anterioară"
#: ../data/50-mutter-navigation.xml.in.h:23
#: data/50-mutter-navigation.xml:79
msgid "Switch windows directly"
msgstr "Schimbă ferestrele în mod direct"
#: ../data/50-mutter-navigation.xml.in.h:24
#: data/50-mutter-navigation.xml:84
msgid "Switch directly to previous window"
msgstr "Schimbă la fereastra anterioară în mod direct"
#: ../data/50-mutter-navigation.xml.in.h:25
#: data/50-mutter-navigation.xml:88
msgid "Switch windows of an app directly"
msgstr "Schimbă în mod direct ferestrele uneui aplicații "
msgstr "Comută direct ferestrele unei aplicații"
#: ../data/50-mutter-navigation.xml.in.h:26
#: data/50-mutter-navigation.xml:93
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.in.h:27
#: data/50-mutter-navigation.xml:97
msgid "Switch system controls directly"
msgstr "Schimbă comenzile de sistem în mod direct"
#: ../data/50-mutter-navigation.xml.in.h:28
#: data/50-mutter-navigation.xml:102
msgid "Switch directly to previous system control"
msgstr "Schimbă în mod direct la o comandă de sistem anterioară"
#: ../data/50-mutter-navigation.xml.in.h:29
#: data/50-mutter-navigation.xml:105
msgid "Hide all normal windows"
msgstr "Ascunde toate ferestrele normale "
msgstr "Ascunde toate ferestrele normale"
#: ../data/50-mutter-navigation.xml.in.h:30
#: data/50-mutter-navigation.xml:108
msgid "Switch to workspace 1"
msgstr "Comută la spațiul de lucru 1"
#: ../data/50-mutter-navigation.xml.in.h:31
#: data/50-mutter-navigation.xml:111
msgid "Switch to workspace 2"
msgstr "Comută la spațiul de lucru 2"
#: ../data/50-mutter-navigation.xml.in.h:32
#: data/50-mutter-navigation.xml:114
msgid "Switch to workspace 3"
msgstr "Comută la spațiul de lucru 3"
#: ../data/50-mutter-navigation.xml.in.h:33
#: data/50-mutter-navigation.xml:117
msgid "Switch to workspace 4"
msgstr "Comută la spațiul de lucru 4"
#: ../data/50-mutter-navigation.xml.in.h:34
#: data/50-mutter-navigation.xml:120
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.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
#: data/50-mutter-navigation.xml:123
msgid "Move to workspace above"
msgstr "Mută pe spațiul de lucru deasupra"
#: ../data/50-mutter-navigation.xml.in.h:38
#: data/50-mutter-navigation.xml:126
msgid "Move to workspace below"
msgstr "Mută pe spațiul de lucru de jos"
#: ../data/50-mutter-system.xml.in.h:1
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
msgid "System"
msgstr "Sistem"
#: ../data/50-mutter-system.xml.in.h:2
#: data/50-mutter-system.xml:8
msgid "Show the run command prompt"
msgstr "Arată prompterul de comandă al comenzii run (rulează)"
#: ../data/50-mutter-system.xml.in.h:3
#: data/50-mutter-system.xml:10
msgid "Show the activities overview"
msgstr "Arată prezentarea generală a activităților"
#: ../data/50-mutter-windows.xml.in.h:1
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Restaurează scurtăturile de tastatură"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Ferestre"
#: ../data/50-mutter-windows.xml.in.h:2
#: data/50-mutter-windows.xml:8
msgid "Activate the window menu"
msgstr "Activează meniul ferestrei"
#: ../data/50-mutter-windows.xml.in.h:3
#: data/50-mutter-windows.xml:10
msgid "Toggle fullscreen mode"
msgstr "Comută modul pe tot ecranul"
#: ../data/50-mutter-windows.xml.in.h:4
#: data/50-mutter-windows.xml:12
msgid "Toggle maximization state"
msgstr "Comută starea de maximizare"
#: ../data/50-mutter-windows.xml.in.h:5
#: data/50-mutter-windows.xml:14
msgid "Maximize window"
msgstr "Maximizează fereastra"
#: ../data/50-mutter-windows.xml.in.h:6
#: data/50-mutter-windows.xml:16
msgid "Restore window"
msgstr "Restabilește fereastra"
#: ../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
#: data/50-mutter-windows.xml:18
msgid "Close window"
msgstr "Închide fereastra"
#: ../data/50-mutter-windows.xml.in.h:9
#: data/50-mutter-windows.xml:20
msgid "Hide window"
msgstr "Ascunde fereastra"
#: ../data/50-mutter-windows.xml.in.h:10
#: data/50-mutter-windows.xml:22
msgid "Move window"
msgstr "Mută fereastra"
#: ../data/50-mutter-windows.xml.in.h:11
#: data/50-mutter-windows.xml:24
msgid "Resize window"
msgstr "Redimensionează fereastra"
#: ../data/50-mutter-windows.xml.in.h:12
#: data/50-mutter-windows.xml:27
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.in.h:13
#: data/50-mutter-windows.xml:29
msgid "Raise window if covered, otherwise lower it"
msgstr "Ridică fereastra dacă este acoperită, altfel, coboar-o"
#: ../data/50-mutter-windows.xml.in.h:14
#: data/50-mutter-windows.xml:31
msgid "Raise window above other windows"
msgstr "Ridică fereastra deasupra celorlalte ferestre"
#: ../data/50-mutter-windows.xml.in.h:15
#: data/50-mutter-windows.xml:33
msgid "Lower window below other windows"
msgstr "Coboară fereastra sub alte ferestre"
#: ../data/50-mutter-windows.xml.in.h:16
#: data/50-mutter-windows.xml:35
msgid "Maximize window vertically"
msgstr "Maximizează fereastra pe verticală"
#: ../data/50-mutter-windows.xml.in.h:17
#: data/50-mutter-windows.xml:37
msgid "Maximize window horizontally"
msgstr "Maximizează fereastra pe orizontală"
#: ../data/50-mutter-windows.xml.in.h:18
#: data/50-mutter-windows.xml:41
msgid "View split on left"
msgstr "Împarte în stânga"
#: ../data/50-mutter-windows.xml.in.h:19
#: data/50-mutter-windows.xml:45
msgid "View split on right"
msgstr "Împarte în dreapta"
#: ../data/mutter.desktop.in.h:1
#: data/mutter.desktop.in:4
msgid "Mutter"
msgstr "Mutter"
#: ../data/org.gnome.mutter.gschema.xml.in.h:1
#: data/org.gnome.mutter.gschema.xml.in:7
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.h:2
#: data/org.gnome.mutter.gschema.xml.in:8
msgid ""
"This key will initiate the \"overlay\", which is a combination window "
"overview and application launching system. The default is intended to be the "
"\"Windows key\" on PC hardware. It's expected that this binding either the "
"default or set to the empty string."
"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."
msgstr ""
"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."
"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."
#: ../data/org.gnome.mutter.gschema.xml.in.h:3
#: data/org.gnome.mutter.gschema.xml.in:20
msgid "Attach modal dialogs"
msgstr "Atașează dialogurile modale"
#: ../data/org.gnome.mutter.gschema.xml.in.h:4
#: data/org.gnome.mutter.gschema.xml.in:21
msgid ""
"When true, instead of having independent titlebars, modal dialogs appear "
"attached to the titlebar of the parent window and are moved together with "
@ -298,13 +281,12 @@ 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.h:5
#, fuzzy
#: data/org.gnome.mutter.gschema.xml.in:30
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
"Activează mozaicul lateral la plasarea ferestrelor pe marginile ecranului"
"Activează mozaicul de margine la plasarea ferestrelor pe marginile ecranului"
#: ../data/org.gnome.mutter.gschema.xml.in.h:6
#: data/org.gnome.mutter.gschema.xml.in:31
msgid ""
"If enabled, dropping windows on vertical screen edges maximizes them "
"vertically and resizes them horizontally to cover half of the available "
@ -315,25 +297,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.h:7
#: data/org.gnome.mutter.gschema.xml.in:40
msgid "Workspaces are managed dynamically"
msgstr "Spațiile de lucru sunt gestionate în mod dinamic"
#: ../data/org.gnome.mutter.gschema.xml.in.h:8
#: data/org.gnome.mutter.gschema.xml.in:41
msgid ""
"Determines whether workspaces are managed dynamically or whether there's a "
"Determines whether workspaces are managed dynamically or whether theres 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 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)"
"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)"
#: ../data/org.gnome.mutter.gschema.xml.in.h:9
#: data/org.gnome.mutter.gschema.xml.in:50
msgid "Workspaces only on primary"
msgstr "Spații de lucru doar pe ecranul principal"
#: ../data/org.gnome.mutter.gschema.xml.in.h:10
#: data/org.gnome.mutter.gschema.xml.in:51
msgid ""
"Determines whether workspace switching should happen for windows on all "
"monitors or only for windows on the primary monitor."
@ -342,11 +324,11 @@ msgstr ""
"ferestrele de pe toate monitoarele sau doar pentru ferestrele de pe "
"monitorul principal."
#: ../data/org.gnome.mutter.gschema.xml.in.h:11
#: data/org.gnome.mutter.gschema.xml.in:59
msgid "No tab popup"
msgstr "Fără popup pentru tab"
#: ../data/org.gnome.mutter.gschema.xml.in.h:12
#: data/org.gnome.mutter.gschema.xml.in:60
msgid ""
"Determines whether the use of popup and highlight frame should be disabled "
"for window cycling."
@ -354,42 +336,40 @@ 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.h:13
#: data/org.gnome.mutter.gschema.xml.in:68
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.h:14
#: 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 ""
"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."
"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ș."
#: ../data/org.gnome.mutter.gschema.xml.in.h:15
#, fuzzy
#: data/org.gnome.mutter.gschema.xml.in:79
msgid "Draggable border width"
msgstr "Lățimea margini ce poate fi acționată"
msgstr "Lățimea marginii ce poate fi plasată"
#: ../data/org.gnome.mutter.gschema.xml.in.h:16
#, fuzzy
#: data/org.gnome.mutter.gschema.xml.in:80
msgid ""
"The amount of total draggable borders. If the theme's visible borders are "
"The amount of total draggable borders. If the themes visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
"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."
"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."
#: ../data/org.gnome.mutter.gschema.xml.in.h:17
#: data/org.gnome.mutter.gschema.xml.in:89
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.h:18
#: data/org.gnome.mutter.gschema.xml.in:90
msgid ""
"If enabled, new windows that are initially the size of the monitor "
"automatically get maximized."
@ -397,11 +377,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.h:19
#: data/org.gnome.mutter.gschema.xml.in:98
msgid "Place new windows in the center"
msgstr "Plasează ferestre noi în centru"
#: ../data/org.gnome.mutter.gschema.xml.in.h:20
#: data/org.gnome.mutter.gschema.xml.in:99
msgid ""
"When true, the new windows will always be put in the center of the active "
"screen of the monitor."
@ -409,107 +389,262 @@ msgstr ""
"Când este adevărat, ferestrele noi vor fi plasate în centrul ecranului activ "
"al monitorului."
#: ../data/org.gnome.mutter.gschema.xml.in.h:21
#: 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. • “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 ""
"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. • “remote-desktop” — "
"activează suportul pentru desktop la distanță. Pentru a suporta desktop la "
"distanță cu partajarea ecranului, trebuie să fie activat și „screen-cast”. • "
"“screen-cast” — activează suportul pentru înregistrarea ecranului."
#: data/org.gnome.mutter.gschema.xml.in:145
msgid "Select window from tab popup"
msgstr "Selectează fereastra din popup-ul tabului"
#: ../data/org.gnome.mutter.gschema.xml.in.h:22
#: data/org.gnome.mutter.gschema.xml.in:150
msgid "Cancel tab popup"
msgstr "Elimină popup-ul pentru tab"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
#: data/org.gnome.mutter.gschema.xml.in:155
msgid "Switch monitor configurations"
msgstr "Comută configurațiile de monitor"
#: data/org.gnome.mutter.gschema.xml.in:160
msgid "Rotates the built-in monitor configuration"
msgstr "Rotește configurarea de monitor integrat"
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
msgid "Switch to VT 1"
msgstr "Comută la terminalul virtual 1"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
#: data/org.gnome.mutter.wayland.gschema.xml.in:10
msgid "Switch to VT 2"
msgstr "Comută la terminalul virtual 2"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
#: data/org.gnome.mutter.wayland.gschema.xml.in:14
msgid "Switch to VT 3"
msgstr "Comută la terminalul virtual 3"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
#: data/org.gnome.mutter.wayland.gschema.xml.in:18
msgid "Switch to VT 4"
msgstr "Comută la terminalul virtual 4"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
#: data/org.gnome.mutter.wayland.gschema.xml.in:22
msgid "Switch to VT 5"
msgstr "Comută la terminalul virtual 5"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
#: data/org.gnome.mutter.wayland.gschema.xml.in:26
msgid "Switch to VT 6"
msgstr "Comută la terminalul virtual 6"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
#: data/org.gnome.mutter.wayland.gschema.xml.in:30
msgid "Switch to VT 7"
msgstr "Comută la terminalul virtual 7"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:8
#: data/org.gnome.mutter.wayland.gschema.xml.in:34
msgid "Switch to VT 8"
msgstr "Comută la terminalul virtual 8"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:9
#: data/org.gnome.mutter.wayland.gschema.xml.in:38
msgid "Switch to VT 9"
msgstr "Comută la terminalul virtual 9"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:10
#: data/org.gnome.mutter.wayland.gschema.xml.in:42
msgid "Switch to VT 10"
msgstr "Comută la terminalul virtual 10"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:11
#: data/org.gnome.mutter.wayland.gschema.xml.in:46
msgid "Switch to VT 11"
msgstr "Comută la terminalul virtual 11"
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:12
#: data/org.gnome.mutter.wayland.gschema.xml.in:50
msgid "Switch to VT 12"
msgstr "Comută la terminalul virtual 12"
#: ../src/backends/meta-monitor-manager.c:500
#: 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
msgid "Built-in display"
msgstr "Afișaj integrat"
#: ../src/backends/meta-monitor-manager.c:526
#: src/backends/meta-monitor-manager.c:926
msgid "Unknown"
msgstr "Necunoscut"
#: ../src/backends/meta-monitor-manager.c:528
#: src/backends/meta-monitor-manager.c:928
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:536
#: src/backends/meta-monitor-manager.c:936
#, 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:456
#: src/compositor/compositor.c:481
#, 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 compozit rulează deja pe ecranul %i pe "
"Un alt administrator de ferestre de compunere rulează deja pe ecranul %i pe "
"afișajul „%s”."
#: ../src/core/bell.c:185
#: src/core/bell.c:194
msgid "Bell event"
msgstr "Eveniment sonor"
#: ../src/core/delete.c:127
#: 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
#, c-format
msgid "“%s” is not responding."
msgstr "„%s” nu răspunde."
#: ../src/core/delete.c:129
#: src/core/meta-close-dialog-default.c:149
msgid "Application is not responding."
msgstr "Aplicația nu răspunde."
#: ../src/core/delete.c:134
#: src/core/meta-close-dialog-default.c:154
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
@ -517,112 +652,95 @@ 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/delete.c:141
msgid "_Wait"
msgstr "_Așteaptă"
#: ../src/core/delete.c:141
#: src/core/meta-close-dialog-default.c:161
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/meta-close-dialog-default.c:161
msgid "_Wait"
msgstr "_Așteaptă"
#: ../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
#: src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"This is free software; see the source for copying conditions.\n"
"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ă NICI O garanție; nici pentru COMERCIALIZARE sau UTILIZAREA ÎNTR-UN "
"Nu există NICIO 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:2050
#: src/core/prefs.c:1997
#, c-format
msgid "Workspace %d"
msgstr "Spațiu de lucru %d"
#: ../src/core/screen.c:526
#: src/core/screen.c:583
#, 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ă folosiți "
"Afișajul „%s” are deja un administrator de ferestre; încercați să utilizați "
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
"ferestre actual."
"ferestre curent."
#: ../src/core/screen.c:608
#: src/core/screen.c:668
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Ecranul %d pe afișajul „%s” este invalid\n"
msgid "Screen %d on display %s is invalid\n"
msgstr "Ecranul %d de pe afișajul „%s” nu este valid\n"
#: ../src/core/util.c:118
#: src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter a fost compilat fără suport pentru modul detaliat\n"
#: ../src/x11/session.c:1815
#: 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
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
"These windows do not support save current setup 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:549
#: src/x11/window-props.c:559
#, 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) 2002, 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
# Copyright (C) 2012-2018 mutter's COPYRIGHT HOLDER
# This file is distributed under the same license as the mutter package.
# Sun G11n <gnome_int_l10n@ireland.sun.com>, 2002.
# He Qiangqiang <carton@linux.net.cn>, 2002
# Xiong Jiang <jxiong@offtopic.org>, 2003
@ -11,22 +11,24 @@
# 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: 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"
"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"
"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: Poedit 1.8.7.1\n"
"X-Generator: Gtranslator 2.91.7\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@ -53,134 +55,118 @@ 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:33
#: data/50-mutter-navigation.xml:27
msgid "Move window one workspace down"
msgstr "将窗口下移一个工作区"
#: data/50-mutter-navigation.xml:36
#: data/50-mutter-navigation.xml:30
msgid "Move window one monitor to the left"
msgstr "将窗口左移一个显示器"
#: data/50-mutter-navigation.xml:39
#: data/50-mutter-navigation.xml:33
msgid "Move window one monitor to the right"
msgstr "将窗口右移一个显示器"
#: data/50-mutter-navigation.xml:42
#: data/50-mutter-navigation.xml:36
msgid "Move window one monitor up"
msgstr "将窗口上移一个显示器"
#: data/50-mutter-navigation.xml:45
#: data/50-mutter-navigation.xml:39
msgid "Move window one monitor down"
msgstr "将窗口下移一个显示器"
#: data/50-mutter-navigation.xml:49
#: data/50-mutter-navigation.xml:43
msgid "Switch applications"
msgstr "切换应用程序"
#: data/50-mutter-navigation.xml:54
#: data/50-mutter-navigation.xml:48
msgid "Switch to previous application"
msgstr "切换到前一个应用程序"
#: data/50-mutter-navigation.xml:58
#: data/50-mutter-navigation.xml:52
msgid "Switch windows"
msgstr "切换窗口"
#: data/50-mutter-navigation.xml:63
#: data/50-mutter-navigation.xml:57
msgid "Switch to previous window"
msgstr "切换到前一个窗口"
#: data/50-mutter-navigation.xml:67
#: data/50-mutter-navigation.xml:61
msgid "Switch windows of an application"
msgstr "在应用程序的窗口之间切换窗口"
#: data/50-mutter-navigation.xml:72
#: data/50-mutter-navigation.xml:66
msgid "Switch to previous window of an application"
msgstr "切换到一个应用程序的前一个窗口"
#: data/50-mutter-navigation.xml:76
#: data/50-mutter-navigation.xml:70
msgid "Switch system controls"
msgstr "切换系统控制"
#: data/50-mutter-navigation.xml:81
#: data/50-mutter-navigation.xml:75
msgid "Switch to previous system control"
msgstr "切换到前一个系统控制"
#: data/50-mutter-navigation.xml:85
#: data/50-mutter-navigation.xml:79
msgid "Switch windows directly"
msgstr "直接切换窗口"
#: data/50-mutter-navigation.xml:90
#: data/50-mutter-navigation.xml:84
msgid "Switch directly to previous window"
msgstr "直接切换到前一个窗口"
#: data/50-mutter-navigation.xml:94
#: data/50-mutter-navigation.xml:88
msgid "Switch windows of an app directly"
msgstr "在应用程序窗口间直接移动焦点"
#: data/50-mutter-navigation.xml:99
#: data/50-mutter-navigation.xml:93
msgid "Switch directly to previous window of an app"
msgstr "直接切换到一个应用程序的前一个窗口"
#: data/50-mutter-navigation.xml:103
#: data/50-mutter-navigation.xml:97
msgid "Switch system controls directly"
msgstr "直接切换系统控制"
#: data/50-mutter-navigation.xml:108
#: data/50-mutter-navigation.xml:102
msgid "Switch directly to previous system control"
msgstr "直接切换到前一个系统控制"
#: data/50-mutter-navigation.xml:111
#: data/50-mutter-navigation.xml:105
msgid "Hide all normal windows"
msgstr "隐藏所有正常窗口"
#: data/50-mutter-navigation.xml:114
#: data/50-mutter-navigation.xml:108
msgid "Switch to workspace 1"
msgstr "切换到工作区 1"
#: data/50-mutter-navigation.xml:117
#: data/50-mutter-navigation.xml:111
msgid "Switch to workspace 2"
msgstr "切换到工作区 2"
#: data/50-mutter-navigation.xml:120
#: data/50-mutter-navigation.xml:114
msgid "Switch to workspace 3"
msgstr "切换到工作区 3"
#: data/50-mutter-navigation.xml:123
#: data/50-mutter-navigation.xml:117
msgid "Switch to workspace 4"
msgstr "切换到工作区 4"
#: data/50-mutter-navigation.xml:126
#: data/50-mutter-navigation.xml:120
msgid "Switch to last workspace"
msgstr "切换到最后一个工作区"
#: 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
#: data/50-mutter-navigation.xml:123
msgid "Move to workspace above"
msgstr "移动到上层工作区"
#: data/50-mutter-navigation.xml:138
#: data/50-mutter-navigation.xml:126
msgid "Move to workspace below"
msgstr "移动到下层工作区"
#: data/50-mutter-system.xml:6
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
msgid "System"
msgstr "系统"
@ -190,7 +176,11 @@ msgstr "显示运行命令提示符"
#: data/50-mutter-system.xml:10
msgid "Show the activities overview"
msgstr "显示活动大纲"
msgstr "显示活动视图"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "还原键盘快捷键"
#: data/50-mutter-windows.xml:6
msgid "Windows"
@ -217,54 +207,50 @@ 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:22
#: data/50-mutter-windows.xml:20
msgid "Hide window"
msgstr "隐藏窗口"
#: data/50-mutter-windows.xml:24
#: data/50-mutter-windows.xml:22
msgid "Move window"
msgstr "移动窗口"
#: data/50-mutter-windows.xml:26
#: data/50-mutter-windows.xml:24
msgid "Resize window"
msgstr "改变窗口大小"
#: data/50-mutter-windows.xml:29
#: data/50-mutter-windows.xml:27
msgid "Toggle window on all workspaces or one"
msgstr "在位于所有或仅一个工作区的窗口间切换"
#: data/50-mutter-windows.xml:31
#: data/50-mutter-windows.xml:29
msgid "Raise window if covered, otherwise lower it"
msgstr "如果窗口被其他窗口遮盖,则提升它,否则降低它"
#: data/50-mutter-windows.xml:33
#: data/50-mutter-windows.xml:31
msgid "Raise window above other windows"
msgstr "将窗口提升到其它窗口之上"
#: data/50-mutter-windows.xml:35
#: data/50-mutter-windows.xml:33
msgid "Lower window below other windows"
msgstr "将窗口降低到其它窗口之下"
#: data/50-mutter-windows.xml:37
#: data/50-mutter-windows.xml:35
msgid "Maximize window vertically"
msgstr "垂直最大化窗口"
#: data/50-mutter-windows.xml:39
#: data/50-mutter-windows.xml:37
msgid "Maximize window horizontally"
msgstr "水平最大化窗口"
#: data/50-mutter-windows.xml:43
#: data/50-mutter-windows.xml:41
msgid "View split on left"
msgstr "在左侧查看分割"
#: data/50-mutter-windows.xml:47
#: data/50-mutter-windows.xml:45
msgid "View split on right"
msgstr "在右侧查看分割"
@ -278,10 +264,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. It's 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. Its expected that this binding either the default or "
"set to the empty string."
msgstr ""
"这个键指出的“覆盖”是一种混合窗口概述和应用程序运行的系统。默认要求使用 "
"“Super 键”。可能使用默认或者空白。"
@ -318,12 +304,12 @@ msgstr "动态管理工作区"
#: data/org.gnome.mutter.gschema.xml.in:41
msgid ""
"Determines whether workspaces are managed dynamically or whether there's a "
"Determines whether workspaces are managed dynamically or whether theres 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
@ -353,9 +339,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”那么进入某个窗口时焦点将不会立即"
"改变,而是等到光标停止移动之后。"
@ -366,7 +352,7 @@ msgstr "可拖拽的边界宽度"
#: data/org.gnome.mutter.gschema.xml.in:80
msgid ""
"The amount of total draggable borders. If the theme's visible borders are "
"The amount of total draggable borders. If the themes visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
"可拖拽的边界总数。如果主题的可见边界不足,将添加不可见的边界来满足此值。"
@ -391,14 +377,50 @@ msgid ""
"screen of the monitor."
msgstr "为 true 时,新窗口将总是置于此显示器已激活屏幕的中央。"
#: data/org.gnome.mutter.gschema.xml.in:120
#: 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
msgid "Select window from tab popup"
msgstr "从 Tab 轮换弹出界面选择窗口"
#: data/org.gnome.mutter.gschema.xml.in:125
#: data/org.gnome.mutter.gschema.xml.in:150
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"
@ -447,127 +469,183 @@ 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:1861
#: src/backends/meta-input-settings.c:2283
msgid "Switch monitor"
msgstr "切换显示器"
#: src/backends/meta-input-settings.c:1863
#: src/backends/meta-input-settings.c:2285
msgid "Show on-screen help"
msgstr "显示在屏帮助"
#: src/backends/meta-monitor-manager.c:515
#: src/backends/meta-monitor-manager.c:900
msgid "Built-in display"
msgstr "内置显示器"
#: src/backends/meta-monitor-manager.c:538
#: src/backends/meta-monitor-manager.c:923
msgid "Unknown"
msgstr "未知"
#: src/backends/meta-monitor-manager.c:540
#: src/backends/meta-monitor-manager.c:925
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:548
#: src/backends/meta-monitor-manager.c:933
#, 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:471
#: src/compositor/compositor.c:481
#, 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/delete.c:127
#: 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
#, c-format
msgid "“%s” is not responding."
msgstr "“%s” 未响应。"
#: src/core/delete.c:129
#: src/core/meta-close-dialog-default.c:149
msgid "Application is not responding."
msgstr "应用程序未响应。"
#: src/core/delete.c:134
#: src/core/meta-close-dialog-default.c:154
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr "您可以选择稍等一会儿,或者强制退出该应用程序。"
#: src/core/delete.c:141
msgid "_Wait"
msgstr "等待(_W)"
#: src/core/delete.c:141
#: src/core/meta-close-dialog-default.c:161
msgid "_Force Quit"
msgstr "强制退出(_F)"
#: 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/meta-close-dialog-default.c:161
msgid "_Wait"
msgstr "等待(_W)"
#: src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"This is free software; see the source for copying conditions.\n"
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
"PARTICULAR PURPOSE.\n"
msgstr ""
"mutter %s\n"
"版权所有 (C) 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
"本软件为自由软件版权条款请参见源码\n"
"不存在任何保证即便是对商业性或者特定目的的适应性也不作保证。\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
"本软件为自由软件版权条款请参见源码\n"
"不存在任何保证即便是对商业性或者特定目的的适应性也不作保证。\n"
#: src/core/mutter.c:53
msgid "Print version"
@ -582,41 +660,54 @@ msgstr "要使用的 Mutter 插件"
msgid "Workspace %d"
msgstr "工作区 %d"
#: src/core/screen.c:521
#: src/core/screen.c:583
#, 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:606
#: src/core/screen.c:668
#, 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:595
#: src/wayland/meta-wayland-tablet-pad.c:567
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "模式切换:%d 模式"
#: src/x11/session.c:1815
#: src/x11/session.c:1818
msgid ""
"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; 您在下次登录时,必须手动重启动它"
"们。"
"These windows do not support save current setup and will have to be "
"restarted manually next time you log in."
msgstr "这些窗口不支持“保存当前设置”,并且在您下次登录时,必须手动重启它们。"
#: src/x11/window-props.c:548
#: src/x11/window-props.c:559
#, c-format
msgid "%s (on %s)"
msgstr "%s (于 %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 "切换卷起状态"
#~ 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-03-01 18:57+0000\n"
"PO-Revision-Date: 2018-03-03 15:20+0800\n"
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
"PO-Revision-Date: 2018-06-09 11:26+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.6\n"
"X-Generator: Poedit 2.0.8\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@ -379,32 +379,27 @@ 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. • “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."
"manage HiDPI monitors. Does not require a restart."
msgstr ""
"若要啟用實驗性功能,請將功能關鍵字加入列表中。置於該功能是否須要重新啟動混成"
"器則視給予的功能而定。任何實驗性功能不一定能用、或是可以調整設定。請不要預期"
"在此設定中加入的任何東西未來都能存在。目前可用的關鍵字有: • “scale-monitor-"
"framebuffer” — 讓 mutter 預設採用邏輯像素座標空間的配置邏輯螢幕,而縮放螢幕 "
"framebuffer 則取代視窗內容以管理 HiDPI 螢幕。不須要重新啟動。 • “remote-"
"desktop” — 啟用遠端桌面支援。若要支援遠端桌面的螢幕分享則必須也啟用“screen-"
"cast”。• “screen-cast” — 啟用螢幕投放支援。"
"framebuffer 則取代視窗內容以管理 HiDPI 螢幕。不須要重新啟動。"
#: data/org.gnome.mutter.gschema.xml.in:145
#: data/org.gnome.mutter.gschema.xml.in:141
msgid "Select window from tab popup"
msgstr "從分頁彈出項選擇視窗"
#: data/org.gnome.mutter.gschema.xml.in:150
#: data/org.gnome.mutter.gschema.xml.in:146
msgid "Cancel tab popup"
msgstr "取消分頁彈出項"
#: data/org.gnome.mutter.gschema.xml.in:155
#: data/org.gnome.mutter.gschema.xml.in:151
msgid "Switch monitor configurations"
msgstr "切換螢幕組態"
#: data/org.gnome.mutter.gschema.xml.in:160
#: data/org.gnome.mutter.gschema.xml.in:156
msgid "Rotates the built-in monitor configuration"
msgstr "旋轉切換內建螢幕組態"
@ -520,22 +515,22 @@ msgstr "切換螢幕"
msgid "Show on-screen help"
msgstr "顯示螢幕求助"
#: src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:903
msgid "Built-in display"
msgstr "內建顯示"
#: src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:926
msgid "Unknown"
msgstr "不明"
#: src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:928
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:933
#: src/backends/meta-monitor-manager.c:936
#, c-format
msgid "%s %s"
msgstr "%s %s"

View File

@ -14,7 +14,6 @@ stackingdir = $(pkgdatadir)/tests/stacking
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 \

View File

@ -91,12 +91,6 @@ mutter_built_sources += \
gtk-text-input-protocol.c \
gtk-text-input-server-protocol.h \
$(NULL)
if HAVE_WAYLAND_EGLSTREAM
mutter_built_sources += \
wayland-eglstream-controller-server-protocol.h \
$(NULL)
endif
endif
wayland_protocols = \
@ -120,8 +114,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-cursor-tracker-private.h \
backends/meta-cursor-renderer.c \
backends/meta-cursor-renderer.h \
backends/meta-cursor-sprite-xcursor.c \
backends/meta-cursor-sprite-xcursor.h \
backends/meta-dnd-private.h \
backends/meta-egl.c \
backends/meta-egl.h \
@ -159,8 +151,6 @@ 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 \
@ -169,9 +159,6 @@ 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 \
@ -189,8 +176,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/x11/meta-gpu-xrandr.h \
backends/x11/cm/meta-backend-x11-cm.c \
backends/x11/cm/meta-backend-x11-cm.h \
backends/x11/cm/meta-cursor-sprite-xfixes.c \
backends/x11/cm/meta-cursor-sprite-xfixes.h \
backends/x11/cm/meta-renderer-x11-cm.c \
backends/x11/cm/meta-renderer-x11-cm.h \
backends/x11/nested/meta-backend-x11-nested.c \
@ -372,10 +357,6 @@ 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 \
@ -389,8 +370,6 @@ if HAVE_WAYLAND
libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
compositor/meta-surface-actor-wayland.c \
compositor/meta-surface-actor-wayland.h \
wayland/meta-cursor-sprite-wayland.c \
wayland/meta-cursor-sprite-wayland.h \
wayland/meta-wayland.c \
wayland/meta-wayland.h \
wayland/meta-wayland-private.h \
@ -452,10 +431,10 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
wayland/meta-wayland-touch.h \
wayland/meta-wayland-surface.c \
wayland/meta-wayland-surface.h \
wayland/meta-wayland-cursor-surface.c \
wayland/meta-wayland-cursor-surface.h \
wayland/meta-wayland-tablet-cursor-surface.c \
wayland/meta-wayland-tablet-cursor-surface.h \
wayland/meta-wayland-surface-role-cursor.c \
wayland/meta-wayland-surface-role-cursor.h \
wayland/meta-wayland-surface-role-tablet-cursor.c \
wayland/meta-wayland-surface-role-tablet-cursor.h \
wayland/meta-wayland-actor-surface.c \
wayland/meta-wayland-actor-surface.h \
wayland/meta-wayland-subsurface.c \
@ -561,7 +540,6 @@ 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 \
@ -782,5 +760,3 @@ endef
$(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
%-server-protocol.h : $(srcdir)/wayland/protocol/%.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header $< $@
%-server-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/%.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header $< $@

View File

@ -35,12 +35,10 @@
#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
@ -60,8 +58,7 @@ enum
KEYMAP_CHANGED,
KEYMAP_LAYOUT_GROUP_CHANGED,
LAST_DEVICE_CHANGED,
SUSPENDING,
RESUMING,
N_SIGNALS
};
@ -95,7 +92,6 @@ struct _MetaBackendPrivate
MetaEgl *egl;
MetaSettings *settings;
#ifdef HAVE_REMOTE_DESKTOP
MetaRemoteAccessController *remote_access_controller;
MetaDbusSessionWatcher *dbus_session_watcher;
MetaScreenCast *screen_cast;
MetaRemoteDesktop *remote_desktop;
@ -116,21 +112,15 @@ 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,
@ -149,10 +139,11 @@ 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);
@ -459,11 +450,8 @@ 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 (backend,
priv->dbus_session_watcher);
priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
#endif /* HAVE_REMOTE_DESKTOP */
@ -551,20 +539,6 @@ 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;
@ -600,81 +574,28 @@ lid_is_closed_changed_cb (UpClient *client,
}
static void
inhibit_sleep (MetaBackend *backend)
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)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
g_autoptr (GVariant) fd_variant = NULL;
g_autoptr (GError) error = NULL;
gboolean suspending;
if (priv->inhibit_sleep_fd >= 0)
g_variant_get (parameters, "(b)", &suspending);
if (suspending)
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);
@ -683,22 +604,17 @@ system_bus_gotten_cb (GObject *object,
priv = meta_backend_get_instance_private (user_data);
priv->system_bus = bus;
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);
}
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);
}
static gboolean
@ -861,24 +777,6 @@ 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,9 +35,6 @@
#include "meta-stage-private.h"
G_DEFINE_INTERFACE (MetaHwCursorInhibitor, meta_hw_cursor_inhibitor,
G_TYPE_OBJECT)
struct _MetaCursorRendererPrivate
{
float current_x;
@ -47,8 +44,6 @@ struct _MetaCursorRendererPrivate
MetaOverlay *stage_overlay;
gboolean handled_by_backend;
guint post_paint_func_id;
GList *hw_cursor_inhibitors;
};
typedef struct _MetaCursorRendererPrivate MetaCursorRendererPrivate;
@ -60,21 +55,6 @@ 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)
@ -213,8 +193,8 @@ meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
}
static void
meta_cursor_renderer_update_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
update_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
gboolean handled_by_backend;
@ -257,7 +237,7 @@ meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
return;
priv->displayed_cursor = cursor_sprite;
meta_cursor_renderer_update_cursor (renderer, cursor_sprite);
update_cursor (renderer, cursor_sprite);
}
void
@ -266,7 +246,7 @@ meta_cursor_renderer_force_update (MetaCursorRenderer *renderer)
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
meta_cursor_renderer_update_cursor (renderer, priv->displayed_cursor);
update_cursor (renderer, priv->displayed_cursor);
}
void
@ -281,7 +261,7 @@ meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
priv->current_x = x;
priv->current_y = y;
meta_cursor_renderer_update_cursor (renderer, priv->displayed_cursor);
update_cursor (renderer, priv->displayed_cursor);
}
ClutterPoint
@ -304,44 +284,27 @@ meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer)
return priv->displayed_cursor;
}
#ifdef HAVE_WAYLAND
void
meta_cursor_renderer_add_hw_cursor_inhibitor (MetaCursorRenderer *renderer,
MetaHwCursorInhibitor *inhibitor)
meta_cursor_renderer_realize_cursor_from_wl_buffer (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
struct wl_resource *buffer)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
priv->hw_cursor_inhibitors = g_list_prepend (priv->hw_cursor_inhibitors,
inhibitor);
MetaCursorRendererClass *renderer_class = META_CURSOR_RENDERER_GET_CLASS (renderer);
if (renderer_class->realize_cursor_from_wl_buffer)
renderer_class->realize_cursor_from_wl_buffer (renderer, cursor_sprite, buffer);
}
#endif
void
meta_cursor_renderer_remove_hw_cursor_inhibitor (MetaCursorRenderer *renderer,
MetaHwCursorInhibitor *inhibitor)
meta_cursor_renderer_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
MetaCursorRendererClass *renderer_class = META_CURSOR_RENDERER_GET_CLASS (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;
if (renderer_class->realize_cursor_from_xcursor)
renderer_class->realize_cursor_from_xcursor (renderer, cursor_sprite, xc_image);
}

View File

@ -26,22 +26,14 @@
#define META_CURSOR_RENDERER_H
#include <glib-object.h>
#include <X11/Xcursor/Xcursor.h>
#ifdef HAVE_WAYLAND
#include <wayland-server.h>
#endif
#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);
@ -52,6 +44,14 @@ struct _MetaCursorRendererClass
gboolean (* update_cursor) (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);
#ifdef HAVE_WAYLAND
void (* realize_cursor_from_wl_buffer) (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
struct wl_resource *buffer);
#endif
void (* realize_cursor_from_xcursor) (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image);
};
MetaCursorRenderer * meta_cursor_renderer_new (void);
@ -67,18 +67,19 @@ 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);
#ifdef HAVE_WAYLAND
void meta_cursor_renderer_realize_cursor_from_wl_buffer (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
struct wl_resource *buffer);
#endif
void meta_cursor_renderer_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image);
void meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite);

View File

@ -26,7 +26,6 @@
#include "meta-cursor.h"
#include "meta-cursor-renderer.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
struct _MetaCursorTracker {
GObject parent_instance;
@ -47,7 +46,7 @@ struct _MetaCursorTracker {
MetaCursorSprite *root_cursor;
/* The cursor from the X11 server. */
MetaCursorSpriteXfixes *xfixes_cursor;
MetaCursorSprite *xfixes_cursor;
};
struct _MetaCursorTrackerClass {

View File

@ -40,15 +40,14 @@
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <X11/extensions/Xfixes.h>
#include "meta-backend-private.h"
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
enum {
CURSOR_CHANGED,
CURSOR_MOVED,
LAST_SIGNAL
};
@ -118,15 +117,11 @@ change_cursor_renderer (MetaCursorTracker *tracker)
static void
sync_cursor (MetaCursorTracker *tracker)
{
gboolean cursor_changed = FALSE;
cursor_changed = update_displayed_cursor (tracker);
if (update_displayed_cursor (tracker))
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
if (update_effective_cursor (tracker))
change_cursor_renderer (tracker);
if (cursor_changed)
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
}
static void
@ -163,15 +158,6 @@ 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);
}
/**
@ -232,14 +218,75 @@ static void
ensure_xfixes_cursor (MetaCursorTracker *tracker)
{
MetaDisplay *display = meta_get_display ();
g_autoptr (GError) error = NULL;
XFixesCursorImage *cursor_image;
CoglTexture2D *sprite;
guint8 *cursor_data;
gboolean free_cursor_data;
CoglContext *ctx;
CoglError *error = NULL;
if (tracker->xfixes_cursor)
return;
tracker->xfixes_cursor = meta_cursor_sprite_xfixes_new (display, &error);
if (!tracker->xfixes_cursor)
g_warning ("Failed to create XFIXES cursor: %s", error->message);
cursor_image = XFixesGetCursorImage (display->xdisplay);
if (!cursor_image)
return;
/* 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 = (guint8 *)cursor_image->pixels;
free_cursor_data = FALSE;
}
else
{
int i, j;
guint32 *cursor_words;
gulong *p;
guint32 *q;
cursor_words = g_new (guint32, cursor_image->width * cursor_image->height);
cursor_data = (guint8 *)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;
}
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
sprite = cogl_texture_2d_new_from_data (ctx,
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 (error != NULL)
{
meta_warning ("Failed to allocate cursor sprite texture: %s\n", error->message);
cogl_error_free (error);
}
if (sprite != NULL)
{
MetaCursorSprite *cursor_sprite = meta_cursor_sprite_new ();
meta_cursor_sprite_set_texture (cursor_sprite,
COGL_TEXTURE (sprite),
cursor_image->xhot,
cursor_image->yhot);
cogl_object_unref (sprite);
tracker->xfixes_cursor = cursor_sprite;
}
XFree (cursor_image);
}
/**
@ -261,7 +308,7 @@ meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker)
else
{
ensure_xfixes_cursor (tracker);
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
cursor_sprite = tracker->xfixes_cursor;
}
if (cursor_sprite)
@ -298,7 +345,7 @@ meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
else
{
ensure_xfixes_cursor (tracker);
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
cursor_sprite = tracker->xfixes_cursor;
}
if (cursor_sprite)
@ -348,8 +395,6 @@ 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

@ -23,12 +23,19 @@
#include "meta-cursor.h"
#include "backends/meta-backend-private.h"
#include "cogl/cogl.h"
#include "meta/common.h"
#include <meta/errors.h>
enum
{
#include "display-private.h"
#include "screen-private.h"
#include "meta-backend-private.h"
#include <string.h>
#include <X11/cursorfont.h>
#include <X11/extensions/Xfixes.h>
#include <X11/Xcursor/Xcursor.h>
enum {
PREPARE_AT,
TEXTURE_CHANGED,
@ -37,148 +44,316 @@ enum
static guint signals[LAST_SIGNAL];
typedef struct _MetaCursorSpritePrivate
struct _MetaCursorSprite
{
GObject parent;
MetaCursor cursor;
CoglTexture2D *texture;
float texture_scale;
int hot_x, hot_y;
} MetaCursorSpritePrivate;
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaCursorSprite,
meta_cursor_sprite,
G_TYPE_OBJECT)
int current_frame;
XcursorImages *xcursor_images;
int theme_scale;
gboolean theme_dirty;
};
G_DEFINE_TYPE (MetaCursorSprite, meta_cursor_sprite, G_TYPE_OBJECT)
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";
default:
break;
}
g_assert_not_reached ();
}
Cursor
meta_cursor_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
meta_cursor_sprite_load_from_xcursor_image (MetaCursorSprite *self,
XcursorImage *xc_image)
{
MetaBackend *meta_backend = meta_get_backend ();
MetaCursorRenderer *renderer = meta_backend_get_cursor_renderer (meta_backend);
uint width, height, rowstride;
CoglPixelFormat cogl_format;
ClutterBackend *clutter_backend;
CoglContext *cogl_context;
CoglTexture2D *texture;
CoglError *error = NULL;
g_assert (self->texture == NULL);
width = xc_image->width;
height = 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 (error)
{
meta_warning ("Failed to allocate cursor texture: %s\n", error->message);
cogl_error_free (error);
}
meta_cursor_sprite_set_texture (self, COGL_TEXTURE (texture),
xc_image->xhot, xc_image->yhot);
if (texture)
cogl_object_unref (texture);
meta_cursor_renderer_realize_cursor_from_xcursor (renderer, self, xc_image);
}
static XcursorImage *
meta_cursor_sprite_get_current_frame_image (MetaCursorSprite *self)
{
return self->xcursor_images->images[self->current_frame];
}
void
meta_cursor_sprite_tick_frame (MetaCursorSprite *self)
{
XcursorImage *image;
if (!meta_cursor_sprite_is_animated (self))
return;
self->current_frame++;
if (self->current_frame >= self->xcursor_images->nimage)
self->current_frame = 0;
image = meta_cursor_sprite_get_current_frame_image (self);
g_clear_pointer (&self->texture, cogl_object_unref);
meta_cursor_sprite_load_from_xcursor_image (self, image);
}
guint
meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *self)
{
if (!meta_cursor_sprite_is_animated (self))
return 0;
return self->xcursor_images->images[self->current_frame]->delay;
}
gboolean
meta_cursor_sprite_is_animated (MetaCursorSprite *sprite)
meta_cursor_sprite_is_animated (MetaCursorSprite *self)
{
MetaCursorSpriteClass *klass = META_CURSOR_SPRITE_GET_CLASS (sprite);
return (self->xcursor_images &&
self->xcursor_images->nimage > 1);
}
if (klass->is_animated)
return klass->is_animated (sprite);
else
return FALSE;
MetaCursorSprite *
meta_cursor_sprite_new (void)
{
return g_object_new (META_TYPE_CURSOR_SPRITE, NULL);
}
static void
meta_cursor_sprite_load_from_theme (MetaCursorSprite *self)
{
XcursorImage *image;
g_assert (self->cursor != META_CURSOR_NONE);
self->theme_dirty = FALSE;
/* We might be reloading with a different scale. If so clear the old data. */
if (self->xcursor_images)
{
g_clear_pointer (&self->texture, cogl_object_unref);
XcursorImagesDestroy (self->xcursor_images);
}
self->current_frame = 0;
self->xcursor_images = load_cursor_on_client (self->cursor,
self->theme_scale);
if (!self->xcursor_images)
meta_fatal ("Could not find cursor. Perhaps set XCURSOR_PATH?");
image = meta_cursor_sprite_get_current_frame_image (self);
meta_cursor_sprite_load_from_xcursor_image (self, image);
}
MetaCursorSprite *
meta_cursor_sprite_from_theme (MetaCursor cursor)
{
MetaCursorSprite *self;
self = meta_cursor_sprite_new ();
self->cursor = cursor;
self->theme_dirty = TRUE;
return self;
}
void
meta_cursor_sprite_tick_frame (MetaCursorSprite *sprite)
{
return META_CURSOR_SPRITE_GET_CLASS (sprite)->tick_frame (sprite);
}
unsigned int
meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *sprite)
{
return META_CURSOR_SPRITE_GET_CLASS (sprite)->get_current_frame_time (sprite);
}
void
meta_cursor_sprite_clear_texture (MetaCursorSprite *sprite)
{
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
g_clear_pointer (&priv->texture, cogl_object_unref);
}
void
meta_cursor_sprite_set_texture (MetaCursorSprite *sprite,
meta_cursor_sprite_set_texture (MetaCursorSprite *self,
CoglTexture *texture,
int hot_x,
int hot_y)
{
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
if (priv->texture == COGL_TEXTURE_2D (texture) &&
priv->hot_x == hot_x &&
priv->hot_y == hot_y)
if (self->texture == COGL_TEXTURE_2D (texture) &&
self->hot_x == hot_x &&
self->hot_y == hot_y)
return;
g_clear_pointer (&priv->texture, cogl_object_unref);
g_clear_pointer (&self->texture, cogl_object_unref);
if (texture)
priv->texture = cogl_object_ref (texture);
priv->hot_x = hot_x;
priv->hot_y = hot_y;
self->texture = cogl_object_ref (texture);
self->hot_x = hot_x;
self->hot_y = hot_y;
g_signal_emit (sprite, signals[TEXTURE_CHANGED], 0);
g_signal_emit (self, signals[TEXTURE_CHANGED], 0);
}
void
meta_cursor_sprite_set_texture_scale (MetaCursorSprite *sprite,
meta_cursor_sprite_set_texture_scale (MetaCursorSprite *self,
float scale)
{
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
self->texture_scale = scale;
}
priv->texture_scale = scale;
void
meta_cursor_sprite_set_theme_scale (MetaCursorSprite *self,
int theme_scale)
{
if (self->theme_scale != theme_scale)
self->theme_dirty = TRUE;
self->theme_scale = theme_scale;
}
CoglTexture *
meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *sprite)
meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *self)
{
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
return COGL_TEXTURE (self->texture);
}
return COGL_TEXTURE (priv->texture);
MetaCursor
meta_cursor_sprite_get_meta_cursor (MetaCursorSprite *self)
{
return self->cursor;
}
void
meta_cursor_sprite_get_hotspot (MetaCursorSprite *sprite,
meta_cursor_sprite_get_hotspot (MetaCursorSprite *self,
int *hot_x,
int *hot_y)
{
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
*hot_x = priv->hot_x;
*hot_y = priv->hot_y;
*hot_x = self->hot_x;
*hot_y = self->hot_y;
}
float
meta_cursor_sprite_get_texture_scale (MetaCursorSprite *sprite)
meta_cursor_sprite_get_texture_scale (MetaCursorSprite *self)
{
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
return priv->texture_scale;
return self->texture_scale;
}
void
meta_cursor_sprite_prepare_at (MetaCursorSprite *sprite,
meta_cursor_sprite_prepare_at (MetaCursorSprite *self,
int x,
int y)
{
g_signal_emit (sprite, signals[PREPARE_AT], 0, x, y);
g_signal_emit (self, signals[PREPARE_AT], 0, x, y);
}
void
meta_cursor_sprite_realize_texture (MetaCursorSprite *sprite)
meta_cursor_sprite_realize_texture (MetaCursorSprite *self)
{
MetaCursorSpriteClass *klass = META_CURSOR_SPRITE_GET_CLASS (sprite);
if (klass->realize_texture)
klass->realize_texture (sprite);
if (self->theme_dirty)
meta_cursor_sprite_load_from_theme (self);
}
static void
meta_cursor_sprite_init (MetaCursorSprite *sprite)
meta_cursor_sprite_init (MetaCursorSprite *self)
{
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
priv->texture_scale = 1.0f;
self->texture_scale = 1.0f;
}
static void
meta_cursor_sprite_finalize (GObject *object)
{
MetaCursorSprite *sprite = META_CURSOR_SPRITE (object);
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
MetaCursorSprite *self = META_CURSOR_SPRITE (object);
g_clear_pointer (&priv->texture, cogl_object_unref);
if (self->xcursor_images)
XcursorImagesDestroy (self->xcursor_images);
g_clear_pointer (&self->texture, cogl_object_unref);
G_OBJECT_CLASS (meta_cursor_sprite_parent_class)->finalize (object);
}

View File

@ -25,50 +25,51 @@
#include <meta/common.h>
#include <meta/boxes.h>
typedef struct _MetaCursorSprite MetaCursorSprite;
#define META_TYPE_CURSOR_SPRITE (meta_cursor_sprite_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaCursorSprite,
meta_cursor_sprite,
META, CURSOR_SPRITE,
GObject)
G_DECLARE_FINAL_TYPE (MetaCursorSprite,
meta_cursor_sprite,
META, CURSOR_SPRITE,
GObject);
struct _MetaCursorSpriteClass
{
GObjectClass parent_class;
MetaCursorSprite * meta_cursor_sprite_new (void);
void (* realize_texture) (MetaCursorSprite *sprite);
gboolean (* is_animated) (MetaCursorSprite *sprite);
void (* tick_frame) (MetaCursorSprite *sprite);
unsigned int (* get_current_frame_time) (MetaCursorSprite *sprite);
};
MetaCursorSprite * meta_cursor_sprite_from_theme (MetaCursor cursor);
void meta_cursor_sprite_prepare_at (MetaCursorSprite *sprite,
void meta_cursor_sprite_set_theme_scale (MetaCursorSprite *self,
int scale);
MetaCursor meta_cursor_sprite_get_meta_cursor (MetaCursorSprite *self);
Cursor meta_cursor_create_x_cursor (Display *xdisplay,
MetaCursor cursor);
void meta_cursor_sprite_prepare_at (MetaCursorSprite *self,
int x,
int y);
void meta_cursor_sprite_realize_texture (MetaCursorSprite *sprite);
void meta_cursor_sprite_realize_texture (MetaCursorSprite *self);
void meta_cursor_sprite_clear_texture (MetaCursorSprite *sprite);
void meta_cursor_sprite_set_texture (MetaCursorSprite *sprite,
void meta_cursor_sprite_set_texture (MetaCursorSprite *self,
CoglTexture *texture,
int hot_x,
int hot_y);
void meta_cursor_sprite_set_texture_scale (MetaCursorSprite *sprite,
void meta_cursor_sprite_set_texture_scale (MetaCursorSprite *self,
float scale);
CoglTexture *meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *sprite);
CoglTexture *meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *self);
void meta_cursor_sprite_get_hotspot (MetaCursorSprite *sprite,
void meta_cursor_sprite_get_hotspot (MetaCursorSprite *self,
int *hot_x,
int *hot_y);
float meta_cursor_sprite_get_texture_scale (MetaCursorSprite *sprite);
float meta_cursor_sprite_get_texture_scale (MetaCursorSprite *self);
gboolean meta_cursor_sprite_is_animated (MetaCursorSprite *sprite);
void meta_cursor_sprite_tick_frame (MetaCursorSprite *sprite);
unsigned int meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *sprite);
gboolean meta_cursor_sprite_is_animated (MetaCursorSprite *self);
void meta_cursor_sprite_tick_frame (MetaCursorSprite *self);
guint meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *self);
#endif /* META_CURSOR_H */

View File

@ -100,12 +100,11 @@ static MetaMonitorTransform
derive_monitor_transform (MetaMonitor *monitor)
{
MetaOutput *main_output;
MetaMonitorTransform transform;
main_output = meta_monitor_get_main_output (monitor);
transform = meta_output_get_assigned_crtc (main_output)->transform;
return meta_monitor_crtc_to_logical_transform (monitor, transform);
return meta_monitor_crtc_to_logical_transform (monitor,
main_output->crtc->transform);
}
MetaLogicalMonitor *
@ -146,7 +145,7 @@ meta_logical_monitor_add_monitor (MetaLogicalMonitor *logical_monitor,
is_presentation = logical_monitor->is_presentation;
logical_monitor->monitors = g_list_append (logical_monitor->monitors,
g_object_ref (monitor));
monitor);
for (l = logical_monitor->monitors; l; l = l->next)
{
@ -158,12 +157,10 @@ meta_logical_monitor_add_monitor (MetaLogicalMonitor *logical_monitor,
for (l_output = outputs; l_output; l_output = l_output->next)
{
MetaOutput *output = l_output->data;
MetaCrtc *crtc;
is_presentation = is_presentation && output->is_presentation;
crtc = meta_output_get_assigned_crtc (output);
if (crtc)
crtc->logical_monitor = logical_monitor;
if (output->crtc)
output->crtc->logical_monitor = logical_monitor;
}
}
@ -223,7 +220,7 @@ foreach_crtc (MetaMonitor *monitor,
ForeachCrtcData *data = user_data;
data->func (data->logical_monitor,
meta_output_get_assigned_crtc (monitor_crtc_mode->output),
monitor_crtc_mode->output->crtc,
data->user_data);
return TRUE;
@ -257,17 +254,13 @@ meta_logical_monitor_init (MetaLogicalMonitor *logical_monitor)
}
static void
meta_logical_monitor_dispose (GObject *object)
meta_logical_monitor_finalize (GObject *object)
{
MetaLogicalMonitor *logical_monitor = META_LOGICAL_MONITOR (object);
if (logical_monitor->monitors)
{
g_list_free_full (logical_monitor->monitors, g_object_unref);
logical_monitor->monitors = NULL;
}
g_list_free (logical_monitor->monitors);
G_OBJECT_CLASS (meta_logical_monitor_parent_class)->dispose (object);
G_OBJECT_CLASS (meta_logical_monitor_parent_class)->finalize (object);
}
static void
@ -275,7 +268,7 @@ meta_logical_monitor_class_init (MetaLogicalMonitorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = meta_logical_monitor_dispose;
object_class->finalize = meta_logical_monitor_finalize;
}
gboolean

View File

@ -486,7 +486,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
output->is_dirty = TRUE;
meta_output_assign_crtc (output, crtc);
output->crtc = crtc;
}
}
}
@ -531,7 +531,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
continue;
}
meta_output_unassign_crtc (output);
output->crtc = NULL;
output->is_primary = FALSE;
}
}

View File

@ -585,8 +585,6 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
&error))
{
g_clear_object (&config);
g_warning ("Failed to use linear monitor configuration: %s",
error->message);
g_clear_error (&error);
}
else
@ -604,8 +602,6 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
&error))
{
g_clear_object (&config);
g_warning ("Failed to use fallback monitor configuration: %s",
error->message);
g_clear_error (&error);
}
else
@ -1045,7 +1041,6 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
GVariantBuilder crtcs, modes, clones, properties;
GBytes *edid;
char *edid_file;
MetaCrtc *crtc;
int crtc_index;
g_variant_builder_init (&crtcs, G_VARIANT_TYPE ("au"));
@ -1139,8 +1134,8 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
output->tile_info.tile_h));
}
crtc = meta_output_get_assigned_crtc (output);
crtc_index = crtc ? g_list_index (combined_crtcs, crtc) : -1;
crtc_index = output->crtc ? g_list_index (combined_crtcs, output->crtc)
: -1;
g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
i, /* ID */
(gint64)output->winsys_id,
@ -2908,7 +2903,11 @@ meta_monitor_manager_get_monitor_for_connector (MetaMonitorManager *manager,
if (meta_monitor_is_active (monitor) &&
g_str_equal (connector, meta_monitor_get_connector (monitor)))
return meta_monitor_get_logical_monitor (monitor)->number;
{
MetaOutput *main_output = meta_monitor_get_main_output (monitor);
return main_output->crtc->logical_monitor->number;
}
}
return -1;

View File

@ -203,9 +203,11 @@ meta_monitor_get_main_output (MetaMonitor *monitor)
gboolean
meta_monitor_is_active (MetaMonitor *monitor)
{
MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor);
MetaOutput *output;
return !!priv->current_mode;
output = meta_monitor_get_main_output (monitor);
return output->crtc && output->crtc->current_mode;
}
gboolean
@ -383,21 +385,6 @@ meta_monitor_crtc_to_logical_transform (MetaMonitor *monitor,
return new_transform;
}
static void
meta_monitor_dispose (GObject *object)
{
MetaMonitor *monitor = META_MONITOR (object);
MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor);
if (priv->outputs)
{
g_list_free_full (priv->outputs, g_object_unref);
priv->outputs = NULL;
}
G_OBJECT_CLASS (meta_monitor_parent_class)->dispose (object);
}
static void
meta_monitor_finalize (GObject *object)
{
@ -406,6 +393,7 @@ meta_monitor_finalize (GObject *object)
g_hash_table_destroy (priv->mode_ids);
g_list_free_full (priv->modes, (GDestroyNotify) meta_monitor_mode_free);
g_clear_pointer (&priv->outputs, g_list_free);
meta_monitor_spec_free (priv->spec);
G_OBJECT_CLASS (meta_monitor_parent_class)->finalize (object);
@ -424,7 +412,6 @@ meta_monitor_class_init (MetaMonitorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = meta_monitor_dispose;
object_class->finalize = meta_monitor_finalize;
}
@ -506,7 +493,6 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
for (i = 0; i < output->n_modes; i++)
{
MetaCrtcMode *crtc_mode = output->modes[i];
MetaCrtc *crtc;
MetaMonitorMode *mode;
gboolean replace;
@ -540,9 +526,7 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
if (crtc_mode == output->preferred_mode)
monitor_priv->preferred_mode = mode;
crtc = meta_output_get_assigned_crtc (output);
if (crtc && crtc_mode == crtc->current_mode)
if (output->crtc && crtc_mode == output->crtc->current_mode)
monitor_priv->current_mode = mode;
}
}
@ -561,7 +545,7 @@ meta_monitor_normal_new (MetaGpu *gpu,
monitor_priv->gpu = gpu;
monitor_priv->outputs = g_list_append (NULL, g_object_ref (output));
monitor_priv->outputs = g_list_append (NULL, output);
monitor_priv->winsys_id = output->winsys_id;
meta_monitor_generate_spec (monitor);
@ -584,15 +568,13 @@ meta_monitor_normal_derive_layout (MetaMonitor *monitor,
MetaRectangle *layout)
{
MetaOutput *output;
MetaCrtc *crtc;
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
*layout = (MetaRectangle) {
.x = crtc->rect.x,
.y = crtc->rect.y,
.width = crtc->rect.width,
.height = crtc->rect.height
.x = output->crtc->rect.x,
.y = output->crtc->rect.y,
.width = output->crtc->rect.width,
.height = output->crtc->rect.height
};
}
@ -676,8 +658,7 @@ add_tiled_monitor_outputs (MetaGpu *gpu,
g_warn_if_fail (output->subpixel_order ==
monitor_tiled->origin_output->subpixel_order);
monitor_priv->outputs = g_list_append (monitor_priv->outputs,
g_object_ref (output));
monitor_priv->outputs = g_list_append (monitor_priv->outputs, output);
}
}
@ -783,13 +764,12 @@ is_monitor_mode_assigned (MetaMonitor *monitor,
{
MetaOutput *output = l->data;
MetaMonitorCrtcMode *monitor_crtc_mode = &mode->crtc_modes[i];
MetaCrtc *crtc;
crtc = meta_output_get_assigned_crtc (output);
if (monitor_crtc_mode->crtc_mode &&
(!crtc || crtc->current_mode != monitor_crtc_mode->crtc_mode))
(!output->crtc ||
output->crtc->current_mode != monitor_crtc_mode->crtc_mode))
return FALSE;
else if (!monitor_crtc_mode->crtc_mode && crtc)
else if (!monitor_crtc_mode->crtc_mode && output->crtc)
return FALSE;
}
@ -1237,16 +1217,14 @@ meta_monitor_tiled_derive_layout (MetaMonitor *monitor,
for (l = monitor_priv->outputs; l; l = l->next)
{
MetaOutput *output = l->data;
MetaCrtc *crtc;
crtc = meta_output_get_assigned_crtc (output);
if (!crtc)
if (!output->crtc)
continue;
min_x = MIN (crtc->rect.x, min_x);
min_y = MIN (crtc->rect.y, min_y);
max_x = MAX (crtc->rect.x + crtc->rect.width, max_x);
max_y = MAX (crtc->rect.y + crtc->rect.height, max_y);
min_x = MIN (output->crtc->rect.x, min_x);
min_y = MIN (output->crtc->rect.y, min_y);
max_x = MAX (output->crtc->rect.x + output->crtc->rect.width, max_x);
max_y = MAX (output->crtc->rect.y + output->crtc->rect.height, max_y);
}
*layout = (MetaRectangle) {
@ -1340,14 +1318,10 @@ meta_monitor_get_spec (MetaMonitor *monitor)
MetaLogicalMonitor *
meta_monitor_get_logical_monitor (MetaMonitor *monitor)
{
MetaOutput *output;
MetaCrtc *crtc;
MetaOutput *output = meta_monitor_get_main_output (monitor);
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
if (crtc)
return crtc->logical_monitor;
if (output->crtc)
return output->crtc->logical_monitor;
else
return NULL;
}
@ -1407,18 +1381,6 @@ 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)
{
@ -1438,8 +1400,6 @@ meta_monitor_derive_current_mode (MetaMonitor *monitor)
}
priv->current_mode = current_mode;
g_warn_if_fail (is_current_mode_known (monitor));
}
void

View File

@ -21,13 +21,7 @@
#include "backends/meta-output.h"
typedef struct _MetaOutputPrivate
{
/* The CRTC driving this output, NULL if the output is not enabled */
MetaCrtc *crtc;
} MetaOutputPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaOutput, meta_output, G_TYPE_OBJECT)
G_DEFINE_TYPE (MetaOutput, meta_output, G_TYPE_OBJECT)
MetaGpu *
meta_output_get_gpu (MetaOutput *output)
@ -35,44 +29,6 @@ meta_output_get_gpu (MetaOutput *output)
return output->gpu;
}
void
meta_output_assign_crtc (MetaOutput *output,
MetaCrtc *crtc)
{
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
g_assert (crtc);
g_set_object (&priv->crtc, crtc);
}
void
meta_output_unassign_crtc (MetaOutput *output)
{
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
g_clear_object (&priv->crtc);
}
MetaCrtc *
meta_output_get_assigned_crtc (MetaOutput *output)
{
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
return priv->crtc;
}
static void
meta_output_dispose (GObject *object)
{
MetaOutput *output = META_OUTPUT (object);
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
g_clear_object (&priv->crtc);
G_OBJECT_CLASS (meta_output_parent_class)->dispose (object);
}
static void
meta_output_finalize (GObject *object)
{
@ -102,6 +58,5 @@ meta_output_class_init (MetaOutputClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->dispose = meta_output_dispose;
object_class->finalize = meta_output_finalize;
}

View File

@ -64,6 +64,9 @@ struct _MetaOutput
MetaGpu *gpu;
/* The CRTC driving this output, NULL if the output is not enabled */
MetaCrtc *crtc;
/* The low-level ID of this output, used to apply back configuration */
glong winsys_id;
char *name;
@ -119,11 +122,4 @@ G_DECLARE_FINAL_TYPE (MetaOutput, meta_output, META, OUTPUT, GObject)
MetaGpu * meta_output_get_gpu (MetaOutput *output);
void meta_output_assign_crtc (MetaOutput *output,
MetaCrtc *crtc);
void meta_output_unassign_crtc (MetaOutput *output);
MetaCrtc * meta_output_get_assigned_crtc (MetaOutput *output);
#endif /* META_OUTPUT_H */

View File

@ -1,130 +0,0 @@
/*
* 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,7 +30,6 @@
#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"
@ -60,8 +59,6 @@ struct _MetaRemoteDesktopSession
ClutterVirtualInputDevice *virtual_pointer;
ClutterVirtualInputDevice *virtual_keyboard;
ClutterVirtualInputDevice *virtual_touchscreen;
MetaRemoteDesktopSessionHandle *handle;
};
static void
@ -78,41 +75,12 @@ 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)
@ -139,8 +107,6 @@ 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;
}
@ -160,20 +126,11 @@ 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);
}
@ -772,7 +729,6 @@ 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);
@ -807,40 +763,3 @@ 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,12 +33,6 @@ 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

@ -94,24 +94,6 @@ 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,7 +53,4 @@ 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,38 +24,23 @@
#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;
gboolean cursor_bitmap_invalid;
gulong actors_painted_handler_id;
gulong paint_handler_id;
gulong cursor_moved_handler_id;
gulong cursor_changed_handler_id;
gulong stage_painted_handler_id;
};
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))
G_DEFINE_TYPE (MetaScreenCastMonitorStreamSrc,
meta_screen_cast_monitor_stream_src,
META_TYPE_SCREEN_CAST_STREAM_SRC)
static ClutterStage *
get_stage (MetaScreenCastMonitorStreamSrc *monitor_src)
@ -117,164 +102,18 @@ 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);
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;
}
monitor_src->stage_painted_handler_id =
g_signal_connect_after (stage, "paint",
G_CALLBACK (stage_painted),
monitor_src);
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
}
@ -283,43 +122,14 @@ 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);
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;
}
g_signal_handler_disconnect (stage, monitor_src->stage_painted_handler_id);
monitor_src->stage_painted_handler_id = 0;
}
static gboolean
static void
meta_screen_cast_monitor_stream_src_record_frame (MetaScreenCastStreamSrc *src,
uint8_t *data)
{
@ -330,226 +140,9 @@ 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 *
@ -564,7 +157,6 @@ 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
@ -577,6 +169,4 @@ 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,15 +105,12 @@ meta_screen_cast_monitor_stream_get_monitor (MetaScreenCastMonitorStream *monito
}
MetaScreenCastMonitorStream *
meta_screen_cast_monitor_stream_new (MetaScreenCastSession *session,
GDBusConnection *connection,
MetaMonitor *monitor,
ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode,
GError **error)
meta_screen_cast_monitor_stream_new (GDBusConnection *connection,
MetaMonitorManager *monitor_manager,
MetaMonitor *monitor,
ClutterStage *stage,
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))
@ -125,9 +122,7 @@ meta_screen_cast_monitor_stream_new (MetaScreenCastSession *session,
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,7 +27,6 @@
#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,
@ -35,12 +34,11 @@ G_DECLARE_FINAL_TYPE (MetaScreenCastMonitorStream,
META, SCREEN_CAST_MONITOR_STREAM,
MetaScreenCastStream)
MetaScreenCastMonitorStream * meta_screen_cast_monitor_stream_new (MetaScreenCastSession *session,
GDBusConnection *connection,
MetaMonitor *monitor,
ClutterStage *stage,
MetaScreenCastCursorMode cursor_mode,
GError **error);
MetaScreenCastMonitorStream * meta_screen_cast_monitor_stream_new (GDBusConnection *connection,
MetaMonitorManager *monitor_manager,
MetaMonitor *monitor,
ClutterStage *stage,
GError **error);
ClutterStage * meta_screen_cast_monitor_stream_get_stage (MetaScreenCastMonitorStream *monitor_stream);

View File

@ -26,11 +26,8 @@
#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"
@ -38,16 +35,12 @@ struct _MetaScreenCastSession
{
MetaDBusScreenCastSessionSkeleton parent;
MetaScreenCast *screen_cast;
char *peer_name;
MetaScreenCastSessionType session_type;
char *object_path;
GList *streams;
MetaScreenCastSessionHandle *handle;
};
static void
@ -64,35 +57,6 @@ 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)
@ -107,8 +71,6 @@ meta_screen_cast_session_start (MetaScreenCastSession *session,
return FALSE;
}
init_remote_access_handle (session);
return TRUE;
}
@ -132,14 +94,6 @@ 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);
}
@ -161,12 +115,6 @@ 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)
{
@ -262,20 +210,6 @@ 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,
@ -289,7 +223,6 @@ 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;
@ -321,28 +254,12 @@ 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 (session,
connection,
monitor_stream = meta_screen_cast_monitor_stream_new (connection,
monitor_manager,
monitor,
stage,
cursor_mode,
&error);
if (!monitor_stream)
{
@ -374,15 +291,6 @@ 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))
{
@ -392,60 +300,9 @@ handle_record_window (MetaDBusScreenCastSession *skeleton,
return TRUE;
}
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);
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_FAILED,
"Recording a window not yet supported");
return TRUE;
}
@ -482,7 +339,6 @@ 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 =
@ -505,7 +361,6 @@ 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);
@ -524,40 +379,3 @@ 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,7 +26,6 @@
#include "backends/meta-screen-cast.h"
#include "backends/meta-screen-cast-stream.h"
#include "meta/meta-remote-access-controller.h"
typedef enum _MetaScreenCastSessionType
{
@ -39,12 +38,6 @@ 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,
@ -60,6 +53,4 @@ 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,10 +40,6 @@
#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,
@ -61,6 +57,14 @@ 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;
@ -87,9 +91,6 @@ 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
@ -116,81 +117,14 @@ meta_screen_cast_stream_src_get_specs (MetaScreenCastStreamSrc *src,
klass->get_specs (src, width, height, frame_rate);
}
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
static void
meta_screen_cast_stream_src_record_frame (MetaScreenCastStreamSrc *src,
uint8_t *data)
{
MetaScreenCastStreamSrcClass *klass =
META_SCREEN_CAST_STREAM_SRC_GET_CLASS (src);
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 ();
klass->record_frame (src, data);
}
void
@ -198,9 +132,8 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
MetaRectangle crop_rect;
struct pw_buffer *buffer;
struct spa_buffer *spa_buffer;
uint32_t buffer_id;
struct spa_buffer *buffer;
uint8_t *map = NULL;
uint8_t *data;
uint64_t now_us;
@ -215,24 +148,22 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
if (!priv->pipewire_stream)
return;
buffer = pw_stream_dequeue_buffer (priv->pipewire_stream);
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);
if (!buffer)
{
g_warning ("Failed to dequeue at PipeWire buffer");
g_warning ("Failed to peek at PipeWire buffer");
return;
}
spa_buffer = buffer->buffer;
if (spa_buffer->datas[0].data)
if (buffer->datas[0].type == priv->pipewire_type->data.MemFd)
{
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,
map = mmap (NULL, buffer->datas[0].maxsize + buffer->datas[0].mapoffset,
PROT_READ | PROT_WRITE, MAP_SHARED,
spa_buffer->datas[0].fd, 0);
buffer->datas[0].fd, 0);
if (map == MAP_FAILED)
{
g_warning ("Failed to mmap pipewire stream buffer: %s\n",
@ -240,54 +171,26 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
return;
}
data = SPA_MEMBER (map, spa_buffer->datas[0].mapoffset, uint8_t);
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;
}
else
{
g_warning ("Unhandled spa buffer type: %d", spa_buffer->datas[0].type);
return;
}
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);
meta_screen_cast_stream_src_record_frame (src, data);
priv->last_frame_timestamp_us = now_us;
if (map)
munmap (map, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset);
munmap (map, buffer->datas[0].maxsize + buffer->datas[0].mapoffset);
pw_stream_queue_buffer (priv->pipewire_stream, buffer);
buffer->datas[0].chunk->size = buffer->datas[0].maxsize;
pw_stream_send_buffer (priv->pipewire_stream, buffer_id);
}
static gboolean
@ -363,8 +266,8 @@ on_stream_state_changed (void *data,
}
static void
on_stream_format_changed (void *data,
const struct spa_pod *format)
on_stream_format_changed (void *data,
struct spa_pod *format)
{
MetaScreenCastStreamSrc *src = data;
MetaScreenCastStreamSrcPrivate *priv =
@ -373,7 +276,7 @@ on_stream_format_changed (void *data,
uint8_t params_buffer[1024];
int32_t width, height, stride, size;
struct spa_pod_builder pod_builder;
const struct spa_pod *params[3];
struct spa_pod *params[1];
const int bpp = 4;
if (!format)
@ -401,18 +304,6 @@ 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));
}
@ -435,6 +326,7 @@ 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;
@ -453,10 +345,7 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
return NULL;
}
meta_screen_cast_stream_src_get_specs (src,
&priv->stream_width,
&priv->stream_height,
&frame_rate);
meta_screen_cast_stream_src_get_specs (src, &width, &height, &frame_rate);
frame_rate_fraction = meta_fraction_from_double (frame_rate);
min_framerate = SPA_FRACTION (1, 1);
@ -469,12 +358,11 @@ 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 (priv->stream_width,
priv->stream_height),
":", spa_type->format_video.size, "R", &SPA_RECTANGLE (width, height),
":", spa_type->format_video.framerate, "F", &SPA_FRACTION (0, 1),
":", spa_type->format_video.max_framerate, "Fru", &max_framerate,
PROP_RANGE (&min_framerate,
&max_framerate));
":", spa_type->format_video.max_framerate, "Fr", &max_framerate,
PROP_RANGE (&min_framerate,
&max_framerate));
pw_stream_add_listener (pipewire_stream,
&priv->pipewire_stream_listener,
@ -484,8 +372,7 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
result = pw_stream_connect (pipewire_stream,
PW_DIRECTION_OUTPUT,
NULL,
(PW_STREAM_FLAG_DRIVER |
PW_STREAM_FLAG_MAP_BUFFERS),
PW_STREAM_FLAG_NONE,
params, G_N_ELEMENTS (params));
if (result != 0)
{
@ -582,7 +469,6 @@ 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,25 +24,8 @@
#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;
@ -62,18 +45,12 @@ struct _MetaScreenCastStreamSrcClass
float *frame_rate);
void (* enable) (MetaScreenCastStreamSrc *src);
void (* disable) (MetaScreenCastStreamSrc *src);
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 (* record_frame) (MetaScreenCastStreamSrc *src,
uint8_t *data);
};
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,17 +24,13 @@
#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
@ -48,13 +44,9 @@ static guint signals[N_SIGNALS];
typedef struct _MetaScreenCastStreamPrivate
{
MetaScreenCastSession *session;
GDBusConnection *connection;
char *object_path;
MetaScreenCastCursorMode cursor_mode;
MetaScreenCastStreamSrc *src;
} MetaScreenCastStreamPrivate;
@ -105,15 +97,6 @@ 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)
@ -167,15 +150,6 @@ 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,
@ -188,15 +162,9 @@ 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);
}
@ -214,15 +182,9 @@ 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);
}
@ -294,16 +256,6 @@ 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",
@ -314,18 +266,6 @@ 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,12 +26,8 @@
#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,
@ -52,8 +48,6 @@ struct _MetaScreenCastStreamClass
double *y);
};
MetaScreenCastSession * meta_screen_cast_stream_get_session (MetaScreenCastStream *stream);
gboolean meta_screen_cast_stream_start (MetaScreenCastStream *stream,
GError **error);
@ -67,6 +61,4 @@ 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

@ -1,247 +0,0 @@
/*
* 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

@ -1,37 +0,0 @@
/*
* 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

@ -1,272 +0,0 @@
/*
* 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

@ -1,44 +0,0 @@
/*
* 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

@ -1,71 +0,0 @@
/*
* 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

@ -1,74 +0,0 @@
/*
* 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,7 +43,6 @@ struct _MetaScreenCast
GList *sessions;
MetaDbusSessionWatcher *session_watcher;
MetaBackend *backend;
};
static void
@ -63,20 +62,12 @@ 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)
{
MetaScreenCast *screen_cast =
meta_screen_cast_session_get_screen_cast (session);
MetaBackend *backend = meta_screen_cast_get_backend (screen_cast);
MetaBackend *backend = meta_get_backend ();
MetaRemoteDesktop *remote_desktop = meta_backend_get_remote_desktop (backend);
MetaRemoteDesktopSession *remote_desktop_session;
@ -253,13 +244,11 @@ meta_screen_cast_finalize (GObject *object)
}
MetaScreenCast *
meta_screen_cast_new (MetaBackend *backend,
MetaDbusSessionWatcher *session_watcher)
meta_screen_cast_new (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,17 +25,9 @@
#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,
@ -43,9 +35,6 @@ G_DECLARE_FINAL_TYPE (MetaScreenCast, meta_screen_cast,
GDBusConnection * meta_screen_cast_get_connection (MetaScreenCast *screen_cast);
MetaBackend * meta_screen_cast_get_backend (MetaScreenCast *screen_cast);
MetaScreenCast * meta_screen_cast_new (MetaBackend *backend,
MetaDbusSessionWatcher *session_watcher);
MetaScreenCast * meta_screen_cast_new (MetaDbusSessionWatcher *session_watcher);
#endif /* META_SCREEN_CAST_H */

View File

@ -260,7 +260,6 @@ 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,17 +30,7 @@
#include "backends/meta-backend-private.h"
#include "clutter/clutter-mutter.h"
enum
{
ACTORS_PAINTED,
N_SIGNALS
};
static guint signals[N_SIGNALS];
struct _MetaOverlay
{
struct _MetaOverlay {
gboolean enabled;
CoglPipeline *pipeline;
@ -150,8 +140,6 @@ 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);
}
@ -191,13 +179,6 @@ 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

@ -645,20 +645,11 @@ 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);
MetaCursorRenderer *cursor_renderer;
MetaCursorRendererNative *cursor_renderer_native;
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 ();
@ -667,6 +658,10 @@ void meta_backend_native_resume (MetaBackendNative *native)
stage = meta_backend_get_stage (backend);
clutter_actor_queue_redraw (stage);
cursor_renderer = meta_backend_get_cursor_renderer (backend);
cursor_renderer_native = META_CURSOR_RENDERER_NATIVE (cursor_renderer);
meta_cursor_renderer_native_force_update (cursor_renderer_native);
idle_monitor = meta_backend_get_idle_monitor (backend, 0);
meta_idle_monitor_reset_idletime (idle_monitor);
}

View File

@ -35,7 +35,6 @@
#include <meta/meta-backend.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-cursor-sprite-xcursor.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor.h"
#include "backends/meta-monitor-manager-private.h"
@ -44,11 +43,6 @@
#include "core/boxes-private.h"
#include "meta/boxes.h"
#ifdef HAVE_WAYLAND
#include "wayland/meta-cursor-sprite-wayland.h"
#include "wayland/meta-wayland-buffer.h"
#endif
#ifndef DRM_CAP_CURSOR_WIDTH
#define DRM_CAP_CURSOR_WIDTH 0x8
#endif
@ -119,11 +113,6 @@ static GQuark quark_cursor_renderer_native_gpu_data = 0;
G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRendererNative, meta_cursor_renderer_native, META_TYPE_CURSOR_RENDERER);
static void
realize_cursor_sprite (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
GList *gpus);
static MetaCursorNativeGpuState *
get_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
MetaGpuKms *gpu_kms);
@ -163,8 +152,7 @@ static void
meta_cursor_renderer_native_finalize (GObject *object)
{
MetaCursorRendererNative *renderer = META_CURSOR_RENDERER_NATIVE (object);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (renderer);
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (renderer);
if (priv->animation_timeout_id)
g_source_remove (priv->animation_timeout_id);
@ -215,8 +203,7 @@ set_crtc_cursor (MetaCursorRendererNative *native,
MetaCrtc *crtc,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
MetaGpuKms *gpu_kms;
int kms_fd;
@ -304,7 +291,6 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
data->in_cursor_renderer_native;
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
MetaCrtc *crtc;
MetaMonitorTransform transform;
ClutterRect scaled_crtc_rect;
float scale;
@ -344,8 +330,6 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
},
};
crtc = meta_output_get_assigned_crtc (monitor_crtc_mode->output);
if (priv->has_hw_cursor &&
clutter_rect_intersection (&scaled_crtc_rect,
&data->in_local_cursor_rect,
@ -356,7 +340,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
float crtc_cursor_x, crtc_cursor_y;
set_crtc_cursor (data->in_cursor_renderer_native,
crtc,
monitor_crtc_mode->output->crtc,
data->in_cursor_sprite);
gpu_kms = META_GPU_KMS (meta_monitor_get_gpu (monitor));
@ -366,7 +350,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
crtc_cursor_y = (data->in_local_cursor_rect.origin.y -
scaled_crtc_rect.origin.y) * scale;
drmModeMoveCursor (kms_fd,
crtc->crtc_id,
monitor_crtc_mode->output->crtc->crtc_id,
roundf (crtc_cursor_x),
roundf (crtc_cursor_y));
@ -374,7 +358,8 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
}
else
{
set_crtc_cursor (data->in_cursor_renderer_native, crtc, NULL);
set_crtc_cursor (data->in_cursor_renderer_native,
monitor_crtc_mode->output->crtc, NULL);
}
return TRUE;
@ -384,8 +369,7 @@ static void
update_hw_cursor (MetaCursorRendererNative *native,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRenderer *renderer = META_CURSOR_RENDERER (native);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
GList *logical_monitors;
@ -578,19 +562,18 @@ can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
static gboolean
should_have_hw_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
GList *gpus)
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
GList *gpus;
GList *l;
CoglTexture *texture;
if (!cursor_sprite)
return FALSE;
if (meta_cursor_renderer_is_hw_cursors_inhibited (renderer,
cursor_sprite))
return FALSE;
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
for (l = gpus; l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
@ -624,8 +607,7 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
static gboolean
meta_cursor_renderer_native_update_animation (MetaCursorRendererNative *native)
{
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRenderer *renderer = META_CURSOR_RENDERER (native);
MetaCursorSprite *cursor_sprite = meta_cursor_renderer_get_cursor (renderer);
@ -637,11 +619,10 @@ meta_cursor_renderer_native_update_animation (MetaCursorRendererNative *native)
}
static void
maybe_schedule_cursor_sprite_animation_frame (MetaCursorRendererNative *native,
MetaCursorSprite *cursor_sprite)
meta_cursor_renderer_native_trigger_frame (MetaCursorRendererNative *native,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
gboolean cursor_change;
guint delay;
@ -673,78 +654,21 @@ maybe_schedule_cursor_sprite_animation_frame (MetaCursorRendererNative *native,
}
}
static GList *
calculate_cursor_sprite_gpus (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
GList *gpus = NULL;
GList *logical_monitors;
GList *l;
ClutterRect cursor_rect;
cursor_rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
logical_monitors =
meta_monitor_manager_get_logical_monitors (monitor_manager);
for (l = logical_monitors; l; l = l->next)
{
MetaLogicalMonitor *logical_monitor = l->data;
MetaRectangle logical_monitor_layout;
ClutterRect logical_monitor_rect;
GList *monitors, *l_mon;
logical_monitor_layout =
meta_logical_monitor_get_layout (logical_monitor);
logical_monitor_rect =
meta_rectangle_to_clutter_rect (&logical_monitor_layout);
if (!clutter_rect_intersection (&cursor_rect, &logical_monitor_rect,
NULL))
continue;
monitors = meta_logical_monitor_get_monitors (logical_monitor);
for (l_mon = monitors; l_mon; l_mon = l_mon->next)
{
MetaMonitor *monitor = l_mon->data;
MetaGpu *gpu;
gpu = meta_monitor_get_gpu (monitor);
if (!g_list_find (gpus, gpu))
gpus = g_list_prepend (gpus, gpu);
}
}
return gpus;
}
static gboolean
meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
g_autoptr (GList) gpus = NULL;
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
if (cursor_sprite)
{
meta_cursor_sprite_realize_texture (cursor_sprite);
gpus = calculate_cursor_sprite_gpus (renderer, cursor_sprite);
realize_cursor_sprite (renderer, cursor_sprite, gpus);
}
meta_cursor_sprite_realize_texture (cursor_sprite);
maybe_schedule_cursor_sprite_animation_frame (native, cursor_sprite);
meta_cursor_renderer_native_trigger_frame (native, cursor_sprite);
priv->has_hw_cursor = should_have_hw_cursor (renderer, cursor_sprite, gpus);
priv->has_hw_cursor = should_have_hw_cursor (renderer, cursor_sprite);
update_hw_cursor (native, cursor_sprite);
return (priv->has_hw_cursor ||
!cursor_sprite ||
!meta_cursor_sprite_get_cogl_texture (cursor_sprite));
return priv->has_hw_cursor;
}
static void
@ -780,24 +704,6 @@ ensure_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
return cursor_gpu_state;
}
static void
on_cursor_sprite_texture_changed (MetaCursorSprite *cursor_sprite)
{
MetaCursorNativePrivate *cursor_priv = get_cursor_priv (cursor_sprite);
GHashTableIter iter;
MetaCursorNativeGpuState *cursor_gpu_state;
g_hash_table_iter_init (&iter, cursor_priv->gpu_states);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &cursor_gpu_state))
{
guint pending_bo;
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_gpu_state);
g_clear_pointer (&cursor_gpu_state->bos[pending_bo],
(GDestroyNotify) gbm_bo_destroy);
cursor_gpu_state->pending_bo_state = META_CURSOR_GBM_BO_STATE_INVALIDATED;
}
}
static void
cursor_priv_free (MetaCursorNativePrivate *cursor_priv)
{
@ -830,9 +736,6 @@ ensure_cursor_priv (MetaCursorSprite *cursor_sprite)
cursor_priv,
(GDestroyNotify) cursor_priv_free);
g_signal_connect (cursor_sprite, "texture-changed",
G_CALLBACK (on_cursor_sprite_texture_changed), NULL);
return cursor_priv;
}
@ -900,71 +803,57 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
}
}
static gboolean
is_cursor_hw_state_valid (MetaCursorSprite *cursor_sprite,
MetaGpuKms *gpu_kms)
static void
invalidate_pending_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite,
MetaGpuKms *gpu_kms)
{
MetaCursorNativePrivate *cursor_priv;
MetaCursorNativeGpuState *cursor_gpu_state;
guint pending_bo;
cursor_priv = get_cursor_priv (cursor_sprite);
if (!cursor_priv)
return FALSE;
return;
cursor_gpu_state = get_cursor_gpu_state (cursor_priv, gpu_kms);
if (!cursor_gpu_state)
return FALSE;
return;
switch (cursor_gpu_state->pending_bo_state)
{
case META_CURSOR_GBM_BO_STATE_SET:
case META_CURSOR_GBM_BO_STATE_NONE:
return TRUE;
case META_CURSOR_GBM_BO_STATE_INVALIDATED:
return FALSE;
}
g_assert_not_reached ();
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_gpu_state);
g_clear_pointer (&cursor_gpu_state->bos[pending_bo],
(GDestroyNotify) gbm_bo_destroy);
cursor_gpu_state->pending_bo_state = META_CURSOR_GBM_BO_STATE_INVALIDATED;
}
#ifdef HAVE_WAYLAND
static void
realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSpriteWayland *sprite_wayland)
meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite,
struct wl_resource *buffer)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_wayland);
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
uint32_t gbm_format;
uint64_t cursor_width, cursor_height;
CoglTexture *texture;
uint width, height;
MetaWaylandBuffer *buffer;
struct wl_resource *buffer_resource;
struct wl_shm_buffer *shm_buffer;
cursor_renderer_gpu_data =
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
if (!cursor_renderer_gpu_data || cursor_renderer_gpu_data->hw_cursor_broken)
return;
if (is_cursor_hw_state_valid (cursor_sprite, gpu_kms))
return;
/* Destroy any previous pending cursor buffer; we'll always either fail (which
* should unset, or succeed, which will set new buffer.
*/
invalidate_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms);
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
width = cogl_texture_get_width (texture);
height = cogl_texture_get_height (texture);
buffer = meta_cursor_sprite_wayland_get_buffer (sprite_wayland);
if (!buffer)
return;
buffer_resource = meta_wayland_buffer_get_resource (buffer);
if (!buffer_resource)
return;
shm_buffer = wl_shm_buffer_get (buffer_resource);
struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get (buffer);
if (shm_buffer)
{
int rowstride = wl_shm_buffer_get_stride (shm_buffer);
@ -1038,27 +927,47 @@ realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
set_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms, bo);
}
}
static void
meta_cursor_renderer_native_realize_cursor_from_wl_buffer (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
struct wl_resource *buffer)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
GList *gpus;
GList *l;
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
for (l = gpus; l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (
renderer,
gpu_kms,
cursor_sprite,
buffer);
}
}
#endif
static void
realize_cursor_sprite_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSpriteXcursor *sprite_xcursor)
meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_xcursor);
XcursorImage *xc_image;
cursor_renderer_gpu_data =
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
if (!cursor_renderer_gpu_data || cursor_renderer_gpu_data->hw_cursor_broken)
return;
if (is_cursor_hw_state_valid (cursor_sprite, gpu_kms))
return;
xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor);
invalidate_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms);
load_cursor_sprite_gbm_buffer_for_gpu (native,
gpu_kms,
@ -1071,45 +980,26 @@ realize_cursor_sprite_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
}
static void
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 =
META_CURSOR_SPRITE_XCURSOR (cursor_sprite);
realize_cursor_sprite_from_xcursor_for_gpu (renderer,
gpu_kms,
sprite_xcursor);
}
}
static void
realize_cursor_sprite (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
GList *gpus)
meta_cursor_renderer_native_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
GList *gpus;
GList *l;
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
for (l = gpus; l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
realize_cursor_sprite_for_gpu (renderer, gpu_kms, cursor_sprite);
meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (
renderer,
gpu_kms,
cursor_sprite,
xc_image);
}
}
@ -1121,6 +1011,12 @@ meta_cursor_renderer_native_class_init (MetaCursorRendererNativeClass *klass)
object_class->finalize = meta_cursor_renderer_native_finalize;
renderer_class->update_cursor = meta_cursor_renderer_native_update_cursor;
#ifdef HAVE_WAYLAND
renderer_class->realize_cursor_from_wl_buffer =
meta_cursor_renderer_native_realize_cursor_from_wl_buffer;
#endif
renderer_class->realize_cursor_from_xcursor =
meta_cursor_renderer_native_realize_cursor_from_xcursor;
quark_cursor_sprite = g_quark_from_static_string ("-meta-cursor-native");
quark_cursor_renderer_native_gpu_data =
@ -1135,13 +1031,14 @@ force_update_hw_cursor (MetaCursorRendererNative *native)
meta_cursor_renderer_native_get_instance_private (native);
priv->hw_state_invalidated = TRUE;
meta_cursor_renderer_force_update (renderer);
update_hw_cursor (native, meta_cursor_renderer_get_cursor (renderer));
}
static void
on_monitors_changed (MetaMonitorManager *monitors,
MetaCursorRendererNative *native)
{
/* Our tracking is all messed up, so force an update. */
force_update_hw_cursor (native);
}
@ -1213,3 +1110,9 @@ static void
meta_cursor_renderer_native_init (MetaCursorRendererNative *native)
{
}
void
meta_cursor_renderer_native_force_update (MetaCursorRendererNative *native)
{
force_update_hw_cursor (native);
}

View File

@ -32,6 +32,8 @@ G_DECLARE_FINAL_TYPE (MetaCursorRendererNative, meta_cursor_renderer_native,
META, CURSOR_RENDERER_NATIVE,
MetaCursorRenderer)
void meta_cursor_renderer_native_force_update (MetaCursorRendererNative *renderer);
MetaCursorRendererNative * meta_cursor_renderer_native_new (MetaBackend *backend);
#endif /* META_CURSOR_RENDERER_NATIVE_H */

View File

@ -68,11 +68,8 @@ 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
@ -113,10 +110,8 @@ get_crtc_drm_connectors (MetaGpu *gpu,
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
{
MetaOutput *output = l->data;
MetaCrtc *assigned_crtc;
assigned_crtc = meta_output_get_assigned_crtc (output);
if (assigned_crtc == crtc)
if (output->crtc == crtc)
g_array_append_val (connectors_array, output->winsys_id);
}
@ -151,10 +146,7 @@ meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
connectors, n_connectors,
mode) != 0)
{
if (mode)
g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
else
g_warning ("Failed to disable CRTC");
g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
g_free (connectors);
return FALSE;
}
@ -199,10 +191,8 @@ meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
{
MetaOutput *output = l->data;
MetaCrtc *assigned_crtc;
assigned_crtc = meta_output_get_assigned_crtc (output);
if (assigned_crtc == crtc)
if (output->crtc == crtc)
{
connected_crtc_found = TRUE;
break;
@ -729,34 +719,20 @@ init_outputs (MetaGpuKms *gpu_kms,
setup_output_clones (gpu);
}
static gboolean
meta_kms_resources_init (MetaKmsResources *resources,
int fd,
GError **error)
static void
meta_kms_resources_init (MetaKmsResources *resources,
int fd)
{
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
@ -768,7 +744,7 @@ meta_kms_resources_release (MetaKmsResources *resources)
drmModeFreeEncoder (resources->encoders[i]);
g_free (resources->encoders);
g_clear_pointer (&resources->resources, drmModeFreeResources);
drmModeFreeResources (resources->resources);
}
static gboolean
@ -779,18 +755,8 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
MetaMonitorManager *monitor_manager =
meta_gpu_get_monitor_manager (gpu);
MetaKmsResources resources;
g_autoptr (GError) local_error = NULL;
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;
}
meta_kms_resources_init (&resources, gpu_kms->fd);
gpu_kms->max_buffer_width = resources.resources->max_width;
gpu_kms->max_buffer_height = resources.resources->max_height;
@ -803,8 +769,6 @@ 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);
@ -815,12 +779,6 @@ 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,
@ -834,47 +792,12 @@ 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);
@ -884,8 +807,6 @@ 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,14 +29,6 @@
#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)
@ -61,8 +53,6 @@ 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

@ -34,7 +34,6 @@
#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>
@ -189,7 +188,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
MetaOutput *output = g_ptr_array_index (crtc_info->outputs, j);
output->is_dirty = TRUE;
meta_output_assign_crtc (output, crtc);
output->crtc = crtc;
}
}
@ -250,7 +249,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
continue;
}
meta_output_unassign_crtc (output);
output->crtc = NULL;
output->is_primary = FALSE;
}
}
@ -416,15 +415,9 @@ 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
@ -649,12 +642,10 @@ 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);
@ -690,11 +681,8 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
gpu_kms = meta_gpu_kms_new (manager_kms, gpu_path, &secondary_error);
if (!gpu_kms)
{
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);
g_warning ("Failed to open secondary gpu '%s': %s",
gpu_path, secondary_error->message);
continue;
}
@ -703,24 +691,6 @@ 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

@ -64,13 +64,11 @@ typedef struct _MetaOutputKms
void
meta_output_kms_set_underscan (MetaOutput *output)
{
MetaCrtc *crtc;
crtc = meta_output_get_assigned_crtc (output);
if (!crtc)
if (!output->crtc)
return;
meta_crtc_kms_set_underscan (crtc, output->is_underscanning);
meta_crtc_kms_set_underscan (output->crtc,
output->is_underscanning);
}
void
@ -602,14 +600,14 @@ meta_create_kms_output (MetaGpuKms *gpu_kms,
if (crtc->crtc_id == output_kms->current_encoder->crtc_id)
{
meta_output_assign_crtc (output, crtc);
output->crtc = crtc;
break;
}
}
}
else
{
meta_output_unassign_crtc (output);
output->crtc = NULL;
}
if (old_output)

View File

@ -96,6 +96,8 @@ typedef struct _MetaRendererNativeGpuData
#ifdef HAVE_EGL_DEVICE
struct {
EGLDeviceEXT device;
gboolean no_egl_output_drm_flip_event;
} egl;
#endif
@ -991,29 +993,14 @@ meta_renderer_native_choose_egl_config (CoglDisplay *cogl_display,
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
MetaBackend *backend = meta_get_backend ();
MetaEgl *egl = meta_backend_get_egl (backend);
MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform;
EGLDisplay egl_display = cogl_renderer_egl->edpy;
switch (renderer_gpu_data->mode)
{
case META_RENDERER_NATIVE_MODE_GBM:
return choose_egl_config_from_gbm_format (egl,
egl_display,
attributes,
GBM_FORMAT_XRGB8888,
out_config,
error);
#ifdef HAVE_EGL_DEVICE
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
return meta_egl_choose_first_config (egl,
egl_display,
attributes,
out_config,
error);
#endif
}
return FALSE;
return choose_egl_config_from_gbm_format (egl,
egl_display,
attributes,
GBM_FORMAT_XRGB8888,
out_config,
error);
}
static gboolean
@ -1291,6 +1278,8 @@ 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);
@ -1311,7 +1300,9 @@ 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", error->message);
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_error_free (error);
meta_gpu_kms_flip_closure_container_free (closure_container);
@ -1621,23 +1612,12 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
return FALSE;
}
if (gbm_bo_get_handle_for_plane (next_bo, 0).s32 == -1)
for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
{
/* 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);
}
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);
@ -2114,7 +2094,6 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
EGLDisplay egl_display = renderer_gpu_data->egl_display;
MetaMonitor *monitor;
MetaOutput *output;
MetaCrtc *crtc;
EGLConfig egl_config;
EGLStreamKHR egl_stream;
EGLSurface egl_surface;
@ -2122,7 +2101,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, 0,
EGL_STREAM_FIFO_LENGTH_KHR, 1,
EGL_CONSUMER_AUTO_ACQUIRE_EXT, EGL_FALSE,
EGL_NONE
};
@ -2138,7 +2117,6 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
/*
* An "logical_monitor" may have multiple outputs/crtcs in case its tiled,
@ -2146,7 +2124,7 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
* lets pass the first one.
*/
output_attribs[0] = EGL_DRM_CRTC_EXT;
output_attribs[1] = crtc->crtc_id;
output_attribs[1] = output->crtc->crtc_id;
output_attribs[2] = EGL_NONE;
if (!meta_egl_get_output_layers (egl, egl_display,
@ -2744,12 +2722,9 @@ 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);
@ -2760,67 +2735,13 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
*/
if (meta_monitor_manager_is_transform_handled (monitor_manager,
crtc,
main_output->crtc,
crtc_transform))
return META_MONITOR_TRANSFORM_NORMAL;
else
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 *
meta_renderer_native_create_view (MetaRenderer *renderer,
MetaLogicalMonitor *logical_monitor)
@ -2830,8 +2751,10 @@ 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 =
cogl_context_from_renderer_native (renderer_native);
clutter_backend_get_cogl_context (clutter_backend);
CoglDisplay *cogl_display = cogl_context_get_display (cogl_context);
MetaGpuKms *primary_gpu;
CoglDisplayEGL *cogl_display_egl;
@ -2866,8 +2789,7 @@ 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 ||
should_force_shadow_fb (renderer_native, primary_gpu))
if (view_transform != META_MONITOR_TRANSFORM_NORMAL)
{
offscreen = meta_renderer_native_create_offscreen (renderer_native,
cogl_context,
@ -2990,11 +2912,10 @@ meta_renderer_native_set_property (GObject *object,
}
static gboolean
create_secondary_egl_config (MetaEgl *egl,
MetaRendererNativeMode mode,
EGLDisplay egl_display,
EGLConfig *egl_config,
GError **error)
create_secondary_egl_config (MetaEgl *egl,
EGLDisplay egl_display,
EGLConfig *egl_config,
GError **error)
{
EGLint attributes[] = {
EGL_RED_SIZE, 1,
@ -3007,26 +2928,12 @@ create_secondary_egl_config (MetaEgl *egl,
EGL_NONE
};
switch (mode)
{
case META_RENDERER_NATIVE_MODE_GBM:
return choose_egl_config_from_gbm_format (egl,
egl_display,
attributes,
GBM_FORMAT_XRGB8888,
egl_config,
error);
#ifdef HAVE_EGL_DEVICE
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
return meta_egl_choose_first_config (egl,
egl_display,
attributes,
egl_config,
error);
#endif
}
return FALSE;
return choose_egl_config_from_gbm_format (egl,
egl_display,
attributes,
GBM_FORMAT_XRGB8888,
egl_config,
error);
}
static EGLContext
@ -3070,8 +2977,7 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
EGLContext egl_context;
char **missing_gl_extensions;
if (!create_secondary_egl_config (egl, renderer_gpu_data->mode, egl_display,
&egl_config, error))
if (!create_secondary_egl_config (egl,egl_display, &egl_config, error))
return FALSE;
egl_context = create_secondary_egl_context (egl, egl_display, egl_config, error);

View File

@ -30,7 +30,6 @@
#include "meta-backend-x11.h"
#include "meta-stage-private.h"
#include "backends/meta-cursor-sprite-xcursor.h"
struct _MetaCursorRendererX11Private
{
@ -60,18 +59,13 @@ meta_cursor_renderer_x11_update_cursor (MetaCursorRenderer *renderer,
gboolean has_server_cursor = FALSE;
if (cursor_sprite && META_IS_CURSOR_SPRITE_XCURSOR (cursor_sprite))
if (cursor_sprite)
{
MetaCursorSpriteXcursor *sprite_xcursor =
META_CURSOR_SPRITE_XCURSOR (cursor_sprite);
MetaCursor cursor;
MetaCursor cursor = meta_cursor_sprite_get_meta_cursor (cursor_sprite);
cursor = meta_cursor_sprite_xcursor_get_cursor (sprite_xcursor);
if (cursor != META_CURSOR_NONE)
{
Cursor xcursor;
xcursor = meta_create_x_cursor (xdisplay, cursor);
Cursor xcursor = meta_cursor_create_x_cursor (xdisplay, cursor);
XDefineCursor (xdisplay, xwindow, xcursor);
XFlush (xdisplay);
XFreeCursor (xdisplay, xcursor);

View File

@ -225,10 +225,8 @@ is_crtc_assignment_changed (MetaCrtc *crtc,
for (j = 0; j < crtc_info->outputs->len; j++)
{
MetaOutput *output = ((MetaOutput**) crtc_info->outputs->pdata)[j];
MetaCrtc *assigned_crtc;
assigned_crtc = meta_output_get_assigned_crtc (output);
if (assigned_crtc != crtc)
if (output->crtc != crtc)
return TRUE;
}
@ -245,7 +243,6 @@ is_output_assignment_changed (MetaOutput *output,
MetaOutputInfo **output_infos,
unsigned int n_output_infos)
{
MetaCrtc *assigned_crtc;
gboolean output_is_found = FALSE;
unsigned int i;
@ -268,10 +265,8 @@ is_output_assignment_changed (MetaOutput *output,
output_is_found = TRUE;
}
assigned_crtc = meta_output_get_assigned_crtc (output);
if (!output_is_found)
return assigned_crtc != NULL;
return output->crtc != NULL;
for (i = 0; i < n_crtc_infos; i++)
{
@ -284,7 +279,7 @@ is_output_assignment_changed (MetaOutput *output,
((MetaOutput**) crtc_info->outputs->pdata)[j];
if (crtc_info_output == output &&
crtc_info->crtc == assigned_crtc)
crtc_info->crtc == output->crtc)
return FALSE;
}
}
@ -460,7 +455,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
output->is_dirty = TRUE;
meta_output_assign_crtc (output, crtc);
output->crtc = crtc;
output_ids[j] = output->winsys_id;
}
@ -526,7 +521,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
continue;
}
meta_output_unassign_crtc (output);
output->crtc = NULL;
output->is_primary = FALSE;
}

View File

@ -97,13 +97,10 @@ output_set_underscanning_xrandr (MetaOutput *output,
* make the border configurable. */
if (underscanning)
{
MetaCrtc *crtc;
uint32_t border_value;
crtc = meta_output_get_assigned_crtc (output);
prop = XInternAtom (xdisplay, "underscan hborder", False);
border_value = crtc->current_mode->width * 0.05;
border_value = output->crtc->current_mode->width * 0.05;
xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
(XID) output->winsys_id,
@ -112,7 +109,7 @@ output_set_underscanning_xrandr (MetaOutput *output,
1, &border_value);
prop = XInternAtom (xdisplay, "underscan vborder", False);
border_value = crtc->current_mode->height * 0.05;
border_value = output->crtc->current_mode->height * 0.05;
xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
(XID) output->winsys_id,
@ -740,14 +737,14 @@ output_get_crtcs (MetaOutput *output,
}
output->n_possible_crtcs = n_actual_crtcs;
meta_output_unassign_crtc (output);
output->crtc = NULL;
for (l = meta_gpu_get_crtcs (gpu); l; l = l->next)
{
MetaCrtc *crtc = l->data;
if ((XID) crtc->crtc_id == xrandr_output->crtc)
{
meta_output_assign_crtc (output, crtc);
output->crtc = crtc;
break;
}
}

View File

@ -113,7 +113,7 @@ draw_crtc (MetaMonitor *monitor,
CoglTexture *texture = data->texture;
MetaLogicalMonitor *logical_monitor = data->logical_monitor;
MetaOutput *output = monitor_crtc_mode->output;
MetaCrtc *crtc;
MetaCrtc *crtc = output->crtc;
MetaRendererView *renderer_view = META_RENDERER_VIEW (data->view);
MetaMonitorTransform view_transform;
MetaMonitorTransform layout_transform = META_MONITOR_TRANSFORM_NORMAL;
@ -129,8 +129,6 @@ draw_crtc (MetaMonitor *monitor,
texture_width = cogl_texture_get_width (texture);
texture_height = cogl_texture_get_height (texture);
crtc = meta_output_get_assigned_crtc (output);
clutter_stage_view_get_layout (data->view, &view_layout);
sample_x = crtc->rect.x - view_layout.x;
sample_y = crtc->rect.y - view_layout.y;

View File

@ -26,8 +26,6 @@
#include "backends/x11/nested/meta-cursor-renderer-x11-nested.h"
#include <X11/Xcursor/Xcursor.h>
#include "backends/x11/meta-backend-x11.h"
struct _MetaCursorRendererX11Nested

View File

@ -50,22 +50,20 @@ 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.
*/
if (meta_monitor_manager_is_transform_handled (monitor_manager,
crtc,
main_output->crtc,
crtc_transform))
return META_MONITOR_TRANSFORM_NORMAL;
else

View File

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

View File

@ -31,10 +31,9 @@ gboolean meta_actor_is_untransformed (ClutterActor *actor,
int *x_origin,
int *y_origin);
gboolean meta_actor_painting_untransformed (CoglFramebuffer *fb,
int paint_width,
int paint_height,
int *x_origin,
int *y_origin);
gboolean meta_actor_painting_untransformed (int paint_width,
int paint_height,
int *x_origin,
int *y_origin);
#endif /* __META_CLUTTER_UTILS_H__ */

View File

@ -325,7 +325,6 @@ setup_pipeline (MetaBackgroundActor *self,
PipelineFlags pipeline_flags = 0;
guint8 opacity;
float color_component;
CoglFramebuffer *fb;
CoglPipelineFilter filter;
opacity = clutter_actor_get_paint_opacity (CLUTTER_ACTOR (self));
@ -418,12 +417,8 @@ setup_pipeline (MetaBackgroundActor *self,
color_component,
opacity / 255.);
fb = cogl_get_draw_framebuffer ();
if (!priv->force_bilinear &&
meta_actor_painting_untransformed (fb,
actor_pixel_rect->width,
actor_pixel_rect->height,
NULL, NULL))
meta_actor_painting_untransformed (actor_pixel_rect->width, actor_pixel_rect->height, NULL, NULL))
filter = COGL_PIPELINE_FILTER_NEAREST;
else
filter = COGL_PIPELINE_FILTER_LINEAR;

View File

@ -279,34 +279,6 @@ meta_background_image_cache_purge (MetaBackgroundImageCache *cache,
image->in_cache = FALSE;
}
/**
* meta_background_image_cache_unload_all:
* @cache: a #MetaBackgroundImageCache
*
* Remove all entries from the cache and unloads them; this would be used
* if textures in video memory have been invalidated.
*/
void
meta_background_image_cache_unload_all (MetaBackgroundImageCache *cache)
{
GHashTableIter iter;
gpointer key, value;
g_return_if_fail (META_IS_BACKGROUND_IMAGE_CACHE (cache));
g_hash_table_iter_init (&iter, cache->images);
while (g_hash_table_iter_next (&iter, &key, &value))
{
MetaBackgroundImage *image = value;
g_clear_pointer (&image->texture, cogl_object_unref);
image->in_cache = FALSE;
image->loaded = FALSE;
}
g_hash_table_remove_all (cache->images);
}
G_DEFINE_TYPE (MetaBackgroundImage, meta_background_image, G_TYPE_OBJECT);
static void

View File

@ -317,20 +317,6 @@ meta_background_finalize (GObject *object)
G_OBJECT_CLASS (meta_background_parent_class)->finalize (object);
}
static void
free_textures (MetaBackground *self)
{
MetaBackgroundPrivate *priv = self->priv;
free_color_texture (self);
free_wallpaper_texture (self);
set_file (self, &priv->file1, &priv->background_image1, NULL);
set_file (self, &priv->file2, &priv->background_image2, NULL);
mark_changed (self);
}
static void
meta_background_constructed (GObject *object)
{
@ -340,7 +326,7 @@ meta_background_constructed (GObject *object)
G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
g_signal_connect_object (meta_screen_get_display (priv->screen), "gl-video-memory-purged",
G_CALLBACK (free_textures), object, G_CONNECT_SWAPPED);
G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
}
static void
@ -974,11 +960,8 @@ meta_background_set_blend (MetaBackground *self,
void
meta_background_refresh_all (void)
{
MetaBackgroundImageCache *cache = meta_background_image_cache_get_default ();
GSList *l;
meta_background_image_cache_unload_all (cache);
for (l = all_backgrounds; l; l = l->next)
mark_changed (l->data);
}

File diff suppressed because it is too large Load Diff

View File

@ -24,7 +24,6 @@
#include <meta/meta-shadow-factory.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-screen-cast-window.h"
#include "clutter/clutter-mutter.h"
#include "compositor-private.h"
#include "meta-shaped-texture-private.h"
@ -189,11 +188,8 @@ static void do_send_frame_timings (MetaWindowActor *self,
static void cullable_iface_init (MetaCullableInterface *iface);
static void screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface);
G_DEFINE_TYPE_WITH_CODE (MetaWindowActor, meta_window_actor, CLUTTER_TYPE_ACTOR,
G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init)
G_IMPLEMENT_INTERFACE (META_TYPE_SCREEN_CAST_WINDOW, screen_cast_window_iface_init));
G_IMPLEMENT_INTERFACE (META_TYPE_CULLABLE, cullable_iface_init));
static void
frame_data_free (FrameData *frame)
@ -454,7 +450,7 @@ meta_window_actor_update_surface (MetaWindowActor *self)
#ifdef HAVE_WAYLAND
if (window->surface)
surface_actor = window->surface->surface_actor;
surface_actor = meta_wayland_surface_get_actor (window->surface);
else
#endif
if (!meta_is_wayland_compositor ())
@ -2185,129 +2181,3 @@ meta_window_actor_from_window (MetaWindow *window)
{
return META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
}
static void
meta_window_actor_get_buffer_bounds (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
ClutterActor *clutter_actor;
clutter_actor = CLUTTER_ACTOR (meta_window_actor_get_texture (window_actor));
bounds->x = 0;
bounds->y = 0;
bounds->width = (int) clutter_actor_get_width (clutter_actor);
bounds->height = (int) clutter_actor_get_height (clutter_actor);
}
static void
meta_window_actor_get_frame_bounds (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
MetaWindow *window;
MetaShapedTexture *stex;
MetaRectangle buffer_rect;
MetaRectangle frame_rect;
double scale_x, scale_y;
stex = meta_surface_actor_get_texture (window_actor->priv->surface);
clutter_actor_get_scale (CLUTTER_ACTOR (stex), &scale_x, &scale_y);
window = window_actor->priv->window;
meta_window_get_buffer_rect (window, &buffer_rect);
meta_window_get_frame_rect (window, &frame_rect);
bounds->x = (int) floor ((frame_rect.x - buffer_rect.x) / scale_x);
bounds->y = (int) floor ((frame_rect.y - buffer_rect.y) / scale_y);
bounds->width = (int) ceil (frame_rect.width / scale_x);
bounds->height = (int) ceil (frame_rect.height / scale_y);
}
static void
meta_window_actor_transform_relative_position (MetaScreenCastWindow *screen_cast_window,
double x,
double y,
double *x_out,
double *y_out)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
MetaShapedTexture *stex;
MetaRectangle bounds;
ClutterVertex v1 = { 0.f, }, v2 = { 0.f, };
meta_window_actor_get_frame_bounds (screen_cast_window, &bounds);
v1.x = CLAMP ((float) x,
bounds.x,
bounds.x + bounds.width);
v1.y = CLAMP ((float) y,
bounds.y,
bounds.y + bounds.height);
stex = meta_surface_actor_get_texture (window_actor->priv->surface);
clutter_actor_apply_transform_to_point (CLUTTER_ACTOR (stex), &v1, &v2);
*x_out = (double) v2.x;
*y_out = (double) v2.y;
}
static void
meta_window_actor_capture_into (MetaScreenCastWindow *screen_cast_window,
MetaRectangle *bounds,
uint8_t *data)
{
MetaWindowActor *window_actor = META_WINDOW_ACTOR (screen_cast_window);
cairo_surface_t *image;
MetaRectangle clip_rect;
uint8_t *cr_data;
int cr_stride;
int bpp = 4;
if (meta_window_actor_is_destroyed (window_actor))
return;
clip_rect = *bounds;
image = meta_surface_actor_get_image (window_actor->priv->surface, &clip_rect);
cr_data = cairo_image_surface_get_data (image);
cr_stride = cairo_image_surface_get_stride (image);
if (clip_rect.width < bounds->width || clip_rect.height < bounds->height)
{
uint8_t *src, *dst;
src = cr_data;
dst = data;
for (int i = 0; i < clip_rect.height; i++)
{
memcpy (dst, src, cr_stride);
if (clip_rect.width < bounds->width)
memset (dst + cr_stride, 0, (bounds->width * bpp) - cr_stride);
src += cr_stride;
dst += bounds->width * bpp;
}
for (int i = clip_rect.height; i < bounds->height; i++)
{
memset (dst, 0, bounds->width * bpp);
dst += bounds->width * bpp;
}
}
else
{
memcpy (data, cr_data, clip_rect.height * cr_stride);
}
cairo_surface_destroy (image);
}
static void
screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface)
{
iface->get_buffer_bounds = meta_window_actor_get_buffer_bounds;
iface->get_frame_bounds = meta_window_actor_get_frame_bounds;
iface->transform_relative_position = meta_window_actor_transform_relative_position;
iface->capture_into = meta_window_actor_capture_into;
}

View File

@ -81,11 +81,7 @@ meta_window_group_paint (ClutterActor *actor)
*/
if (clutter_actor_is_in_clone_paint (actor))
{
CoglFramebuffer *fb;
fb = cogl_get_draw_framebuffer ();
if (!meta_actor_painting_untransformed (fb,
screen_width,
if (!meta_actor_painting_untransformed (screen_width,
screen_height,
&paint_x_origin,
&paint_y_origin) ||

View File

@ -38,12 +38,6 @@ typedef enum
FIXED_DIRECTION_Y = 1 << 1,
} FixedDirections;
typedef enum _MetaRoundingStrategy
{
META_ROUNDING_STRATEGY_SHRINK,
META_ROUNDING_STRATEGY_GROW,
} MetaRoundingStrategy;
/* Output functions -- note that the output buffer had better be big enough:
* rect_to_string: RECT_LENGTH
* region_to_string: (RECT_LENGTH+strlen(separator_string)) *
@ -224,10 +218,6 @@ GList* meta_rectangle_find_nonintersected_monitor_edges (
gboolean meta_rectangle_is_adjecent_to (MetaRectangle *rect,
MetaRectangle *other);
void meta_rectangle_scale_double (MetaRectangle *rect,
double scale,
MetaRoundingStrategy rounding_strategy);
static inline ClutterRect
meta_rectangle_to_clutter_rect (MetaRectangle *rect)
{

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