Compare commits

...

193 Commits

Author SHA1 Message Date
Florian Müllner
5ac7109aaa Bump version to 3.29.4
Update NEWS.
2018-07-18 17:36:45 +02:00
Olivier Fourdan
7749f4d983 tests: Add the "parent_exported" test
This test aims at checking that the transient relationship set using the
xdg-foreign API is respected by mutter and that no crash occurs, such as
the one in issue !174.

Note: the crash from issue !174 occurs only if "attach_modal_dialogs" is
set, so one has to change that default value to "true" to be able to
trigger the crash:

    gsettings set org.gnome.mutter attach-modal-dialogs true

Related: https://gitlab.gnome.org/GNOME/mutter/issues/174
2018-07-18 14:31:38 +02:00
Olivier Fourdan
22aea3dc67 tests: Fix usage message for "set_parent"
"set_parent" usage message was referring to "menu" which is not a valid
command.
2018-07-18 14:30:51 +02:00
Olivier Fourdan
3d5784342d tests: Add "set_parent_exported" command
Add a "set_parent_exported" command to test the xdg-foreign support, so
that we can add a test which uses the GDK API for exported window:

  `gdk_wayland_window_set_transient_for_exported()`

That will allow to detect if transient is applied correctly between
foreign windows and detect possible crashes such as issue !174.

Related: https://gitlab.gnome.org/GNOME/mutter/issues/174
2018-07-18 14:30:40 +02:00
Bastien Nocera
fa9e330f2c backend: Remove direct upower-glib usage
Monitor whether UPower is running ourselves. That allows us to keep the
same value for "lid-is-closed" throughout the process of UPower
restarting, preventing unwanted monitor re-configuration through the process.

Fixes another screen black out when UPower restarts and the laptop lid
is closed.
2018-07-18 10:17:37 +00:00
Bastien Nocera
951219650f backend: Move lid-is-closed handling to MetaBackend
Rather than handle UpClient in both MetaBackend (to reset the idletime
when the lid is opened), and in MetaMonitorManager and
MetaMonitorConfigManager (to turn the screen under the lid on/off
depending on its status), move the ability to get the lid status from
UPower or mock it in one place, in MetaBackend.
2018-07-18 10:17:36 +00:00
Bastien Nocera
49b23c7490 monitor-manager: Cache the last known value of "lid-is-closed"
Restarting UPower will make every property of UpClient emit a "notify"
signal (as a GDBusProxy would). Avoid mutter reconfiguring the displays
when upower restarts by caching the last known value of "lid-is-closed"
and only reconfiguring the displays if it actually changed.

This fixes a black out of the screen when UPower restarts.
2018-07-18 10:17:35 +00:00
Bastien Nocera
644a618fb1 monitor-manager: Don't throw an error if UPower isn't running
Don't try to connect to a UpClient signal if creating the client failed,
because UPower isn't running for example.
2018-07-18 10:17:34 +00:00
Bastien Nocera
1e3ac3cf2c backends/native: Remove unused upower-glib header
Wasn't removed in 657417a.
2018-07-18 10:17:34 +00:00
Daniel Șerbănescu
658c373580 Update Romanian translation 2018-07-17 18:26:47 +00:00
Jonas Ådahl
6d12d2eac2 tests: Move window-shown verification to test-runner
Previously we relied on the test-client to make sure that a window was
shown. For X11, we did not need to do anything, but for Wayland we had
to make sure we had drawn the first frame, otherwise mutter wouldn't
have a buffer making the window not showable.

Doing it this way doesn't work anymore however, since the 'after-paint'
event will be emitted even if we didn't actually paint anything. This is
the case with current Gtk under Wayland, where we won't draw until the
compositor has configured the surface. In effect, this mean we'll get a
dummy after-paint emission before the first frame is actually painted.

Instead, move the verification that a "show" command has completed by
having the test-runner wait for a "shown" signal on the window, which is
emitted in the end of meta_window_show(). This requires an additional
call to gdk_display_sync() in the test-client after creating the window,
to make sure that the window creation vents has been received in the
compositor.
2018-07-17 16:30:18 +02:00
Jonas Ådahl
356cad094b stack-tracker: Don't sort O-R's under guard window on top
As of "stack-tracker: Keep override redirect windows on top"
(e3d5bc077d), we always sorted all
override redirect on top of regular windows, as so is expected by
regular override redirect windows. This had an unwanted consequence,
however, which is that we should still not sort such override redirect
windows on top if they are behind the guard window, as that'd result in
windows hidden behind it now getting restacked anyway.

Fix this by only sorting the override redirect windows that are found
above the guard window on top. This fixes the override-redirect stacking
test.
2018-07-17 16:30:18 +02:00
Carlos Garnacho
161d2540e6 ClutterActor: Preserve valid paint volumes till the next relayout/repaint
Cuts down approximately all paint volume calculations when there's
windows that redraw frequently, but don't move.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2018-07-13 11:42:28 +00:00
Carlos Garnacho
94f4009882 compositor: Add get_paint_volume() implementation to MetaSurfaceActor
The special ::pick implementation there makes clutter fall into paths
that do require a get_paint_volume() implementation, or an infinite
area will be used.

Providing a paint volume here is easier on the invalidation mechanism.
2018-07-13 11:42:28 +00:00
Carlos Garnacho
ec8138773a compositor: Do not optimize obscured areas away in paint volumes
This optimization was presumably added before Clutter was able to
invalidate selected regions of an actor. Paint volumes are supposed
to be invariable as long as the actor conditions don't change.
Stacking of other actors shouldn't affect the paint volume, so it's
actually wrong to optimize those areas away here.
2018-07-13 11:42:28 +00:00
Jonas Ådahl
041be7c565 screen-cast-src: Allow negotiating the framerate
The framerate for screen cast sources was set to variable within 1 FPS
and the framerate of the monitor being screen casted. This meant that if
the sink didn't match the framerate (e.g. had a lower max framerate),
the formats would not match and a stream would not be established.

Allow letting the sink clamp the framerate range by setting it as
'unset', allowing it to be negotiated.
2018-07-13 08:59:14 +00:00
Jonas Ådahl
0407a8b33d screen-cast-src: Port to pipewire master
The PipeWire master branch saw some backports from the work branch,
including API changes making the 0.1 series more aligned with future
plans. Make mutter use the new API. This is needed to avoid dead locks
that existed in the older version.
2018-07-12 20:25:40 +00:00
Olivier Fourdan
912a6f5e3f contraints: Do not constrain modals without parent
xdg-foreign clears the `transient_for` of a modal dialog when its
imported parent is destroyed, which would later cause a crash in
`constrain_modal_dialog()` because the transient `NULL`.

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

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/174
2018-07-10 16:51:50 +02:00
Iain Lane
89162a90aa launcher: First check if we are in a login session
For mutter developers we still want to support running from a VT, which
will be in a different login session.

Fixes #218
2018-07-10 08:43:35 +00:00
Florian Müllner
90a68f3118 Bump version to 3.29.3
Update NEWS.
2018-07-09 18:37:32 +02:00
Florian Müllner
951fb03a7c build: Fix distcheck
The test fix in commit 859bea629b broke distcheck, probably because
abs_srcdir is prefixed with a relative $BUILDROOT. Hopefully this is
the last autotools breakage before switching to meson, so don't
bother investigating too much ...
2018-07-09 18:37:32 +02:00
Iain Lane
4837ea3434 meta-launcher: Find the current user's graphical session, not the pid's
If we're started by systemd --user, we might not be in the same session,
but this is nevertheless the one we are interested in.
2018-07-07 14:12:29 +01:00
Jonas Ådahl
3fbeeb9072 backends/x11: Force-update cursor when theme or size changed
Force update the cursor renderer after theme or size changes; otherwise
we'll be stuck with the old theme and/or size until something else
triggers resetting of the cursor.
2018-07-06 19:54:46 +02:00
Jonas Ådahl
0ca3526627 display: Make meta_display_get_workspace_manager() introspectable
So that it can be reached from Javascript.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:54:46 +02:00
Jonas Ådahl
5b8c8a4114 display: Remove replaced signals
MetaDisplay still had workspace signals, but nothing emitted them,
meaning we wouldn't get warnings if handlers were added there instead
of to MetaWorkspaceManager.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:54:46 +02:00
Jonas Ådahl
f635876eac x11: Open window decoration X11 connection earlier
If we wait with opening the X11 window decoration GDK connection, we
might end up with a terminated X11 server before we finish
initializing, depending on the things happening after spawning Xwayland
and before opening the MetaX11Dispaly. In gnome-shell, this involves
e.g. creating a couple of temporary X11 connections, and on disconnect,
if they happen to be the last client, the X server will terminate
itself.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:54:46 +02:00
Jonas Ådahl
1caaf0cd1e display: Export meta_display_close()
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Jonas Ådahl
e2464660bc x11-display: Set the correct default Xcursor theme size
Under Xorg the cursor size preference was pre-scaled originating from
gtk, while with Wayland it came directly from GSettings remaining
unscaled. Under Xwayland this caused the X11 display code to set the
wrong size with HiDPI configurations, which was often later overridden
by the equivalent code in gtk, but not always.

Fix this by always having the cursor size preference unscaled, scaling
the size correctly where it's used, depending on how it's used.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Armin Krezović
81c1c70c0a Move workspace related code from MetaDisplay to MetaWorkspaceManager
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Armin Krezović
e05cd6009a Add MetaWorkspaceManager skeleton
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Armin Krezović
390314adfb Rename errors.[ch] to meta-x11-errors.[ch]
Also rename meta_error_trap_* to meta_x11_error_trap_* and
move meta-x11-errors.c to src/x11

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Jonas Ådahl
2ac7afe8a9 remote-desktop: Remove unnecessary include
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Armin Krezović
d5c5669f2a Add --no-x11 flag so mutter wayland can be started without X11
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Armin Krezović
e8171ccdc1 Use MetaMonitorManager insted of MetaDisplay where possible
This drops display's monitors-changed signal and makes all
the code rely on MetaMonitorManager.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
Armin Krezović
43f9cd537e Fix XDND handling to work without GDK and MetaX11Display
This fixes mutter --nested --wayland without X11

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
d4c4d6e64d Split GDK initialization from MetaUI
Get rid of the deprecated gdk_display_get_default_screen ()

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Jonas Ådahl
89727aa747 xwayland: Destroy selection bridge windows before closing X11 display
Listen to the "x11-display-closing" signal so we can destroy the X11
selection bridge related windows before the X11 display is gone.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
de5e7a7175 Don't use gtk_settings callback to set shell_shows_app_menu
GTK+ won't be initialized if X11 is not available

Instead, when setting gtk-shell-shows-app-menu,
meta_prefs_set_show_fallback_app_menu should be
called as well.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
e6b885210c Make stack tracker work without X11
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
9f1ab1c3af Move workarea hint setting to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
9333a6da75 Make bell and libstartup-notification bits work without X11
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
8adab02757 Make workspace management work without X11
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Jonas Ådahl
14d8aec4b8 prefs: Allow no-op listener removal
Allow removing a prefs handler that was already removed. This allows us
to remove prefs from the dispose function without having to keep track
of it in every place.
2018-07-06 19:47:16 +02:00
Armin Krezović
8e7e1eeef5 Prepare for making MetaX11Display conditional
- Stop using CurrentTime, introduce META_CURRENT_TIME
- Use g_get_monotonic_time () instead of relying on an
  X server running and making roundtrip to it

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
0a8ae8417c Get rid of MetaScreen
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
1d5e37050d Stop using MetaScreen where it is unnecessary
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
b7c3dada81 Move workspace handling to MetaDisplay and MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
d79ffd3976 Move UI and key grabs to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
6458139c04 Move mouse window tracking to MetaDisplay
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
82307dd694 Move xinerama management to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
e1c67a1824 Move monitor management API to MetaDisplay
This includes changing various users to use MetaDisplay directly, who
used MetaScreen only for this before.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
68f261e8e2 Move rest of non-X11 specific objects from MetaScreen
This moves following objects from MetaScreen to MetaDisplay

- workareas_later and in_fullscreen_later signals and functions
- startup_sequences signals and functions
- tile_preview functions

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
1530f27513 Move X11 event, icon cache and property handling to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
05899596d1 Move X11 helper windows and xprops to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
98d912ba5f Move stack tracking and guard_window outside of MetaScreen
Move stack, stack_tracker to MetaDisplay guard_window to MetaX11Display

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
9e5ea8def4 Move groups and window/group prop hooks to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
722c975aca Move alarm and xids management to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Jonas Ådahl
937a9853cd Unmanage compositor and windows when closing display
Instead of unmanaging when closing the display, which is closed when
closing the screen, unmanage them directly from meta_display_close().

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
cd8f4259be Move screen size and cursor setting to MetaDisplay
Split X11 specific parts into MetaX11Display. This also required
changing MetaScreen to stop listening to any signals by itself, but
instead relying on MetaDisplay forwarding them. This was to ensure the
ordering. MetaDisplay listens to both the internal and external
monitors-changed signal so that it can pass the external one via the
redundant MetaDisplay(prev MetaScreen)::monitors-changed.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
c64d5ad8af Move X11 extension queries to MetaX11Display
Also split extension queries into their own functions

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
dacc041d0c Switch meta_error_trap functions to MetaX11Display
They are X11 specific functions, used for X11 code. They have been
improved per jadahl's suggestion to use gdk_x11_lookup_xdisplay and
gdk_x11_display_error_trap_* functions, instead of current code.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
18779109de Start populating MetaX11Display
- Moved xdisplay, name and various atoms from MetaDisplay
- Moved xroot, screen_name, default_depth and default_xvisual
  from MetaScreen

- Moved some X11 specific functions from screen.c and display.c
  to meta-x11-display.c

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Jonas Ådahl
522f9b4c38 display: Emit signals when opening and closing X11 display
This is needed so that other parts can initialize and deinitialize X11
dependent functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
3d2b9a3a69 Add MetaX11Display skeleton
Also reorder meta_display_open () and meta_display_close ()
to sort X11 and non-X11 specific members.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Jonas Ådahl
15fa7816bd configure.ac: Bump libmutter API version to 3 2018-07-06 19:47:16 +02:00
Jonas Ådahl
6621a9b5a0 tests: Add missing monitors config XML file
Lid switch test, but lid-switch.xml was not added, making it fail due to
theh file not being found.
2018-07-04 10:07:30 +00:00
Daniel van Vugt
04e411c2c0 compositor: Remove dead code: META_DISABLE_MIPMAPS
Seems to have been unused for quite some time.
2018-07-04 11:08:49 +08:00
Marco Trevisan (Treviño)
859bea629b tests: use abs_srcdir to refer to metatest files
These files are used to run mutter-test tools and using relative
paths won't work if the builddir doesn't match the srcdir.

This won't affect their installation (in case the build option is passed)
2018-06-29 22:20:34 +02:00
Jonas Ådahl
cbc783108e tests: run mutter-test tools with G_TEST_* env variables
Set test srcdir and builddir to the absolute paths
2018-06-29 22:20:34 +02:00
Fabio Tomat
2383801f7b Update Friulian translation 2018-06-29 13:33:53 +00:00
Sam Spilsbury
8626c69c2f window: Return -1 if meta_window_get_monitor is called on an unmanaged window
As opposed to crashing. In this case, letting the caller deal with
it is the best policy, since this is public API.

https://bugzilla.gnome.org/show_bug.cgi?id=788834
2018-06-28 16:24:07 +00:00
Jonas Ådahl
768ec15ea0 backends: Add logical monitor -> monitor -> output -> crtc ref chain
Make it so that each logical monitor has a reference to all the
monitors that are assigned to it.

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

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

https://bugzilla.gnome.org/show_bug.cgi?id=786929
2018-06-28 13:42:15 +02:00
Jonas Ådahl
1200182d70 backends: Move MetaOutput::crtc field into private struct
No functional changes. This is only done so that changes to reference
counting can done more reliably.

https://bugzilla.gnome.org/show_bug.cgi?id=786929
2018-06-28 13:42:15 +02:00
Jonas Ådahl
d9c18fd5bb monitor-manager: Add back warning messages
For some reason "backends: Remove X11 idle-monitor backend" removed
unrelated warning messages for when generated monitor configurations
that should work didn't, which also made the unit tests fail.

This commit adds them back, which also makes the tests pass again.
2018-06-28 11:23:39 +00:00
Miguel A. Vico
54709c16b5 wayland: Realize dmabuf buffers before trying to attach them
Commit 22723ca37 moved buffer realization to
meta_wayland_surface_commit() so that it wouldn't be part of
meta_wayland_buffer_attach().

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

Add the missing bit in order to make zwp_linux_dmabuf protocol work
again.
2018-06-21 21:47:05 +02:00
Daniel Șerbănescu
8da95b17f5 Update Romanian translation 2018-06-17 19:38:55 +00:00
Jordi Mas
d535c1eb6d Update Catalan translation 2018-06-17 10:31:36 +02:00
Miguel A. Vico
435b3c4bdb wayland: Create EGLStream-backed buffers through wl_eglstream_controller
One of the current limitations of EGLStreams is that there's no way to
resize a surface consumer without re-creating the entire stream.

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

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

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

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

https://bugzilla.gnome.org/show_bug.cgi?id=782575
2018-06-15 13:45:29 -07:00
Miguel A. Vico
22723ca371 wayland: Always realize buffers at surface commit time
Clients using EGLStream-backed buffers will expect the stream to be
functional after wl_surface::attach(). That means the compositor-side
stream must be created and a consumer attached to it.

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

https://bugzilla.gnome.org/show_bug.cgi?id=782575
2018-06-15 13:45:25 -07:00
Miguel A. Vico
edd3634bb5 wayland-buffer: Create EGLStream texture at buffer_realize time
When dealing with synchronized subsurfaces, we defer buffer attachments
until the parent surface state is applied.

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

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

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

https://bugzilla.gnome.org/show_bug.cgi?id=782575
2018-06-15 13:42:43 -07:00
Miguel A. Vico
1bf2eb95b5 renderer/native: Choose first EGL config for non-GBM backends
Commit 712ec30cd9 added the logic to only
choose EGL configs that match the GBM_FORMAT_XRGB8888 pixel format.
However, there won't be any EGL config satisfying such criteria for
non-GBM backends, such as EGLDevice.

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

Related to: https://gitlab.gnome.org/GNOME/mutter/issues/2
2018-06-15 19:43:04 +00:00
Jonas Ådahl
516fb524cb cursor-render/native: Realize hw cursor lazilly
Where to realize a hardware cursor depends on where on the screen it
will be displayed. For example it only needs buffers for the cursor
plane on a certain GPU if it overlaps with a monitor that is connected
said GPU.

Previously, we were too eager with uploading the cursor plane buffers,
which in effect resulted in the secondary GPU always being woken up
when changing the cursor, even though the cursor plane would actually
never be set unless the pointer cursor was moved to a monitor connected
to the secondary GPU. These wake-ups caused noticable stuttering; thus
by uploading the buffers more lazilly, the stuttering is avoided.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:56 +00:00
Jonas Ådahl
596b30096d cursor-renderer/native: Don't trigger redraw when cursor hidden
When a cursor is hidden, the native backend will properly hide the HW
cursor sprite as well, but it would communicate this as if the cursor
was not handled by the backend, while in fact it still was. This caused
the generic cursor rendering layer to queue a redraw.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:56 +00:00
Jonas Ådahl
7412794c66 cursor-renderer/native: Update hw state via generic update path
When force-updating the HW state we might end up with a situation where
the HW cursor is no longer usable. If this would happen, we'd before
this commit not trigger the fallback paths using a GL texture.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:55 +00:00
Jonas Ådahl
ad22b3f098 backend/native: Remove unnecessary cursor renderer update
It is already handled by the monitor-updated-internal signal handler in
meta-cursor-renderer-native.c, which will always be called indirectly
by resuming the monitor manager.

While at it, remove a useless comment.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:55 +00:00
Jonas Ådahl
206634e0ed cursor-renderer: Rename update_cursor function
Call it meta_cursor_renderer_update_cursor. This avoids confusing it
with the update_cursor MetaCursorRendererClass vfunc when navigating
the file.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:55 +00:00
Jonas Ådahl
ea05d2af49 cursor-renderer/native: Let the backend realize cursor sprite itself
It knows better when it's needed. For now, just do it just as before,
before drawing. Eventually, we can conditionalize where to realize
depending on the cursor sprite position.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:55 +00:00
Jonas Ådahl
6c7c566c6c cursor-renderer/native: Fix Xcursor image loading error handling
Check the return value whether there was an error, and change to
g_warning to warn while at it.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:54 +00:00
Jonas Ådahl
b596cf97ee cursor-renderer/native: Rename frame scheduling helper function
The function conditionally schedules a cursor animation frame, so
rename it to make that clearer.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:54 +00:00
Jonas Ådahl
9dcf9782b6 cursor-renderer: Centralize hw cursor realization paths
Use a common entry point into the cursor renderer implementations HW
cursor realization paths for all cursor sprite types. This is in
preparation for realizing at more strategic times.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:53 +00:00
Jonas Ådahl
0f519ffb05 cursor-renderer/native: Various whitespace fixes
https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:53 +00:00
Jonas Ådahl
42c78bd41f cursor-renderer/native: Fetch instead of pass wl_buffer when realizing
This is the next step in centralizing the cursor sprite hw sprite
realization paths.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:53 +00:00
Jonas Ådahl
b702c0fa5c cursor-renderer/native: Shorten some helper function names
Purely a cosmetic change, making a couple of unnecessarily long function
name shorter.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:53 +00:00
Jonas Ådahl
c80fd487f1 cursor-renderer: Fetch instead of pass Xcursor image when realizing
The end goal here is to being able to realize at any point in time
through a single API, so start by moving state into the cursor sprite
implementation.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:52 +00:00
Jonas Ådahl
817c8e568c wayland: Add wl_surface backed cursor sprite implementation
This removes the last use of the non-abstract form of MetaCursorSprite
usage.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:52 +00:00
Jonas Ådahl
b7e9388906 wayland/cursor-surface: Remove unnecessary NULL check
The priv->cursor_sprite is created on init() and destroyed on dispose()
so it will never be NULL when updating the cursor sprite texture.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:52 +00:00
Jonas Ådahl
b8336633a7 cursor-tracker: Split out XFIXES cursor code into cursor sprite type
Remove some X11 compositing manager specific code from the general
purpose cursor tracker into a new MetaCursorSprite based special
purpose XFIXES cursor sprite.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:51 +00:00
Jonas Ådahl
3c538d4a92 backends/cursor: Move out Xcursor functionality into own type
Introduce a new type MetaCursorSpriteXcursor that is a MetaCursorSprite
implementation backed by Xcursor images. A plain MetaCursorSprite can
still be created "bare bone", but must be manually provided with a
texture. These usages will eventually be wrapped into new
MetaCursorSprite types while turning MetaCursorSprite into an abstract
type.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:51 +00:00
Jonas Ådahl
2fc978ca9d backends/cursor: Rename X11 cursor creation function
It was prefixed with meta_cursor_, but it took a X11 Display, so update
the naming. Eventually it should be duplicated depending if it's a
frontend X11 connection call or a backend X11 connection call and moved
to the corresponding layers, but let's just do this minor cleanup for
now.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:51 +00:00
Jonas Ådahl
10dfc67dad backends/cursor: Minor whitespace cleanup
https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:50 +00:00
Jonas Ådahl
9ebcb719a1 backends/cursor: Clean up includes
Some were unnecessary, some were added even though not strictly needed.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:50 +00:00
Jonas Ådahl
2a20df0c50 backends/cursor: Make MetaCursorSprite derivable
This makes it possible to move out backing store specific code (such as
Xcursor handling) to separate units, while also making it easier to add
more types).

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:50 +00:00
Jonas Ådahl
d3441f7577 backends/cursor: Remove 'meta_' prefix from variable name
https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:49 +00:00
Jonas Ådahl
65c02e26db backends/cursor: Change variable name from 'self' to 'sprite'
This makes it somewhat more descriptive.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:49 +00:00
Jonas Ådahl
50ff9d4c71 wayland: Rename cursor role types
Rename the two cursor role types according to the convention used by the
other roles. This means that MetaWaylandSurfaceRoleCursor was renamed to
MetaWaylandCursorSurface, and MetaWaylandSurfaceRoleTabletCursor was
renamed to MetaWaylandTabletCursorSurface. The corresponding filenames
were renamed accordingly too.

https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:49 +00:00
Jonas Ådahl
a3269dde95 idle-monitor: NULL check cached InhibitedActions property variant
We might not have a cached "InhibitedActions" property available for us,
so do as elsewhere in this file and NULL check before processing it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/130
2018-06-14 17:52:11 +02:00
Daniel Stone
f2dea5d139 renderer-native: Remove no_add_fb2
drmModeAddFB2 allows userspace to specify a real format enum on
non-ancient kernels, as an improvement over the legacy drmModeAddFB
which derives format from a fixed depth/bpp mapping.

As an optimisation, Weston used to decide at the first failure of
drmModeAddFB2 that the ioctl was unavailable: as non-existent DRM
ioctls return -EINVAL rather than -ENOSYS or similar, bad parameters are
not distinguishable from the ioctl not being present.

Mutter has also implemented the same optimisation for dumb framebuffers,
which potentially papers over errors for the gain of avoiding one ioctl
which will rapidly fail on ancient kernels. Remove the optimisation and
always use AddFB2 where possible.

Closes: #14
2018-06-14 15:25:31 +00:00
Carlos Garnacho
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
Yi-Jyun Pan
36b9551f92 Update Chinese (Taiwan) translation 2018-06-13 08:36:21 +00:00
Carlos Garnacho
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
Carlos Garnacho
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
Jonas Ådahl
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
Jonas Ådahl
909dbafd67 settings: Remove confused comment
It got lost, lets help it find the way out.
2018-06-07 12:57:52 +00:00
Jonas Ådahl
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
Corentin Noël
2a45b7de7c clutter-input-device-xi2: Check for null group_modes before unref 2018-06-07 12:54:56 +01:00
Daniel van Vugt
62c67be4c8 clutter-actor: Fix uninitialized matrix multiply
`modelview` is uninitialized and the `apply` function just multiplies it.
What we really want is to initialize `modelview` so replace `apply` with
`get`.

Who knows what bugs this may have caused...
2018-05-31 15:43:27 +08:00
Marco Trevisan (Treviño)
0332b7394e renderer-native: Don't crash if the FB surface can't be locked 2018-05-29 22:13:03 +00:00
Marco Trevisan (Treviño)
15f41c9f68 device-manager-evdev: Add main seat to seats by default
Treat the main seat as other seats, so we don't have to handle it differently
in specific places. This was already the case before when a real device
was plugged before the startup, but not applied when hotplugging a device.
2018-05-29 10:35:51 +00:00
Marco Trevisan (Treviño)
2a38601b42 device-manager-evdev: Free the main seat on finalize 2018-05-29 10:35:51 +00:00
Marco Trevisan (Treviño)
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
Changwoo Ryu
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
Olivier Fourdan
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
Florian Müllner
f7747e4d4f Bump version to 3.29.2
Update NEWS.
2018-05-24 17:12:55 +02:00
Dz Chen
e8dc2acfca Update Chinese (China) translation 2018-05-21 16:18:26 +00:00
Georges Basile Stavracas Neto
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
Daniel van Vugt
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
Marcos Lans
d2a8cdfd7c Update Galician translation 2018-05-15 22:33:40 +00:00
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
5f83d9a5c8 clutter-seat-evdev: Add function to get device by id 2018-05-15 12:05:39 +01:00
Carlos Garnacho
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
Carlos Garnacho
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
Florian Müllner
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
Florian Müllner
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
Florian Müllner
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
Florian Müllner
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
Jonas Ådahl
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
Jonas Ådahl
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
Jonas Ådahl
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
Florian Müllner
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
Florian Müllner
33c2a38ff7 main: Fix typo 2018-05-04 20:15:33 +02:00
Olivier Fourdan
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
Florian Müllner
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
Daniel Șerbănescu
3b4319a87c Update Romanian translation 2018-04-30 05:56:32 +00:00
Georges Basile Stavracas Neto
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
Georges Basile Stavracas Neto
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
Georges Basile Stavracas Neto
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
Florian Müllner
b412e6c493 Bump version to 3.29.1
Update NEWS.
2018-04-25 20:25:43 +02:00
Jonas Ådahl
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
Marco Trevisan (Treviño)
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
Jonas Ådahl
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
Carlos Garnacho
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
Mario Sanchez Prada
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
Carlos Garnacho
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
Carlos Garnacho
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
Carlos Garnacho
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
Carlos Garnacho
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
Carlos Garnacho
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
Carlos Garnacho
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
Carlos Garnacho
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
Carlos Garnacho
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
Marco Trevisan (Treviño)
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
Mario Sanchez Prada
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
Olivier Fourdan
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
Olivier Fourdan
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
Ray Strode
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
Ray Strode
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
Georges Basile Stavracas Neto
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
Georges Basile Stavracas Neto
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
Georges Basile Stavracas Neto
7fdac6d310 monitor-manager-kms: Use g_autoptr for error
A minor code cleanup.
2018-04-16 16:30:21 +02:00
Jonas Ådahl
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
Bastien Nocera
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
Bastien Nocera
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
Bastien Nocera
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
Bastien Nocera
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
Bastien Nocera
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
Carlos Garnacho
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
Aleksandr Mezin
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
Matej Urbančič
a1c34aad09 Updated Slovenian translation 2018-04-10 17:58:55 +02:00
Benjamin Otte
98dfd5b887 screen-cast: Fix compile error
Credit goes to gcc for finding this typo.
2018-04-10 13:02:51 +02:00
Olivier Fourdan
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
Olivier Fourdan
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
Marco Trevisan (Treviño)
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
Marco Trevisan (Treviño)
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
Daniel Stone
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
Carlos Garnacho
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
Alberts Muktupāvels
31b5059068 input-settings: Fix a typo in tap-and-drag setting 2018-03-29 09:51:32 -05:00
Olivier Fourdan
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
Daniel van Vugt
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
Olivier Fourdan
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
Yussuf Khalil
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
Georges Basile Stavracas Neto
63e2c0329f window: Fix a small memory leak 2018-03-21 21:16:23 -03:00
Rasmus Thomsen
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
Carlos Garnacho
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
226 changed files with 11760 additions and 9269 deletions

1
.gitignore vendored
View File

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

65
NEWS
View File

@@ -1,3 +1,68 @@
3.29.4
======
* Fix crash with parent-less modal dialogs [Olivier; #174]
* Preserve paint volumes where possible to optimize CPU usage [Carlos; #782344]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Iain Lane, Bastien Nocera
Translators:
Daniel Șerbănescu [ro]
3.29.3
======
* Fix Korean Hangul support on wayland [Changwoo; #152]
* Improve support for proprietary Nvidia driver [Jonas; #790316]
* Only upload HW cursor sprite to the GPU that will display them [Jonas; #77]
* Improve EGLstream support [Miguel; #2, #782575]
* Remove MetaScreen to prepare for non-mandatary X11 dependency
[Armin, Jonas; #759538]
* Misc. bug fixes [Olivier, Jonas, Sam; #160, !130, #786929, #788834]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Armin Krezović, Corentin Noël,
Changwoo Ryu, Sam Spilsbury, Daniel Stone, Marco Trevisan (Treviño),
Miguel A. Vico, Daniel van Vugt
Translators:
Yi-Jyun Pan [zh_TW], Jordi Mas [ca], Daniel Șerbănescu [ro], Fabio Tomat [fur]
3.29.2
======
* Fix size change animations on wayland [Georges; #780292]
* Handle touch events on server-side titlebars [Carlos; #770185]
* Misc. bug fixes [Florian, Olivier, Jonas, Georges; #134, #124, !96, #138,
!102, #781471, #150]
Contributors:
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Florian Müllner,
Georges Basile Stavracas Neto, Marco Trevisan (Treviño), Daniel van Vugt
Translators:
Daniel Șerbănescu [ro], Marcos Lans [gl], Dz Chen [zh_CN]
3.29.1
======
* 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]
* 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, Bastien Nocera, Benjamin Otte,
Mario Sanchez Prada, Daniel Stone, Ray Strode, Rasmus Thomsen,
Marco Trevisan (Treviño), Daniel van Vugt
Translators:
Emin Tufan Çetin [tr], Dušan Kazik [sk], Matej Urbančič [sl]
3.28.0
======
* Fix xdg-foreign regression [Carlos; #63]

View File

@@ -692,7 +692,7 @@ Cally_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
Cally_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
--warn-all \
--c-include='cally/cally.h' \
--pkg-export=mutter-cally-@LIBMUTTER_API_VERSION@ \
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
INTROSPECTION_GIRS += Cally-@LIBMUTTER_API_VERSION@.gir

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

@@ -840,6 +840,7 @@ struct _ClutterActorPrivate
guint needs_compute_expand : 1;
guint needs_x_expand : 1;
guint needs_y_expand : 1;
guint needs_paint_volume_update : 1;
};
enum
@@ -1504,6 +1505,8 @@ clutter_actor_real_map (ClutterActor *self)
CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_MAPPED);
self->priv->needs_paint_volume_update = TRUE;
stage = _clutter_actor_get_stage_internal (self);
priv->pick_id = _clutter_stage_acquire_pick_id (CLUTTER_STAGE (stage), self);
@@ -2737,6 +2740,7 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
priv->needs_width_request = TRUE;
priv->needs_height_request = TRUE;
priv->needs_allocation = TRUE;
priv->needs_paint_volume_update = TRUE;
/* reset the cached size requests */
memset (priv->width_requests, 0,
@@ -2821,7 +2825,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);
@@ -8518,6 +8522,7 @@ clutter_actor_init (ClutterActor *self)
priv->needs_width_request = TRUE;
priv->needs_height_request = TRUE;
priv->needs_allocation = TRUE;
priv->needs_paint_volume_update = TRUE;
priv->cached_width_age = 1;
priv->cached_height_age = 1;
@@ -10084,6 +10089,9 @@ clutter_actor_allocate (ClutterActor *self,
return;
}
if (CLUTTER_ACTOR_IS_MAPPED (self))
self->priv->needs_paint_volume_update = TRUE;
if (!stage_allocation_changed)
{
/* If the actor didn't move but needs_allocation is set, we just
@@ -12972,6 +12980,9 @@ clutter_actor_add_child_internal (ClutterActor *self,
child->priv->needs_height_request = TRUE;
child->priv->needs_allocation = TRUE;
if (CLUTTER_ACTOR_IS_MAPPED (child))
child->priv->needs_paint_volume_update = TRUE;
/* we only queue a relayout here, because any possible
* redraw has already been queued either by show() or
* by our call to queue_redraw() above
@@ -17514,11 +17525,16 @@ _clutter_actor_get_paint_volume_mutable (ClutterActor *self)
priv = self->priv;
if (priv->paint_volume_valid)
clutter_paint_volume_free (&priv->paint_volume);
{
if (!priv->needs_paint_volume_update)
return &priv->paint_volume;
clutter_paint_volume_free (&priv->paint_volume);
}
if (_clutter_actor_get_paint_volume_real (self, &priv->paint_volume))
{
priv->paint_volume_valid = TRUE;
priv->needs_paint_volume_update = FALSE;
return &priv->paint_volume;
}
else

View File

@@ -353,6 +353,7 @@ clutter_input_method_notify_key_event (ClutterInputMethod *im,
copy = clutter_event_copy (event);
clutter_event_set_flags (copy, clutter_event_get_flags (event) |
CLUTTER_EVENT_FLAG_INPUT_METHOD);
clutter_event_set_source_device (copy, clutter_event_get_device (copy));
clutter_event_put (copy);
clutter_event_free (copy);
}

View File

@@ -2830,6 +2830,10 @@ clutter_text_key_focus_in (ClutterActor *actor)
if (method && priv->editable)
{
clutter_input_method_focus_in (method, priv->input_focus);
clutter_input_focus_set_content_purpose (priv->input_focus,
priv->input_purpose);
clutter_input_focus_set_content_hints (priv->input_focus,
priv->input_hints);
update_cursor_location (CLUTTER_TEXT (actor));
}
@@ -4511,6 +4515,27 @@ buffer_deleted_text (ClutterTextBuffer *buffer,
}
}
static void
clutter_text_queue_redraw_or_relayout (ClutterText *self)
{
ClutterActor *actor = CLUTTER_ACTOR (self);
gfloat preferred_width;
gfloat preferred_height;
clutter_text_dirty_cache (self);
/* we're using our private implementations here to avoid the caching done by ClutterActor */
clutter_text_get_preferred_width (actor, -1, NULL, &preferred_width);
clutter_text_get_preferred_height (actor, preferred_width, NULL, &preferred_height);
if (clutter_actor_has_allocation (actor) &&
(fabsf (preferred_width - clutter_actor_get_width (actor)) > 0.001 ||
fabsf (preferred_height - clutter_actor_get_height (actor)) > 0.001))
clutter_actor_queue_relayout (actor);
else
clutter_text_queue_redraw (actor);
}
static void
buffer_notify_text (ClutterTextBuffer *buffer,
GParamSpec *spec,
@@ -4518,9 +4543,7 @@ buffer_notify_text (ClutterTextBuffer *buffer,
{
g_object_freeze_notify (G_OBJECT (self));
clutter_text_dirty_cache (self);
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
clutter_text_queue_redraw_or_relayout (self);
g_signal_emit (self, text_signals[TEXT_CHANGED], 0);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_TEXT]);
@@ -4872,8 +4895,7 @@ clutter_text_set_cursor_visible (ClutterText *self,
{
priv->cursor_visible = cursor_visible;
clutter_text_dirty_cache (self);
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
clutter_text_queue_redraw_or_relayout (self);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_CURSOR_VISIBLE]);
}
@@ -5774,9 +5796,7 @@ clutter_text_set_line_alignment (ClutterText *self,
{
priv->alignment = alignment;
clutter_text_dirty_cache (self);
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
clutter_text_queue_redraw_or_relayout (self);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_LINE_ALIGNMENT]);
}
@@ -5831,9 +5851,7 @@ clutter_text_set_use_markup (ClutterText *self,
if (setting)
clutter_text_set_markup_internal (self, text);
clutter_text_dirty_cache (self);
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
clutter_text_queue_redraw_or_relayout (self);
}
/**
@@ -5880,9 +5898,7 @@ clutter_text_set_justify (ClutterText *self,
{
priv->justify = justify;
clutter_text_dirty_cache (self);
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
clutter_text_queue_redraw_or_relayout (self);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_JUSTIFY]);
}
@@ -6449,8 +6465,7 @@ clutter_text_set_preedit_string (ClutterText *self,
priv->preedit_set = TRUE;
}
clutter_text_dirty_cache (self);
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
clutter_text_queue_redraw_or_relayout (self);
}
@@ -6512,7 +6527,9 @@ clutter_text_set_input_hints (ClutterText *self,
g_return_if_fail (CLUTTER_IS_TEXT (self));
self->priv->input_hints = hints;
clutter_input_focus_set_content_hints (self->priv->input_focus, hints);
if (clutter_input_focus_is_focused (self->priv->input_focus))
clutter_input_focus_set_content_hints (self->priv->input_focus, hints);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_INPUT_HINTS]);
}
@@ -6531,7 +6548,9 @@ clutter_text_set_input_purpose (ClutterText *self,
g_return_if_fail (CLUTTER_IS_TEXT (self));
self->priv->input_purpose = purpose;
clutter_input_focus_set_content_purpose (self->priv->input_focus, purpose);
if (clutter_input_focus_is_focused (self->priv->input_focus))
clutter_input_focus_set_content_purpose (self->priv->input_focus, purpose);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_INPUT_PURPOSE]);
}

View File

@@ -793,10 +793,12 @@ evdev_add_device (ClutterDeviceManagerEvdev *manager_evdev,
if (priv->main_seat->libinput_seat == NULL)
seat = priv->main_seat;
else
seat = clutter_seat_evdev_new (manager_evdev);
{
seat = clutter_seat_evdev_new (manager_evdev);
priv->seats = g_slist_append (priv->seats, seat);
}
clutter_seat_evdev_set_libinput_seat (seat, libinput_seat);
priv->seats = g_slist_append (priv->seats, seat);
}
device = _clutter_input_device_evdev_new (manager, seat, libinput_device);
@@ -919,7 +921,6 @@ clutter_device_manager_evdev_get_device (ClutterDeviceManager *manager,
ClutterDeviceManagerEvdev *manager_evdev;
ClutterDeviceManagerEvdevPrivate *priv;
GSList *l;
GSList *device_it;
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
priv = manager_evdev->priv;
@@ -927,14 +928,10 @@ clutter_device_manager_evdev_get_device (ClutterDeviceManager *manager,
for (l = priv->seats; l; l = l->next)
{
ClutterSeatEvdev *seat = l->data;
ClutterInputDevice *device = clutter_seat_evdev_get_device (seat, id);
for (device_it = seat->devices; device_it; device_it = device_it->next)
{
ClutterInputDevice *device = device_it->data;
if (clutter_input_device_get_device_id (device) == id)
return device;
}
if (device)
return device;
}
return NULL;
@@ -1967,6 +1964,7 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
xkb_context_unref (ctx);
priv->main_seat = clutter_seat_evdev_new (manager_evdev);
priv->seats = g_slist_append (priv->seats, priv->main_seat);
dispatch_libinput (manager_evdev);

View File

@@ -433,6 +433,8 @@ key_event_is_modifier (ClutterEvent *event)
case XKB_KEY_Super_R:
case XKB_KEY_Hyper_L:
case XKB_KEY_Hyper_R:
case XKB_KEY_Caps_Lock:
case XKB_KEY_Shift_Lock:
return TRUE;
default:
return FALSE;
@@ -584,6 +586,12 @@ handle_stickykeys_press (ClutterEvent *event,
}
depressed_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_DEPRESSED);
/* Ignore the lock modifier mask, that one cannot be sticky, yet the
* CAPS_LOCK key itself counts as a modifier as it might be remapped
* to some other modifier which can be sticky.
*/
depressed_mods &= ~CLUTTER_LOCK_MASK;
new_latched_mask = device->stickykeys_latched_mask;
new_locked_mask = device->stickykeys_locked_mask;
@@ -1122,6 +1130,10 @@ clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent *e
{
ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
/* Ignore key events injected from IM */
if (event->key.flags & CLUTTER_EVENT_FLAG_INPUT_METHOD)
goto emit_event;
if (!device_evdev->a11y_flags & CLUTTER_A11Y_KEYBOARD_ENABLED)
goto emit_event;

View File

@@ -858,6 +858,24 @@ clutter_seat_evdev_free (ClutterSeatEvdev *seat)
g_free (seat);
}
ClutterInputDevice *
clutter_seat_evdev_get_device (ClutterSeatEvdev *seat,
gint id)
{
ClutterInputDevice *device;
GSList *l;
for (l = seat->devices; l; l = l->next)
{
device = l->data;
if (clutter_input_device_get_device_id (device) == id)
return device;
}
return NULL;
}
void
clutter_seat_evdev_set_stage (ClutterSeatEvdev *seat,
ClutterStage *stage)

View File

@@ -139,6 +139,9 @@ void clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
void clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat);
ClutterInputDevice * clutter_seat_evdev_get_device (ClutterSeatEvdev *seat,
gint id);
ClutterTouchState * clutter_seat_evdev_acquire_touch_state (ClutterSeatEvdev *seat,
int device_slot);

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

@@ -452,7 +452,7 @@ libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
-avoid-version \
-export-dynamic \
-rpath $(mutterlibdir) \
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_texture_set_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_|_cogl_winsys_glx_get_vtable|_cogl_winsys_egl_xlib_get_vtable|_cogl_winsys_egl_get_vtable|_cogl_closure_disconnect|_cogl_onscreen_notify_complete|_cogl_onscreen_notify_frame_sync|_cogl_winsys_egl_renderer_connect_common|_cogl_winsys_error_quark|_cogl_set_error|_cogl_poll_renderer_add_fd|_cogl_poll_renderer_add_idle|_cogl_framebuffer_winsys_update_size|_cogl_winsys_egl_make_current|_cogl_pixel_format_get_bytes_per_pixel).*"
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_texture_set_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_|_cogl_winsys_glx_get_vtable|_cogl_winsys_egl_xlib_get_vtable|_cogl_winsys_egl_get_vtable|_cogl_closure_disconnect|_cogl_onscreen_notify_complete|_cogl_onscreen_notify_frame_sync|_cogl_winsys_egl_renderer_connect_common|_cogl_winsys_error_quark|_cogl_set_error|_cogl_poll_renderer_add_fd|_cogl_poll_renderer_add_idle|_cogl_framebuffer_winsys_update_size|_cogl_winsys_egl_make_current|_cogl_winsys_egl_ensure_current|_cogl_pixel_format_get_bytes_per_pixel).*"
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(cogl_sources_c)
nodist_libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)

View File

@@ -109,7 +109,11 @@ _cogl_object_default_unref (void *object)
void
cogl_object_unref (void *obj)
{
void (* unref_func) (void *) = ((CoglObject *) obj)->klass->virt_unref;
void (* unref_func) (void *);
_COGL_RETURN_IF_FAIL (obj != NULL);
unref_func = ((CoglObject *) obj)->klass->virt_unref;
unref_func (obj);
}

View File

@@ -1412,22 +1412,12 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
if (!cogl_is_offscreen (framebuffer))
y = framebuffer_height - y - height;
required_format = ctx->driver_vtable->pixel_format_to_gl (ctx,
format,
&gl_intformat,
&gl_format,
&gl_type);
#if HAVE_COGL_GL
/* As we are reading pixels, we want to consider the bitmap according to
* its real pixel format, not the swizzled channels we pretend face to the
* pipeline.
*/
if ((ctx->driver == COGL_DRIVER_GL || ctx->driver == COGL_DRIVER_GL3) &&
(format == COGL_PIXEL_FORMAT_BGRA_8888 ||
format == COGL_PIXEL_FORMAT_BGRA_8888_PRE) &&
_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
gl_format = GL_BGRA;
#endif
required_format = ctx->driver_vtable->pixel_format_to_gl_with_target (ctx,
framebuffer->internal_format,
format,
&gl_intformat,
&gl_format,
&gl_type);
/* NB: All offscreen rendering is done upside down so there is no need
* to flip in this case... */

View File

@@ -181,6 +181,9 @@ _cogl_winsys_egl_make_current (CoglDisplay *display,
EGLSurface read,
EGLContext context);
EGLBoolean
_cogl_winsys_egl_ensure_current (CoglDisplay *display);
#ifdef EGL_KHR_image_base
EGLImageKHR
_cogl_egl_create_image (CoglContext *ctx,

View File

@@ -309,6 +309,18 @@ _cogl_winsys_egl_make_current (CoglDisplay *display,
return ret;
}
EGLBoolean
_cogl_winsys_egl_ensure_current (CoglDisplay *display)
{
CoglDisplayEGL *egl_display = display->winsys;
CoglRendererEGL *egl_renderer = display->renderer->winsys;
return eglMakeCurrent (egl_renderer->edpy,
egl_display->current_draw_surface,
egl_display->current_read_surface,
egl_display->current_context);
}
static void
cleanup_context (CoglDisplay *display)
{

View File

@@ -1,15 +1,15 @@
AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [28])
m4_define([mutter_micro_version], [0])
m4_define([mutter_minor_version], [29])
m4_define([mutter_micro_version], [4])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])
m4_define([mutter_plugin_api_version], [3])
m4_define([libmutter_api_version], [2])
m4_define([libmutter_api_version], [3])
AC_INIT([mutter], [mutter_version],
[http://bugzilla.gnome.org/enter_bug.cgi?product=mutter])
@@ -88,7 +88,6 @@ MUTTER_PC_MODULES="
cairo >= 1.10.0
gsettings-desktop-schemas >= 3.21.4
json-glib-1.0
upower-glib >= 0.99.0
gnome-desktop-3.0
xcomposite >= 0.2
xcursor
@@ -262,7 +261,19 @@ AC_SUBST(XWAYLAND_PATH)
PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
MUTTER_NATIVE_BACKEND_MODULES="libdrm >= 2.4.83 libsystemd libinput >= 1.4 gudev-1.0 gbm >= 17.1"
PKG_CHECK_MODULES(ELOGIND, [libelogind], [have_elogind=yes], [have_elogind=no])
if test x$have_elogind = xyes; then
logind_provider="libelogind"
fi
PKG_CHECK_MODULES(SYSTEMD, [libsystemd], [have_systemd=yes], [have_systemd=no])
if test x$have_systemd = xyes -o -z "$logind_provider"; then
logind_provider="libsystemd"
fi
MUTTER_NATIVE_BACKEND_MODULES="libdrm $logind_provider libinput >= 1.4 gudev-1.0 gbm >= 10.3"
AC_ARG_ENABLE(native-backend,
AS_HELP_STRING([--disable-native-backend], [disable mutter native (KMS) backend]),,
@@ -278,13 +289,24 @@ 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"
@@ -537,6 +559,7 @@ 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

@@ -120,10 +120,6 @@
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.
</description>
</key>

View File

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

208
po/ca.po
View File

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

View File

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

View File

@@ -14,16 +14,16 @@ msgid ""
msgstr ""
"Project-Id-Version: gl\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-03-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"

575
po/ro.po
View File

@@ -4,15 +4,15 @@
# Mugurel Tudor <mugurelu@gnome.ro>, 2002-2004, 2005, 2006, 2007.
# Adi Roiban https://launchpad.net/~adiroiban, 2008, 2009
# Lucian Adrian Grijincu <lucian.grijincu@gmail.com>, 2011.
# Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>, 2015.
# 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"
"Last-Translator: Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-07-13 13:37+0000\n"
"PO-Revision-Date: 2018-07-17 18:56+0300\n"
"Last-Translator: Florentina Mușat <florentina.musat.28 [at] gmail [dot] "
"com>\n"
"Language-Team: Gnome Romanian Translation Team\n"
"Language: ro\n"
"MIME-Version: 1.0\n"
@@ -20,275 +20,259 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2);;\n"
"X-Generator: Virtaal 0.7.1\n"
"X-Generator: Poedit 2.0.9\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 +282,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 +298,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 +325,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 +337,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 +378,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 +390,255 @@ 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."
msgstr ""
"Pentru a activa funcționalitățile experimentale, adăugați cuvântul cheie al "
"funcționalității la listă. Dacă funcționalitatea necesită sau nu repornirea "
"compunătorului depinde de funcționalitatea dată. Nu este necesar ca "
"funcționalitatea experimentală să fie încă disponibilă, sau configurabilă. "
"Nu vă așteptați să adăugați ceva la această configurare care va rezista "
"timpului. Cuvintele cheie posibile în mod curent: • „scale-monitor-"
"framebuffer” — face ca mutter să treacă implicit la aranjarea monitoarelor "
"logice într-un spațiu logic de coordonate pixel, în timpul scalării de "
"framebuffer-uri de monitor în locul conținutului ferestrei, pentru a "
"gestiona monitoare HiDPI. Nu necesită o repornire."
#: data/org.gnome.mutter.gschema.xml.in:141
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:146
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:151
msgid "Switch monitor configurations"
msgstr "Comută configurațiile de monitor"
#: data/org.gnome.mutter.gschema.xml.in:156
msgid "Rotates the built-in monitor configuration"
msgstr "Rotește configurarea de monitor integrat"
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
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:907
msgid "Built-in display"
msgstr "Afișaj integrat"
#: ../src/backends/meta-monitor-manager.c:526
#: src/backends/meta-monitor-manager.c:930
msgid "Unknown"
msgstr "Necunoscut"
#: ../src/backends/meta-monitor-manager.c:528
#: src/backends/meta-monitor-manager.c:932
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:940
#, 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:254
msgid "Bell event"
msgstr "Eveniment sonor"
#: ../src/core/delete.c:127
#: src/core/main.c:191
msgid "Disable connection to session manager"
msgstr "Dezactivează conexiunea la administratorul de sesiune"
#: src/core/main.c:197
msgid "Replace the running window manager"
msgstr "Înlocuiește administratorul de ferestre curent"
#: src/core/main.c:203
msgid "Specify session management ID"
msgstr "Specifică ID-ul administrării de sesiune"
#: src/core/main.c:208
msgid "X Display to use"
msgstr "Ecranul X ce va fi folosit"
#: src/core/main.c:214
msgid "Initialize session from savefile"
msgstr "Inițializează sesiunea din fișierul salvat"
#: src/core/main.c:220
msgid "Make X calls synchronous"
msgstr "Realizează apelurile X sincron"
#: src/core/main.c:227
msgid "Run as a wayland compositor"
msgstr "Rulează ca un compunător wayland"
#: src/core/main.c:233
msgid "Run as a nested compositor"
msgstr "Rulează ca un compunător imbricat"
#: src/core/main.c:239
msgid "Run wayland compositor without starting Xwayland"
msgstr "Rulează compunătorul wayland fără a porni Xwayland"
#: src/core/main.c:247
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:253
msgid "Run with X11 backend"
msgstr "Rulează cu backend X11"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:148
#, c-format
msgid "“%s” is not responding."
msgstr "„%s” nu răspunde."
#: ../src/core/delete.c:129
#: src/core/meta-close-dialog-default.c:150
msgid "Application is not responding."
msgstr "Aplicația nu răspunde."
#: ../src/core/delete.c:134
#: src/core/meta-close-dialog-default.c:155
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
@@ -517,112 +646,104 @@ 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:162
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:162
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:1915
#, c-format
msgid "Workspace %d"
msgstr "Spațiu de lucru %d"
#: ../src/core/screen.c:526
#, c-format
msgid ""
"Display \"%s\" already has a window manager; try using the --replace option "
"to replace the current window manager."
msgstr ""
"Afișajul „%s” are deja un administrator de ferestre; încercați să folosiți "
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
"ferestre actual."
#: ../src/core/screen.c:608
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Ecranul %d pe afișajul „%s” este invalid\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/meta-x11-display.c:666
#, c-format
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
"Display “%s” already has a window manager; try using the --replace option to "
"replace the current window manager."
msgstr ""
"Afișajul „%s” are deja un administrator de ferestre; încercați să utilizați "
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
"ferestre curent."
#: src/x11/meta-x11-display.c:1010
msgid "Failed to initialize GDK\n"
msgstr "Nu s-a putut inițializa GDK\n"
#: src/x11/meta-x11-display.c:1034
#, 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/x11/meta-x11-display.c:1117
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Ecranul %d de pe afișajul „%s” nu este valid\n"
#: src/x11/session.c:1819
msgid ""
"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:565
#, 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

@@ -10,8 +10,8 @@ msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-03-05 19:32+0000\n"
"PO-Revision-Date: 2018-03-06 22:02+0100\n"
"POT-Creation-Date: 2018-04-03 20:43+0000\n"
"PO-Revision-Date: 2018-04-09 20:28+0200\n"
"Last-Translator: Matej Urbančič <mateju@svn.gnome.org>\n"
"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
"Language: sl_SI\n"
@@ -21,7 +21,7 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n"
"%100==4 ? 3 : 0);\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 2.0.4\n"
"X-Generator: Poedit 2.0.6\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -481,7 +481,7 @@ msgstr "Ponovno omogoči tipkovne bližnjice"
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
msgid "Allow grabs with Xwayland"
msgstr ""
msgstr "Dovoli zajemanje z XWayland"
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
msgid ""
@@ -491,10 +491,14 @@ msgid ""
"window or be among the applications white-listed in key “xwayland-grab-"
"access-rules”."
msgstr ""
"Upošteva zajeme s tipkovnico, ki jih sprožijo programi X11, zagnani v okolju "
"Xwayland. Če naj se programski zajem upošteva, mora odjemalec ali poslati "
"specifično sporočilo X11 na korensko okno ali pa mora biti zaveden na "
"seznamu programov v ključu »xwayland-garb-access-rules«."
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr ""
msgstr "Program XWayland ima dovoljenje za zajemanje s tipkovnico"
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
msgid ""
@@ -509,6 +513,15 @@ msgid ""
"using the specific keyboard shortcut defined by the keybinding key “restore-"
"shortcuts”."
msgstr ""
"Seznam imen ali razredov virov oken X11, ki lahko sprožijo zajeme v okolju "
"Xwayland. Ime oziroma razred vira podanega okna X11 je mogoče pridobiti z "
"ukazom »xprop WM_CLASS«. Uporaba pomožnih znakov » * « in » ? « je podprta. "
"Vrednosti, ki se začnejo z znakom » ! « so uvrščeni na črni seznam. Ta "
"seznam je obravnavan prednostno pred belim seznamom in prekliče zajeme na "
"seznamu sistema. Privzeti seznam vključuje ključ: "
"»@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@« Uporabniki lahko prekinejo obstoječi "
"zajem z uporabo posebne tipkovne bližnjice, določene s tipkovnim ključem "
"»restore-shortcuts«."
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.

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

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

View File

@@ -91,6 +91,12 @@ 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 = \
@@ -114,6 +120,8 @@ 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 \
@@ -153,7 +161,7 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-pointer-constraint.h \
backends/meta-settings.c \
backends/meta-settings-private.h \
backends/meta-stage.h \
backends/meta-stage-private.h \
backends/meta-stage.c \
backends/meta-renderer.c \
backends/meta-renderer.h \
@@ -161,6 +169,7 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-renderer-view.h \
backends/edid-parse.c \
backends/edid.h \
backends/gsm-inhibitor-flag.h \
backends/x11/meta-backend-x11.c \
backends/x11/meta-backend-x11.h \
backends/x11/meta-barrier-x11.c \
@@ -175,6 +184,8 @@ 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 \
@@ -183,8 +194,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/x11/nested/meta-cursor-renderer-x11-nested.h \
backends/x11/nested/meta-renderer-x11-nested.c \
backends/x11/nested/meta-renderer-x11-nested.h \
backends/x11/meta-idle-monitor-xsync.c \
backends/x11/meta-idle-monitor-xsync.h \
backends/x11/meta-input-settings-x11.c \
backends/x11/meta-input-settings-x11.h \
backends/x11/meta-monitor-manager-xrandr.c \
@@ -247,7 +256,7 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
compositor/meta-window-actor.c \
compositor/meta-window-actor-private.h \
compositor/meta-window-group.c \
compositor/meta-window-group.h \
compositor/meta-window-group-private.h \
compositor/meta-window-shape.c \
compositor/region-utils.c \
compositor/region-utils.h \
@@ -280,12 +289,13 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
core/edge-resistance.h \
core/events.c \
core/events.h \
core/errors.c \
meta/errors.h \
core/frame.c \
core/frame.h \
core/meta-gesture-tracker.c \
core/meta-gesture-tracker-private.h \
core/meta-workspace-manager.c \
core/meta-workspace-manager-private.h \
meta/meta-workspace-manager.h \
core/keybindings.c \
core/keybindings-private.h \
core/main-private.h \
@@ -294,9 +304,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
core/place.h \
core/prefs.c \
meta/prefs.h \
core/screen.c \
core/screen-private.h \
meta/screen.h \
core/startup-notification.c \
core/startup-notification-private.h \
meta/types.h \
@@ -323,6 +330,11 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
ui/theme-private.h \
ui/ui.c \
x11/atomnames.h \
x11/meta-x11-display.c \
x11/meta-x11-display-private.h \
meta/meta-x11-display.h \
x11/meta-x11-errors.c \
meta/meta-x11-errors.h \
x11/events.c \
x11/events.h \
x11/group-private.h \
@@ -371,6 +383,8 @@ 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 \
@@ -432,10 +446,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-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-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-actor-surface.c \
wayland/meta-wayland-actor-surface.h \
wayland/meta-wayland-subsurface.c \
@@ -487,8 +501,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
backends/native/meta-default-modes.h \
backends/native/meta-gpu-kms.c \
backends/native/meta-gpu-kms.h \
backends/native/meta-idle-monitor-native.c \
backends/native/meta-idle-monitor-native.h \
backends/native/meta-input-settings-native.c \
backends/native/meta-input-settings-native.h \
backends/native/meta-monitor-manager-kms.c \
@@ -527,7 +539,6 @@ libmutterinclude_headers = \
meta/compositor-mutter.h \
meta/compositor.h \
meta/display.h \
meta/errors.h \
meta/group.h \
meta/keybindings.h \
meta/main.h \
@@ -546,10 +557,14 @@ libmutterinclude_headers = \
meta/meta-settings.h \
meta/meta-shaped-texture.h \
meta/meta-shadow-factory.h \
meta/meta-stage.h \
meta/meta-window-actor.h \
meta/meta-window-group.h \
meta/meta-window-shape.h \
meta/meta-workspace-manager.h \
meta/meta-x11-display.h \
meta/meta-x11-errors.h \
meta/prefs.h \
meta/screen.h \
meta/theme.h \
meta/types.h \
meta/util.h \
@@ -761,3 +776,5 @@ 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

@@ -0,0 +1,36 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
*
* Copyright (C) 2008 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GSM_INHIBITOR_FLAG_H__
#define __GSM_INHIBITOR_FLAG_H__
#include <glib-object.h>
G_BEGIN_DECLS
typedef enum {
GSM_INHIBITOR_FLAG_LOGOUT = 1 << 0,
GSM_INHIBITOR_FLAG_SWITCH_USER = 1 << 1,
GSM_INHIBITOR_FLAG_SUSPEND = 1 << 2,
GSM_INHIBITOR_FLAG_IDLE = 1 << 3,
GSM_INHIBITOR_FLAG_AUTOMOUNT = 1 << 4
} GsmInhibitorFlag;
G_END_DECLS
#endif /* __GSM_INHIBITOR_FLAG_H__ */

View File

@@ -59,8 +59,6 @@ struct _MetaBackendClass
void (* post_init) (MetaBackend *backend);
MetaIdleMonitor * (* create_idle_monitor) (MetaBackend *backend,
int device_id);
MetaMonitorManager * (* create_monitor_manager) (MetaBackend *backend,
GError **error);
MetaCursorRenderer * (* create_cursor_renderer) (MetaBackend *backend);
@@ -86,6 +84,8 @@ struct _MetaBackendClass
const char *variants,
const char *options);
gboolean (* is_lid_closed) (MetaBackend *backend);
struct xkb_keymap * (* get_keymap) (MetaBackend *backend);
xkb_layout_index_t (* get_keymap_layout_group) (MetaBackend *backend);
@@ -146,6 +146,8 @@ struct xkb_keymap * meta_backend_get_keymap (MetaBackend *backend);
xkb_layout_index_t meta_backend_get_keymap_layout_group (MetaBackend *backend);
gboolean meta_backend_is_lid_closed (MetaBackend *backend);
void meta_backend_update_last_device (MetaBackend *backend,
int device_id);

View File

@@ -34,7 +34,7 @@
#include "meta-input-settings-private.h"
#include "backends/x11/meta-backend-x11.h"
#include "meta-cursor-tracker-private.h"
#include "meta-stage.h"
#include "meta-stage-private.h"
#ifdef HAVE_REMOTE_DESKTOP
#include "backends/meta-dbus-session-watcher.h"
@@ -58,6 +58,7 @@ enum
KEYMAP_CHANGED,
KEYMAP_LAYOUT_GROUP_CHANGED,
LAST_DEVICE_CHANGED,
LID_IS_CLOSED_CHANGED,
N_SIGNALS
};
@@ -110,6 +111,14 @@ struct _MetaBackendPrivate
MetaPointerConstraint *client_pointer_constraint;
MetaDnd *dnd;
guint upower_watch_id;
GDBusProxy *upower_proxy;
gboolean lid_is_closed;
guint sleep_signal_id;
GCancellable *cancellable;
GDBusConnection *system_bus;
};
typedef struct _MetaBackendPrivate MetaBackendPrivate;
@@ -136,6 +145,15 @@ meta_backend_finalize (GObject *object)
g_clear_object (&priv->dbus_session_watcher);
#endif
if (priv->sleep_signal_id)
g_dbus_connection_signal_unsubscribe (priv->system_bus, priv->sleep_signal_id);
if (priv->upower_watch_id)
g_bus_unwatch_name (priv->upower_watch_id);
g_cancellable_cancel (priv->cancellable);
g_clear_object (&priv->cancellable);
g_clear_object (&priv->system_bus);
g_clear_object (&priv->upower_proxy);
if (priv->device_update_idle_id)
g_source_remove (priv->device_update_idle_id);
@@ -158,7 +176,7 @@ meta_backend_sync_screen_size (MetaBackend *backend)
}
static void
center_pointer (MetaBackend *backend)
reset_pointer_position (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
@@ -167,9 +185,11 @@ center_pointer (MetaBackend *backend)
primary =
meta_monitor_manager_get_primary_logical_monitor (monitor_manager);
/* Move the pointer out of the way to avoid hovering over reactive
* elements (e.g. users list at login) causing undesired behaviour. */
meta_backend_warp_pointer (backend,
primary->rect.x + primary->rect.width / 2,
primary->rect.y + primary->rect.height / 2);
primary->rect.x + primary->rect.width * 0.9,
primary->rect.y + primary->rect.height * 0.9);
}
void
@@ -192,7 +212,7 @@ meta_backend_monitors_changed (MetaBackend *backend)
!priv->is_pointer_position_initialized) &&
!meta_monitor_manager_is_headless (monitor_manager))
{
center_pointer (backend);
reset_pointer_position (backend);
priv->is_pointer_position_initialized = TRUE;
}
}
@@ -222,7 +242,9 @@ static MetaIdleMonitor *
meta_backend_create_idle_monitor (MetaBackend *backend,
int device_id)
{
return META_BACKEND_GET_CLASS (backend)->create_idle_monitor (backend, device_id);
return g_object_new (META_TYPE_IDLE_MONITOR,
"device-id", device_id,
NULL);
}
static void
@@ -402,28 +424,6 @@ meta_backend_create_input_settings (MetaBackend *backend)
return META_BACKEND_GET_CLASS (backend)->create_input_settings (backend);
}
#ifdef HAVE_REMOTE_DESKTOP
static gboolean
is_screen_cast_enabled (MetaBackend *backend)
{
MetaSettings *settings = meta_backend_get_settings (backend);
return meta_settings_is_experimental_feature_enabled (
settings,
META_EXPERIMENTAL_FEATURE_SCREEN_CAST);
}
static gboolean
is_remote_desktop_enabled (MetaBackend *backend)
{
MetaSettings *settings = meta_backend_get_settings (backend);
return meta_settings_is_experimental_feature_enabled (
settings,
META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP);
}
#endif /* HAVE_REMOTE_DESKTOP */
static void
meta_backend_real_post_init (MetaBackend *backend)
{
@@ -457,15 +457,13 @@ meta_backend_real_post_init (MetaBackend *backend)
#ifdef HAVE_REMOTE_DESKTOP
priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER, NULL);
if (is_screen_cast_enabled (backend))
priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
if (is_remote_desktop_enabled (backend))
priv->remote_desktop = meta_remote_desktop_new (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 */
if (!meta_monitor_manager_is_headless (priv->monitor_manager))
{
center_pointer (backend);
reset_pointer_position (backend);
priv->is_pointer_position_initialized = TRUE;
}
}
@@ -511,6 +509,144 @@ meta_backend_real_get_relative_motion_deltas (MetaBackend *backend,
return FALSE;
}
static gboolean
meta_backend_real_is_lid_closed (MetaBackend *backend)
{
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
return priv->lid_is_closed;
}
gboolean
meta_backend_is_lid_closed (MetaBackend *backend)
{
return META_BACKEND_GET_CLASS (backend)->is_lid_closed (backend);
}
static void
upower_properties_changed (GDBusProxy *proxy,
GVariant *changed_properties,
GStrv invalidated_properties,
gpointer user_data)
{
MetaBackend *backend = user_data;
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
GVariant *v;
gboolean lid_is_closed;
v = g_variant_lookup_value (changed_properties,
"LidIsClosed",
G_VARIANT_TYPE_BOOLEAN);
if (!v)
return;
lid_is_closed = g_variant_get_boolean (v);
g_variant_unref (v);
if (lid_is_closed == priv->lid_is_closed)
return;
priv->lid_is_closed = lid_is_closed;
g_signal_emit (backend, signals[LID_IS_CLOSED_CHANGED], 0,
priv->lid_is_closed);
if (lid_is_closed)
return;
meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
}
static void
upower_ready_cb (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
MetaBackend *backend;
MetaBackendPrivate *priv;
GDBusProxy *proxy;
GError *error = NULL;
GVariant *v;
proxy = g_dbus_proxy_new_finish (res, &error);
if (!proxy)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Failed to create UPower proxy: %s", error->message);
g_error_free (error);
return;
}
backend = META_BACKEND (user_data);
priv = meta_backend_get_instance_private (backend);
priv->upower_proxy = proxy;
g_signal_connect (proxy, "g-properties-changed",
G_CALLBACK (upower_properties_changed), backend);
v = g_dbus_proxy_get_cached_property (proxy, "LidIsClosed");
if (!v)
return;
priv->lid_is_closed = g_variant_get_boolean (v);
g_variant_unref (v);
if (priv->lid_is_closed)
{
g_signal_emit (backend, signals[LID_IS_CLOSED_CHANGED], 0,
priv->lid_is_closed);
}
}
static void
upower_appeared (GDBusConnection *connection,
const gchar *name,
const gchar *name_owner,
gpointer user_data)
{
MetaBackend *backend = META_BACKEND (user_data);
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
g_dbus_proxy_new (connection,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
"org.freedesktop.UPower",
"/org/freedesktop/UPower",
"org.freedesktop.UPower",
priv->cancellable,
upower_ready_cb,
backend);
}
static void
upower_vanished (GDBusConnection *connection,
const gchar *name,
gpointer user_data)
{
MetaBackend *backend = META_BACKEND (user_data);
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
g_clear_object (&priv->upower_proxy);
}
static void
meta_backend_constructed (GObject *object)
{
MetaBackend *backend = META_BACKEND (object);
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
MetaBackendClass *backend_class =
META_BACKEND_GET_CLASS (backend);
if (backend_class->is_lid_closed != meta_backend_real_is_lid_closed)
return;
priv->upower_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
"org.freedesktop.UPower",
G_BUS_NAME_WATCHER_FLAGS_NONE,
upower_appeared,
upower_vanished,
backend,
NULL);
}
static void
meta_backend_class_init (MetaBackendClass *klass)
{
@@ -518,6 +654,7 @@ meta_backend_class_init (MetaBackendClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_backend_finalize;
object_class->constructed = meta_backend_constructed;
klass->post_init = meta_backend_real_post_init;
klass->create_cursor_renderer = meta_backend_real_create_cursor_renderer;
@@ -525,6 +662,7 @@ meta_backend_class_init (MetaBackendClass *klass)
klass->ungrab_device = meta_backend_real_ungrab_device;
klass->select_stage_events = meta_backend_real_select_stage_events;
klass->get_relative_motion_deltas = meta_backend_real_get_relative_motion_deltas;
klass->is_lid_closed = meta_backend_real_is_lid_closed;
signals[KEYMAP_CHANGED] =
g_signal_new ("keymap-changed",
@@ -547,31 +685,18 @@ meta_backend_class_init (MetaBackendClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_INT);
signals[LID_IS_CLOSED_CHANGED] =
g_signal_new ("lid-is-closed-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
mutter_stage_views = g_getenv ("MUTTER_STAGE_VIEWS");
stage_views_disabled = g_strcmp0 (mutter_stage_views, "0") == 0;
}
static void
experimental_features_changed (MetaSettings *settings,
MetaExperimentalFeature old_experimental_features,
MetaBackend *backend)
{
#ifdef HAVE_REMOTE_DESKTOP
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
if (is_screen_cast_enabled (backend) && !priv->screen_cast)
priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
else if (!is_screen_cast_enabled (backend))
g_clear_object (&priv->screen_cast);
if (is_remote_desktop_enabled (backend) && !priv->remote_desktop)
priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
else if (!is_remote_desktop_enabled (backend))
g_clear_object (&priv->remote_desktop);
#endif /* HAVE_REMOTE_DESKTOP */
}
static MetaMonitorManager *
meta_backend_create_monitor_manager (MetaBackend *backend,
GError **error)
@@ -590,6 +715,50 @@ meta_backend_create_renderer (MetaBackend *backend,
return META_BACKEND_GET_CLASS (backend)->create_renderer (backend, error);
}
static void
prepare_for_sleep_cb (GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
gboolean suspending;
g_variant_get (parameters, "(b)", &suspending);
if (suspending)
return;
meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
}
static void
system_bus_gotten_cb (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
MetaBackendPrivate *priv;
GDBusConnection *bus;
bus = g_bus_get_finish (res, NULL);
if (!bus)
return;
priv = meta_backend_get_instance_private (user_data);
priv->system_bus = bus;
priv->sleep_signal_id =
g_dbus_connection_signal_subscribe (priv->system_bus,
"org.freedesktop.login1",
"org.freedesktop.login1.Manager",
"PrepareForSleep",
"/org/freedesktop/login1",
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
prepare_for_sleep_cb,
NULL,
NULL);
}
static gboolean
meta_backend_initable_init (GInitable *initable,
GCancellable *cancellable,
@@ -599,9 +768,6 @@ meta_backend_initable_init (GInitable *initable,
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
priv->settings = meta_settings_new (backend);
g_signal_connect (priv->settings, "experimental-features-changed",
G_CALLBACK (experimental_features_changed),
backend);
priv->egl = g_object_new (META_TYPE_EGL, NULL);
@@ -619,6 +785,12 @@ meta_backend_initable_init (GInitable *initable,
priv->dnd = g_object_new (META_TYPE_DND, NULL);
priv->cancellable = g_cancellable_new ();
g_bus_get (G_BUS_TYPE_SYSTEM,
priv->cancellable,
system_bus_gotten_cb,
backend);
return TRUE;
}

View File

@@ -33,7 +33,7 @@
#include <cogl/cogl.h>
#include <clutter/clutter.h>
#include "meta-stage.h"
#include "meta-stage-private.h"
struct _MetaCursorRendererPrivate
{
@@ -193,8 +193,8 @@ meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
}
static void
update_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
meta_cursor_renderer_update_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
gboolean handled_by_backend;
@@ -237,7 +237,7 @@ meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
return;
priv->displayed_cursor = cursor_sprite;
update_cursor (renderer, cursor_sprite);
meta_cursor_renderer_update_cursor (renderer, cursor_sprite);
}
void
@@ -246,7 +246,7 @@ meta_cursor_renderer_force_update (MetaCursorRenderer *renderer)
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
update_cursor (renderer, priv->displayed_cursor);
meta_cursor_renderer_update_cursor (renderer, priv->displayed_cursor);
}
void
@@ -261,7 +261,19 @@ meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
priv->current_x = x;
priv->current_y = y;
update_cursor (renderer, priv->displayed_cursor);
meta_cursor_renderer_update_cursor (renderer, priv->displayed_cursor);
}
ClutterPoint
meta_cursor_renderer_get_position (MetaCursorRenderer *renderer)
{
MetaCursorRendererPrivate *priv =
meta_cursor_renderer_get_instance_private (renderer);
return (ClutterPoint) {
.x = priv->current_x,
.y = priv->current_y
};
}
MetaCursorSprite *
@@ -271,28 +283,3 @@ meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer)
return priv->displayed_cursor;
}
#ifdef HAVE_WAYLAND
void
meta_cursor_renderer_realize_cursor_from_wl_buffer (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
struct wl_resource *buffer)
{
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_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
{
MetaCursorRendererClass *renderer_class = META_CURSOR_RENDERER_GET_CLASS (renderer);
if (renderer_class->realize_cursor_from_xcursor)
renderer_class->realize_cursor_from_xcursor (renderer, cursor_sprite, xc_image);
}

View File

@@ -26,12 +26,7 @@
#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_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
@@ -44,14 +39,6 @@ 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);
@@ -62,6 +49,7 @@ void meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
void meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
float x,
float y);
ClutterPoint meta_cursor_renderer_get_position (MetaCursorRenderer *renderer);
void meta_cursor_renderer_force_update (MetaCursorRenderer *renderer);
MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer);
@@ -69,16 +57,6 @@ MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer
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

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

View File

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

View File

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

View File

@@ -33,16 +33,17 @@
#include <string.h>
#include <meta/main.h>
#include <meta/util.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include <cogl/cogl.h>
#include <clutter/clutter.h>
#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"
#include "x11/meta-x11-display-private.h"
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
@@ -161,15 +162,15 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
}
/**
* meta_cursor_tracker_get_for_screen:
* @screen: the #MetaScreen
* meta_cursor_tracker_get_for_display:
* @display: the #MetaDisplay
*
* Retrieves the cursor tracker object for @screen.
* Retrieves the cursor tracker object for @display.
*
* Returns: (transfer none):
*/
MetaCursorTracker *
meta_cursor_tracker_get_for_screen (MetaScreen *screen)
meta_cursor_tracker_get_for_display (MetaDisplay *display)
{
MetaBackend *backend = meta_get_backend ();
MetaCursorTracker *tracker = meta_backend_get_cursor_tracker (backend);
@@ -195,13 +196,13 @@ gboolean
meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
XEvent *xevent)
{
MetaDisplay *display = meta_get_display ();
MetaX11Display *x11_display = meta_get_display ()->x11_display;
XFixesCursorNotifyEvent *notify_event;
if (meta_is_wayland_compositor ())
return FALSE;
if (xevent->xany.type != display->xfixes_event_base + XFixesCursorNotify)
if (xevent->xany.type != x11_display->xfixes_event_base + XFixesCursorNotify)
return FALSE;
notify_event = (XFixesCursorNotifyEvent *)xevent;
@@ -218,75 +219,14 @@ static void
ensure_xfixes_cursor (MetaCursorTracker *tracker)
{
MetaDisplay *display = meta_get_display ();
XFixesCursorImage *cursor_image;
CoglTexture2D *sprite;
guint8 *cursor_data;
gboolean free_cursor_data;
CoglContext *ctx;
CoglError *error = NULL;
g_autoptr (GError) error = NULL;
if (tracker->xfixes_cursor)
return;
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);
tracker->xfixes_cursor = meta_cursor_sprite_xfixes_new (display, &error);
if (!tracker->xfixes_cursor)
g_warning ("Failed to create XFIXES cursor: %s", error->message);
}
/**
@@ -308,7 +248,7 @@ meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker)
else
{
ensure_xfixes_cursor (tracker);
cursor_sprite = tracker->xfixes_cursor;
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
}
if (cursor_sprite)
@@ -345,7 +285,7 @@ meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
else
{
ensure_xfixes_cursor (tracker);
cursor_sprite = tracker->xfixes_cursor;
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
}
if (cursor_sprite)

View File

@@ -23,19 +23,12 @@
#include "meta-cursor.h"
#include <meta/errors.h>
#include "backends/meta-backend-private.h"
#include "cogl/cogl.h"
#include "meta/common.h"
#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 {
enum
{
PREPARE_AT,
TEXTURE_CHANGED,
@@ -44,316 +37,148 @@ enum {
static guint signals[LAST_SIGNAL];
struct _MetaCursorSprite
typedef struct _MetaCursorSpritePrivate
{
GObject parent;
MetaCursor cursor;
CoglTexture2D *texture;
float texture_scale;
int hot_x, hot_y;
} MetaCursorSpritePrivate;
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;
}
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaCursorSprite,
meta_cursor_sprite,
G_TYPE_OBJECT)
gboolean
meta_cursor_sprite_is_animated (MetaCursorSprite *self)
meta_cursor_sprite_is_animated (MetaCursorSprite *sprite)
{
return (self->xcursor_images &&
self->xcursor_images->nimage > 1);
}
MetaCursorSpriteClass *klass = META_CURSOR_SPRITE_GET_CLASS (sprite);
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;
if (klass->is_animated)
return klass->is_animated (sprite);
else
return FALSE;
}
void
meta_cursor_sprite_set_texture (MetaCursorSprite *self,
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,
CoglTexture *texture,
int hot_x,
int hot_y)
{
if (self->texture == COGL_TEXTURE_2D (texture) &&
self->hot_x == hot_x &&
self->hot_y == 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)
return;
g_clear_pointer (&self->texture, cogl_object_unref);
g_clear_pointer (&priv->texture, cogl_object_unref);
if (texture)
self->texture = cogl_object_ref (texture);
self->hot_x = hot_x;
self->hot_y = hot_y;
priv->texture = cogl_object_ref (texture);
priv->hot_x = hot_x;
priv->hot_y = hot_y;
g_signal_emit (self, signals[TEXTURE_CHANGED], 0);
g_signal_emit (sprite, signals[TEXTURE_CHANGED], 0);
}
void
meta_cursor_sprite_set_texture_scale (MetaCursorSprite *self,
meta_cursor_sprite_set_texture_scale (MetaCursorSprite *sprite,
float scale)
{
self->texture_scale = scale;
}
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
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;
priv->texture_scale = scale;
}
CoglTexture *
meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *self)
meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *sprite)
{
return COGL_TEXTURE (self->texture);
}
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
MetaCursor
meta_cursor_sprite_get_meta_cursor (MetaCursorSprite *self)
{
return self->cursor;
return COGL_TEXTURE (priv->texture);
}
void
meta_cursor_sprite_get_hotspot (MetaCursorSprite *self,
meta_cursor_sprite_get_hotspot (MetaCursorSprite *sprite,
int *hot_x,
int *hot_y)
{
*hot_x = self->hot_x;
*hot_y = self->hot_y;
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
*hot_x = priv->hot_x;
*hot_y = priv->hot_y;
}
float
meta_cursor_sprite_get_texture_scale (MetaCursorSprite *self)
meta_cursor_sprite_get_texture_scale (MetaCursorSprite *sprite)
{
return self->texture_scale;
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
return priv->texture_scale;
}
void
meta_cursor_sprite_prepare_at (MetaCursorSprite *self,
meta_cursor_sprite_prepare_at (MetaCursorSprite *sprite,
int x,
int y)
{
g_signal_emit (self, signals[PREPARE_AT], 0, x, y);
g_signal_emit (sprite, signals[PREPARE_AT], 0, x, y);
}
void
meta_cursor_sprite_realize_texture (MetaCursorSprite *self)
meta_cursor_sprite_realize_texture (MetaCursorSprite *sprite)
{
if (self->theme_dirty)
meta_cursor_sprite_load_from_theme (self);
MetaCursorSpriteClass *klass = META_CURSOR_SPRITE_GET_CLASS (sprite);
if (klass->realize_texture)
klass->realize_texture (sprite);
}
static void
meta_cursor_sprite_init (MetaCursorSprite *self)
meta_cursor_sprite_init (MetaCursorSprite *sprite)
{
self->texture_scale = 1.0f;
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
priv->texture_scale = 1.0f;
}
static void
meta_cursor_sprite_finalize (GObject *object)
{
MetaCursorSprite *self = META_CURSOR_SPRITE (object);
MetaCursorSprite *sprite = META_CURSOR_SPRITE (object);
MetaCursorSpritePrivate *priv =
meta_cursor_sprite_get_instance_private (sprite);
if (self->xcursor_images)
XcursorImagesDestroy (self->xcursor_images);
g_clear_pointer (&self->texture, cogl_object_unref);
g_clear_pointer (&priv->texture, cogl_object_unref);
G_OBJECT_CLASS (meta_cursor_sprite_parent_class)->finalize (object);
}

View File

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

View File

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

View File

@@ -24,6 +24,7 @@
#include "meta-idle-monitor-dbus.h"
#include <meta/meta-idle-monitor.h>
#include <backends/meta-idle-monitor-private.h>
#include "meta-dbus-idle-monitor.h"
#include <clutter/clutter.h>
@@ -43,6 +44,26 @@ handle_get_idletime (MetaDBusIdleMonitor *skeleton,
return TRUE;
}
static gboolean
handle_reset_idletime (MetaDBusIdleMonitor *skeleton,
GDBusMethodInvocation *invocation,
MetaIdleMonitor *monitor)
{
if (!g_getenv ("MUTTER_DEBUG_RESET_IDLETIME"))
{
g_dbus_method_invocation_return_error_literal (invocation,
G_DBUS_ERROR,
G_DBUS_ERROR_UNKNOWN_METHOD,
"No such method");
return FALSE;
}
meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
meta_dbus_idle_monitor_complete_reset_idletime (skeleton, invocation);
return TRUE;
}
typedef struct {
MetaDBusIdleMonitor *dbus_monitor;
MetaIdleMonitor *monitor;
@@ -173,6 +194,8 @@ create_monitor_skeleton (GDBusObjectManagerServer *manager,
G_CALLBACK (handle_add_user_active_watch), monitor, 0);
g_signal_connect_object (skeleton, "handle-remove-watch",
G_CALLBACK (handle_remove_watch), monitor, 0);
g_signal_connect_object (skeleton, "handle-reset-idletime",
G_CALLBACK (handle_reset_idletime), monitor, 0);
g_signal_connect_object (skeleton, "handle-get-idletime",
G_CALLBACK (handle_get_idletime), monitor, 0);

View File

@@ -26,9 +26,6 @@
#include <meta/meta-idle-monitor.h>
#include "display-private.h"
#include <X11/Xlib.h>
#include <X11/extensions/sync.h>
typedef struct
{
MetaIdleMonitor *monitor;
@@ -38,28 +35,26 @@ typedef struct
GDestroyNotify notify;
guint64 timeout_msec;
int idle_source_id;
GSource *timeout_source;
} MetaIdleMonitorWatch;
struct _MetaIdleMonitor
{
GObject parent_instance;
GDBusProxy *session_proxy;
gboolean inhibited;
GHashTable *watches;
int device_id;
guint64 last_event_time;
};
struct _MetaIdleMonitorClass
{
GObjectClass parent_class;
gint64 (*get_idletime) (MetaIdleMonitor *monitor);
MetaIdleMonitorWatch * (*make_watch) (MetaIdleMonitor *monitor,
guint64 timeout_msec,
MetaIdleMonitorWatchFunc callback,
gpointer user_data,
GDestroyNotify notify);
};
void _meta_idle_monitor_watch_fire (MetaIdleMonitorWatch *watch);
void meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor);
#endif /* META_IDLE_MONITOR_PRIVATE_H */

View File

@@ -36,6 +36,7 @@
#include <meta/util.h>
#include <meta/main.h>
#include <meta/meta-idle-monitor.h>
#include "gsm-inhibitor-flag.h"
#include "meta-idle-monitor-private.h"
#include "meta-idle-monitor-dbus.h"
#include "meta-backend-private.h"
@@ -87,6 +88,7 @@ meta_idle_monitor_dispose (GObject *object)
MetaIdleMonitor *monitor = META_IDLE_MONITOR (object);
g_clear_pointer (&monitor->watches, g_hash_table_destroy);
g_clear_object (&monitor->session_proxy);
G_OBJECT_CLASS (meta_idle_monitor_parent_class)->dispose (object);
}
@@ -151,9 +153,121 @@ meta_idle_monitor_class_init (MetaIdleMonitorClass *klass)
g_object_class_install_property (object_class, PROP_DEVICE_ID, obj_props[PROP_DEVICE_ID]);
}
static void
free_watch (gpointer data)
{
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) data;
MetaIdleMonitor *monitor = watch->monitor;
g_object_ref (monitor);
if (watch->idle_source_id)
{
g_source_remove (watch->idle_source_id);
watch->idle_source_id = 0;
}
if (watch->notify != NULL)
watch->notify (watch->user_data);
if (watch->timeout_source != NULL)
g_source_destroy (watch->timeout_source);
g_object_unref (monitor);
g_slice_free (MetaIdleMonitorWatch, watch);
}
static void
update_inhibited_watch (gpointer key,
gpointer value,
gpointer user_data)
{
MetaIdleMonitor *monitor = user_data;
MetaIdleMonitorWatch *watch = value;
if (!watch->timeout_source)
return;
if (monitor->inhibited)
{
g_source_set_ready_time (watch->timeout_source, -1);
}
else
{
g_source_set_ready_time (watch->timeout_source,
monitor->last_event_time +
watch->timeout_msec * 1000);
}
}
static void
update_inhibited (MetaIdleMonitor *monitor,
gboolean inhibited)
{
if (inhibited == monitor->inhibited)
return;
g_hash_table_foreach (monitor->watches,
update_inhibited_watch,
monitor);
}
static void
meta_idle_monitor_inhibited_actions_changed (GDBusProxy *session,
GVariant *changed,
char **invalidated,
gpointer user_data)
{
MetaIdleMonitor *monitor = user_data;
GVariant *v;
v = g_variant_lookup_value (changed, "InhibitedActions", G_VARIANT_TYPE_UINT32);
if (v)
{
gboolean inhibited;
inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
g_variant_unref (v);
if (!inhibited)
monitor->last_event_time = g_get_monotonic_time ();
update_inhibited (monitor, inhibited);
}
}
static void
meta_idle_monitor_init (MetaIdleMonitor *monitor)
{
GVariant *v;
monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch);
monitor->last_event_time = g_get_monotonic_time ();
/* Monitor inhibitors */
monitor->session_proxy =
g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
NULL,
"org.gnome.SessionManager",
"/org/gnome/SessionManager",
"org.gnome.SessionManager",
NULL,
NULL);
if (!monitor->session_proxy)
return;
g_signal_connect (monitor->session_proxy, "g-properties-changed",
G_CALLBACK (meta_idle_monitor_inhibited_actions_changed),
monitor);
v = g_dbus_proxy_get_cached_property (monitor->session_proxy,
"InhibitedActions");
if (v)
{
monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
g_variant_unref (v);
}
}
/**
@@ -185,6 +299,36 @@ meta_idle_monitor_get_for_device (int device_id)
return meta_backend_get_idle_monitor (backend, device_id);
}
static guint32
get_next_watch_serial (void)
{
static guint32 serial = 0;
g_atomic_int_inc (&serial);
return serial;
}
static gboolean
idle_monitor_dispatch_timeout (GSource *source,
GSourceFunc callback,
gpointer user_data)
{
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) user_data;
_meta_idle_monitor_watch_fire (watch);
g_source_set_ready_time (watch->timeout_source, -1);
return TRUE;
}
static GSourceFuncs idle_monitor_source_funcs = {
.prepare = NULL,
.check = NULL,
.dispatch = idle_monitor_dispatch_timeout,
.finalize = NULL,
};
static MetaIdleMonitorWatch *
make_watch (MetaIdleMonitor *monitor,
guint64 timeout_msec,
@@ -194,11 +338,32 @@ make_watch (MetaIdleMonitor *monitor,
{
MetaIdleMonitorWatch *watch;
watch = META_IDLE_MONITOR_GET_CLASS (monitor)->make_watch (monitor,
timeout_msec,
callback,
user_data,
notify);
watch = g_slice_new0 (MetaIdleMonitorWatch);
watch->monitor = monitor;
watch->id = get_next_watch_serial ();
watch->callback = callback;
watch->user_data = user_data;
watch->notify = notify;
watch->timeout_msec = timeout_msec;
if (timeout_msec != 0)
{
GSource *source = g_source_new (&idle_monitor_source_funcs,
sizeof (GSource));
g_source_set_callback (source, NULL, watch, NULL);
if (!monitor->inhibited)
{
g_source_set_ready_time (source,
monitor->last_event_time +
timeout_msec * 1000);
}
g_source_attach (source, NULL);
g_source_unref (source);
watch->timeout_source = source;
}
g_hash_table_insert (monitor->watches,
GUINT_TO_POINTER (watch->id),
@@ -314,5 +479,39 @@ meta_idle_monitor_remove_watch (MetaIdleMonitor *monitor,
gint64
meta_idle_monitor_get_idletime (MetaIdleMonitor *monitor)
{
return META_IDLE_MONITOR_GET_CLASS (monitor)->get_idletime (monitor);
return (g_get_monotonic_time () - monitor->last_event_time) / 1000;
}
void
meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor)
{
GList *node, *watch_ids;
monitor->last_event_time = g_get_monotonic_time ();
watch_ids = g_hash_table_get_keys (monitor->watches);
for (node = watch_ids; node != NULL; node = node->next)
{
guint watch_id = GPOINTER_TO_UINT (node->data);
MetaIdleMonitorWatch *watch;
watch = g_hash_table_lookup (monitor->watches,
GUINT_TO_POINTER (watch_id));
if (!watch)
continue;
if (watch->timeout_msec == 0)
{
_meta_idle_monitor_watch_fire ((MetaIdleMonitorWatch *) watch);
}
else
{
g_source_set_ready_time (watch->timeout_source,
monitor->last_event_time +
watch->timeout_msec * 1000);
}
}
g_list_free (watch_ids);
}

View File

@@ -1088,7 +1088,7 @@ meta_input_settings_changed_cb (GSettings *settings,
update_device_natural_scroll (input_settings, NULL);
else if (strcmp (key, "tap-to-click") == 0)
update_touchpad_tap_enabled (input_settings, NULL);
else if (strcmp (key, "tap-and_drag") == 0)
else if (strcmp (key, "tap-and-drag") == 0)
update_touchpad_tap_and_drag_enabled (input_settings, NULL);
else if (strcmp(key, "disable-while-typing") == 0)
update_touchpad_disable_while_typing (input_settings, NULL);

View File

@@ -100,11 +100,12 @@ 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,
main_output->crtc->transform);
return meta_monitor_crtc_to_logical_transform (monitor, transform);
}
MetaLogicalMonitor *
@@ -145,7 +146,7 @@ meta_logical_monitor_add_monitor (MetaLogicalMonitor *logical_monitor,
is_presentation = logical_monitor->is_presentation;
logical_monitor->monitors = g_list_append (logical_monitor->monitors,
monitor);
g_object_ref (monitor));
for (l = logical_monitor->monitors; l; l = l->next)
{
@@ -157,10 +158,12 @@ 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;
if (output->crtc)
output->crtc->logical_monitor = logical_monitor;
crtc = meta_output_get_assigned_crtc (output);
if (crtc)
crtc->logical_monitor = logical_monitor;
}
}
@@ -220,7 +223,7 @@ foreach_crtc (MetaMonitor *monitor,
ForeachCrtcData *data = user_data;
data->func (data->logical_monitor,
monitor_crtc_mode->output->crtc,
meta_output_get_assigned_crtc (monitor_crtc_mode->output),
data->user_data);
return TRUE;
@@ -254,13 +257,17 @@ meta_logical_monitor_init (MetaLogicalMonitor *logical_monitor)
}
static void
meta_logical_monitor_finalize (GObject *object)
meta_logical_monitor_dispose (GObject *object)
{
MetaLogicalMonitor *logical_monitor = META_LOGICAL_MONITOR (object);
g_list_free (logical_monitor->monitors);
if (logical_monitor->monitors)
{
g_list_free_full (logical_monitor->monitors, g_object_unref);
logical_monitor->monitors = NULL;
}
G_OBJECT_CLASS (meta_logical_monitor_parent_class)->finalize (object);
G_OBJECT_CLASS (meta_logical_monitor_parent_class)->dispose (object);
}
static void
@@ -268,38 +275,38 @@ meta_logical_monitor_class_init (MetaLogicalMonitorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_logical_monitor_finalize;
object_class->dispose = meta_logical_monitor_dispose;
}
gboolean
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitor *neighbor,
MetaScreenDirection neighbor_direction)
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitor *neighbor,
MetaDisplayDirection neighbor_direction)
{
switch (neighbor_direction)
{
case META_SCREEN_RIGHT:
case META_DISPLAY_RIGHT:
if (neighbor->rect.x == (logical_monitor->rect.x +
logical_monitor->rect.width) &&
meta_rectangle_vert_overlap (&neighbor->rect,
&logical_monitor->rect))
return TRUE;
break;
case META_SCREEN_LEFT:
case META_DISPLAY_LEFT:
if (logical_monitor->rect.x == (neighbor->rect.x +
neighbor->rect.width) &&
meta_rectangle_vert_overlap (&neighbor->rect,
&logical_monitor->rect))
return TRUE;
break;
case META_SCREEN_UP:
case META_DISPLAY_UP:
if (logical_monitor->rect.y == (neighbor->rect.y +
neighbor->rect.height) &&
meta_rectangle_horiz_overlap (&neighbor->rect,
&logical_monitor->rect))
return TRUE;
break;
case META_SCREEN_DOWN:
case META_DISPLAY_DOWN:
if (neighbor->rect.y == (logical_monitor->rect.y +
logical_monitor->rect.height) &&
meta_rectangle_horiz_overlap (&neighbor->rect,

View File

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

View File

@@ -23,6 +23,7 @@
#include "backends/meta-monitor-config-manager.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-monitor-config-migration.h"
#include "backends/meta-monitor-config-store.h"
#include "backends/meta-monitor-manager-private.h"
@@ -326,6 +327,15 @@ meta_monitor_config_manager_assign (MetaMonitorManager *manager,
return TRUE;
}
static gboolean
is_lid_closed (MetaMonitorManager *monitor_manager)
{
MetaBackend *backend;
backend = meta_monitor_manager_get_backend (monitor_manager);
return meta_backend_is_lid_closed (backend);
}
MetaMonitorsConfigKey *
meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_manager)
{
@@ -340,7 +350,7 @@ meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_m
MetaMonitorSpec *monitor_spec;
if (meta_monitor_is_laptop_panel (monitor) &&
meta_monitor_manager_is_lid_closed (monitor_manager))
is_lid_closed (monitor_manager))
continue;
monitor_spec = meta_monitor_spec_clone (meta_monitor_get_spec (monitor));
@@ -455,7 +465,7 @@ find_primary_monitor (MetaMonitorManager *monitor_manager)
{
MetaMonitor *monitor;
if (meta_monitor_manager_is_lid_closed (monitor_manager))
if (is_lid_closed (monitor_manager))
{
monitor = meta_monitor_manager_get_primary_monitor (monitor_manager);
if (monitor && !meta_monitor_is_laptop_panel (monitor))
@@ -598,7 +608,7 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana
continue;
if (meta_monitor_is_laptop_panel (monitor) &&
meta_monitor_manager_is_lid_closed (monitor_manager))
is_lid_closed (monitor_manager))
continue;
logical_monitor_config =
@@ -1252,7 +1262,7 @@ meta_monitors_config_new (MetaMonitorManager *monitor_manager,
MetaMonitor *monitor = l->data;
MetaMonitorSpec *monitor_spec;
if (meta_monitor_manager_is_lid_closed (monitor_manager) &&
if (is_lid_closed (monitor_manager) &&
meta_monitor_is_laptop_panel (monitor))
continue;

View File

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

View File

@@ -37,10 +37,8 @@
#include <cogl/cogl.h>
#include <libgnome-desktop/gnome-pnp-ids.h>
#include <libupower-glib/upower.h>
#include "display-private.h"
#include <meta/screen.h>
#include "stack-tracker.h"
#include <meta/meta-monitor-manager.h>
@@ -180,7 +178,6 @@ struct _MetaMonitorManager
MetaMonitorConfigManager *config_manager;
GnomePnpIds *pnp_ids;
UpClient *up_client;
gulong experimental_features_changed_handler_id;
@@ -196,8 +193,6 @@ struct _MetaMonitorManagerClass
GBytes* (*read_edid) (MetaMonitorManager *,
MetaOutput *);
gboolean (*is_lid_closed) (MetaMonitorManager *);
void (*ensure_initial_config) (MetaMonitorManager *);
gboolean (*apply_monitors_config) (MetaMonitorManager *,
@@ -279,9 +274,9 @@ MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_at (MetaMonitorMana
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
MetaRectangle *rect);
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaScreenDirection direction);
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaDisplayDirection direction);
MetaMonitor * meta_monitor_manager_get_primary_monitor (MetaMonitorManager *manager);
@@ -336,8 +331,6 @@ void meta_monitor_manager_update_logical_state (MetaMonitorManager
void meta_monitor_manager_update_logical_state_derived (MetaMonitorManager *manager,
MetaMonitorsConfig *config);
gboolean meta_monitor_manager_is_lid_closed (MetaMonitorManager *manager);
void meta_monitor_manager_lid_is_closed_changed (MetaMonitorManager *manager);
gboolean meta_monitor_manager_is_headless (MetaMonitorManager *manager);

View File

@@ -34,8 +34,9 @@
#include <meta/main.h>
#include "util-private.h"
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "edid.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-crtc.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor.h"
@@ -89,6 +90,9 @@ static gboolean
meta_monitor_manager_is_config_complete (MetaMonitorManager *manager,
MetaMonitorsConfig *config);
static MetaMonitor *
meta_monitor_manager_get_active_monitor (MetaMonitorManager *manager);
MetaBackend *
meta_monitor_manager_get_backend (MetaMonitorManager *manager)
{
@@ -198,13 +202,17 @@ calculate_monitor_scale (MetaMonitorManager *manager,
static float
derive_calculated_global_scale (MetaMonitorManager *manager)
{
MetaMonitor *primary_monitor;
MetaMonitor *monitor = NULL;
primary_monitor = meta_monitor_manager_get_primary_monitor (manager);
if (!primary_monitor)
monitor = meta_monitor_manager_get_primary_monitor (manager);
if (!monitor || !meta_monitor_is_active (monitor))
monitor = meta_monitor_manager_get_active_monitor (manager);
if (!monitor)
return 1.0;
return calculate_monitor_scale (manager, primary_monitor);
return calculate_monitor_scale (manager, monitor);
}
static float
@@ -339,30 +347,14 @@ meta_monitor_manager_lid_is_closed_changed (MetaMonitorManager *manager)
}
static void
lid_is_closed_changed (UpClient *client,
GParamSpec *pspec,
gpointer user_data)
lid_is_closed_changed (MetaBackend *backend,
gboolean lid_is_closed,
gpointer user_data)
{
MetaMonitorManager *manager = user_data;
meta_monitor_manager_lid_is_closed_changed (manager);
}
static gboolean
meta_monitor_manager_real_is_lid_closed (MetaMonitorManager *manager)
{
if (!manager->up_client)
return FALSE;
return up_client_get_lid_is_closed (manager->up_client);
}
gboolean
meta_monitor_manager_is_lid_closed (MetaMonitorManager *manager)
{
return META_MONITOR_MANAGER_GET_CLASS (manager)->is_lid_closed (manager);
}
gboolean
meta_monitor_manager_is_headless (MetaMonitorManager *manager)
{
@@ -598,7 +590,7 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
{
g_clear_object (&config);
g_warning ("Failed to use fallback monitor configuration: %s",
error->message);
error->message);
g_clear_error (&error);
}
else
@@ -712,8 +704,6 @@ static void
meta_monitor_manager_constructed (GObject *object)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
MetaMonitorManagerClass *manager_class =
META_MONITOR_MANAGER_GET_CLASS (manager);
MetaBackend *backend = manager->backend;
MetaSettings *settings = meta_backend_get_settings (backend);
@@ -723,13 +713,6 @@ meta_monitor_manager_constructed (GObject *object)
G_CALLBACK (experimental_features_changed),
manager);
if (manager_class->is_lid_closed == meta_monitor_manager_real_is_lid_closed)
{
manager->up_client = up_client_new ();
g_signal_connect_object (manager->up_client, "notify::lid-is-closed",
G_CALLBACK (lid_is_closed_changed), manager, 0);
}
g_signal_connect_object (manager, "notify::power-save-mode",
G_CALLBACK (power_save_mode_changed), manager, 0);
@@ -738,6 +721,11 @@ meta_monitor_manager_constructed (GObject *object)
G_CALLBACK (orientation_changed),
manager, 0);
g_signal_connect_object (backend,
"lid-is-closed-changed",
G_CALLBACK (lid_is_closed_changed),
manager, 0);
manager->current_switch_config = META_MONITOR_SWITCH_CONFIG_UNKNOWN;
initialize_dbus_interface (manager);
@@ -769,7 +757,6 @@ meta_monitor_manager_dispose (GObject *object)
}
g_clear_object (&manager->config_manager);
g_clear_object (&manager->up_client);
G_OBJECT_CLASS (meta_monitor_manager_parent_class)->dispose (object);
}
@@ -837,7 +824,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
klass->get_edid_file = meta_monitor_manager_real_get_edid_file;
klass->read_edid = meta_monitor_manager_real_read_edid;
klass->is_lid_closed = meta_monitor_manager_real_is_lid_closed;
signals[MONITORS_CHANGED_INTERNAL] =
g_signal_new ("monitors-changed-internal",
@@ -1032,12 +1018,13 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
NULL /* properties */);
}
for (l = combined_outputs; l; l = l->next)
for (l = combined_outputs, i = 0; l; l = l->next, i++)
{
MetaOutput *output = l->data;
GVariantBuilder crtcs, modes, clones, properties;
GBytes *edid;
char *edid_file;
MetaCrtc *crtc;
int crtc_index;
g_variant_builder_init (&crtcs, G_VARIANT_TYPE ("au"));
@@ -1131,8 +1118,8 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
output->tile_info.tile_h));
}
crtc_index = output->crtc ? g_list_index (combined_crtcs, output->crtc)
: -1;
crtc = meta_output_get_assigned_crtc (output);
crtc_index = crtc ? g_list_index (combined_crtcs, crtc) : -1;
g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
i, /* ID */
(gint64)output->winsys_id,
@@ -1574,7 +1561,7 @@ meta_monitor_manager_is_config_applicable (MetaMonitorManager *manager,
}
if (meta_monitor_is_laptop_panel (monitor) &&
meta_monitor_manager_is_lid_closed (manager))
meta_backend_is_lid_closed (manager->backend))
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Refusing to activate a closed laptop panel");
@@ -2382,6 +2369,12 @@ meta_monitor_manager_get_laptop_panel (MetaMonitorManager *manager)
return find_monitor (manager, meta_monitor_is_laptop_panel);
}
static MetaMonitor *
meta_monitor_manager_get_active_monitor (MetaMonitorManager *manager)
{
return find_monitor (manager, meta_monitor_is_active);
}
MetaMonitor *
meta_monitor_manager_get_monitor_from_connector (MetaMonitorManager *manager,
const char *connector)
@@ -2478,9 +2471,9 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
}
MetaLogicalMonitor *
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaScreenDirection direction)
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaDisplayDirection direction)
{
GList *l;
@@ -2894,11 +2887,7 @@ meta_monitor_manager_get_monitor_for_connector (MetaMonitorManager *manager,
if (meta_monitor_is_active (monitor) &&
g_str_equal (connector, meta_monitor_get_connector (monitor)))
{
MetaOutput *main_output = meta_monitor_get_main_output (monitor);
return main_output->crtc->logical_monitor->number;
}
return meta_monitor_get_logical_monitor (monitor)->number;
}
return -1;
@@ -2974,7 +2963,7 @@ meta_monitor_manager_switch_config (MetaMonitorManager *manager,
gboolean
meta_monitor_manager_can_switch_config (MetaMonitorManager *manager)
{
return (!meta_monitor_manager_is_lid_closed (manager) &&
return (!meta_backend_is_lid_closed (manager->backend) &&
g_list_length (manager->monitors) > 1);
}

View File

@@ -204,10 +204,12 @@ gboolean
meta_monitor_is_active (MetaMonitor *monitor)
{
MetaOutput *output;
MetaCrtc *crtc;
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
return output->crtc && output->crtc->current_mode;
return crtc && crtc->current_mode;
}
gboolean
@@ -385,6 +387,21 @@ 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)
{
@@ -393,7 +410,6 @@ 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);
@@ -412,6 +428,7 @@ 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;
}
@@ -493,6 +510,7 @@ 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;
@@ -526,7 +544,9 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
if (crtc_mode == output->preferred_mode)
monitor_priv->preferred_mode = mode;
if (output->crtc && crtc_mode == output->crtc->current_mode)
crtc = meta_output_get_assigned_crtc (output);
if (crtc && crtc_mode == crtc->current_mode)
monitor_priv->current_mode = mode;
}
}
@@ -545,7 +565,7 @@ meta_monitor_normal_new (MetaGpu *gpu,
monitor_priv->gpu = gpu;
monitor_priv->outputs = g_list_append (NULL, output);
monitor_priv->outputs = g_list_append (NULL, g_object_ref (output));
monitor_priv->winsys_id = output->winsys_id;
meta_monitor_generate_spec (monitor);
@@ -568,13 +588,15 @@ 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 = output->crtc->rect.x,
.y = output->crtc->rect.y,
.width = output->crtc->rect.width,
.height = output->crtc->rect.height
.x = crtc->rect.x,
.y = crtc->rect.y,
.width = crtc->rect.width,
.height = crtc->rect.height
};
}
@@ -658,7 +680,8 @@ 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, output);
monitor_priv->outputs = g_list_append (monitor_priv->outputs,
g_object_ref (output));
}
}
@@ -764,12 +787,13 @@ 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 &&
(!output->crtc ||
output->crtc->current_mode != monitor_crtc_mode->crtc_mode))
(!crtc || crtc->current_mode != monitor_crtc_mode->crtc_mode))
return FALSE;
else if (!monitor_crtc_mode->crtc_mode && output->crtc)
else if (!monitor_crtc_mode->crtc_mode && crtc)
return FALSE;
}
@@ -1217,14 +1241,16 @@ meta_monitor_tiled_derive_layout (MetaMonitor *monitor,
for (l = monitor_priv->outputs; l; l = l->next)
{
MetaOutput *output = l->data;
MetaCrtc *crtc;
if (!output->crtc)
crtc = meta_output_get_assigned_crtc (output);
if (!crtc)
continue;
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);
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);
}
*layout = (MetaRectangle) {
@@ -1318,10 +1344,14 @@ meta_monitor_get_spec (MetaMonitor *monitor)
MetaLogicalMonitor *
meta_monitor_get_logical_monitor (MetaMonitor *monitor)
{
MetaOutput *output = meta_monitor_get_main_output (monitor);
MetaOutput *output;
MetaCrtc *crtc;
if (output->crtc)
return output->crtc->logical_monitor;
output = meta_monitor_get_main_output (monitor);
crtc = meta_output_get_assigned_crtc (output);
if (crtc)
return crtc->logical_monitor;
else
return NULL;
}

View File

@@ -21,7 +21,13 @@
#include "backends/meta-output.h"
G_DEFINE_TYPE (MetaOutput, meta_output, G_TYPE_OBJECT)
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)
MetaGpu *
meta_output_get_gpu (MetaOutput *output)
@@ -29,6 +35,44 @@ 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)
{
@@ -58,5 +102,6 @@ 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,9 +64,6 @@ 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;
@@ -122,4 +119,11 @@ 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

@@ -34,7 +34,6 @@
#include "backends/x11/meta-backend-x11.h"
#include "cogl/cogl.h"
#include "meta/meta-backend.h"
#include "meta/errors.h"
#include "meta-dbus-remote-desktop.h"
#define META_REMOTE_DESKTOP_SESSION_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop/Session"

View File

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

View File

@@ -132,8 +132,8 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
{
MetaScreenCastStreamSrcPrivate *priv =
meta_screen_cast_stream_src_get_instance_private (src);
uint32_t buffer_id;
struct spa_buffer *buffer;
struct pw_buffer *buffer;
struct spa_buffer *spa_buffer;
uint8_t *map = NULL;
uint8_t *data;
uint64_t now_us;
@@ -148,17 +148,24 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
if (!priv->pipewire_stream)
return;
buffer_id = pw_stream_get_empty_buffer (priv->pipewire_stream);
if (buffer_id == SPA_ID_INVALID)
return;
buffer = pw_stream_peek_buffer (priv->pipewire_stream, buffer_id);
if (buffer->datas[0].type == priv->pipewire_type->data.MemFd)
buffer = pw_stream_dequeue_buffer (priv->pipewire_stream);
if (!buffer)
{
map = mmap (NULL, buffer->datas[0].maxsize + buffer->datas[0].mapoffset,
g_warning ("Failed to dequeue at PipeWire buffer");
return;
}
spa_buffer = buffer->buffer;
if (spa_buffer->datas[0].data)
{
data = spa_buffer->datas[0].data;
}
else if (spa_buffer->datas[0].type == priv->pipewire_type->data.MemFd)
{
map = mmap (NULL, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset,
PROT_READ | PROT_WRITE, MAP_SHARED,
buffer->datas[0].fd, 0);
spa_buffer->datas[0].fd, 0);
if (map == MAP_FAILED)
{
g_warning ("Failed to mmap pipewire stream buffer: %s\n",
@@ -166,14 +173,11 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
return;
}
data = SPA_MEMBER (map, buffer->datas[0].mapoffset, uint8_t);
}
else if (buffer->datas[0].type == priv->pipewire_type->data.MemPtr)
{
data = buffer->datas[0].data;
data = SPA_MEMBER (map, spa_buffer->datas[0].mapoffset, uint8_t);
}
else
{
g_warning ("Unhandled spa buffer type: %d", spa_buffer->datas[0].type);
return;
}
@@ -181,11 +185,11 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
priv->last_frame_timestamp_us = now_us;
if (map)
munmap (map, buffer->datas[0].maxsize + buffer->datas[0].mapoffset);
munmap (map, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset);
buffer->datas[0].chunk->size = buffer->datas[0].maxsize;
spa_buffer->datas[0].chunk->size = spa_buffer->datas[0].maxsize;
pw_stream_send_buffer (priv->pipewire_stream, buffer_id);
pw_stream_queue_buffer (priv->pipewire_stream, buffer);
}
static gboolean
@@ -261,8 +265,8 @@ on_stream_state_changed (void *data,
}
static void
on_stream_format_changed (void *data,
struct spa_pod *format)
on_stream_format_changed (void *data,
const struct spa_pod *format)
{
MetaScreenCastStreamSrc *src = data;
MetaScreenCastStreamSrcPrivate *priv =
@@ -271,7 +275,7 @@ on_stream_format_changed (void *data,
uint8_t params_buffer[1024];
int32_t width, height, stride, size;
struct spa_pod_builder pod_builder;
struct spa_pod *params[1];
const struct spa_pod *params[1];
const int bpp = 4;
if (!format)
@@ -327,10 +331,18 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
struct spa_fraction max_framerate;
struct spa_fraction min_framerate;
const struct spa_pod *params[1];
int result;
pipewire_stream = pw_stream_new (priv->pipewire_remote,
"meta-screen-cast-src",
NULL);
if (!pipewire_stream)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to create PipeWire stream: %s",
strerror (errno));
return NULL;
}
meta_screen_cast_stream_src_get_specs (src, &width, &height, &frame_rate);
frame_rate_fraction = meta_fraction_from_double (frame_rate);
@@ -347,23 +359,25 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
":", spa_type->format_video.format, "I", spa_type->video_format.BGRx,
":", spa_type->format_video.size, "R", &SPA_RECTANGLE (width, height),
":", spa_type->format_video.framerate, "F", &SPA_FRACTION (0, 1),
":", spa_type->format_video.max_framerate, "Fr", &max_framerate,
PROP_RANGE (&min_framerate,
&max_framerate));
":", spa_type->format_video.max_framerate, "Fru", &max_framerate,
PROP_RANGE (&min_framerate,
&max_framerate));
pw_stream_add_listener (pipewire_stream,
&priv->pipewire_stream_listener,
&stream_events,
src);
if (pw_stream_connect (pipewire_stream,
PW_DIRECTION_OUTPUT,
NULL,
PW_STREAM_FLAG_NONE,
params, G_N_ELEMENTS (&params)) != 0)
result = pw_stream_connect (pipewire_stream,
PW_DIRECTION_OUTPUT,
NULL,
(PW_STREAM_FLAG_DRIVER |
PW_STREAM_FLAG_MAP_BUFFERS),
params, G_N_ELEMENTS (params));
if (result != 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Could not connect");
"Could not connect: %s", spa_strerror (result));
return NULL;
}
@@ -466,6 +480,12 @@ create_pipewire_source (void)
(MetaPipeWireSource *) g_source_new (&pipewire_source_funcs,
sizeof (MetaPipeWireSource));
pipewire_source->pipewire_loop = pw_loop_new (NULL);
if (!pipewire_source->pipewire_loop)
{
g_source_destroy ((GSource *) pipewire_source);
return NULL;
}
g_source_add_unix_fd (&pipewire_source->base,
pw_loop_get_fd (pipewire_source->pipewire_loop),
G_IO_IN | G_IO_ERR);
@@ -491,6 +511,13 @@ meta_screen_cast_stream_src_initable_init (GInitable *initable,
meta_screen_cast_stream_src_get_instance_private (src);
priv->pipewire_source = create_pipewire_source ();
if (!priv->pipewire_source)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to create PipeWire source");
return FALSE;
}
priv->pipewire_core = pw_core_new (priv->pipewire_source->pipewire_loop,
NULL);
if (!priv->pipewire_core)

View File

@@ -31,8 +31,7 @@ typedef enum _MetaExperimentalFeature
{
META_EXPERIMENTAL_FEATURE_NONE = 0,
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0),
META_EXPERIMENTAL_FEATURE_SCREEN_CAST = (1 << 1),
META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP = (1 << 2),
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
} MetaExperimentalFeature;
#define META_TYPE_SETTINGS (meta_settings_get_type ())

View File

@@ -260,13 +260,10 @@ 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, "screen-cast"))
features |= META_EXPERIMENTAL_FEATURE_SCREEN_CAST;
else if (g_str_equal (feature, "remote-desktop"))
features |= META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP;
else if (g_str_equal (feature, "kms-modifiers"))
features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;
else
g_info ("Unknown experimental feature '%s'\n", feature);
}

View File

@@ -17,39 +17,23 @@
* 02111-1307, USA.
*/
#ifndef META_STAGE_H
#define META_STAGE_H
#ifndef META_STAGE_PRIVATE_H
#define META_STAGE_PRIVATE_H
#include <clutter/clutter.h>
#include <meta/meta-stage.h>
#include "meta-cursor.h"
#include <meta/boxes.h>
G_BEGIN_DECLS
#define META_TYPE_STAGE (meta_stage_get_type ())
#define META_STAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_STAGE, MetaStage))
#define META_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_STAGE, MetaStageClass))
#define META_IS_STAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_STAGE))
#define META_IS_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_STAGE))
#define META_STAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_STAGE, MetaStageClass))
typedef struct _MetaStage MetaStage;
typedef struct _MetaStageClass MetaStageClass;
typedef struct _MetaOverlay MetaOverlay;
struct _MetaStageClass
{
ClutterStageClass parent_class;
};
struct _MetaStage
{
ClutterStage parent;
};
GType meta_stage_get_type (void) G_GNUC_CONST;
ClutterActor *meta_stage_new (void);
MetaOverlay *meta_stage_create_cursor_overlay (MetaStage *stage);
@@ -68,4 +52,4 @@ void meta_stage_update_view_layout (MetaStage *stage);
G_END_DECLS
#endif /* META_STAGE_H */
#endif /* META_STAGE_PRIVATE_H */

View File

@@ -22,7 +22,7 @@
#include <config.h>
#include "meta-stage.h"
#include "meta-stage-private.h"
#include <meta/meta-backend.h>
#include <meta/meta-monitor-manager.h>

View File

@@ -29,21 +29,20 @@
#include <meta/main.h>
#include <clutter/evdev/clutter-evdev.h>
#include <libupower-glib/upower.h>
#include "clutter/egl/clutter-egl.h"
#include "clutter/evdev/clutter-evdev.h"
#include "meta-barrier-native.h"
#include "meta-border.h"
#include "meta-idle-monitor-native.h"
#include "meta-monitor-manager-kms.h"
#include "meta-cursor-renderer-native.h"
#include "meta-launcher.h"
#include "backends/meta-cursor-tracker-private.h"
#include "backends/meta-idle-monitor-private.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-pointer-constraint.h"
#include "backends/meta-stage.h"
#include "backends/meta-stage-private.h"
#include "backends/native/meta-clutter-backend-native.h"
#include "backends/native/meta-input-settings-native.h"
#include "backends/native/meta-renderer-native.h"
@@ -60,10 +59,6 @@ struct _MetaBackendNativePrivate
{
MetaLauncher *launcher;
MetaBarrierManagerNative *barrier_manager;
UpClient *up_client;
guint sleep_signal_id;
GCancellable *cancellable;
GDBusConnection *system_bus;
};
typedef struct _MetaBackendNativePrivate MetaBackendNativePrivate;
@@ -85,69 +80,9 @@ meta_backend_native_finalize (GObject *object)
meta_launcher_free (priv->launcher);
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);
G_OBJECT_CLASS (meta_backend_native_parent_class)->finalize (object);
}
static void
prepare_for_sleep_cb (GDBusConnection *connection,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
gboolean suspending;
g_variant_get (parameters, "(b)", &suspending);
if (suspending)
return;
meta_idle_monitor_native_reset_idletime (meta_idle_monitor_get_core ());
}
static void
system_bus_gotten_cb (GObject *object,
GAsyncResult *res,
gpointer user_data)
{
MetaBackendNativePrivate *priv;
GDBusConnection *bus;
bus = g_bus_get_finish (res, NULL);
if (!bus)
return;
priv = meta_backend_native_get_instance_private (META_BACKEND_NATIVE (user_data));
priv->system_bus = bus;
priv->sleep_signal_id = g_dbus_connection_signal_subscribe (priv->system_bus,
"org.freedesktop.login1",
"org.freedesktop.login1.Manager",
"PrepareForSleep",
"/org/freedesktop/login1",
NULL,
G_DBUS_SIGNAL_FLAGS_NONE,
prepare_for_sleep_cb,
NULL,
NULL);
}
static void
lid_is_closed_changed_cb (UpClient *client,
GParamSpec *pspec,
gpointer user_data)
{
if (up_client_get_lid_is_closed (client))
return;
meta_idle_monitor_native_reset_idletime (meta_idle_monitor_get_core ());
}
static void
constrain_to_barriers (ClutterInputDevice *device,
guint32 time,
@@ -276,7 +211,7 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
MetaLogicalMonitor *cur = current;
float x = cur_x, y = cur_y;
float dx = *dx_inout, dy = *dy_inout;
MetaScreenDirection direction = -1;
MetaDisplayDirection direction = -1;
while (cur)
{
@@ -304,18 +239,18 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
{ cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
};
if (direction != META_SCREEN_RIGHT &&
if (direction != META_DISPLAY_RIGHT &&
meta_line2_intersects_with (&motion, &left, &intersection))
direction = META_SCREEN_LEFT;
else if (direction != META_SCREEN_LEFT &&
direction = META_DISPLAY_LEFT;
else if (direction != META_DISPLAY_LEFT &&
meta_line2_intersects_with (&motion, &right, &intersection))
direction = META_SCREEN_RIGHT;
else if (direction != META_SCREEN_DOWN &&
direction = META_DISPLAY_RIGHT;
else if (direction != META_DISPLAY_DOWN &&
meta_line2_intersects_with (&motion, &top, &intersection))
direction = META_SCREEN_UP;
else if (direction != META_SCREEN_UP &&
direction = META_DISPLAY_UP;
else if (direction != META_DISPLAY_UP &&
meta_line2_intersects_with (&motion, &bottom, &intersection))
direction = META_SCREEN_DOWN;
direction = META_DISPLAY_DOWN;
else
{
/* We reached the dest logical monitor */
@@ -398,15 +333,6 @@ meta_backend_native_post_init (MetaBackend *backend)
meta_backend_get_monitor_manager (backend));
}
static MetaIdleMonitor *
meta_backend_native_create_idle_monitor (MetaBackend *backend,
int device_id)
{
return g_object_new (META_TYPE_IDLE_MONITOR_NATIVE,
"device-id", device_id,
NULL);
}
static MetaMonitorManager *
meta_backend_native_create_monitor_manager (MetaBackend *backend,
GError **error)
@@ -604,7 +530,6 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
backend_class->post_init = meta_backend_native_post_init;
backend_class->create_idle_monitor = meta_backend_native_create_idle_monitor;
backend_class->create_monitor_manager = meta_backend_native_create_monitor_manager;
backend_class->create_cursor_renderer = meta_backend_native_create_cursor_renderer;
backend_class->create_renderer = meta_backend_native_create_renderer;
@@ -637,16 +562,6 @@ meta_backend_native_init (MetaBackendNative *native)
}
priv->barrier_manager = meta_barrier_manager_native_new ();
priv->up_client = up_client_new ();
g_signal_connect (priv->up_client, "notify::lid-is-closed",
G_CALLBACK (lid_is_closed_changed_cb), NULL);
priv->cancellable = g_cancellable_new ();
g_bus_get (G_BUS_TYPE_SYSTEM,
priv->cancellable,
system_bus_gotten_cb,
native);
}
MetaLauncher *
@@ -729,8 +644,6 @@ void meta_backend_native_resume (MetaBackendNative *native)
meta_backend_get_monitor_manager (backend);
MetaMonitorManagerKms *monitor_manager_kms =
META_MONITOR_MANAGER_KMS (monitor_manager);
MetaCursorRenderer *cursor_renderer;
MetaCursorRendererNative *cursor_renderer_native;
ClutterActor *stage;
MetaIdleMonitor *idle_monitor;
@@ -742,10 +655,6 @@ 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_native_reset_idletime (idle_monitor);
meta_idle_monitor_reset_idletime (idle_monitor);
}

View File

@@ -35,6 +35,7 @@
#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"
@@ -43,6 +44,11 @@
#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
@@ -113,6 +119,11 @@ 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);
@@ -152,7 +163,8 @@ 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);
@@ -203,7 +215,8 @@ 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;
@@ -291,9 +304,12 @@ 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;
int crtc_x, crtc_y;
int crtc_width, crtc_height;
if (meta_is_stage_views_scaled ())
scale = meta_logical_monitor_get_scale (data->in_logical_monitor);
@@ -305,17 +321,31 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
META_MONITOR_TRANSFORM_NORMAL,
&crtc_x, &crtc_y);
transform = meta_logical_monitor_get_transform (data->in_logical_monitor);
if (meta_monitor_transform_is_rotated (transform))
{
crtc_width = monitor_crtc_mode->crtc_mode->height;
crtc_height = monitor_crtc_mode->crtc_mode->width;
}
else
{
crtc_width = monitor_crtc_mode->crtc_mode->width;
crtc_height = monitor_crtc_mode->crtc_mode->height;
}
scaled_crtc_rect = (ClutterRect) {
.origin = {
.x = crtc_x / scale,
.y = crtc_y / scale
},
.size = {
.width = monitor_crtc_mode->crtc_mode->width / scale,
.height = monitor_crtc_mode->crtc_mode->height / scale
.width = crtc_width / scale,
.height = crtc_height / scale
},
};
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,
@@ -326,7 +356,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
float crtc_cursor_x, crtc_cursor_y;
set_crtc_cursor (data->in_cursor_renderer_native,
monitor_crtc_mode->output->crtc,
crtc,
data->in_cursor_sprite);
gpu_kms = META_GPU_KMS (meta_monitor_get_gpu (monitor));
@@ -336,7 +366,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,
monitor_crtc_mode->output->crtc->crtc_id,
crtc->crtc_id,
roundf (crtc_cursor_x),
roundf (crtc_cursor_y));
@@ -344,8 +374,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
}
else
{
set_crtc_cursor (data->in_cursor_renderer_native,
monitor_crtc_mode->output->crtc, NULL);
set_crtc_cursor (data->in_cursor_renderer_native, crtc, NULL);
}
return TRUE;
@@ -355,7 +384,8 @@ 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;
@@ -548,18 +578,15 @@ can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
static gboolean
should_have_hw_cursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
MetaCursorSprite *cursor_sprite,
GList *gpus)
{
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;
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
for (l = gpus; l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
@@ -593,7 +620,8 @@ 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);
@@ -605,10 +633,11 @@ meta_cursor_renderer_native_update_animation (MetaCursorRendererNative *native)
}
static void
meta_cursor_renderer_native_trigger_frame (MetaCursorRendererNative *native,
MetaCursorSprite *cursor_sprite)
maybe_schedule_cursor_sprite_animation_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;
@@ -640,21 +669,78 @@ meta_cursor_renderer_native_trigger_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);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
g_autoptr (GList) gpus = NULL;
if (cursor_sprite)
meta_cursor_sprite_realize_texture (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_renderer_native_trigger_frame (native, cursor_sprite);
maybe_schedule_cursor_sprite_animation_frame (native, cursor_sprite);
priv->has_hw_cursor = should_have_hw_cursor (renderer, cursor_sprite);
priv->has_hw_cursor = should_have_hw_cursor (renderer, cursor_sprite, gpus);
update_hw_cursor (native, cursor_sprite);
return priv->has_hw_cursor;
return (priv->has_hw_cursor ||
!cursor_sprite ||
!meta_cursor_sprite_get_cogl_texture (cursor_sprite));
}
static void
@@ -690,6 +776,24 @@ 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)
{
@@ -722,6 +826,9 @@ 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;
}
@@ -789,57 +896,71 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
}
}
static void
invalidate_pending_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite,
MetaGpuKms *gpu_kms)
static gboolean
is_cursor_hw_state_valid (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;
return FALSE;
cursor_gpu_state = get_cursor_gpu_state (cursor_priv, gpu_kms);
if (!cursor_gpu_state)
return;
return FALSE;
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;
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 ();
}
#ifdef HAVE_WAYLAND
static void
meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite,
struct wl_resource *buffer)
realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSpriteWayland *sprite_wayland)
{
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;
/* 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);
if (is_cursor_hw_state_valid (cursor_sprite, gpu_kms))
return;
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
width = cogl_texture_get_width (texture);
height = cogl_texture_get_height (texture);
struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get (buffer);
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);
if (shm_buffer)
{
int rowstride = wl_shm_buffer_get_stride (shm_buffer);
@@ -913,47 +1034,27 @@ meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRen
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
meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
realize_cursor_sprite_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSpriteXcursor *sprite_xcursor)
{
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;
invalidate_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms);
if (is_cursor_hw_state_valid (cursor_sprite, gpu_kms))
return;
xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor);
load_cursor_sprite_gbm_buffer_for_gpu (native,
gpu_kms,
@@ -966,26 +1067,44 @@ meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (MetaCursorRende
}
static void
meta_cursor_renderer_native_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
realize_cursor_sprite_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite)
{
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);
}
#ifdef HAVE_WAYLAND
else if (META_IS_CURSOR_SPRITE_WAYLAND (cursor_sprite))
{
MetaCursorSpriteWayland *sprite_wayland =
META_CURSOR_SPRITE_WAYLAND (cursor_sprite);
realize_cursor_sprite_from_wl_buffer_for_gpu (renderer,
gpu_kms,
sprite_wayland);
}
#endif
}
static void
realize_cursor_sprite (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
GList *gpus)
{
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_xcursor_for_gpu (
renderer,
gpu_kms,
cursor_sprite,
xc_image);
realize_cursor_sprite_for_gpu (renderer, gpu_kms, cursor_sprite);
}
}
@@ -997,12 +1116,6 @@ 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 =
@@ -1017,14 +1130,13 @@ force_update_hw_cursor (MetaCursorRendererNative *native)
meta_cursor_renderer_native_get_instance_private (native);
priv->hw_state_invalidated = TRUE;
update_hw_cursor (native, meta_cursor_renderer_get_cursor (renderer));
meta_cursor_renderer_force_update (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);
}
@@ -1096,9 +1208,3 @@ 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

@@ -26,14 +26,13 @@
#define META_CURSOR_RENDERER_NATIVE_H
#include "meta-cursor-renderer.h"
#include "meta/meta-backend.h"
#define META_TYPE_CURSOR_RENDERER_NATIVE (meta_cursor_renderer_native_get_type ())
G_DECLARE_FINAL_TYPE (MetaCursorRendererNative, meta_cursor_renderer_native,
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

@@ -47,6 +47,12 @@ typedef struct _MetaKmsSource
MetaGpuKms *gpu_kms;
} MetaKmsSource;
typedef struct _MetaGpuKmsFlipClosureContainer
{
GClosure *flip_closure;
MetaGpuKms *gpu_kms;
} MetaGpuKmsFlipClosureContainer;
struct _MetaGpuKms
{
MetaGpu parent;
@@ -104,8 +110,10 @@ get_crtc_drm_connectors (MetaGpu *gpu,
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
{
MetaOutput *output = l->data;
MetaCrtc *assigned_crtc;
if (output->crtc == crtc)
assigned_crtc = meta_output_get_assigned_crtc (output);
if (assigned_crtc == crtc)
g_array_append_val (connectors_array, output->winsys_id);
}
@@ -185,8 +193,10 @@ 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;
if (output->crtc == crtc)
assigned_crtc = meta_output_get_assigned_crtc (output);
if (assigned_crtc == crtc)
{
connected_crtc_found = TRUE;
break;
@@ -199,11 +209,26 @@ meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
return TRUE;
}
typedef struct _GpuClosureContainer
MetaGpuKmsFlipClosureContainer *
meta_gpu_kms_wrap_flip_closure (MetaGpuKms *gpu_kms,
GClosure *flip_closure)
{
GClosure *flip_closure;
MetaGpuKms *gpu_kms;
} GpuClosureContainer;
MetaGpuKmsFlipClosureContainer *closure_container;
closure_container = g_new0 (MetaGpuKmsFlipClosureContainer, 1);
*closure_container = (MetaGpuKmsFlipClosureContainer) {
.flip_closure = flip_closure,
.gpu_kms = gpu_kms
};
return closure_container;
}
void
meta_gpu_kms_flip_closure_container_free (MetaGpuKmsFlipClosureContainer *closure_container)
{
g_free (closure_container);
}
gboolean
meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
@@ -229,14 +254,11 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
if (!gpu_kms->page_flips_not_supported)
{
GpuClosureContainer *closure_container;
MetaGpuKmsFlipClosureContainer *closure_container;
int kms_fd = meta_gpu_kms_get_fd (gpu_kms);
closure_container = g_new0 (GpuClosureContainer, 1);
*closure_container = (GpuClosureContainer) {
.flip_closure = flip_closure,
.gpu_kms = gpu_kms
};
closure_container = meta_gpu_kms_wrap_flip_closure (gpu_kms,
flip_closure);
ret = drmModePageFlip (kms_fd,
crtc->crtc_id,
@@ -245,7 +267,7 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
closure_container);
if (ret != 0 && ret != -EACCES)
{
g_free (closure_container);
meta_gpu_kms_flip_closure_container_free (closure_container);
g_warning ("Failed to flip: %s", strerror (-ret));
gpu_kms->page_flips_not_supported = TRUE;
}
@@ -276,12 +298,12 @@ page_flip_handler (int fd,
unsigned int usec,
void *user_data)
{
GpuClosureContainer *closure_container = user_data;
MetaGpuKmsFlipClosureContainer *closure_container = user_data;
GClosure *flip_closure = closure_container->flip_closure;
MetaGpuKms *gpu_kms = closure_container->gpu_kms;
invoke_flip_closure (flip_closure, gpu_kms);
g_free (closure_container);
meta_gpu_kms_flip_closure_container_free (closure_container);
}
gboolean
@@ -778,7 +800,7 @@ meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
kms_fd = meta_launcher_open_restricted (launcher, kms_file_path, error);
if (kms_fd == -1)
return FALSE;
return NULL;
gpu_kms = g_object_new (META_TYPE_GPU_KMS,
"monitor-manager", monitor_manager_kms,

View File

@@ -32,6 +32,8 @@
#define META_TYPE_GPU_KMS (meta_gpu_kms_get_type ())
G_DECLARE_FINAL_TYPE (MetaGpuKms, meta_gpu_kms, META, GPU_KMS, MetaGpu)
typedef struct _MetaGpuKmsFlipClosureContainer MetaGpuKmsFlipClosureContainer;
typedef struct _MetaKmsResources
{
drmModeRes *resources;
@@ -84,4 +86,9 @@ gboolean meta_drm_mode_equal (const drmModeModeInfo *one,
float meta_calculate_drm_mode_refresh_rate (const drmModeModeInfo *mode);
MetaGpuKmsFlipClosureContainer * meta_gpu_kms_wrap_flip_closure (MetaGpuKms *gpu_kms,
GClosure *flip_closure);
void meta_gpu_kms_flip_closure_container_free (MetaGpuKmsFlipClosureContainer *closure_container);
#endif /* META_GPU_KMS_H */

View File

@@ -1,200 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright 2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
*/
#include "config.h"
#include "meta-idle-monitor-native.h"
#include "meta-idle-monitor-private.h"
#include <meta/util.h>
#include "display-private.h"
#include <string.h>
struct _MetaIdleMonitorNative
{
MetaIdleMonitor parent;
guint64 last_event_time;
};
struct _MetaIdleMonitorNativeClass
{
MetaIdleMonitorClass parent_class;
};
typedef struct {
MetaIdleMonitorWatch base;
GSource *timeout_source;
} MetaIdleMonitorWatchNative;
G_DEFINE_TYPE (MetaIdleMonitorNative, meta_idle_monitor_native, META_TYPE_IDLE_MONITOR)
static gint64
meta_idle_monitor_native_get_idletime (MetaIdleMonitor *monitor)
{
MetaIdleMonitorNative *monitor_native = META_IDLE_MONITOR_NATIVE (monitor);
return (g_get_monotonic_time () - monitor_native->last_event_time) / 1000;
}
static guint32
get_next_watch_serial (void)
{
static guint32 serial = 0;
g_atomic_int_inc (&serial);
return serial;
}
static gboolean
native_dispatch_timeout (GSource *source,
GSourceFunc callback,
gpointer user_data)
{
MetaIdleMonitorWatchNative *watch_native = user_data;
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) watch_native;
_meta_idle_monitor_watch_fire (watch);
g_source_set_ready_time (watch_native->timeout_source, -1);
return TRUE;
}
static GSourceFuncs native_source_funcs = {
NULL, /* prepare */
NULL, /* check */
native_dispatch_timeout,
NULL, /* finalize */
};
static void
free_watch (gpointer data)
{
MetaIdleMonitorWatchNative *watch_native = data;
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) watch_native;
MetaIdleMonitor *monitor = watch->monitor;
g_object_ref (monitor);
if (watch->idle_source_id)
{
g_source_remove (watch->idle_source_id);
watch->idle_source_id = 0;
}
if (watch->notify != NULL)
watch->notify (watch->user_data);
if (watch_native->timeout_source != NULL)
g_source_destroy (watch_native->timeout_source);
g_object_unref (monitor);
g_slice_free (MetaIdleMonitorWatchNative, watch_native);
}
static MetaIdleMonitorWatch *
meta_idle_monitor_native_make_watch (MetaIdleMonitor *monitor,
guint64 timeout_msec,
MetaIdleMonitorWatchFunc callback,
gpointer user_data,
GDestroyNotify notify)
{
MetaIdleMonitorWatchNative *watch_native;
MetaIdleMonitorWatch *watch;
MetaIdleMonitorNative *monitor_native = META_IDLE_MONITOR_NATIVE (monitor);
watch_native = g_slice_new0 (MetaIdleMonitorWatchNative);
watch = (MetaIdleMonitorWatch *) watch_native;
watch->monitor = monitor;
watch->id = get_next_watch_serial ();
watch->callback = callback;
watch->user_data = user_data;
watch->notify = notify;
watch->timeout_msec = timeout_msec;
if (timeout_msec != 0)
{
GSource *source = g_source_new (&native_source_funcs, sizeof (GSource));
g_source_set_callback (source, NULL, watch, NULL);
g_source_set_ready_time (source, monitor_native->last_event_time + timeout_msec * 1000);
g_source_attach (source, NULL);
g_source_unref (source);
watch_native->timeout_source = source;
}
return watch;
}
static void
meta_idle_monitor_native_class_init (MetaIdleMonitorNativeClass *klass)
{
MetaIdleMonitorClass *idle_monitor_class = META_IDLE_MONITOR_CLASS (klass);
idle_monitor_class->get_idletime = meta_idle_monitor_native_get_idletime;
idle_monitor_class->make_watch = meta_idle_monitor_native_make_watch;
}
static void
meta_idle_monitor_native_init (MetaIdleMonitorNative *monitor_native)
{
MetaIdleMonitor *monitor = META_IDLE_MONITOR (monitor_native);
monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch);
monitor_native->last_event_time = g_get_monotonic_time ();
}
void
meta_idle_monitor_native_reset_idletime (MetaIdleMonitor *monitor)
{
MetaIdleMonitorNative *monitor_native = META_IDLE_MONITOR_NATIVE (monitor);
GList *node, *watch_ids;
monitor_native->last_event_time = g_get_monotonic_time ();
watch_ids = g_hash_table_get_keys (monitor->watches);
for (node = watch_ids; node != NULL; node = node->next)
{
guint watch_id = GPOINTER_TO_UINT (node->data);
MetaIdleMonitorWatchNative *watch;
watch = g_hash_table_lookup (monitor->watches, GUINT_TO_POINTER (watch_id));
if (!watch)
continue;
if (watch->base.timeout_msec == 0)
{
_meta_idle_monitor_watch_fire ((MetaIdleMonitorWatch *) watch);
}
else
{
g_source_set_ready_time (watch->timeout_source,
monitor_native->last_event_time +
watch->base.timeout_msec * 1000);
}
}
g_list_free (watch_ids);
}

View File

@@ -1,43 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright 2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
*/
#ifndef META_IDLE_MONITOR_NATIVE_H
#define META_IDLE_MONITOR_NATIVE_H
#include <glib-object.h>
#include <meta/meta-idle-monitor.h>
#define META_TYPE_IDLE_MONITOR_NATIVE (meta_idle_monitor_native_get_type ())
#define META_IDLE_MONITOR_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_IDLE_MONITOR_NATIVE, MetaIdleMonitorNative))
#define META_IDLE_MONITOR_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_IDLE_MONITOR_NATIVE, MetaIdleMonitorNativeClass))
#define META_IS_IDLE_MONITOR_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_IDLE_MONITOR_NATIVE))
#define META_IS_IDLE_MONITOR_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_IDLE_MONITOR_NATIVE))
#define META_IDLE_MONITOR_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_IDLE_MONITOR_NATIVE, MetaIdleMonitorNativeClass))
typedef struct _MetaIdleMonitorNative MetaIdleMonitorNative;
typedef struct _MetaIdleMonitorNativeClass MetaIdleMonitorNativeClass;
GType meta_idle_monitor_native_get_type (void);
void meta_idle_monitor_native_reset_idletime (MetaIdleMonitor *monitor);
#endif /* META_IDLE_MONITOR_NATIVE_H */

View File

@@ -44,7 +44,6 @@
#include "backends/meta-backend-private.h"
#include "backends/native/meta-backend-native.h"
#include "meta-cursor-renderer-native.h"
#include "meta-idle-monitor-native.h"
#include "meta-renderer-native.h"
struct _MetaLauncher
@@ -63,20 +62,179 @@ meta_launcher_get_seat_id (MetaLauncher *launcher)
return launcher->seat_id;
}
static gboolean
find_systemd_session (gchar **session_id,
GError **error)
{
const gchar * const graphical_session_types[] = { "wayland", "x11", "mir", NULL };
const gchar * const active_states[] = { "active", "online", NULL };
g_autofree gchar *class = NULL;
g_autofree gchar *local_session_id = NULL;
g_autofree gchar *type = NULL;
g_autofree gchar *state = NULL;
g_auto (GStrv) sessions = NULL;
int n_sessions;
int saved_errno;
g_assert (session_id != NULL);
g_assert (error == NULL || *error == NULL);
/* if we are in a logind session, we can trust that value, so use it. This
* happens for example when you run mutter directly from a VT but when
* systemd starts us we will not be in a logind session. */
saved_errno = sd_pid_get_session (0, &local_session_id);
if (saved_errno < 0)
{
if (saved_errno != -ENODATA)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Failed to get session by pid for user %d (%s)",
getuid (),
g_strerror (-saved_errno));
return FALSE;
}
}
else
{
*session_id = g_steal_pointer (&local_session_id);
return TRUE;
}
saved_errno = sd_uid_get_display (getuid (), &local_session_id);
if (saved_errno < 0)
{
/* no session, maybe there's a greeter session */
if (saved_errno == -ENODATA)
{
n_sessions = sd_uid_get_sessions (getuid (), 1, &sessions);
if (n_sessions < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Failed to get all sessions for user %d (%m)",
getuid ());
return FALSE;
}
if (n_sessions == 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"User %d has no sessions",
getuid ());
return FALSE;
}
for (int i = 0; i < n_sessions; ++i)
{
saved_errno = sd_session_get_class (sessions[i], &class);
if (saved_errno < 0)
{
g_warning ("Couldn't get class for session '%d': %s",
i,
g_strerror (-saved_errno));
continue;
}
if (g_strcmp0 (class, "greeter") == 0)
{
local_session_id = g_strdup (sessions[i]);
break;
}
}
if (!local_session_id)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't find a session or a greeter session for user %d",
getuid ());
return FALSE;
}
}
else
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't get display for user %d: %s",
getuid (),
g_strerror (-saved_errno));
return FALSE;
}
}
/* sd_uid_get_display will return any session if there is no graphical
* one, so let's check it really is graphical. */
saved_errno = sd_session_get_type (local_session_id, &type);
if (saved_errno < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't get type for session '%s': %s",
local_session_id,
g_strerror (-saved_errno));
return FALSE;
}
if (!g_strv_contains (graphical_session_types, type))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Session '%s' is not a graphical session (type: '%s')",
local_session_id,
type);
return FALSE;
}
/* and display sessions can be 'closing' if they are logged out but
* some processes are lingering; we shouldn't consider these */
saved_errno = sd_session_get_state (local_session_id, &state);
if (saved_errno < 0)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Couldn't get state for session '%s': %s",
local_session_id,
g_strerror (-saved_errno));
return FALSE;
}
if (!g_strv_contains (active_states, state))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Session '%s' is not active",
local_session_id);
return FALSE;
}
*session_id = g_steal_pointer (&local_session_id);
return TRUE;
}
static Login1Session *
get_session_proxy (GCancellable *cancellable,
GError **error)
{
g_autofree char *proxy_path = NULL;
g_autofree char *session_id = NULL;
g_autoptr (GError) local_error = NULL;
Login1Session *session_proxy;
if (sd_pid_get_session (getpid (), &session_id) < 0)
if (!find_systemd_session (&session_id, &local_error))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get session ID: %m");
g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
return NULL;
}
@@ -303,17 +461,14 @@ on_active_changed (Login1Session *session,
static gchar *
get_seat_id (GError **error)
{
g_autoptr (GError) local_error = NULL;
g_autofree char *session_id = NULL;
char *seat_id = NULL;
int r;
r = sd_pid_get_session (0, &session_id);
if (r < 0)
if (!find_systemd_session (&session_id, &local_error))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get session for PID: %s", g_strerror (-r));
g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
return NULL;
}

View File

@@ -46,7 +46,7 @@
#include <unistd.h>
#include <meta/main.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include <gudev/gudev.h>
@@ -188,7 +188,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
MetaOutput *output = g_ptr_array_index (crtc_info->outputs, j);
output->is_dirty = TRUE;
output->crtc = crtc;
meta_output_assign_crtc (output, crtc);
}
}
@@ -249,7 +249,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
continue;
}
output->crtc = NULL;
meta_output_unassign_crtc (output);
output->is_primary = FALSE;
}
}
@@ -674,7 +674,7 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
gpu_paths = get_gpu_paths (manager_kms, GPU_TYPE_SECONDARY, primary_gpu_path);
for (l = gpu_paths; l; l = l->next)
{
GError *secondary_error = NULL;
g_autoptr (GError) secondary_error = NULL;
char *gpu_path = l->data;
MetaGpuKms *gpu_kms;
@@ -683,7 +683,7 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
{
g_warning ("Failed to open secondary gpu '%s': %s",
gpu_path, secondary_error->message);
g_error_free (secondary_error);
continue;
}
meta_monitor_manager_add_gpu (META_MONITOR_MANAGER (manager_kms),

View File

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

View File

@@ -103,8 +103,6 @@ typedef struct _MetaRendererNativeGpuData
MetaRendererNativeMode mode;
gboolean no_add_fb2;
EGLDisplay egl_display;
/*
@@ -193,6 +191,8 @@ struct _MetaRendererNative
MetaMonitorManagerKms *monitor_manager_kms;
MetaGles3 *gles3;
gboolean use_modifiers;
GHashTable *gpu_datas;
CoglClosure *swap_notify_idle;
@@ -991,14 +991,29 @@ 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;
return choose_egl_config_from_gbm_format (egl,
egl_display,
attributes,
GBM_FORMAT_XRGB8888,
out_config,
error);
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;
}
static gboolean
@@ -1269,6 +1284,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
MetaRendererNativeGpuData *renderer_gpu_data;
EGLDisplay *egl_display;
MetaEgl *egl = meta_onscreen_native_get_egl (onscreen_native);
MetaGpuKmsFlipClosureContainer *closure_container;
EGLAttrib *acquire_attribs;
GError *error = NULL;
@@ -1278,9 +1294,12 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
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);
acquire_attribs = (EGLAttrib[]) {
EGL_DRM_FLIP_EVENT_DATA_NV,
(EGLAttrib) flip_closure,
(EGLAttrib) closure_container,
EGL_NONE
};
@@ -1299,6 +1318,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
renderer_gpu_data->egl.no_egl_output_drm_flip_event = TRUE;
}
g_error_free (error);
meta_gpu_kms_flip_closure_container_free (closure_container);
return FALSE;
}
@@ -1586,6 +1606,7 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
struct gbm_bo **out_next_bo,
uint32_t *out_next_fb_id)
{
MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
struct gbm_bo *next_bo;
uint32_t next_fb_id;
int kms_fd;
@@ -1598,6 +1619,12 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
/* Now we need to set the CRTC to whatever is the front buffer */
next_bo = gbm_surface_lock_front_buffer (gbm_surface);
if (!next_bo)
{
g_error ("Impossible to lock surface front buffer: %m");
return FALSE;
}
for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
{
strides[i] = gbm_bo_get_stride_for_plane (next_bo, i);
@@ -1608,7 +1635,8 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
if (modifiers[0] != DRM_FORMAT_MOD_INVALID)
if (renderer_native->use_modifiers &&
modifiers[0] != DRM_FORMAT_MOD_INVALID)
{
if (drmModeAddFB2WithModifiers (kms_fd,
gbm_bo_get_width (next_bo),
@@ -1854,18 +1882,18 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos);
frame_info->global_frame_counter = renderer_native->frame_counter;
/*
* Wait for the flip callback before continuing, as we might have started the
* animation earlier due to the animation being driven by some other monitor.
*/
wait_for_pending_flips (onscreen);
update_secondary_gpu_state_pre_swap_buffers (onscreen);
parent_vtable->onscreen_swap_buffers_with_damage (onscreen,
rectangles,
n_rectangles);
/*
* Wait for the flip callback before continuing, as we might have started the
* animation earlier due to the animation being driven by some other monitor.
*/
wait_for_pending_flips (onscreen);
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
render_gpu);
switch (renderer_gpu_data->mode)
@@ -1907,12 +1935,7 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
* context.
*/
if (egl_context_changed)
{
_cogl_winsys_egl_make_current (cogl_display,
EGL_NO_SURFACE,
EGL_NO_SURFACE,
EGL_NO_CONTEXT);
}
_cogl_winsys_egl_ensure_current (cogl_display);
}
static gboolean
@@ -1996,7 +2019,7 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
CoglRenderer *cogl_renderer = cogl_display->renderer;
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform;
struct gbm_surface *new_gbm_surface;
struct gbm_surface *new_gbm_surface = NULL;
EGLNativeWindowType egl_native_window;
EGLSurface new_egl_surface;
uint32_t format = GBM_FORMAT_XRGB8888;
@@ -2006,7 +2029,10 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
meta_renderer_native_get_gpu_data (renderer_native,
onscreen_native->render_gpu);
modifiers = get_supported_modifiers (onscreen, format);
if (renderer_native->use_modifiers)
modifiers = get_supported_modifiers (onscreen, format);
else
modifiers = NULL;
if (modifiers)
{
@@ -2017,7 +2043,8 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
modifiers->len);
g_array_free (modifiers, TRUE);
}
else
if (!new_gbm_surface)
{
uint32_t flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;
@@ -2080,6 +2107,7 @@ 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;
@@ -2103,6 +2131,7 @@ 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,
@@ -2110,7 +2139,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] = output->crtc->crtc_id;
output_attribs[1] = crtc->crtc_id;
output_attribs[2] = EGL_NONE;
if (!meta_egl_get_output_layers (egl, egl_display,
@@ -2167,14 +2196,15 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
uint32_t format,
GError **error)
{
MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
MetaRendererNativeGpuData *renderer_gpu_data;
struct drm_mode_create_dumb create_arg;
struct drm_mode_destroy_dumb destroy_arg;
struct drm_mode_map_dumb map_arg;
uint32_t fb_id = 0;
void *map;
int kms_fd;
uint32_t handles[4] = { 0, };
uint32_t pitches[4] = { 0, };
uint32_t offsets[4] = { 0, };
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
@@ -2192,25 +2222,18 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
goto err_ioctl;
}
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
gpu_kms);
if (!renderer_gpu_data->no_add_fb2)
{
uint32_t handles[4] = { create_arg.handle, };
uint32_t pitches[4] = { create_arg.pitch, };
uint32_t offsets[4] = { 0 };
handles[0] = create_arg.handle;
pitches[0] = create_arg.pitch;
if (drmModeAddFB2 (kms_fd, width, height, format,
handles, pitches, offsets,
&fb_id, 0) != 0)
{
g_warning ("drmModeAddFB2 failed (%s), falling back to drmModeAddFB",
g_strerror (errno));
renderer_gpu_data->no_add_fb2 = TRUE;
}
if (drmModeAddFB2 (kms_fd, width, height, format,
handles, pitches, offsets,
&fb_id, 0) != 0)
{
g_debug ("drmModeAddFB2 failed (%s), falling back to drmModeAddFB",
g_strerror (errno));
}
if (renderer_gpu_data->no_add_fb2)
if (fb_id == 0)
{
if (drmModeAddFB (kms_fd, width, height,
24 /* depth of RGBX8888 */,
@@ -2708,12 +2731,10 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
{
MetaMonitor *main_monitor;
MetaOutput *main_output;
MetaMonitorTransform crtc_transform;
MetaCrtc *crtc;
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
main_output = meta_monitor_get_main_output (main_monitor);
crtc_transform =
meta_monitor_logical_to_crtc_transform (main_monitor,
logical_monitor->transform);
crtc = meta_output_get_assigned_crtc (main_output);
/*
* Pick any monitor and output and check; all CRTCs of a logical monitor will
@@ -2721,11 +2742,11 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
*/
if (meta_monitor_manager_is_transform_handled (monitor_manager,
main_output->crtc,
crtc_transform))
crtc,
crtc->transform))
return META_MONITOR_TRANSFORM_NORMAL;
else
return crtc_transform;
return crtc->transform;
}
static MetaRendererView *
@@ -2898,10 +2919,11 @@ meta_renderer_native_set_property (GObject *object,
}
static gboolean
create_secondary_egl_config (MetaEgl *egl,
EGLDisplay egl_display,
EGLConfig *egl_config,
GError **error)
create_secondary_egl_config (MetaEgl *egl,
MetaRendererNativeMode mode,
EGLDisplay egl_display,
EGLConfig *egl_config,
GError **error)
{
EGLint attributes[] = {
EGL_RED_SIZE, 1,
@@ -2914,12 +2936,26 @@ create_secondary_egl_config (MetaEgl *egl,
EGL_NONE
};
return choose_egl_config_from_gbm_format (egl,
egl_display,
attributes,
GBM_FORMAT_XRGB8888,
egl_config,
error);
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;
}
static EGLContext
@@ -2963,7 +2999,8 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
EGLContext egl_context;
char **missing_gl_extensions;
if (!create_secondary_egl_config (egl,egl_display, &egl_config, error))
if (!create_secondary_egl_config (egl, renderer_gpu_data->mode, egl_display,
&egl_config, error))
return FALSE;
egl_context = create_secondary_egl_context (egl, egl_display, egl_config, error);
@@ -3389,6 +3426,22 @@ meta_renderer_native_finalize (GObject *object)
G_OBJECT_CLASS (meta_renderer_native_parent_class)->finalize (object);
}
static void
meta_renderer_native_constructed (GObject *object)
{
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (object);
MetaMonitorManager *monitor_manager =
META_MONITOR_MANAGER (renderer_native->monitor_manager_kms);
MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
MetaSettings *settings = meta_backend_get_settings (backend);
if (meta_settings_is_experimental_feature_enabled (
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS))
renderer_native->use_modifiers = TRUE;
G_OBJECT_CLASS (meta_renderer_native_parent_class)->constructed (object);
}
static void
meta_renderer_native_init (MetaRendererNative *renderer_native)
{
@@ -3407,6 +3460,7 @@ meta_renderer_native_class_init (MetaRendererNativeClass *klass)
object_class->get_property = meta_renderer_native_get_property;
object_class->set_property = meta_renderer_native_set_property;
object_class->finalize = meta_renderer_native_finalize;
object_class->constructed = meta_renderer_native_constructed;
renderer_class->create_cogl_renderer = meta_renderer_native_create_cogl_renderer;
renderer_class->create_view = meta_renderer_native_create_view;

View File

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

View File

@@ -0,0 +1,36 @@
/*
* Copyright 2013, 2018 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef META_CURSOR_SPRITE_XFIXES_H
#define META_CURSOR_SPRITE_XFIXES_H
#include <glib-object.h>
#include "backends/meta-cursor.h"
#include "meta/types.h"
#define META_TYPE_CURSOR_SPRITE_XFIXES (meta_cursor_sprite_xfixes_get_type ())
G_DECLARE_FINAL_TYPE (MetaCursorSpriteXfixes,
meta_cursor_sprite_xfixes,
META, CURSOR_SPRITE_XFIXES,
MetaCursorSprite)
MetaCursorSpriteXfixes * meta_cursor_sprite_xfixes_new (MetaDisplay *display,
GError **error);
#endif /* META_CURSOR_SPRITE_XFIXES_H */

View File

@@ -37,8 +37,7 @@
#include <X11/Xlib-xcb.h>
#include <xkbcommon/xkbcommon-x11.h>
#include "meta-idle-monitor-xsync.h"
#include "backends/meta-stage.h"
#include "backends/meta-stage-private.h"
#include "backends/x11/meta-clutter-backend-x11.h"
#include "backends/x11/meta-renderer-x11.h"
#include "meta/meta-cursor-tracker.h"
@@ -47,6 +46,7 @@
#include "display-private.h"
#include "compositor/compositor-private.h"
#include "backends/meta-dnd-private.h"
#include "backends/meta-idle-monitor-private.h"
struct _MetaBackendX11Private
{
@@ -57,6 +57,8 @@ struct _MetaBackendX11Private
int xsync_event_base;
int xsync_error_base;
XSyncAlarm user_active_alarm;
XSyncCounter counter;
int xinput_opcode;
int xinput_event_base;
@@ -83,13 +85,77 @@ G_DEFINE_TYPE_WITH_CODE (MetaBackendX11, meta_backend_x11, META_TYPE_BACKEND,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
initable_iface_init));
static void
handle_alarm_notify (MetaBackend *backend,
XEvent *event)
uint64_to_xsync_value (uint64_t value,
XSyncValue *xsync_value)
{
meta_backend_foreach_device_monitor (backend,
(GFunc) meta_idle_monitor_xsync_handle_xevent,
event);
XSyncIntsToValue (xsync_value, value & 0xffffffff, value >> 32);
}
static XSyncAlarm
xsync_user_active_alarm_set (MetaBackendX11Private *priv)
{
XSyncAlarmAttributes attr;
XSyncValue delta;
unsigned long flags;
flags = (XSyncCACounter | XSyncCAValueType | XSyncCATestType |
XSyncCAValue | XSyncCADelta | XSyncCAEvents);
XSyncIntToValue (&delta, 0);
attr.trigger.counter = priv->counter;
attr.trigger.value_type = XSyncAbsolute;
attr.delta = delta;
attr.events = TRUE;
uint64_to_xsync_value (1, &attr.trigger.wait_value);
attr.trigger.test_type = XSyncNegativeTransition;
return XSyncCreateAlarm (priv->xdisplay, flags, &attr);
}
static XSyncCounter
find_idletime_counter (MetaBackendX11Private *priv)
{
int i;
int n_counters;
XSyncSystemCounter *counters;
XSyncCounter counter = None;
counters = XSyncListSystemCounters (priv->xdisplay, &n_counters);
for (i = 0; i < n_counters; i++)
{
if (g_strcmp0 (counters[i].name, "IDLETIME") == 0)
{
counter = counters[i].counter;
break;
}
}
XSyncFreeSystemCounterList (counters);
return counter;
}
static void
handle_alarm_notify (MetaBackend *backend,
XSyncAlarmNotifyEvent *alarm_event)
{
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
MetaIdleMonitor *idle_monitor;
XSyncAlarmAttributes attr;
if (alarm_event->state != XSyncAlarmActive ||
alarm_event->alarm != priv->user_active_alarm)
return;
attr.events = TRUE;
XSyncChangeAlarm (priv->xdisplay, priv->user_active_alarm,
XSyncCAEvents, &attr);
idle_monitor = meta_backend_get_idle_monitor (backend, 0);
meta_idle_monitor_reset_idletime (idle_monitor);
}
static void
@@ -110,7 +176,7 @@ translate_device_event (MetaBackendX11 *x11,
meta_backend_x11_translate_device_event (x11, device_event);
if (!device_event->send_event && device_event->time != CurrentTime)
if (!device_event->send_event && device_event->time != META_CURRENT_TIME)
{
if (XSERVER_TIME_IS_BEFORE (device_event->time, priv->latest_evtime))
{
@@ -266,7 +332,7 @@ handle_host_xevent (MetaBackend *backend,
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
bypass_clutter = TRUE;
if (meta_dnd_handle_xdnd_event (backend, compositor, display, event))
if (meta_dnd_handle_xdnd_event (backend, compositor, priv->xdisplay, event))
bypass_clutter = TRUE;
}
}
@@ -275,7 +341,7 @@ handle_host_xevent (MetaBackend *backend,
bypass_clutter);
if (event->type == (priv->xsync_event_base + XSyncAlarmNotify))
handle_alarm_notify (backend, event);
handle_alarm_notify (backend, (XSyncAlarmNotifyEvent *) event);
if (event->type == priv->xkb_event_base)
{
@@ -423,6 +489,12 @@ meta_backend_x11_post_init (MetaBackend *backend)
!XSyncInitialize (priv->xdisplay, &major, &minor))
meta_fatal ("Could not initialize XSync");
priv->counter = find_idletime_counter (priv);
if (priv->counter == None)
meta_fatal ("Could not initialize XSync counter");
priv->user_active_alarm = xsync_user_active_alarm_set (priv);
if (XQueryExtension (priv->xdisplay,
"XInputExtension",
&priv->xinput_opcode,
@@ -464,15 +536,6 @@ meta_backend_x11_create_clutter_backend (MetaBackend *backend)
return g_object_new (META_TYPE_CLUTTER_BACKEND_X11, NULL);
}
static MetaIdleMonitor *
meta_backend_x11_create_idle_monitor (MetaBackend *backend,
int device_id)
{
return g_object_new (META_TYPE_IDLE_MONITOR_XSYNC,
"device-id", device_id,
NULL);
}
static gboolean
meta_backend_x11_grab_device (MetaBackend *backend,
int device_id,
@@ -484,7 +547,7 @@ meta_backend_x11_grab_device (MetaBackend *backend,
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
int ret;
if (timestamp != CurrentTime)
if (timestamp != META_CURRENT_TIME)
timestamp = MAX (timestamp, priv->latest_evtime);
XISetMask (mask.mask, XI_ButtonPress);
@@ -679,14 +742,30 @@ initable_iface_init (GInitableIface *initable_iface)
initable_iface->init = meta_backend_x11_initable_init;
}
static void
meta_backend_x11_finalize (GObject *object)
{
MetaBackendX11 *x11 = META_BACKEND_X11 (object);
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
if (priv->user_active_alarm != None)
{
XSyncDestroyAlarm (priv->xdisplay, priv->user_active_alarm);
priv->user_active_alarm = None;
}
G_OBJECT_CLASS (meta_backend_x11_parent_class)->finalize (object);
}
static void
meta_backend_x11_class_init (MetaBackendX11Class *klass)
{
MetaBackendClass *backend_class = META_BACKEND_CLASS (klass);
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_backend_x11_finalize;
backend_class->create_clutter_backend = meta_backend_x11_create_clutter_backend;
backend_class->post_init = meta_backend_x11_post_init;
backend_class->create_idle_monitor = meta_backend_x11_create_idle_monitor;
backend_class->grab_device = meta_backend_x11_grab_device;
backend_class->ungrab_device = meta_backend_x11_ungrab_device;
backend_class->warp_pointer = meta_backend_x11_warp_pointer;
@@ -723,3 +802,13 @@ meta_backend_x11_get_xwindow (MetaBackendX11 *x11)
ClutterActor *stage = meta_backend_get_stage (META_BACKEND (x11));
return clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
}
void
meta_backend_x11_reload_cursor (MetaBackendX11 *x11)
{
MetaBackend *backend = META_BACKEND (x11);
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
meta_cursor_renderer_force_update (cursor_renderer);
}

View File

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

View File

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

View File

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

View File

@@ -1,373 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright 2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
*/
#include "config.h"
#include "meta-idle-monitor-xsync.h"
#include "meta-idle-monitor-private.h"
#include "meta-backend-x11.h"
#include <string.h>
struct _MetaIdleMonitorXSync
{
MetaIdleMonitor parent;
GHashTable *alarms;
Display *display;
XSyncCounter counter;
XSyncAlarm user_active_alarm;
};
struct _MetaIdleMonitorXSyncClass
{
MetaIdleMonitorClass parent_class;
};
typedef struct {
MetaIdleMonitorWatch base;
XSyncAlarm xalarm;
} MetaIdleMonitorWatchXSync;
G_DEFINE_TYPE (MetaIdleMonitorXSync, meta_idle_monitor_xsync, META_TYPE_IDLE_MONITOR)
static gint64
_xsyncvalue_to_int64 (XSyncValue value)
{
return ((guint64) XSyncValueHigh32 (value)) << 32
| (guint64) XSyncValueLow32 (value);
}
#define GUINT64_TO_XSYNCVALUE(value, ret) XSyncIntsToValue (ret, (value) & 0xFFFFFFFF, ((guint64)(value)) >> 32)
static XSyncAlarm
_xsync_alarm_set (MetaIdleMonitorXSync *monitor_xsync,
XSyncTestType test_type,
guint64 interval,
gboolean want_events)
{
XSyncAlarmAttributes attr;
XSyncValue delta;
guint flags;
flags = XSyncCACounter | XSyncCAValueType | XSyncCATestType |
XSyncCAValue | XSyncCADelta | XSyncCAEvents;
XSyncIntToValue (&delta, 0);
attr.trigger.counter = monitor_xsync->counter;
attr.trigger.value_type = XSyncAbsolute;
attr.delta = delta;
attr.events = want_events;
GUINT64_TO_XSYNCVALUE (interval, &attr.trigger.wait_value);
attr.trigger.test_type = test_type;
return XSyncCreateAlarm (monitor_xsync->display, flags, &attr);
}
static void
ensure_alarm_rescheduled (Display *dpy,
XSyncAlarm alarm)
{
XSyncAlarmAttributes attr;
/* Some versions of Xorg have an issue where alarms aren't
* always rescheduled. Calling XSyncChangeAlarm, even
* without any attributes, will reschedule the alarm. */
XSyncChangeAlarm (dpy, alarm, 0, &attr);
}
static void
set_alarm_enabled (Display *dpy,
XSyncAlarm alarm,
gboolean enabled)
{
XSyncAlarmAttributes attr;
attr.events = enabled;
XSyncChangeAlarm (dpy, alarm, XSyncCAEvents, &attr);
}
static char *
counter_name_for_device (int device_id)
{
if (device_id > 0)
return g_strdup_printf ("DEVICEIDLETIME %d", device_id);
return g_strdup ("IDLETIME");
}
static XSyncCounter
find_idletime_counter (MetaIdleMonitorXSync *monitor_xsync)
{
MetaIdleMonitor *monitor = META_IDLE_MONITOR (monitor_xsync);
int i;
int ncounters;
XSyncSystemCounter *counters;
XSyncCounter counter = None;
char *counter_name;
counter_name = counter_name_for_device (monitor->device_id);
counters = XSyncListSystemCounters (monitor_xsync->display, &ncounters);
for (i = 0; i < ncounters; i++)
{
if (counters[i].name != NULL && strcmp (counters[i].name, counter_name) == 0)
{
counter = counters[i].counter;
break;
}
}
XSyncFreeSystemCounterList (counters);
g_free (counter_name);
return counter;
}
static void
init_xsync (MetaIdleMonitorXSync *monitor_xsync)
{
monitor_xsync->counter = find_idletime_counter (monitor_xsync);
/* IDLETIME counter not found? */
if (monitor_xsync->counter == None)
{
g_warning ("IDLETIME counter not found\n");
return;
}
monitor_xsync->user_active_alarm = _xsync_alarm_set (monitor_xsync, XSyncNegativeTransition, 1, FALSE);
}
static void
meta_idle_monitor_xsync_dispose (GObject *object)
{
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (object);
if (monitor_xsync->user_active_alarm != None)
{
XSyncDestroyAlarm (monitor_xsync->display, monitor_xsync->user_active_alarm);
monitor_xsync->user_active_alarm = None;
}
g_clear_pointer (&monitor_xsync->alarms, g_hash_table_destroy);
G_OBJECT_CLASS (meta_idle_monitor_xsync_parent_class)->dispose (object);
}
static void
meta_idle_monitor_xsync_constructed (GObject *object)
{
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (object);
MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ());
monitor_xsync->display = meta_backend_x11_get_xdisplay (backend);
init_xsync (monitor_xsync);
G_OBJECT_CLASS (meta_idle_monitor_xsync_parent_class)->constructed (object);
}
static gint64
meta_idle_monitor_xsync_get_idletime (MetaIdleMonitor *monitor)
{
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
XSyncValue value;
if (!XSyncQueryCounter (monitor_xsync->display, monitor_xsync->counter, &value))
return -1;
return _xsyncvalue_to_int64 (value);
}
static gboolean
fire_watch_idle (gpointer data)
{
MetaIdleMonitorWatch *watch = data;
watch->idle_source_id = 0;
_meta_idle_monitor_watch_fire (watch);
return FALSE;
}
static guint32
get_next_watch_serial (void)
{
static guint32 serial = 0;
g_atomic_int_inc (&serial);
return serial;
}
static void
free_watch (gpointer data)
{
MetaIdleMonitorWatchXSync *watch_xsync = data;
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) watch_xsync;
MetaIdleMonitor *monitor = watch->monitor;
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
g_object_ref (monitor);
if (watch->idle_source_id)
{
g_source_remove (watch->idle_source_id);
watch->idle_source_id = 0;
}
if (watch->notify != NULL)
watch->notify (watch->user_data);
if (watch_xsync->xalarm != monitor_xsync->user_active_alarm &&
watch_xsync->xalarm != None)
{
XSyncDestroyAlarm (monitor_xsync->display, watch_xsync->xalarm);
g_hash_table_remove (monitor_xsync->alarms, (gpointer) watch_xsync->xalarm);
}
g_object_unref (monitor);
g_slice_free (MetaIdleMonitorWatchXSync, watch_xsync);
}
static MetaIdleMonitorWatch *
meta_idle_monitor_xsync_make_watch (MetaIdleMonitor *monitor,
guint64 timeout_msec,
MetaIdleMonitorWatchFunc callback,
gpointer user_data,
GDestroyNotify notify)
{
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
MetaIdleMonitorWatchXSync *watch_xsync;
MetaIdleMonitorWatch *watch;
watch_xsync = g_slice_new0 (MetaIdleMonitorWatchXSync);
watch = (MetaIdleMonitorWatch *) watch_xsync;
watch->monitor = monitor;
watch->id = get_next_watch_serial ();
watch->callback = callback;
watch->user_data = user_data;
watch->notify = notify;
watch->timeout_msec = timeout_msec;
if (monitor_xsync->user_active_alarm != None)
{
if (timeout_msec != 0)
{
watch_xsync->xalarm = _xsync_alarm_set (monitor_xsync, XSyncPositiveTransition, timeout_msec, TRUE);
g_hash_table_add (monitor_xsync->alarms, (gpointer) watch_xsync->xalarm);
if (meta_idle_monitor_get_idletime (monitor) > (gint64)timeout_msec)
{
watch->idle_source_id = g_idle_add (fire_watch_idle, watch);
g_source_set_name_by_id (watch->idle_source_id, "[mutter] fire_watch_idle");
}
}
else
{
watch_xsync->xalarm = monitor_xsync->user_active_alarm;
set_alarm_enabled (monitor_xsync->display, monitor_xsync->user_active_alarm, TRUE);
}
}
return watch;
}
static void
meta_idle_monitor_xsync_class_init (MetaIdleMonitorXSyncClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
MetaIdleMonitorClass *idle_monitor_class = META_IDLE_MONITOR_CLASS (klass);
object_class->dispose = meta_idle_monitor_xsync_dispose;
object_class->constructed = meta_idle_monitor_xsync_constructed;
idle_monitor_class->get_idletime = meta_idle_monitor_xsync_get_idletime;
idle_monitor_class->make_watch = meta_idle_monitor_xsync_make_watch;
}
static void
meta_idle_monitor_xsync_init (MetaIdleMonitorXSync *monitor_xsync)
{
MetaIdleMonitor *monitor = META_IDLE_MONITOR (monitor_xsync);
monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch);
monitor_xsync->alarms = g_hash_table_new (NULL, NULL);
}
static void
check_x11_watches (MetaIdleMonitor *monitor,
XSyncAlarm alarm)
{
GList *node, *watch_ids;
/* we get the keys and do explicit look ups in case
* an early iteration of the loop ends up leading
* to watches from later iterations getting invalidated
*/
watch_ids = g_hash_table_get_keys (monitor->watches);
for (node = watch_ids; node != NULL; node = node->next)
{
guint watch_id = GPOINTER_TO_UINT (node->data);
MetaIdleMonitorWatchXSync *watch;
watch = g_hash_table_lookup (monitor->watches, GUINT_TO_POINTER (watch_id));
if (watch && watch->xalarm == alarm)
_meta_idle_monitor_watch_fire ((MetaIdleMonitorWatch *) watch);
}
g_list_free (watch_ids);
}
void
meta_idle_monitor_xsync_handle_xevent (MetaIdleMonitor *monitor,
XSyncAlarmNotifyEvent *alarm_event)
{
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
XSyncAlarm alarm;
gboolean has_alarm;
if (alarm_event->state != XSyncAlarmActive)
return;
alarm = alarm_event->alarm;
has_alarm = FALSE;
if (alarm == monitor_xsync->user_active_alarm)
{
set_alarm_enabled (monitor_xsync->display,
alarm,
FALSE);
has_alarm = TRUE;
}
else if (g_hash_table_contains (monitor_xsync->alarms, (gpointer) alarm))
{
ensure_alarm_rescheduled (monitor_xsync->display,
alarm);
has_alarm = TRUE;
}
if (has_alarm)
check_x11_watches (monitor, alarm);
}

View File

@@ -1,47 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright 2013 Red Hat, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
*/
#ifndef META_IDLE_MONITOR_XSYNC_H
#define META_IDLE_MONITOR_XSYNC_H
#include <glib-object.h>
#include <meta/meta-idle-monitor.h>
#include <X11/Xlib.h>
#include <X11/extensions/sync.h>
#define META_TYPE_IDLE_MONITOR_XSYNC (meta_idle_monitor_xsync_get_type ())
#define META_IDLE_MONITOR_XSYNC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_IDLE_MONITOR_XSYNC, MetaIdleMonitorXSync))
#define META_IDLE_MONITOR_XSYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_IDLE_MONITOR_XSYNC, MetaIdleMonitorXSyncClass))
#define META_IS_IDLE_MONITOR_XSYNC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_IDLE_MONITOR_XSYNC))
#define META_IS_IDLE_MONITOR_XSYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_IDLE_MONITOR_XSYNC))
#define META_IDLE_MONITOR_XSYNC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_IDLE_MONITOR_XSYNC, MetaIdleMonitorXSyncClass))
typedef struct _MetaIdleMonitorXSync MetaIdleMonitorXSync;
typedef struct _MetaIdleMonitorXSyncClass MetaIdleMonitorXSyncClass;
GType meta_idle_monitor_xsync_get_type (void);
void meta_idle_monitor_xsync_handle_xevent (MetaIdleMonitor *monitor,
XSyncAlarmNotifyEvent *xevent);
#endif /* META_IDLE_MONITOR_XSYNC_H */

View File

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

View File

@@ -39,7 +39,7 @@
#include "meta-backend-x11.h"
#include <meta/main.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "backends/meta-crtc.h"
#include "backends/meta-monitor-config-manager.h"
#include "backends/meta-logical-monitor.h"
@@ -225,8 +225,10 @@ 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;
if (output->crtc != crtc)
assigned_crtc = meta_output_get_assigned_crtc (output);
if (assigned_crtc != crtc)
return TRUE;
}
@@ -243,6 +245,7 @@ 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;
@@ -265,8 +268,10 @@ is_output_assignment_changed (MetaOutput *output,
output_is_found = TRUE;
}
assigned_crtc = meta_output_get_assigned_crtc (output);
if (!output_is_found)
return output->crtc != NULL;
return assigned_crtc != NULL;
for (i = 0; i < n_crtc_infos; i++)
{
@@ -279,7 +284,7 @@ is_output_assignment_changed (MetaOutput *output,
((MetaOutput**) crtc_info->outputs->pdata)[j];
if (crtc_info_output == output &&
crtc_info->crtc == output->crtc)
crtc_info->crtc == assigned_crtc)
return FALSE;
}
}
@@ -455,7 +460,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
output->is_dirty = TRUE;
output->crtc = crtc;
meta_output_assign_crtc (output, crtc);
output_ids[j] = output->winsys_id;
}
@@ -521,7 +526,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
continue;
}
output->crtc = NULL;
meta_output_unassign_crtc (output);
output->is_primary = FALSE;
}

View File

@@ -97,10 +97,13 @@ 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 = output->crtc->current_mode->width * 0.05;
border_value = crtc->current_mode->width * 0.05;
xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
(XID) output->winsys_id,
@@ -109,7 +112,7 @@ output_set_underscanning_xrandr (MetaOutput *output,
1, &border_value);
prop = XInternAtom (xdisplay, "underscan vborder", False);
border_value = output->crtc->current_mode->height * 0.05;
border_value = crtc->current_mode->height * 0.05;
xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
(XID) output->winsys_id,
@@ -737,14 +740,14 @@ output_get_crtcs (MetaOutput *output,
}
output->n_possible_crtcs = n_actual_crtcs;
output->crtc = NULL;
meta_output_unassign_crtc (output);
for (l = meta_gpu_get_crtcs (gpu); l; l = l->next)
{
MetaCrtc *crtc = l->data;
if ((XID) crtc->crtc_id == xrandr_output->crtc)
{
output->crtc = crtc;
meta_output_assign_crtc (output, 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 = output->crtc;
MetaCrtc *crtc;
MetaRendererView *renderer_view = META_RENDERER_VIEW (data->view);
MetaMonitorTransform view_transform;
MetaMonitorTransform layout_transform = META_MONITOR_TRANSFORM_NORMAL;
@@ -129,6 +129,8 @@ 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,6 +26,8 @@
#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,24 +50,22 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
{
MetaMonitor *main_monitor;
MetaOutput *main_output;
MetaMonitorTransform crtc_transform;
MetaCrtc *crtc;
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
main_output = meta_monitor_get_main_output (main_monitor);
crtc_transform =
meta_monitor_logical_to_crtc_transform (main_monitor,
logical_monitor->transform);
crtc = meta_output_get_assigned_crtc (main_output);
/*
* 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,
main_output->crtc,
crtc_transform))
crtc,
crtc->transform))
return META_MONITOR_TRANSFORM_NORMAL;
else
return crtc_transform;
return crtc->transform;
}
static MetaRendererView *

View File

@@ -22,7 +22,6 @@ struct _MetaCompositor
gint64 server_time_offset;
guint server_time_is_monotonic_time : 1;
guint no_mipmaps : 1;
ClutterActor *stage, *window_group, *top_window_group, *feedback_group;
ClutterActor *background_actor;

View File

@@ -42,8 +42,8 @@
* There's two containers in the stage that are used to place window actors, here
* are listed in the order in which they are painted:
*
* - window group, accessible with meta_get_window_group_for_screen()
* - top window group, accessible with meta_get_top_window_group_for_screen()
* - window group, accessible with meta_get_window_group_for_display()
* - top window group, accessible with meta_get_top_window_group_for_display()
*
* Mutter will place actors representing windows in the window group, except for
* override-redirect windows (ie. popups and menus) which will be placed in the
@@ -55,8 +55,7 @@
#include <clutter/x11/clutter-x11.h>
#include "core.h"
#include <meta/screen.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include <meta/window.h>
#include "compositor-private.h"
#include <meta/compositor-mutter.h>
@@ -67,7 +66,7 @@
#include <meta/meta-background-group.h>
#include <meta/meta-shadow-factory.h>
#include "meta-window-actor-private.h"
#include "meta-window-group.h"
#include "meta-window-group-private.h"
#include "window-private.h" /* to check window->hidden */
#include "display-private.h" /* for meta_display_lookup_x_window() and meta_display_cancel_touch() */
#include "util-private.h"
@@ -80,6 +79,8 @@
#include "backends/x11/meta-backend-x11.h"
#include "clutter/clutter-mutter.h"
#include "x11/meta-x11-display-private.h"
#ifdef HAVE_WAYLAND
#include "wayland/meta-wayland-private.h"
#endif
@@ -149,78 +150,78 @@ process_damage (MetaCompositor *compositor,
/* compat helper */
static MetaCompositor *
get_compositor_for_screen (MetaScreen *screen)
get_compositor_for_display (MetaDisplay *display)
{
return screen->display->compositor;
return display->compositor;
}
/**
* meta_get_stage_for_screen:
* @screen: a #MetaScreen
* meta_get_stage_for_display:
* @display: a #MetaDisplay
*
* Returns: (transfer none): The #ClutterStage for the screen
* Returns: (transfer none): The #ClutterStage for the display
*/
ClutterActor *
meta_get_stage_for_screen (MetaScreen *screen)
meta_get_stage_for_display (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
return compositor->stage;
}
/**
* meta_get_window_group_for_screen:
* @screen: a #MetaScreen
* meta_get_window_group_for_display:
* @display: a #MetaDisplay
*
* Returns: (transfer none): The window group corresponding to @screen
* Returns: (transfer none): The window group corresponding to @display
*/
ClutterActor *
meta_get_window_group_for_screen (MetaScreen *screen)
meta_get_window_group_for_display (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
return compositor->window_group;
}
/**
* meta_get_top_window_group_for_screen:
* @screen: a #MetaScreen
* meta_get_top_window_group_for_display:
* @display: a #MetaDisplay
*
* Returns: (transfer none): The top window group corresponding to @screen
* Returns: (transfer none): The top window group corresponding to @display
*/
ClutterActor *
meta_get_top_window_group_for_screen (MetaScreen *screen)
meta_get_top_window_group_for_display (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
return compositor->top_window_group;
}
/**
* meta_get_feedback_group_for_screen:
* @screen: a #MetaScreen
* meta_get_feedback_group_for_display:
* @display: a #MetaDisplay
*
* Returns: (transfer none): The feedback group corresponding to @screen
* Returns: (transfer none): The feedback group corresponding to @display
*/
ClutterActor *
meta_get_feedback_group_for_screen (MetaScreen *screen)
meta_get_feedback_group_for_display (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
return compositor->feedback_group;
}
/**
* meta_get_window_actors:
* @screen: a #MetaScreen
* @display: a #MetaDisplay
*
* Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @screen
* Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @display
*/
GList *
meta_get_window_actors (MetaScreen *screen)
meta_get_window_actors (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
return compositor->windows;
}
void
meta_set_stage_input_region (MetaScreen *screen,
meta_set_stage_input_region (MetaDisplay *display,
XserverRegion region)
{
/* As a wayland compositor we can simply ignore all this trickery
@@ -230,9 +231,8 @@ meta_set_stage_input_region (MetaScreen *screen,
*/
if (!meta_is_wayland_compositor ())
{
MetaDisplay *display = screen->display;
MetaCompositor *compositor = display->compositor;
Display *xdpy = meta_display_get_xdisplay (display);
Display *xdpy = meta_x11_display_get_xdisplay (display->x11_display);
Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage));
XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);
@@ -247,7 +247,7 @@ meta_set_stage_input_region (MetaScreen *screen,
}
void
meta_empty_stage_input_region (MetaScreen *screen)
meta_empty_stage_input_region (MetaDisplay *display)
{
/* Using a static region here is a bit hacky, but Metacity never opens more than
* one XDisplay, so it works fine. */
@@ -255,22 +255,21 @@ meta_empty_stage_input_region (MetaScreen *screen)
if (region == None)
{
MetaDisplay *display = meta_screen_get_display (screen);
Display *xdpy = meta_display_get_xdisplay (display);
Display *xdpy = meta_x11_display_get_xdisplay (display->x11_display);
region = XFixesCreateRegion (xdpy, NULL, 0);
}
meta_set_stage_input_region (screen, region);
meta_set_stage_input_region (display, region);
}
void
meta_focus_stage_window (MetaScreen *screen,
guint32 timestamp)
meta_focus_stage_window (MetaDisplay *display,
guint32 timestamp)
{
ClutterStage *stage;
Window window;
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
if (!stage)
return;
@@ -279,14 +278,13 @@ meta_focus_stage_window (MetaScreen *screen,
if (window == None)
return;
meta_display_set_input_focus_xwindow (screen->display,
screen,
window,
timestamp);
meta_x11_display_set_input_focus_xwindow (display->x11_display,
window,
timestamp);
}
gboolean
meta_stage_is_focused (MetaScreen *screen)
meta_stage_is_focused (MetaDisplay *display)
{
ClutterStage *stage;
Window window;
@@ -294,7 +292,7 @@ meta_stage_is_focused (MetaScreen *screen)
if (meta_is_wayland_compositor ())
return TRUE;
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
if (!stage)
return FALSE;
@@ -303,7 +301,7 @@ meta_stage_is_focused (MetaScreen *screen)
if (window == None)
return FALSE;
return (screen->display->focus_xwindow == window);
return (display->x11_display->focus_xwindow == window);
}
static gboolean
@@ -364,11 +362,14 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor,
if (is_modal (display) || display->grab_op != META_GRAB_OP_NONE)
return FALSE;
/* XXX: why is this needed? */
XIUngrabDevice (display->xdisplay,
META_VIRTUAL_CORE_POINTER_ID,
timestamp);
XSync (display->xdisplay, False);
if (display->x11_display)
{
/* XXX: why is this needed? */
XIUngrabDevice (display->x11_display->xdisplay,
META_VIRTUAL_CORE_POINTER_ID,
timestamp);
XSync (display->x11_display->xdisplay, False);
}
if (!grab_devices (options, timestamp))
return FALSE;
@@ -380,7 +381,7 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor,
display->grab_have_keyboard = TRUE;
g_signal_emit_by_name (display, "grab-op-begin",
meta_plugin_get_screen (plugin),
meta_plugin_get_display (plugin),
display->grab_window, display->grab_op);
if (meta_is_wayland_compositor ())
@@ -407,7 +408,7 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
g_return_if_fail (is_modal (display));
g_signal_emit_by_name (display, "grab-op-end",
meta_plugin_get_screen (plugin),
meta_plugin_get_display (plugin),
display->grab_window, display->grab_op);
display->grab_op = META_GRAB_OP_NONE;
@@ -445,14 +446,13 @@ after_stage_paint (ClutterStage *stage,
}
static void
redirect_windows (MetaScreen *screen)
redirect_windows (MetaX11Display *x11_display)
{
MetaDisplay *display = meta_screen_get_display (screen);
Display *xdisplay = meta_display_get_xdisplay (display);
Window xroot = meta_screen_get_xroot (screen);
int screen_number = meta_screen_get_screen_number (screen);
guint n_retries;
guint max_retries;
Display *xdisplay = meta_x11_display_get_xdisplay (x11_display);
Window xroot = meta_x11_display_get_xroot (x11_display);
int screen_number = meta_x11_display_get_screen_number (x11_display);
guint n_retries;
guint max_retries;
if (meta_get_replace_current_wm ())
max_retries = 5;
@@ -467,11 +467,11 @@ redirect_windows (MetaScreen *screen)
*/
while (TRUE)
{
meta_error_trap_push (display);
meta_x11_error_trap_push (x11_display);
XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
XSync (xdisplay, FALSE);
if (!meta_error_trap_pop_with_return (display))
if (!meta_x11_error_trap_pop_with_return (x11_display))
break;
if (n_retries == max_retries)
@@ -479,7 +479,7 @@ redirect_windows (MetaScreen *screen)
/* This probably means that a non-WM compositor like xcompmgr is running;
* we have no way to get it to exit */
meta_fatal (_("Another compositing manager is already running on screen %i on display “%s”."),
screen_number, display->name);
screen_number, x11_display->name);
}
n_retries++;
@@ -491,11 +491,14 @@ void
meta_compositor_manage (MetaCompositor *compositor)
{
MetaDisplay *display = compositor->display;
Display *xdisplay = display->xdisplay;
MetaScreen *screen = display->screen;
Display *xdisplay = NULL;
MetaBackend *backend = meta_get_backend ();
meta_screen_set_cm_selection (display->screen);
if (display->x11_display)
{
xdisplay = display->x11_display->xdisplay;
meta_x11_display_set_cm_selection (display->x11_display);
}
compositor->stage = meta_backend_get_stage (backend);
@@ -516,9 +519,9 @@ meta_compositor_manage (MetaCompositor *compositor)
clutter_stage_set_sync_delay (CLUTTER_STAGE (compositor->stage), META_SYNC_DELAY);
compositor->window_group = meta_window_group_new (screen);
compositor->top_window_group = meta_window_group_new (screen);
compositor->feedback_group = meta_window_group_new (screen);
compositor->window_group = meta_window_group_new (display);
compositor->top_window_group = meta_window_group_new (display);
compositor->feedback_group = meta_window_group_new (display);
clutter_actor_add_child (compositor->stage, compositor->window_group);
clutter_actor_add_child (compositor->stage, compositor->top_window_group);
@@ -535,13 +538,13 @@ meta_compositor_manage (MetaCompositor *compositor)
{
Window xwin;
compositor->output = screen->composite_overlay_window;
compositor->output = display->x11_display->composite_overlay_window;
xwin = meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend));
XReparentWindow (xdisplay, xwin, compositor->output, 0, 0);
meta_empty_stage_input_region (screen);
meta_empty_stage_input_region (display);
/* Make sure there isn't any left-over output shape on the
* overlay window by setting the whole screen to be an
@@ -561,7 +564,8 @@ meta_compositor_manage (MetaCompositor *compositor)
compositor->have_x11_sync_object = meta_sync_ring_init (xdisplay);
}
redirect_windows (display->screen);
if (display->x11_display)
redirect_windows (display->x11_display);
compositor->plugin_mgr = meta_plugin_manager_new (compositor);
}
@@ -571,9 +575,9 @@ meta_compositor_unmanage (MetaCompositor *compositor)
{
if (!meta_is_wayland_compositor ())
{
MetaDisplay *display = compositor->display;
Display *xdisplay = meta_display_get_xdisplay (display);
Window xroot = display->screen->xroot;
MetaX11Display *display = compositor->display->x11_display;
Display *xdisplay = display->xdisplay;
Window xroot = display->xroot;
/* This is the most important part of cleanup - we have to do this
* before giving up the window manager selection or the next
@@ -598,7 +602,7 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
MetaWindow *window)
{
MetaDisplay *display = compositor->display;
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
if (window == NULL)
XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0, 0, None);
@@ -616,7 +620,7 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
window_bounds.width = rect.width;
window_bounds.height = rect.height;
meta_screen_get_size (display->screen, &width, &height);
meta_display_get_size (display, &width, &height);
screen_rect.x = 0;
screen_rect.y = 0;
screen_rect.width = width;
@@ -659,12 +663,12 @@ meta_compositor_add_window (MetaCompositor *compositor,
{
MetaDisplay *display = compositor->display;
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
meta_window_actor_new (window);
sync_actor_stacking (compositor);
meta_error_trap_pop (display);
meta_x11_error_trap_pop (display->x11_display);
}
void
@@ -744,8 +748,10 @@ meta_compositor_process_event (MetaCompositor *compositor,
XEvent *event,
MetaWindow *window)
{
MetaX11Display *x11_display = compositor->display->x11_display;
if (!meta_is_wayland_compositor () &&
event->type == meta_display_get_damage_event_base (compositor->display) + XDamageNotify)
event->type == meta_x11_display_get_damage_event_base (x11_display) + XDamageNotify)
{
/* Core code doesn't handle damage events, so we need to extract the MetaWindow
* ourselves
@@ -753,7 +759,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
if (window == NULL)
{
Window xwin = ((XDamageNotifyEvent *) event)->drawable;
window = meta_display_lookup_x_window (compositor->display, xwin);
window = meta_x11_display_lookup_x_window (x11_display, xwin);
}
if (window)
@@ -943,11 +949,13 @@ get_top_visible_window_actor (MetaCompositor *compositor)
MetaWindowActor *window_actor = l->data;
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
MetaRectangle buffer_rect;
MetaRectangle display_rect = { 0 };
meta_window_get_buffer_rect (window, &buffer_rect);
meta_display_get_size (compositor->display,
&display_rect.width, &display_rect.height);
if (meta_rectangle_overlap (&compositor->display->screen->rect,
&buffer_rect))
if (meta_rectangle_overlap (&display_rect, &buffer_rect))
return window_actor;
}
@@ -961,7 +969,7 @@ on_top_window_actor_destroyed (MetaWindowActor *window_actor,
compositor->top_window_actor = NULL;
compositor->windows = g_list_remove (compositor->windows, window_actor);
meta_stack_tracker_queue_sync_stack (compositor->display->screen->stack_tracker);
meta_stack_tracker_queue_sync_stack (compositor->display->stack_tracker);
}
void
@@ -1169,7 +1177,7 @@ meta_pre_paint_func (gpointer data)
if (compositor->have_x11_sync_object)
compositor->have_x11_sync_object = meta_sync_ring_insert_wait ();
else
XSync (compositor->display->xdisplay, False);
XSync (compositor->display->x11_display->xdisplay, False);
}
return TRUE;
@@ -1241,9 +1249,6 @@ meta_compositor_new (MetaDisplay *display)
compositor->display = display;
compositor->context = clutter_backend->cogl_context;
if (g_getenv("META_DISABLE_MIPMAPS"))
compositor->no_mipmaps = TRUE;
g_signal_connect (meta_shadow_factory_get_default (),
"changed",
G_CALLBACK (on_shadow_factory_changed),
@@ -1264,44 +1269,44 @@ meta_compositor_new (MetaDisplay *display)
/**
* meta_get_overlay_window: (skip)
* @screen: a #MetaScreen
* @display: a #MetaDisplay
*
*/
Window
meta_get_overlay_window (MetaScreen *screen)
meta_get_overlay_window (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
return compositor->output;
}
/**
* meta_disable_unredirect_for_screen:
* @screen: a #MetaScreen
* meta_disable_unredirect_for_display:
* @display: a #MetaDisplay
*
* Disables unredirection, can be usefull in situations where having
* unredirected windows is undesireable like when recording a video.
*
*/
void
meta_disable_unredirect_for_screen (MetaScreen *screen)
meta_disable_unredirect_for_display (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
compositor->disable_unredirect_count++;
}
/**
* meta_enable_unredirect_for_screen:
* @screen: a #MetaScreen
* meta_enable_unredirect_for_display:
* @display: a #MetaDisplay
*
* Enables unredirection which reduces the overhead for apps like games.
*
*/
void
meta_enable_unredirect_for_screen (MetaScreen *screen)
meta_enable_unredirect_for_display (MetaDisplay *display)
{
MetaCompositor *compositor = get_compositor_for_screen (screen);
MetaCompositor *compositor = get_compositor_for_display (display);
if (compositor->disable_unredirect_count == 0)
g_warning ("Called enable_unredirect_for_screen while unredirection is enabled.");
g_warning ("Called enable_unredirect_for_display while unredirection is enabled.");
if (compositor->disable_unredirect_count > 0)
compositor->disable_unredirect_count--;
}
@@ -1318,15 +1323,15 @@ flash_out_completed (ClutterTimeline *timeline,
}
void
meta_compositor_flash_screen (MetaCompositor *compositor,
MetaScreen *screen)
meta_compositor_flash_display (MetaCompositor *compositor,
MetaDisplay *display)
{
ClutterActor *stage;
ClutterActor *flash;
ClutterTransition *transition;
gfloat width, height;
stage = meta_get_stage_for_screen (screen);
stage = meta_get_stage_for_display (display);
clutter_actor_get_size (stage, &width, &height);
flash = clutter_actor_new ();

View File

@@ -3,7 +3,6 @@
#ifndef META_BACKGROUND_ACTOR_PRIVATE_H
#define META_BACKGROUND_ACTOR_PRIVATE_H
#include <meta/screen.h>
#include <meta/meta-background-actor.h>
cairo_region_t *meta_background_actor_get_clip_region (MetaBackgroundActor *self);

View File

@@ -78,14 +78,15 @@
#include "cogl-utils.h"
#include "clutter-utils.h"
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "meta-background-actor-private.h"
#include "meta-background-private.h"
#include "meta-cullable.h"
#include "meta/display.h"
enum
{
PROP_META_SCREEN = 1,
PROP_META_DISPLAY = 1,
PROP_MONITOR,
PROP_BACKGROUND,
PROP_GRADIENT,
@@ -150,7 +151,7 @@ typedef enum {
struct _MetaBackgroundActorPrivate
{
MetaScreen *screen;
MetaDisplay *display;
int monitor;
MetaBackground *background;
@@ -213,7 +214,9 @@ get_preferred_size (MetaBackgroundActor *self,
MetaBackgroundActorPrivate *priv = META_BACKGROUND_ACTOR (self)->priv;
MetaRectangle monitor_geometry;
meta_screen_get_monitor_geometry (priv->screen, priv->monitor, &monitor_geometry);
meta_display_get_monitor_geometry (priv->display,
priv->monitor,
&monitor_geometry);
if (width != NULL)
*width = monitor_geometry.width;
@@ -381,7 +384,8 @@ setup_pipeline (MetaBackgroundActor *self,
MetaRectangle monitor_geometry;
float gradient_height_perc;
meta_screen_get_monitor_geometry (priv->screen, priv->monitor, &monitor_geometry);
meta_display_get_monitor_geometry (priv->display,
priv->monitor, &monitor_geometry);
gradient_height_perc = MAX (0.0001, priv->gradient_height / (float)monitor_geometry.height);
cogl_pipeline_set_uniform_1f (priv->pipeline,
cogl_pipeline_get_uniform_location (priv->pipeline,
@@ -548,8 +552,8 @@ meta_background_actor_set_property (GObject *object,
switch (prop_id)
{
case PROP_META_SCREEN:
priv->screen = g_value_get_object (value);
case PROP_META_DISPLAY:
priv->display = g_value_get_object (value);
break;
case PROP_MONITOR:
meta_background_actor_set_monitor (self, g_value_get_int (value));
@@ -609,8 +613,8 @@ meta_background_actor_get_property (GObject *object,
switch (prop_id)
{
case PROP_META_SCREEN:
g_value_set_object (value, priv->screen);
case PROP_META_DISPLAY:
g_value_set_object (value, priv->display);
break;
case PROP_MONITOR:
g_value_set_int (value, priv->monitor);
@@ -660,14 +664,14 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
actor_class->get_paint_volume = meta_background_actor_get_paint_volume;
actor_class->paint = meta_background_actor_paint;
param_spec = g_param_spec_object ("meta-screen",
"MetaScreen",
"MetaScreen",
META_TYPE_SCREEN,
param_spec = g_param_spec_object ("meta-display",
"MetaDisplay",
"MetaDisplay",
META_TYPE_DISPLAY,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (object_class,
PROP_META_SCREEN,
PROP_META_DISPLAY,
param_spec);
param_spec = g_param_spec_int ("monitor",
@@ -778,13 +782,13 @@ meta_background_actor_init (MetaBackgroundActor *self)
* Return value: the newly created background actor
*/
ClutterActor *
meta_background_actor_new (MetaScreen *screen,
int monitor)
meta_background_actor_new (MetaDisplay *display,
int monitor)
{
MetaBackgroundActor *self;
self = g_object_new (META_TYPE_BACKGROUND_ACTOR,
"meta-screen", screen,
"meta-display", display,
"monitor", monitor,
NULL);
@@ -923,12 +927,13 @@ meta_background_actor_set_monitor (MetaBackgroundActor *self,
MetaBackgroundActorPrivate *priv = self->priv;
MetaRectangle old_monitor_geometry;
MetaRectangle new_monitor_geometry;
MetaDisplay *display = priv->display;
if(priv->monitor == monitor)
return;
meta_screen_get_monitor_geometry (priv->screen, priv->monitor, &old_monitor_geometry);
meta_screen_get_monitor_geometry (priv->screen, monitor, &new_monitor_geometry);
meta_display_get_monitor_geometry (display, priv->monitor, &old_monitor_geometry);
meta_display_get_monitor_geometry (display, monitor, &new_monitor_geometry);
if(old_monitor_geometry.height != new_monitor_geometry.height)
invalidate_pipeline (self, CHANGED_GRADIENT_PARAMETERS);

View File

@@ -17,9 +17,11 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <meta/display.h>
#include <meta/util.h>
#include <meta/meta-background.h>
#include <meta/meta-background-image.h>
#include <meta/meta-monitor-manager.h>
#include "meta-background-private.h"
#include "cogl-utils.h"
@@ -44,7 +46,7 @@ struct _MetaBackgroundMonitor
struct _MetaBackgroundPrivate
{
MetaScreen *screen;
MetaDisplay *display;
MetaBackgroundMonitor *monitors;
int n_monitors;
@@ -68,7 +70,7 @@ struct _MetaBackgroundPrivate
enum
{
PROP_META_SCREEN = 1,
PROP_META_DISPLAY = 1,
PROP_MONITOR,
};
@@ -128,8 +130,7 @@ free_wallpaper_texture (MetaBackground *self)
}
static void
on_monitors_changed (MetaScreen *screen,
MetaBackground *self)
invalidate_monitor_backgrounds (MetaBackground *self)
{
MetaBackgroundPrivate *priv = self->priv;
@@ -138,11 +139,11 @@ on_monitors_changed (MetaScreen *screen,
priv->monitors = NULL;
priv->n_monitors = 0;
if (priv->screen)
if (priv->display)
{
int i;
priv->n_monitors = meta_screen_get_n_monitors (screen);
priv->n_monitors = meta_display_get_n_monitors (priv->display);
priv->monitors = g_new0 (MetaBackgroundMonitor, priv->n_monitors);
for (i = 0; i < priv->n_monitors; i++)
@@ -151,27 +152,20 @@ on_monitors_changed (MetaScreen *screen,
}
static void
set_screen (MetaBackground *self,
MetaScreen *screen)
on_monitors_changed (MetaBackground *self)
{
invalidate_monitor_backgrounds (self);
}
static void
set_display (MetaBackground *self,
MetaDisplay *display)
{
MetaBackgroundPrivate *priv = self->priv;
if (priv->screen != NULL)
{
g_signal_handlers_disconnect_by_func (priv->screen,
(gpointer)on_monitors_changed,
self);
}
g_set_object (&priv->display, display);
g_set_object (&priv->screen, screen);
if (priv->screen != NULL)
{
g_signal_connect (priv->screen, "monitors-changed",
G_CALLBACK (on_monitors_changed), self);
}
on_monitors_changed (priv->screen, self);
invalidate_monitor_backgrounds (self);
}
static void
@@ -182,8 +176,8 @@ meta_background_set_property (GObject *object,
{
switch (prop_id)
{
case PROP_META_SCREEN:
set_screen (META_BACKGROUND (object), g_value_get_object (value));
case PROP_META_DISPLAY:
set_display (META_BACKGROUND (object), g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -201,8 +195,8 @@ meta_background_get_property (GObject *object,
switch (prop_id)
{
case PROP_META_SCREEN:
g_value_set_object (value, priv->screen);
case PROP_META_DISPLAY:
g_value_set_object (value, priv->display);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -304,7 +298,7 @@ meta_background_dispose (GObject *object)
set_file (self, &priv->file1, &priv->background_image1, NULL);
set_file (self, &priv->file2, &priv->background_image2, NULL);
set_screen (self, NULL);
set_display (self, NULL);
G_OBJECT_CLASS (meta_background_parent_class)->dispose (object);
}
@@ -322,11 +316,16 @@ meta_background_constructed (GObject *object)
{
MetaBackground *self = META_BACKGROUND (object);
MetaBackgroundPrivate *priv = self->priv;
MetaMonitorManager *monitor_manager = meta_monitor_manager_get ();
G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
g_signal_connect_object (meta_screen_get_display (priv->screen), "gl-video-memory-purged",
g_signal_connect_object (priv->display, "gl-video-memory-purged",
G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
g_signal_connect_object (monitor_manager, "monitors-changed",
G_CALLBACK (on_monitors_changed), self,
G_CONNECT_SWAPPED);
}
static void
@@ -351,14 +350,14 @@ meta_background_class_init (MetaBackgroundClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
param_spec = g_param_spec_object ("meta-screen",
"MetaScreen",
"MetaScreen",
META_TYPE_SCREEN,
param_spec = g_param_spec_object ("meta-display",
"MetaDisplay",
"MetaDisplay",
META_TYPE_DISPLAY,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
g_object_class_install_property (object_class,
PROP_META_SCREEN,
PROP_META_DISPLAY,
param_spec);
}
@@ -407,7 +406,7 @@ get_texture_area (MetaBackground *self,
set_texture_area_from_monitor_area (monitor_rect, texture_area);
break;
case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
meta_screen_get_size (priv->screen, &screen_width, &screen_height);
meta_display_get_size (priv->display, &screen_width, &screen_height);
/* Start off by centering a tile in the middle of the
* total screen area.
@@ -476,7 +475,7 @@ get_texture_area (MetaBackground *self,
/* paint region is the union of all monitors, with the origin
* of the region set to align with monitor associated with the background.
*/
meta_screen_get_size (priv->screen, &screen_width, &screen_height);
meta_display_get_size (priv->display, &screen_width, &screen_height);
/* unclipped texture area is whole screen */
image_area.width = screen_width;
@@ -750,7 +749,7 @@ meta_background_get_texture (MetaBackground *self,
monitor = &priv->monitors[monitor_index];
meta_screen_get_monitor_geometry (priv->screen, monitor_index, &geometry);
meta_display_get_monitor_geometry (priv->display, monitor_index, &geometry);
monitor_area.x = geometry.x;
monitor_area.y = geometry.y;
monitor_area.width = geometry.width;
@@ -879,10 +878,10 @@ meta_background_get_texture (MetaBackground *self,
}
MetaBackground *
meta_background_new (MetaScreen *screen)
meta_background_new (MetaDisplay *display)
{
return g_object_new (META_TYPE_BACKGROUND,
"meta-screen", screen,
"meta-display", display,
NULL);
}

View File

@@ -27,6 +27,7 @@
#include "core/display-private.h"
#include "backends/meta-dnd-private.h"
#include "meta/meta-dnd.h"
#include "x11/meta-x11-display-private.h"
struct _MetaDndClass
{
@@ -139,7 +140,7 @@ meta_dnd_notify_dnd_leave (MetaDnd *dnd)
gboolean
meta_dnd_handle_xdnd_event (MetaBackend *backend,
MetaCompositor *compositor,
MetaDisplay *display,
Display *xdisplay,
XEvent *xev)
{
MetaDnd *dnd = meta_backend_get_dnd (backend);
@@ -152,23 +153,23 @@ meta_dnd_handle_xdnd_event (MetaBackend *backend,
xev->xany.window != clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage)))
return FALSE;
if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndPosition"))
if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndPosition", TRUE))
{
XEvent xevent;
Window src = xev->xclient.data.l[0];
memset (&xevent, 0, sizeof(xevent));
xevent.xany.type = ClientMessage;
xevent.xany.display = display->xdisplay;
xevent.xany.display = xdisplay;
xevent.xclient.window = src;
xevent.xclient.message_type = gdk_x11_get_xatom_by_name ("XdndStatus");
xevent.xclient.message_type = XInternAtom (xdisplay, "XdndStatus", TRUE);
xevent.xclient.format = 32;
xevent.xclient.data.l[0] = output_window;
/* flags: bit 0: will we accept the drop? bit 1: do we want more position messages */
xevent.xclient.data.l[1] = 2;
xevent.xclient.data.l[4] = None;
XSendEvent (display->xdisplay, src, False, 0, &xevent);
XSendEvent (xdisplay, src, False, 0, &xevent);
meta_dnd_notify_dnd_position_change (dnd,
(int)(xev->xclient.data.l[2] >> 16),
@@ -176,13 +177,13 @@ meta_dnd_handle_xdnd_event (MetaBackend *backend,
return TRUE;
}
else if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndLeave"))
else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndLeave", TRUE))
{
meta_dnd_notify_dnd_leave (dnd);
return TRUE;
}
else if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndEnter"))
else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndEnter", TRUE))
{
meta_dnd_notify_dnd_enter (dnd);

View File

@@ -23,7 +23,7 @@
#include "compositor-private.h"
#include "meta-plugin-manager.h"
#include <meta/prefs.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include <meta/workspace.h>
#include "meta-module.h"
#include "window-private.h"

View File

@@ -23,7 +23,6 @@
#define META_PLUGIN_MANAGER_H_
#include <meta/types.h>
#include <meta/screen.h>
#include <meta/meta-plugin.h>
typedef enum {

View File

@@ -28,7 +28,6 @@
#include <meta/meta-plugin.h>
#include "meta-plugin-manager.h"
#include <meta/screen.h>
#include <meta/display.h>
#include <meta/util.h>
@@ -191,19 +190,19 @@ meta_plugin_end_modal (MetaPlugin *plugin,
}
/**
* meta_plugin_get_screen:
* meta_plugin_get_display:
* @plugin: a #MetaPlugin
*
* Gets the #MetaScreen corresponding to a plugin.
* Gets the #MetaDisplay corresponding to a plugin.
*
* Return value: (transfer none): the #MetaScreen for the plugin
* Return value: (transfer none): the #MetaDisplay for the plugin
*/
MetaScreen *
meta_plugin_get_screen (MetaPlugin *plugin)
MetaDisplay *
meta_plugin_get_display (MetaPlugin *plugin)
{
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
return priv->compositor->display->screen;
return priv->compositor->display;
}
void

View File

@@ -38,6 +38,20 @@
#include "meta-cullable.h"
/* MAX_MIPMAPPING_FPS needs to be as small as possible for the best GPU
* performance, but higher than the refresh rate of commonly slow updating
* windows like top or a blinking cursor, so that such windows do get
* mipmapped.
*/
#define MAX_MIPMAPPING_FPS 5
#define MIN_MIPMAP_AGE_USEC (G_USEC_PER_SEC / MAX_MIPMAPPING_FPS)
/* MIN_FAST_UPDATES_BEFORE_UNMIPMAP allows windows to update themselves
* occasionally without causing mipmapping to be disabled, so long as such
* an update takes fewer update_area calls than:
*/
#define MIN_FAST_UPDATES_BEFORE_UNMIPMAP 20
static void meta_shaped_texture_dispose (GObject *object);
static void meta_shaped_texture_paint (ClutterActor *actor);
@@ -95,6 +109,11 @@ struct _MetaShapedTexturePrivate
guint tex_width, tex_height;
guint fallback_width, fallback_height;
gint64 prev_invalidation, last_invalidation;
guint fast_updates;
guint remipmap_timeout_id;
gint64 earliest_remipmap;
guint create_mipmaps : 1;
};
@@ -191,6 +210,12 @@ meta_shaped_texture_dispose (GObject *object)
MetaShapedTexture *self = (MetaShapedTexture *) object;
MetaShapedTexturePrivate *priv = self->priv;
if (priv->remipmap_timeout_id)
{
g_source_remove (priv->remipmap_timeout_id);
priv->remipmap_timeout_id = 0;
}
if (priv->paint_tower)
meta_texture_tower_free (priv->paint_tower);
priv->paint_tower = NULL;
@@ -372,6 +397,21 @@ set_cogl_texture (MetaShapedTexture *stex,
meta_texture_tower_set_base_texture (priv->paint_tower, cogl_tex);
}
static gboolean
texture_is_idle_and_not_mipmapped (gpointer user_data)
{
MetaShapedTexture *stex = META_SHAPED_TEXTURE (user_data);
MetaShapedTexturePrivate *priv = stex->priv;
if ((g_get_monotonic_time () - priv->earliest_remipmap) < 0)
return G_SOURCE_CONTINUE;
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
priv->remipmap_timeout_id = 0;
return G_SOURCE_REMOVE;
}
static void
meta_shaped_texture_paint (ClutterActor *actor)
{
@@ -381,9 +421,10 @@ meta_shaped_texture_paint (ClutterActor *actor)
guchar opacity;
CoglContext *ctx;
CoglFramebuffer *fb;
CoglTexture *paint_tex;
CoglTexture *paint_tex = NULL;
ClutterActorBox alloc;
CoglPipelineFilter filter;
gint64 now = g_get_monotonic_time ();
if (priv->clip_region && cairo_region_is_empty (priv->clip_region))
return;
@@ -406,13 +447,34 @@ meta_shaped_texture_paint (ClutterActor *actor)
* Setting the texture quality to high without SGIS_generate_mipmap
* support for TFP textures will result in fallbacks to XGetImage.
*/
if (priv->create_mipmaps)
paint_tex = meta_texture_tower_get_paint_texture (priv->paint_tower);
else
paint_tex = COGL_TEXTURE (priv->texture);
if (priv->create_mipmaps && priv->last_invalidation)
{
gint64 age = now - priv->last_invalidation;
if (age >= MIN_MIPMAP_AGE_USEC ||
priv->fast_updates < MIN_FAST_UPDATES_BEFORE_UNMIPMAP)
paint_tex = meta_texture_tower_get_paint_texture (priv->paint_tower);
}
if (paint_tex == NULL)
return;
{
paint_tex = COGL_TEXTURE (priv->texture);
if (paint_tex == NULL)
return;
if (priv->create_mipmaps)
{
/* Minus 1000 to ensure we don't fail the age test in timeout */
priv->earliest_remipmap = now + MIN_MIPMAP_AGE_USEC - 1000;
if (!priv->remipmap_timeout_id)
priv->remipmap_timeout_id =
g_timeout_add (MIN_MIPMAP_AGE_USEC / 1000,
texture_is_idle_and_not_mipmapped,
stex);
}
}
tex_width = priv->tex_width;
tex_height = priv->tex_height;
@@ -632,46 +694,11 @@ effective_unobscured_region (MetaShapedTexture *self)
return priv->unobscured_region;
}
static gboolean
get_unobscured_bounds (MetaShapedTexture *self,
cairo_rectangle_int_t *unobscured_bounds)
{
cairo_region_t *unobscured_region = effective_unobscured_region (self);
if (unobscured_region)
{
cairo_region_get_extents (unobscured_region, unobscured_bounds);
return TRUE;
}
else
return FALSE;
}
static gboolean
meta_shaped_texture_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume)
{
MetaShapedTexture *self = META_SHAPED_TEXTURE (actor);
ClutterActorBox box;
cairo_rectangle_int_t unobscured_bounds;
if (!clutter_actor_has_allocation (actor))
return FALSE;
clutter_actor_get_allocation_box (actor, &box);
if (get_unobscured_bounds (self, &unobscured_bounds))
{
box.x1 = MAX (unobscured_bounds.x, box.x1);
box.x2 = MIN (unobscured_bounds.x + unobscured_bounds.width, box.x2);
box.y1 = MAX (unobscured_bounds.y, box.y1);
box.y2 = MIN (unobscured_bounds.y + unobscured_bounds.height, box.y2);
}
box.x2 = MAX (box.x2, box.x1);
box.y2 = MAX (box.y2, box.y1);
clutter_paint_volume_union_box (volume, &box);
return TRUE;
return clutter_paint_volume_set_from_allocation (volume, actor);
}
void
@@ -758,6 +785,20 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
meta_texture_tower_update_area (priv->paint_tower, x, y, width, height);
priv->prev_invalidation = priv->last_invalidation;
priv->last_invalidation = g_get_monotonic_time ();
if (priv->prev_invalidation)
{
gint64 interval = priv->last_invalidation - priv->prev_invalidation;
gboolean fast_update = interval < MIN_MIPMAP_AGE_USEC;
if (!fast_update)
priv->fast_updates = 0;
else if (priv->fast_updates < MIN_FAST_UPDATES_BEFORE_UNMIPMAP)
priv->fast_updates++;
}
unobscured_region = effective_unobscured_region (stex);
if (unobscured_region)
{

View File

@@ -30,11 +30,12 @@
#include <X11/extensions/Xcomposite.h>
#include <cogl/winsys/cogl-texture-pixmap-x11.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "window-private.h"
#include "meta-shaped-texture-private.h"
#include "meta-cullable.h"
#include "x11/window-x11.h"
#include "x11/meta-x11-display-private.h"
struct _MetaSurfaceActorX11Private
{
@@ -68,15 +69,15 @@ free_damage (MetaSurfaceActorX11 *self)
{
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
MetaDisplay *display = priv->display;
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
if (priv->damage == None)
return;
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
XDamageDestroy (xdisplay, priv->damage);
priv->damage = None;
meta_error_trap_pop (display);
meta_x11_error_trap_pop (display->x11_display);
}
static void
@@ -84,7 +85,7 @@ detach_pixmap (MetaSurfaceActorX11 *self)
{
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
MetaDisplay *display = priv->display;
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
if (priv->pixmap == None)
@@ -97,10 +98,10 @@ detach_pixmap (MetaSurfaceActorX11 *self)
meta_shaped_texture_set_texture (stex, NULL);
cogl_flush ();
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
XFreePixmap (xdisplay, priv->pixmap);
priv->pixmap = None;
meta_error_trap_pop (display);
meta_x11_error_trap_pop (display->x11_display);
g_clear_pointer (&priv->texture, cogl_object_unref);
}
@@ -138,7 +139,7 @@ update_pixmap (MetaSurfaceActorX11 *self)
{
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
MetaDisplay *display = priv->display;
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
if (priv->size_changed)
{
@@ -151,10 +152,10 @@ update_pixmap (MetaSurfaceActorX11 *self)
Pixmap new_pixmap;
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow);
if (meta_error_trap_pop_with_return (display) != Success)
if (meta_x11_error_trap_pop_with_return (display->x11_display) != Success)
{
/* Probably a BadMatch if the window isn't viewable; we could
* GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync
@@ -223,13 +224,13 @@ meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor)
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
MetaDisplay *display = priv->display;
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
if (priv->received_damage)
{
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
XDamageSubtract (xdisplay, priv->damage, None, None);
meta_error_trap_pop (display);
meta_x11_error_trap_pop (display->x11_display);
priv->received_damage = FALSE;
}
@@ -311,10 +312,10 @@ sync_unredirected (MetaSurfaceActorX11 *self)
{
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
MetaDisplay *display = priv->display;
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
if (priv->unredirected)
{
@@ -326,7 +327,7 @@ sync_unredirected (MetaSurfaceActorX11 *self)
XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual);
}
meta_error_trap_pop (display);
meta_x11_error_trap_pop (display->x11_display);
}
static void
@@ -403,7 +404,7 @@ static void
create_damage (MetaSurfaceActorX11 *self)
{
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
Display *xdisplay = meta_display_get_xdisplay (priv->display);
Display *xdisplay = meta_x11_display_get_xdisplay (priv->display->x11_display);
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);

View File

@@ -101,6 +101,13 @@ meta_surface_actor_pick (ClutterActor *actor,
clutter_actor_paint (child);
}
static gboolean
meta_surface_actor_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume)
{
return clutter_paint_volume_set_from_allocation (volume, actor);
}
static void
meta_surface_actor_dispose (GObject *object)
{
@@ -120,6 +127,7 @@ meta_surface_actor_class_init (MetaSurfaceActorClass *klass)
object_class->dispose = meta_surface_actor_dispose;
actor_class->pick = meta_surface_actor_pick;
actor_class->get_paint_volume = meta_surface_actor_get_paint_volume;
signals[REPAINT_SCHEDULED] = g_signal_new ("repaint-scheduled",
G_TYPE_FROM_CLASS (object_class),

View File

@@ -58,5 +58,6 @@ void meta_window_actor_effect_completed (MetaWindowActor *actor,
MetaSurfaceActor *meta_window_actor_get_surface (MetaWindowActor *self);
void meta_window_actor_update_surface (MetaWindowActor *self);
MetaWindowActor *meta_window_actor_from_window (MetaWindow *window);
#endif /* META_WINDOW_ACTOR_PRIVATE_H */

View File

@@ -16,7 +16,7 @@
#include <string.h>
#include <meta/display.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "frame.h"
#include <meta/window.h>
#include <meta/meta-shaped-texture.h>
@@ -37,6 +37,8 @@
#include "meta-surface-actor.h"
#include "meta-surface-actor-x11.h"
#include "x11/meta-x11-display-private.h"
#ifdef HAVE_WAYLAND
#include "meta-surface-actor-wayland.h"
#include "wayland/meta-wayland-surface.h"
@@ -142,6 +144,8 @@ struct _FrameData
enum
{
FIRST_FRAME,
EFFECTS_COMPLETED,
LAST_SIGNAL
};
@@ -238,6 +242,21 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
NULL, NULL, NULL,
G_TYPE_NONE, 0);
/**
* MetaWindowActor::effects-completed:
* @actor: the #MetaWindowActor instance
*
* The ::effects-completed signal will be emitted once all pending compositor
* effects are completed.
*/
signals[EFFECTS_COMPLETED] =
g_signal_new ("effects-completed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
pspec = g_param_spec_object ("meta-window",
"MetaWindow",
"The displayed MetaWindow",
@@ -433,7 +452,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 ())
@@ -1131,6 +1150,7 @@ meta_window_actor_after_effects (MetaWindowActor *self)
return;
}
g_signal_emit (self, signals[EFFECTS_COMPLETED], 0);
meta_window_actor_sync_visibility (self);
meta_window_actor_sync_actor_geometry (self, FALSE);
}
@@ -1953,7 +1973,7 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
{
MetaWindowActorPrivate *priv = self->priv;
MetaDisplay *display = meta_window_get_display (priv->window);
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
XClientMessageEvent ev = { 0, };
@@ -1963,17 +1983,17 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
ev.type = ClientMessage;
ev.window = meta_window_get_xwindow (priv->window);
ev.message_type = display->atom__NET_WM_FRAME_DRAWN;
ev.message_type = display->x11_display->atom__NET_WM_FRAME_DRAWN;
ev.format = 32;
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
ev.data.l[1] = frame->sync_request_serial >> 32;
ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff);
ev.data.l[3] = frame->frame_drawn_time >> 32;
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
XFlush (xdisplay);
meta_error_trap_pop (display);
meta_x11_error_trap_pop (display->x11_display);
}
void
@@ -2021,13 +2041,13 @@ do_send_frame_timings (MetaWindowActor *self,
{
MetaWindowActorPrivate *priv = self->priv;
MetaDisplay *display = meta_window_get_display (priv->window);
Display *xdisplay = meta_display_get_xdisplay (display);
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
XClientMessageEvent ev = { 0, };
ev.type = ClientMessage;
ev.window = meta_window_get_xwindow (priv->window);
ev.message_type = display->atom__NET_WM_FRAME_TIMINGS;
ev.message_type = display->x11_display->atom__NET_WM_FRAME_TIMINGS;
ev.format = 32;
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
ev.data.l[1] = frame->sync_request_serial >> 32;
@@ -2047,10 +2067,10 @@ do_send_frame_timings (MetaWindowActor *self,
ev.data.l[3] = refresh_interval;
ev.data.l[4] = 1000 * META_SYNC_DELAY;
meta_error_trap_push (display);
meta_x11_error_trap_push (display->x11_display);
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
XFlush (xdisplay);
meta_error_trap_pop (display);
meta_x11_error_trap_pop (display->x11_display);
}
static void
@@ -2157,3 +2177,9 @@ meta_window_actor_sync_updates_frozen (MetaWindowActor *self)
meta_window_actor_set_updates_frozen (self, meta_window_updates_are_frozen (window));
}
MetaWindowActor *
meta_window_actor_from_window (MetaWindow *window)
{
return META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
}

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