Compare commits

...

127 Commits

Author SHA1 Message Date
90a68f3118 Bump version to 3.29.3
Update NEWS.
2018-07-09 18:37:32 +02:00
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
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
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
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
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
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
1caaf0cd1e display: Export meta_display_close()
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
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
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
e05cd6009a Add MetaWorkspaceManager skeleton
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
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
2ac7afe8a9 remote-desktop: Remove unnecessary include
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:17 +02:00
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
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
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
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
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
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
e6b885210c Make stack tracker work without X11
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
9f1ab1c3af Move workarea hint setting to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
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
8adab02757 Make workspace management work without X11
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
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
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
0a8ae8417c Get rid of MetaScreen
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
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
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
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
6458139c04 Move mouse window tracking to MetaDisplay
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
82307dd694 Move xinerama management to MetaX11Display
https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
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
15fa7816bd configure.ac: Bump libmutter API version to 3 2018-07-06 19:47:16 +02:00
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
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
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
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
2383801f7b Update Friulian translation 2018-06-29 13:33:53 +00:00
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
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
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
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
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
8da95b17f5 Update Romanian translation 2018-06-17 19:38:55 +00:00
d535c1eb6d Update Catalan translation 2018-06-17 10:31:36 +02:00
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
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
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
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
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
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
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
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
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
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
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
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
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
0f519ffb05 cursor-renderer/native: Various whitespace fixes
https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:53 +00:00
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
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
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
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
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
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
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
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
10dfc67dad backends/cursor: Minor whitespace cleanup
https://gitlab.gnome.org/GNOME/mutter/issues/77
2018-06-15 19:09:50 +00:00
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
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
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
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
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
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
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
3649795108 wayland: Detach MetaWaylandActorSurface from its actor on dispose
And ensure the actor is no longer reactive even though it might live longer
because of close effects, GCs, and whatnot. This ensures the actor is not
eligible for pointer picking within the destruction of its surface.

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

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

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

Related: #132
2018-06-08 17:31:25 +02:00
8ee14a7cb7 renderer/native: Also wrap flip closures for EGLStreams
When using the EGLStream backend, the MetaRendererNative passed a
GClosure to KMS when using EGLStreams, but KMS flip callback event
handler in meta-gpu-kms.c expected a closure wrapped in a closure
container, meaning it'd instead crash when using EGLStreams. Make the
flip handler get what it expects also when using EGLStreams by wrapping
the flip closure in the container before handing it over to EGL.

https://bugzilla.gnome.org/show_bug.cgi?id=790316
2018-06-07 22:14:05 +02:00
909dbafd67 settings: Remove confused comment
It got lost, lets help it find the way out.
2018-06-07 12:57:52 +00:00
d5203f170e Make screen cast and remote desktop non-experimental
It's time to make this feature more accessible by not requiring editing
an array in gsettings.
2018-06-07 12:57:51 +00:00
2a45b7de7c clutter-input-device-xi2: Check for null group_modes before unref 2018-06-07 12:54:56 +01:00
62c67be4c8 clutter-actor: Fix uninitialized matrix multiply
`modelview` is uninitialized and the `apply` function just multiplies it.
What we really want is to initialize `modelview` so replace `apply` with
`get`.

Who knows what bugs this may have caused...
2018-05-31 15:43:27 +08:00
0332b7394e renderer-native: Don't crash if the FB surface can't be locked 2018-05-29 22:13:03 +00:00
15f41c9f68 device-manager-evdev: Add main seat to seats by default
Treat the main seat as other seats, so we don't have to handle it differently
in specific places. This was already the case before when a real device
was plugged before the startup, but not applied when hotplugging a device.
2018-05-29 10:35:51 +00:00
2a38601b42 device-manager-evdev: Free the main seat on finalize 2018-05-29 10:35:51 +00:00
d7bdc1591f device-manager-evdev: Set and unset the stage for the main seat too
When no input devices are available on startup the device manager might be fast
enough to be constructed so that no default stage is set yet, and thus when
main seat virtual devices are created they won't have a proper stage set.
If then we plug a real device, the events that an input manager could generate
won't be associated to any stage and thus won't be processed.

We need then ensure that when we update the stage for the device manager we
(un)associate it also to the main seat devices.
2018-05-29 10:35:51 +00:00
bd36764b4d wayland: Don't reset input focus on text commit
Preedit text can be active even after text commit. Resetting the input
focus will lead to unintended commit of the preedit text.

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

Closes: #152
2018-05-26 18:58:42 +09:00
473bf38753 frames: Allow for unknown mouse buttons
Commit 47131b1d ("frames: Handle touch events") introduced an assert to
make sure that all mouse button actions are handled in mutter.

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

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/160
2018-05-25 09:20:36 +00:00
f7747e4d4f Bump version to 3.29.2
Update NEWS.
2018-05-24 17:12:55 +02:00
e8dc2acfca Update Chinese (China) translation 2018-05-21 16:18:26 +00:00
cf734999fb wayland: Compare geometries after chaining up
After 20176d03, the Wayland backend only synchronizes with the
compositor after a geometry was set, and it was different from
the current geometry.

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

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

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/150
2018-05-18 13:09:10 +00:00
c9c3283540 shaped-texture: Disable mipmapping during animation
This avoids overwhelming the GPU with trying to update mipmaps at a high
rate. Because doing so could easily cause a reduction in the compositor
frame rate and thus actually reduce visual quality.

In the case of a window that is constantly animating in the overview,
this reduces mutter's render time by around 20%-30%.
2018-05-18 16:45:26 +08:00
d2a8cdfd7c Update Galician translation 2018-05-15 22:33:40 +00:00
3e85ac8131 clutter-device-evdev: Get devices from main seat if no real seat is set
In devices such as ARM boards there could be no input devices connected on
startup, leading to a crash when we try to process artificial events that
could be queued (as gnome-shell does when syncing pointer).

Those events still should refer to a device and, in case we don't have one
provided by libinput we should still return the core devices defined in the
main seat.
2018-05-15 12:09:59 +01:00
5f83d9a5c8 clutter-seat-evdev: Add function to get device by id 2018-05-15 12:05:39 +01:00
ac20bf2000 frames: Handle touch events
This is just done on wayland as it'll break horribly on X11, we let
this happen through pointer emulated events in XISelectEvents evmask
instead.

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

https://bugzilla.gnome.org/show_bug.cgi?id=770185
2018-05-14 17:11:57 +01:00
3561082aba frames: Make 1st button/motion handlers take generic events
This will ease handling of touch events through these same handlers.

https://bugzilla.gnome.org/show_bug.cgi?id=770185
2018-05-14 13:44:03 +01:00
e34c330f66 build: Adjust to filename changes
The meta-stage and meta-window-group headers got split into a public
and private part, but the Makefiles still reference the old files.
2018-05-07 22:41:01 +02:00
7655e09d00 build: Introspect some more types
While MetaStage, MetaWindowGroup and MetaDBusDisplayConfigSkeleton don't
appear explicitly in the public API, their gtypes are still exposed via
meta_get_stage_for_screen(), meta_get_*window_group_for_screen() and
MetaMonitorManager's parent type. Newer versions of gjs will warn about
undefined properties if it encounters a gtype without introspection
information, so expose those types to shut up the warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 21:44:47 +02:00
be069fb8ae window-group: Remove undefined function declaration
Ever since the function has been made public, its name has been
meta_actor_is_untransformed() ...

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 21:44:47 +02:00
a30166a547 clutter: Don't reference invalid pc in gir
Cally is built into clutter itself rather than exposed as a separate
library.

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/102
2018-05-07 19:24:47 +00:00
332d55f7f6 wayland/xdg-foreign: Fix child surface validation check
The role type should be either an xdg-shell toplevel, or a
xdg-shell unstable v6 toplevel.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/138
2018-05-07 19:16:40 +00:00
98d7024288 wayland/xdg-foreign: Send immediate destroy event to correct resource
The destroyed signal that was emitted if an imported surface was not
available when created, for example if the handle was invalid or
already unexported, was emitted on the wrong resource.
2018-05-07 19:16:39 +00:00
82564772dc build: Don't fail immediately when logind is missing
We require logind for the native backend, but the backend itself is
optional. However since commit 06c357d78, we will always throw an
error if neither logind nor elogind are available, even when the
backend is disabled.

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

https://gitlab.gnome.org/GNOME/mutter/merge_requests/96
2018-05-07 19:50:20 +02:00
33c2a38ff7 main: Fix typo 2018-05-04 20:15:33 +02:00
52fdd24467 wayland: avoid a crash in is_effectively_synchronized()
To check if a subsurface is effectively synchronized, we walk the
subsurface hierarchy to look for a non-subsurface parent or a subsurface
being synchronized.

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

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

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/124
2018-05-03 11:39:33 +02:00
2319cd9c40 idle-monitor: Don't try to auto-start SessionManager
The interface is provided by gnome-session and not activatable.

https://gitlab.gnome.org/GNOME/mutter/issues/134
2018-04-30 13:55:41 +00:00
3b4319a87c Update Romanian translation 2018-04-30 05:56:32 +00:00
20176d0395 wayland: Check if state and size changed before calling move_resize()
The current implementation of the XdgSurface v6 protocol does not check
if the window changed before calling meta_window_wayland_move_resize().

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

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

https://bugzilla.gnome.org/show_bug.cgi?id=780292
Issue: #78
2018-04-25 23:33:41 -03:00
762a3f89a9 wayland: Add function to query if window needs move or resize
This will be used by the next commit to determine when a window
geometry change should be ignored or not. Normally, it would be
enough to just check if the position and sizes changed.

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

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

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

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

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

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

Fixes #78
2018-04-25 21:55:05 -03:00
189 changed files with 10190 additions and 7943 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

33
NEWS
View File

@ -1,3 +1,36 @@
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]
* nvidia [Miguel; #2]
* nvidia [Miguel; #782575]
* Remove MetaScreen to prepare for non-mandatary X11 dependency
[Armin, Jonas; #759538]
* Misc. bug fixes [Olivier, Jonas, Sam; #160, !130, #786929, #788834]
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]

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

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

View File

@ -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

@ -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

@ -2,14 +2,14 @@ AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [29])
m4_define([mutter_micro_version], [1])
m4_define([mutter_micro_version], [3])
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])
@ -270,13 +270,10 @@ fi
PKG_CHECK_MODULES(SYSTEMD, [libsystemd], [have_systemd=yes], [have_systemd=no])
if test x$have_systemd = xyes; then
if test x$have_systemd = xyes -o -z "$logind_provider"; then
logind_provider="libsystemd"
fi
AS_IF([test -z "$logind_provider"],
AC_MSG_ERROR([Could not find either systemd or elogind as logind provider])])
MUTTER_NATIVE_BACKEND_MODULES="libdrm $logind_provider libinput >= 1.4 gudev-1.0 gbm >= 10.3"
AC_ARG_ENABLE(native-backend,
@ -293,13 +290,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"
@ -552,6 +560,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"

553
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-06-07 13:00+0000\n"
"PO-Revision-Date: 2018-06-17 21:51+0300\n"
"Last-Translator: Florentina Mușat <florentina.musat.28 [at] gmail [dot] "
"com>\n"
"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.8\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,256 @@ 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:903
msgid "Built-in display"
msgstr "Afișaj integrat"
#: ../src/backends/meta-monitor-manager.c:526
#: src/backends/meta-monitor-manager.c:926
msgid "Unknown"
msgstr "Necunoscut"
#: ../src/backends/meta-monitor-manager.c:528
#: src/backends/meta-monitor-manager.c:928
msgid "Unknown Display"
msgstr "Afișaj necunoscut"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: ../src/backends/meta-monitor-manager.c:536
#: src/backends/meta-monitor-manager.c:936
#, c-format
msgid "%s %s"
msgstr "%s %s"
#. This probably means that a non-WM compositor like xcompmgr is running;
#. * we have no way to get it to exit
#: ../src/compositor/compositor.c:456
#: src/compositor/compositor.c:481
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display \"%s"
"\"."
"Another compositing manager is already running on screen %i on display “%s”."
msgstr ""
"Un alt administrator de ferestre compozit rulează deja pe ecranul %i pe "
"Un alt administrator de ferestre de compunere rulează deja pe ecranul %i pe "
"afișajul „%s”."
#: ../src/core/bell.c:185
#: src/core/bell.c:194
msgid "Bell event"
msgstr "Eveniment sonor"
#: ../src/core/delete.c:127
#: src/core/display.c:608
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Nu s-a putut deschide afișajul sistemului de ferestre X „%s”\n"
#: src/core/main.c:190
msgid "Disable connection to session manager"
msgstr "Dezactivează conexiunea la administratorul de sesiune"
#: src/core/main.c:196
msgid "Replace the running window manager"
msgstr "Înlocuiește administratorul de ferestre curent"
#: src/core/main.c:202
msgid "Specify session management ID"
msgstr "Specifică ID-ul administrării de sesiune"
#: src/core/main.c:207
msgid "X Display to use"
msgstr "Ecranul X ce va fi folosit"
#: src/core/main.c:213
msgid "Initialize session from savefile"
msgstr "Inițializează sesiunea din fișierul salvat"
#: src/core/main.c:219
msgid "Make X calls synchronous"
msgstr "Realizează apelurile X sincron"
#: src/core/main.c:226
msgid "Run as a wayland compositor"
msgstr "Rulează ca un compunător wayland"
#: src/core/main.c:232
msgid "Run as a nested compositor"
msgstr "Rulează ca un compunător imbricat"
#: src/core/main.c:240
msgid "Run as a full display server, rather than nested"
msgstr "Rulează ca server de afișare și nu ca server imbricat"
#: src/core/main.c:246
msgid "Run with X11 backend"
msgstr "Rulează cu backend X11"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:147
#, c-format
msgid "“%s” is not responding."
msgstr "„%s” nu răspunde."
#: ../src/core/delete.c:129
#: src/core/meta-close-dialog-default.c:149
msgid "Application is not responding."
msgstr "Aplicația nu răspunde."
#: ../src/core/delete.c:134
#: src/core/meta-close-dialog-default.c:154
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
@ -517,112 +647,95 @@ msgstr ""
"Puteți alege între a aștepta pentru câteva secunde ca aplicația să continue "
"sau a forța terminarea aplicației."
#: ../src/core/delete.c:141
msgid "_Wait"
msgstr "_Așteaptă"
#: ../src/core/delete.c:141
#: src/core/meta-close-dialog-default.c:161
msgid "_Force Quit"
msgstr "_Forțează închiderea"
#: ../src/core/display.c:563
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr "Nu s-a putut deschide afișajul X Window System „%s”\n"
#: src/core/meta-close-dialog-default.c:161
msgid "_Wait"
msgstr "_Așteaptă"
#: ../src/core/main.c:176
msgid "Disable connection to session manager"
msgstr "Dezactivează conexiunea la administratorul de sesiune"
#: ../src/core/main.c:182
msgid "Replace the running window manager"
msgstr "Înlocuiește administratorul de ferestre curent"
#: ../src/core/main.c:188
msgid "Specify session management ID"
msgstr "Specifică ID-ul administrării de sesiune"
#: ../src/core/main.c:193
msgid "X Display to use"
msgstr "Ecranul X ce va fi folosit"
#: ../src/core/main.c:199
msgid "Initialize session from savefile"
msgstr "Inițializează sesiunea din fișierul salvat"
#: ../src/core/main.c:205
msgid "Make X calls synchronous"
msgstr "Realizează apelurile X sincron"
#: ../src/core/main.c:212
msgid "Run as a wayland compositor"
msgstr "Rulează ca compozitor wayland"
#: ../src/core/main.c:220
msgid "Run as a full display server, rather than nested"
msgstr "Rulează ca server de afișare și nu ca server imbricat"
#: ../src/core/mutter.c:39
#: src/core/mutter.c:39
#, c-format
msgid ""
"mutter %s\n"
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
"This is free software; see the source for copying conditions.\n"
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
"PARTICULAR PURPOSE.\n"
msgstr ""
"mutter %s\n"
"Drepturi de autor (C) 2001--%d Havoc Pennington, Red Hat, Inc., și alții\n"
"Drepturi de autor (C) 2001-%d Havoc Pennington, Red Hat, Inc., și alții\n"
"Acesta este software liber; consultați codul sursă pentru condițiile de "
"copiere.\n"
"Nu există NICI O garanție; nici pentru COMERCIALIZARE sau UTILIZAREA ÎNTR-UN "
"Nu există NICIO garanție; nici pentru COMERCIALIZARE sau UTILIZAREA ÎNTR-UN "
"SCOP ANUME.\n"
#: ../src/core/mutter.c:53
#: src/core/mutter.c:53
msgid "Print version"
msgstr "Afișează versiunea"
#: ../src/core/mutter.c:59
#: src/core/mutter.c:59
msgid "Mutter plugin to use"
msgstr "Modul Mutter de utilizat"
#: ../src/core/prefs.c:2050
#: src/core/prefs.c:1997
#, c-format
msgid "Workspace %d"
msgstr "Spațiu de lucru %d"
#: ../src/core/screen.c:526
#: src/core/screen.c:583
#, c-format
msgid ""
"Display \"%s\" already has a window manager; try using the --replace option "
"to replace the current window manager."
"Display “%s” already has a window manager; try using the --replace option to "
"replace the current window manager."
msgstr ""
"Afișajul „%s” are deja un administrator de ferestre; încercați să folosiți "
"Afișajul „%s” are deja un administrator de ferestre; încercați să utilizați "
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
"ferestre actual."
"ferestre curent."
#: ../src/core/screen.c:608
#: src/core/screen.c:668
#, c-format
msgid "Screen %d on display '%s' is invalid\n"
msgstr "Ecranul %d pe afișajul „%s” este invalid\n"
msgid "Screen %d on display %s is invalid\n"
msgstr "Ecranul %d de pe afișajul „%s” nu este valid\n"
#: ../src/core/util.c:118
#: src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "Mutter a fost compilat fără suport pentru modul detaliat\n"
#: ../src/x11/session.c:1815
#: src/wayland/meta-wayland-tablet-pad.c:567
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Comutator de mod: modul %d"
#: src/x11/session.c:1818
msgid ""
"These windows do not support &quot;save current setup&quot; and will have to "
"be restarted manually next time you log in."
"These windows do not support save current setup and will have to be "
"restarted manually next time you log in."
msgstr ""
"Aceste ferestre nu suportă „salvează configurarea curentă” și vor trebui "
"repornite manual următoarea dată când vă veți autentifica."
#: ../src/x11/window-props.c:549
#: src/x11/window-props.c:559
#, c-format
msgid "%s (on %s)"
msgstr "%s (pe %s)"
#~ msgid "Move window one workspace to the left"
#~ msgstr "Mută fereastra pe spațiul de lucru de la stânga"
#~ msgid "Move window one workspace to the right"
#~ msgstr "Mută fereastra pe spațiul de lucru de la dreapta"
#~ msgid "Move to workspace left"
#~ msgstr "Mută pe spațiul de lucru din stânga"
#~ msgid "Move to workspace right"
#~ msgstr "Mută pe spațiul de lucru din dreapta"
#~ msgid "Toggle shaded state"
#~ msgstr "Comută starea de umbrire"
#~ msgid "Switch to workspace on the left of the current workspace"
#~ msgstr "Schimbă cu spațiul de lucru din stânga celui actual"

View File

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

View File

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

View File

@ -11,13 +11,13 @@ 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/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 +72,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 \
@ -176,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 \
@ -246,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 \
@ -279,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 \
@ -293,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 \
@ -322,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 \
@ -370,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 \
@ -431,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 \
@ -524,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 \
@ -543,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 \
@ -758,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

@ -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"
@ -418,28 +418,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)
{
@ -473,10 +451,8 @@ 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))
@ -568,26 +544,6 @@ meta_backend_class_init (MetaBackendClass *klass)
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)
@ -670,9 +626,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);

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,7 @@ 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
@ -283,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);
@ -70,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

@ -246,7 +246,8 @@ meta_idle_monitor_init (MetaIdleMonitor *monitor)
/* 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_CONNECT_SIGNALS |
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
NULL,
"org.gnome.SessionManager",
"/org/gnome/SessionManager",
@ -262,8 +263,11 @@ meta_idle_monitor_init (MetaIdleMonitor *monitor)
v = g_dbus_proxy_get_cached_property (monitor->session_proxy,
"InhibitedActions");
monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
g_variant_unref (v);
if (v)
{
monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
g_variant_unref (v);
}
}
/**

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

@ -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

@ -40,7 +40,6 @@
#include <libupower-glib/upower.h>
#include "display-private.h"
#include <meta/screen.h>
#include "stack-tracker.h"
#include <meta/meta-monitor-manager.h>
@ -279,9 +278,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);

View File

@ -34,7 +34,7 @@
#include <meta/main.h>
#include "util-private.h"
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "edid.h"
#include "backends/meta-crtc.h"
#include "backends/meta-logical-monitor.h"
@ -585,6 +585,8 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
&error))
{
g_clear_object (&config);
g_warning ("Failed to use linear monitor configuration: %s",
error->message);
g_clear_error (&error);
}
else
@ -602,6 +604,8 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
&error))
{
g_clear_object (&config);
g_warning ("Failed to use fallback monitor configuration: %s",
error->message);
g_clear_error (&error);
}
else
@ -1041,6 +1045,7 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
GVariantBuilder crtcs, modes, clones, properties;
GBytes *edid;
char *edid_file;
MetaCrtc *crtc;
int crtc_index;
g_variant_builder_init (&crtcs, G_VARIANT_TYPE ("au"));
@ -1134,8 +1139,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,
@ -2487,9 +2492,9 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
}
MetaLogicalMonitor *
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaScreenDirection direction)
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
MetaLogicalMonitor *logical_monitor,
MetaDisplayDirection direction)
{
GList *l;
@ -2903,11 +2908,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;

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

@ -153,6 +153,11 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
return;
buffer = pw_stream_peek_buffer (priv->pipewire_stream, buffer_id);
if (!buffer)
{
g_warning ("Failed to peek at PipeWire buffer");
return;
}
if (buffer->datas[0].type == priv->pipewire_type->data.MemFd)
{
@ -327,10 +332,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);
@ -356,14 +369,15 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
&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_NONE,
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,9 +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 << 3),
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
} MetaExperimentalFeature;
#define META_TYPE_SETTINGS (meta_settings_get_type ())

View File

@ -260,13 +260,8 @@ 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

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

@ -43,7 +43,7 @@
#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"
@ -212,7 +212,7 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
MetaLogicalMonitor *cur = current;
float x = cur_x, y = cur_y;
float dx = *dx_inout, dy = *dy_inout;
MetaScreenDirection direction = -1;
MetaDisplayDirection direction = -1;
while (cur)
{
@ -240,18 +240,18 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
{ cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
};
if (direction != META_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 */
@ -645,8 +645,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;
@ -658,10 +656,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_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,6 +304,7 @@ 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;
@ -330,6 +344,8 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
},
};
crtc = meta_output_get_assigned_crtc (monitor_crtc_mode->output);
if (priv->has_hw_cursor &&
clutter_rect_intersection (&scaled_crtc_rect,
&data->in_local_cursor_rect,
@ -340,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));
@ -350,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));
@ -358,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;
@ -369,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;
@ -562,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;
@ -607,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);
@ -619,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;
@ -654,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
@ -704,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)
{
@ -736,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;
}
@ -803,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);
@ -927,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,
@ -980,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);
}
}
@ -1011,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 =
@ -1031,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);
}
@ -1110,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

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

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

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;
/*
@ -993,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
@ -1271,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;
@ -1280,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
};
@ -1301,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;
}
@ -1601,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);
@ -2083,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;
@ -2106,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,
@ -2113,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,
@ -2170,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);
@ -2195,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 */,
@ -2711,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
@ -2724,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 *
@ -2901,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,
@ -2917,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
@ -2966,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);

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,7 +37,7 @@
#include <X11/Xlib-xcb.h>
#include <xkbcommon/xkbcommon-x11.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"
@ -176,7 +176,7 @@ translate_device_event (MetaBackendX11 *x11,
meta_backend_x11_translate_device_event (x11, device_event);
if (!device_event->send_event && device_event->time != CurrentTime)
if (!device_event->send_event && device_event->time != META_CURRENT_TIME)
{
if (XSERVER_TIME_IS_BEFORE (device_event->time, priv->latest_evtime))
{
@ -332,7 +332,7 @@ handle_host_xevent (MetaBackend *backend,
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
bypass_clutter = TRUE;
if (meta_dnd_handle_xdnd_event (backend, compositor, display, event))
if (meta_dnd_handle_xdnd_event (backend, compositor, priv->xdisplay, event))
bypass_clutter = TRUE;
}
}
@ -547,7 +547,7 @@ meta_backend_x11_grab_device (MetaBackend *backend,
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
int ret;
if (timestamp != CurrentTime)
if (timestamp != META_CURRENT_TIME)
timestamp = MAX (timestamp, priv->latest_evtime);
XISetMask (mask.mask, XI_ButtonPress);
@ -802,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

@ -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;
@ -758,6 +820,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

@ -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"
@ -1971,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, };
@ -1981,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
@ -2039,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;
@ -2065,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

View File

@ -0,0 +1,24 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef META_WINDOW_GROUP_PRIVATE_H
#define META_WINDOW_GROUP_PRIVATE_H
#include <meta/meta-window-group.h>
#include <meta/display.h>
/**
* MetaWindowGroup:
*
* This class is a subclass of ClutterActor with special handling for
* #MetaCullable when painting children. It uses code similar to
* meta_cullable_cull_out_children(), but also has additional special
* cases for the undirected window, and similar.
*/
typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate;
ClutterActor *meta_window_group_new (MetaDisplay *display);
#endif /* META_WINDOW_GROUP_PRIVATE_H */

View File

@ -10,9 +10,10 @@
#include "clutter-utils.h"
#include "compositor-private.h"
#include "meta-window-actor-private.h"
#include "meta-window-group.h"
#include "meta-window-group-private.h"
#include "window-private.h"
#include "meta-cullable.h"
#include "display-private.h"
struct _MetaWindowGroupClass
{
@ -23,7 +24,7 @@ struct _MetaWindowGroup
{
ClutterActor parent;
MetaScreen *screen;
MetaDisplay *display;
};
static void cullable_iface_init (MetaCullableInterface *iface);
@ -64,7 +65,7 @@ meta_window_group_paint (ClutterActor *actor)
MetaWindowGroup *window_group = META_WINDOW_GROUP (actor);
ClutterActor *stage = clutter_actor_get_stage (actor);
meta_screen_get_size (window_group->screen, &screen_width, &screen_height);
meta_display_get_size (window_group->display, &screen_width, &screen_height);
/* Normally we expect an actor to be drawn at it's position on the screen.
* However, if we're inside the paint of a ClutterClone, that won't be the
@ -199,13 +200,13 @@ meta_window_group_init (MetaWindowGroup *window_group)
}
ClutterActor *
meta_window_group_new (MetaScreen *screen)
meta_window_group_new (MetaDisplay *display)
{
MetaWindowGroup *window_group;
window_group = g_object_new (META_TYPE_WINDOW_GROUP, NULL);
window_group->screen = screen;
window_group->display = display;
return CLUTTER_ACTOR (window_group);
}

View File

@ -1,37 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
#ifndef META_WINDOW_GROUP_H
#define META_WINDOW_GROUP_H
#include <clutter/clutter.h>
#include <meta/screen.h>
/**
* MetaWindowGroup:
*
* This class is a subclass of ClutterActor with special handling for
* #MetaCullable when painting children. It uses code similar to
* meta_cullable_cull_out_children(), but also has additional special
* cases for the undirected window, and similar.
*/
#define META_TYPE_WINDOW_GROUP (meta_window_group_get_type ())
#define META_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroup))
#define META_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass))
#define META_IS_WINDOW_GROUP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_WINDOW_GROUP))
#define META_IS_WINDOW_GROUP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_WINDOW_GROUP))
#define META_WINDOW_GROUP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_WINDOW_GROUP, MetaWindowGroupClass))
typedef struct _MetaWindowGroup MetaWindowGroup;
typedef struct _MetaWindowGroupClass MetaWindowGroupClass;
typedef struct _MetaWindowGroupPrivate MetaWindowGroupPrivate;
GType meta_window_group_get_type (void);
ClutterActor *meta_window_group_new (MetaScreen *screen);
gboolean meta_window_group_actor_is_untransformed (ClutterActor *actor,
int *x_origin,
int *y_origin);
#endif /* META_WINDOW_GROUP_H */

View File

@ -21,10 +21,12 @@
#include <config.h>
#include <meta/display.h>
#include <meta/meta-plugin.h>
#include <meta/window.h>
#include <meta/meta-background-group.h>
#include <meta/meta-background-actor.h>
#include <meta/meta-monitor-manager.h>
#include <meta/util.h>
#include <glib/gi18n-lib.h>
@ -38,7 +40,7 @@
#define SWITCH_TIMEOUT 500
#define ACTOR_DATA_KEY "MCCP-Default-actor-data"
#define SCREEN_TILE_PREVIEW_DATA_KEY "MCCP-Default-screen-tile-preview-data"
#define DISPLAY_TILE_PREVIEW_DATA_KEY "MCCP-Default-display-tile-preview-data"
#define META_TYPE_DEFAULT_PLUGIN (meta_default_plugin_get_type ())
#define META_DEFAULT_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPlugin))
@ -67,7 +69,7 @@ struct _MetaDefaultPluginClass
};
static GQuark actor_data_quark = 0;
static GQuark screen_tile_preview_data_quark = 0;
static GQuark display_tile_preview_data_quark = 0;
static void start (MetaPlugin *plugin);
static void minimize (MetaPlugin *plugin,
@ -134,14 +136,14 @@ typedef struct
} EffectCompleteData;
typedef struct _ScreenTilePreview
typedef struct _DisplayTilePreview
{
ClutterActor *actor;
GdkRGBA *preview_color;
MetaRectangle tile_rect;
} ScreenTilePreview;
} DisplayTilePreview;
static void
meta_default_plugin_dispose (GObject *object)
@ -285,8 +287,8 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
{
MetaPlugin *plugin = META_PLUGIN (data);
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
MetaScreen *screen = meta_plugin_get_screen (plugin);
GList *l = meta_get_window_actors (screen);
MetaDisplay *display = meta_plugin_get_display (plugin);
GList *l = meta_get_window_actors (display);
while (l)
{
@ -318,16 +320,18 @@ on_switch_workspace_effect_complete (ClutterTimeline *timeline, gpointer data)
}
static void
on_monitors_changed (MetaScreen *screen,
MetaPlugin *plugin)
on_monitors_changed (MetaMonitorManager *monitor_manager,
MetaPlugin *plugin)
{
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
MetaDisplay *display = meta_plugin_get_display (plugin);
int i, n;
GRand *rand = g_rand_new_with_seed (123456);
clutter_actor_destroy_all_children (self->priv->background_group);
n = meta_screen_get_n_monitors (screen);
n = meta_display_get_n_monitors (display);
for (i = 0; i < n; i++)
{
MetaRectangle rect;
@ -335,9 +339,9 @@ on_monitors_changed (MetaScreen *screen,
MetaBackground *background;
ClutterColor color;
meta_screen_get_monitor_geometry (screen, i, &rect);
meta_display_get_monitor_geometry (display, i, &rect);
background_actor = meta_background_actor_new (screen, i);
background_actor = meta_background_actor_new (display, i);
clutter_actor_set_position (background_actor, rect.x, rect.y);
clutter_actor_set_size (background_actor, rect.width, rect.height);
@ -352,7 +356,7 @@ on_monitors_changed (MetaScreen *screen,
g_rand_int_range (rand, 0, 255),
255);
background = meta_background_new (screen);
background = meta_background_new (display);
meta_background_set_color (background, &color);
meta_background_actor_set_background (META_BACKGROUND_ACTOR (background_actor), background);
g_object_unref (background);
@ -372,17 +376,19 @@ static void
start (MetaPlugin *plugin)
{
MetaDefaultPlugin *self = META_DEFAULT_PLUGIN (plugin);
MetaScreen *screen = meta_plugin_get_screen (plugin);
MetaDisplay *display = meta_plugin_get_display (plugin);
MetaMonitorManager *monitor_manager = meta_monitor_manager_get ();
self->priv->background_group = meta_background_group_new ();
clutter_actor_insert_child_below (meta_get_window_group_for_screen (screen),
clutter_actor_insert_child_below (meta_get_window_group_for_display (display),
self->priv->background_group, NULL);
g_signal_connect (screen, "monitors-changed",
g_signal_connect (monitor_manager, "monitors-changed",
G_CALLBACK (on_monitors_changed), plugin);
on_monitors_changed (screen, plugin);
clutter_actor_show (meta_get_stage_for_screen (screen));
on_monitors_changed (monitor_manager, plugin);
clutter_actor_show (meta_get_stage_for_display (display));
}
static void
@ -390,7 +396,7 @@ switch_workspace (MetaPlugin *plugin,
gint from, gint to,
MetaMotionDirection direction)
{
MetaScreen *screen;
MetaDisplay *display;
MetaDefaultPluginPrivate *priv = META_DEFAULT_PLUGIN (plugin)->priv;
GList *l;
ClutterActor *workspace0 = clutter_actor_new ();
@ -398,12 +404,12 @@ switch_workspace (MetaPlugin *plugin,
ClutterActor *stage;
int screen_width, screen_height;
screen = meta_plugin_get_screen (plugin);
stage = meta_get_stage_for_screen (screen);
display = meta_plugin_get_display (plugin);
stage = meta_get_stage_for_display (display);
meta_screen_get_size (screen,
&screen_width,
&screen_height);
meta_display_get_size (display,
&screen_width,
&screen_height);
clutter_actor_set_pivot_point (workspace1, 1.0, 1.0);
clutter_actor_set_position (workspace1,
@ -421,7 +427,7 @@ switch_workspace (MetaPlugin *plugin,
return;
}
l = g_list_last (meta_get_window_actors (screen));
l = g_list_last (meta_get_window_actors (display));
while (l)
{
@ -669,36 +675,36 @@ destroy (MetaPlugin *plugin, MetaWindowActor *window_actor)
* Tile preview private data accessor
*/
static void
free_screen_tile_preview (gpointer data)
free_display_tile_preview (gpointer data)
{
ScreenTilePreview *preview = data;
DisplayTilePreview *preview = data;
if (G_LIKELY (preview != NULL)) {
clutter_actor_destroy (preview->actor);
g_slice_free (ScreenTilePreview, preview);
g_slice_free (DisplayTilePreview, preview);
}
}
static ScreenTilePreview *
get_screen_tile_preview (MetaScreen *screen)
static DisplayTilePreview *
get_display_tile_preview (MetaDisplay *display)
{
ScreenTilePreview *preview = g_object_get_qdata (G_OBJECT (screen), screen_tile_preview_data_quark);
DisplayTilePreview *preview = g_object_get_qdata (G_OBJECT (display), display_tile_preview_data_quark);
if (G_UNLIKELY (screen_tile_preview_data_quark == 0))
screen_tile_preview_data_quark = g_quark_from_static_string (SCREEN_TILE_PREVIEW_DATA_KEY);
if (G_UNLIKELY (display_tile_preview_data_quark == 0))
display_tile_preview_data_quark = g_quark_from_static_string (DISPLAY_TILE_PREVIEW_DATA_KEY);
if (G_UNLIKELY (!preview))
{
preview = g_slice_new0 (ScreenTilePreview);
preview = g_slice_new0 (DisplayTilePreview);
preview->actor = clutter_actor_new ();
clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue);
clutter_actor_set_opacity (preview->actor, 100);
clutter_actor_add_child (meta_get_window_group_for_screen (screen), preview->actor);
g_object_set_qdata_full (G_OBJECT (screen),
screen_tile_preview_data_quark, preview,
free_screen_tile_preview);
clutter_actor_add_child (meta_get_window_group_for_display (display), preview->actor);
g_object_set_qdata_full (G_OBJECT (display),
display_tile_preview_data_quark, preview,
free_display_tile_preview);
}
return preview;
@ -710,8 +716,8 @@ show_tile_preview (MetaPlugin *plugin,
MetaRectangle *tile_rect,
int tile_monitor_number)
{
MetaScreen *screen = meta_plugin_get_screen (plugin);
ScreenTilePreview *preview = get_screen_tile_preview (screen);
MetaDisplay *display = meta_plugin_get_display (plugin);
DisplayTilePreview *preview = get_display_tile_preview (display);
ClutterActor *window_actor;
if (clutter_actor_is_visible (preview->actor)
@ -737,8 +743,8 @@ show_tile_preview (MetaPlugin *plugin,
static void
hide_tile_preview (MetaPlugin *plugin)
{
MetaScreen *screen = meta_plugin_get_screen (plugin);
ScreenTilePreview *preview = get_screen_tile_preview (screen);
MetaDisplay *display = meta_plugin_get_display (plugin);
DisplayTilePreview *preview = get_display_tile_preview (display);
clutter_actor_hide (preview->actor);
}

View File

@ -49,16 +49,76 @@
#include <config.h>
#include "bell.h"
#include "screen-private.h"
#include "window-private.h"
#include "util-private.h"
#include "compositor/compositor-private.h"
#include <meta/prefs.h>
#include <meta/compositor.h>
#ifdef HAVE_LIBCANBERRA
#include <canberra-gtk.h>
#endif
G_DEFINE_TYPE (MetaBell, meta_bell, G_TYPE_OBJECT)
enum
{
IS_AUDIBLE_CHANGED,
LAST_SIGNAL
};
static guint bell_signals [LAST_SIGNAL] = { 0 };
static void
prefs_changed_callback (MetaPreference pref,
gpointer data)
{
MetaBell *bell = data;
if (pref == META_PREF_AUDIBLE_BELL)
{
g_signal_emit (bell, bell_signals[IS_AUDIBLE_CHANGED], 0,
meta_prefs_bell_is_audible ());
}
}
static void
meta_bell_finalize (GObject *object)
{
MetaBell *bell = META_BELL (object);
meta_prefs_remove_listener (prefs_changed_callback, bell);
G_OBJECT_CLASS (meta_bell_parent_class)->finalize (object);
}
static void
meta_bell_class_init (MetaBellClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_bell_finalize;
bell_signals[IS_AUDIBLE_CHANGED] =
g_signal_new ("is-audible-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 1,
G_TYPE_BOOLEAN);
}
static void
meta_bell_init (MetaBell *bell)
{
meta_prefs_add_listener (prefs_changed_callback, bell);
}
MetaBell *
meta_bell_new (MetaDisplay *display)
{
return g_object_new (META_TYPE_BELL, NULL);
}
/**
* bell_flash_fullscreen:
* @display: The display the event came in on
@ -73,7 +133,7 @@
static void
bell_flash_fullscreen (MetaDisplay *display)
{
meta_compositor_flash_screen (display->compositor, display->screen);
meta_compositor_flash_display (display->compositor, display);
}
/**
@ -226,68 +286,6 @@ meta_bell_notify (MetaDisplay *display,
return TRUE;
}
void
meta_bell_set_audible (MetaDisplay *display, gboolean audible)
{
#ifdef HAVE_LIBCANBERRA
/* When we are playing sounds using libcanberra support, we handle the
* bell whether its an audible bell or a visible bell */
gboolean enable_system_bell = FALSE;
#else
gboolean enable_system_bell = audible;
#endif /* HAVE_LIBCANBERRA */
XkbChangeEnabledControls (display->xdisplay,
XkbUseCoreKbd,
XkbAudibleBellMask,
enable_system_bell ? XkbAudibleBellMask : 0);
}
gboolean
meta_bell_init (MetaDisplay *display)
{
int xkb_base_error_type, xkb_opcode;
if (!XkbQueryExtension (display->xdisplay, &xkb_opcode,
&display->xkb_base_event_type,
&xkb_base_error_type,
NULL, NULL))
{
display->xkb_base_event_type = -1;
g_message ("could not find XKB extension.");
return FALSE;
}
else
{
unsigned int mask = XkbBellNotifyMask;
gboolean visual_bell_auto_reset = FALSE;
/* TRUE if and when non-broken version is available */
XkbSelectEvents (display->xdisplay,
XkbUseCoreKbd,
XkbBellNotifyMask,
XkbBellNotifyMask);
meta_bell_set_audible (display, meta_prefs_bell_is_audible ());
if (visual_bell_auto_reset) {
XkbSetAutoResetControls (display->xdisplay,
XkbAudibleBellMask,
&mask,
&mask);
}
return TRUE;
}
return FALSE;
}
void
meta_bell_shutdown (MetaDisplay *display)
{
/* TODO: persist initial bell state in display, reset here */
XkbChangeEnabledControls (display->xdisplay,
XkbUseCoreKbd,
XkbAudibleBellMask,
XkbAudibleBellMask);
}
/**
* meta_bell_notify_frame_destroy:
* @frame: The frame which is being destroyed

View File

@ -17,11 +17,19 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <X11/Xlib.h>
#include <X11/XKBlib.h>
#include "display-private.h"
#include "frame.h"
struct _MetaBell
{
GObject parent;
};
#define META_TYPE_BELL (meta_bell_get_type ())
G_DECLARE_FINAL_TYPE (MetaBell, meta_bell, META, BELL, GObject)
MetaBell * meta_bell_new (MetaDisplay *display);
/**
* meta_bell_notify:
* @display: The display the bell event came in on
@ -34,48 +42,6 @@
gboolean meta_bell_notify (MetaDisplay *display,
MetaWindow *window);
/**
* meta_bell_set_audible:
* @display: The display we're configuring
* @audible: True for an audible bell, false for a visual bell
*
* Turns the bell to audible or visual. This tells X what to do, but
* not Mutter; you will need to set the "visual bell" pref for that.
*
* If the configure script found we had no XKB, this is a no-op.
*/
void meta_bell_set_audible (MetaDisplay *display, gboolean audible);
/**
* meta_bell_init:
* @display: The display which is opening
*
* Initialises the bell subsystem. This involves intialising
* XKB (which, despite being a keyboard extension, is the
* place to look for bell notifications), then asking it
* to send us bell notifications, and then also switching
* off the audible bell if we're using a visual one ourselves.
*
* \bug There is a line of code that's never run that tells
* XKB to reset the bell status after we quit. Bill H said
* (<http://bugzilla.gnome.org/show_bug.cgi?id=99886#c12>)
* that XFree86's implementation is broken so we shouldn't
* call it, but that was in 2002. Is it working now?
*/
gboolean meta_bell_init (MetaDisplay *display);
/**
* meta_bell_shutdown:
* @display: The display which is closing
*
* Shuts down the bell subsystem.
*
* \bug This is never called! If we had XkbSetAutoResetControls
* enabled in meta_bell_init(), this wouldn't be a problem, but
* we don't.
*/
void meta_bell_shutdown (MetaDisplay *display);
/**
* meta_bell_notify_frame_destroy:
* @frame: The frame which is being destroyed

View File

@ -24,6 +24,7 @@
#include <config.h>
#include "boxes-private.h"
#include "constraints.h"
#include "meta-workspace-manager-private.h"
#include "workspace-private.h"
#include "place.h"
#include <meta/prefs.h>
@ -412,7 +413,7 @@ setup_constraint_info (ConstraintInfo *info,
&info->entire_monitor);
}
cur_workspace = window->screen->active_workspace;
cur_workspace = window->display->workspace_manager->active_workspace;
info->usable_screen_region =
meta_workspace_get_onscreen_region (cur_workspace);
info->usable_monitor_region =
@ -499,7 +500,7 @@ place_window_if_needed(MetaWindow *window,
meta_window_get_work_area_for_logical_monitor (window,
logical_monitor,
&info->work_area_monitor);
cur_workspace = window->screen->active_workspace;
cur_workspace = window->display->workspace_manager->active_workspace;
info->usable_monitor_region =
meta_workspace_get_onmonitor_region (cur_workspace, logical_monitor);
@ -926,6 +927,7 @@ constrain_maximization (MetaWindow *window,
ConstraintPriority priority,
gboolean check_only)
{
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
MetaRectangle target_size;
MetaRectangle min_size, max_size;
gboolean hminbad, vminbad;
@ -965,7 +967,7 @@ constrain_maximization (MetaWindow *window,
direction = META_DIRECTION_HORIZONTAL;
else
direction = META_DIRECTION_VERTICAL;
active_workspace_struts = window->screen->active_workspace->all_struts;
active_workspace_struts = workspace_manager->active_workspace->all_struts;
target_size = info->current;
meta_rectangle_expand_to_avoiding_struts (&target_size,

View File

@ -24,11 +24,13 @@
#include <config.h>
#include "core.h"
#include "frame.h"
#include "meta-workspace-manager-private.h"
#include "workspace-private.h"
#include <meta/prefs.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "util-private.h"
#include "x11/meta-x11-display-private.h"
#include "x11/window-x11.h"
#include "x11/window-x11-private.h"
@ -51,7 +53,7 @@ get_window (Display *xdisplay,
MetaWindow *window;
display = meta_display_for_x_display (xdisplay);
window = meta_display_lookup_x_window (display, frame_xwindow);
window = meta_x11_display_lookup_x_window (display->x11_display, frame_xwindow);
if (window == NULL || window->frame == NULL)
{
@ -76,6 +78,8 @@ static gboolean
lower_window_and_transients (MetaWindow *window,
gpointer data)
{
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
meta_window_lower (window);
meta_window_foreach_transient (window, lower_window_and_transients, NULL);
@ -86,22 +90,22 @@ lower_window_and_transients (MetaWindow *window,
* Do extra sanity checks to avoid possible race conditions.
* (Borrowed from window.c.)
*/
if (window->screen->active_workspace &&
if (workspace_manager->active_workspace &&
meta_window_located_on_workspace (window,
window->screen->active_workspace))
workspace_manager->active_workspace))
{
GList* link;
link = g_list_find (window->screen->active_workspace->mru_list,
link = g_list_find (workspace_manager->active_workspace->mru_list,
window);
g_assert (link);
window->screen->active_workspace->mru_list =
g_list_remove_link (window->screen->active_workspace->mru_list,
workspace_manager->active_workspace->mru_list =
g_list_remove_link (workspace_manager->active_workspace->mru_list,
link);
g_list_free (link);
window->screen->active_workspace->mru_list =
g_list_append (window->screen->active_workspace->mru_list,
workspace_manager->active_workspace->mru_list =
g_list_append (workspace_manager->active_workspace->mru_list,
window);
}
}
@ -115,6 +119,7 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
guint32 timestamp)
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
MetaWorkspaceManager *workspace_manager = window->display->workspace_manager;
lower_window_and_transients (window, NULL);
@ -122,7 +127,7 @@ meta_core_user_lower_and_unfocus (Display *xdisplay,
* the focus window, assume that's always the case. (Typically,
* this will be invoked via keyboard action or by a mouse action;
* in either case the window or a modal child will have been focused.) */
meta_workspace_focus_default_window (window->screen->active_workspace,
meta_workspace_focus_default_window (workspace_manager->active_workspace,
NULL,
timestamp);
}
@ -219,14 +224,10 @@ meta_core_begin_grab_op (Display *xdisplay,
{
MetaWindow *window = get_window (xdisplay, frame_xwindow);
MetaDisplay *display;
MetaScreen *screen;
display = meta_display_for_x_display (xdisplay);
screen = display->screen;
g_assert (screen != NULL);
return meta_display_begin_grab_op (display, screen, window,
return meta_display_begin_grab_op (display, window,
op, pointer_already_grabbed,
frame_action,
button, modmask,

View File

@ -26,7 +26,7 @@
#include "util-private.h"
#include "window-private.h"
#include "compositor-private.h"
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include <meta/workspace.h>
#include <errno.h>
@ -115,5 +115,8 @@ meta_window_kill (MetaWindow *window)
void
meta_window_free_delete_dialog (MetaWindow *window)
{
if (window->close_dialog &&
meta_close_dialog_is_visible (window->close_dialog))
meta_close_dialog_hide (window->close_dialog);
g_clear_object (&window->close_dialog);
}

View File

@ -37,6 +37,7 @@
#include "keybindings-private.h"
#include "startup-notification-private.h"
#include "meta-gesture-tracker-private.h"
#include "stack-tracker.h"
#include <meta/prefs.h>
#include <meta/barrier.h>
#include <clutter/clutter.h>
@ -47,12 +48,10 @@
#include <X11/extensions/sync.h>
typedef struct _MetaBell MetaBell;
typedef struct _MetaStack MetaStack;
typedef struct _MetaUISlave MetaUISlave;
typedef struct _MetaGroupPropHooks MetaGroupPropHooks;
typedef struct _MetaWindowPropHooks MetaWindowPropHooks;
typedef struct MetaEdgeResistanceData MetaEdgeResistanceData;
typedef enum {
@ -102,43 +101,23 @@ typedef enum {
META_EVENT_ROUTE_FRAME_BUTTON,
} MetaEventRoute;
typedef gboolean (*MetaAlarmFilter) (MetaDisplay *display,
XSyncAlarmNotifyEvent *event,
gpointer data);
typedef void (* MetaDisplayWindowFunc) (MetaWindow *window,
gpointer user_data);
struct _MetaDisplay
{
GObject parent_instance;
char *name;
Display *xdisplay;
MetaX11Display *x11_display;
int clutter_event_filter;
Window leader_window;
Window timestamp_pinging_window;
/* Pull in all the names of atoms as fields; we will intern them when the
* class is constructed.
*/
#define item(x) Atom atom_##x;
#include <x11/atomnames.h>
#undef item
/* The window and serial of the most recent FocusIn event. */
Window server_focus_window;
gulong server_focus_serial;
/* Our best guess as to the "currently" focused window (that is, the
* window that we expect will be focused at the point when the X
* server processes our next request), and the serial of the request
* or event that caused this.
*/
MetaWindow *focus_window;
/* For windows we've focused that don't necessarily have an X window,
* like the no_focus_window or the stage X window. */
Window focus_xwindow;
gulong focus_serial;
/* last timestamp passed to XSetInputFocus */
guint32 last_focus_time;
@ -169,8 +148,6 @@ struct _MetaDisplay
guint focused_by_us : 1;
/*< private-ish >*/
MetaScreen *screen;
GHashTable *xids;
GHashTable *stamps;
GHashTable *wayland_windows;
@ -229,9 +206,6 @@ struct _MetaDisplay
* to avoid some race conditions on EnterNotify events
*/
int sentinel_counter;
int xkb_base_event_type;
guint32 last_bell_time;
int grab_resize_timeout_id;
MetaKeyBindingManager key_binding_manager;
@ -245,60 +219,31 @@ struct _MetaDisplay
/* Closing down the display */
int closing;
/* Managed by group.c */
GHashTable *groups_by_leader;
/* Managed by window-props.c */
MetaWindowPropHooks *prop_hooks_table;
GHashTable *prop_hooks;
int n_prop_hooks;
/* Managed by group-props.c */
MetaGroupPropHooks *group_prop_hooks;
/* Managed by compositor.c */
MetaCompositor *compositor;
MetaGestureTracker *gesture_tracker;
ClutterEventSequence *pointer_emulating_sequence;
MetaAlarmFilter alarm_filter;
gpointer alarm_filter_data;
int composite_event_base;
int composite_error_base;
int composite_major_version;
int composite_minor_version;
int damage_event_base;
int damage_error_base;
int xfixes_event_base;
int xfixes_error_base;
int xinput_error_base;
int xinput_event_base;
int xinput_opcode;
ClutterActor *current_pad_osd;
MetaStartupNotification *startup_notification;
int xsync_event_base;
int xsync_error_base;
int shape_event_base;
int shape_error_base;
unsigned int have_xsync : 1;
#define META_DISPLAY_HAS_XSYNC(display) ((display)->have_xsync)
unsigned int have_shape : 1;
#define META_DISPLAY_HAS_SHAPE(display) ((display)->have_shape)
unsigned int have_composite : 1;
unsigned int have_damage : 1;
#define META_DISPLAY_HAS_COMPOSITE(display) ((display)->have_composite)
#define META_DISPLAY_HAS_DAMAGE(display) ((display)->have_damage)
#ifdef HAVE_XI23
gboolean have_xinput_23 : 1;
#define META_DISPLAY_HAS_XINPUT_23(display) ((display)->have_xinput_23)
#else
#define META_DISPLAY_HAS_XINPUT_23(display) FALSE
#endif /* HAVE_XI23 */
MetaCursor current_cursor;
MetaStack *stack;
MetaStackTracker *stack_tracker;
guint tile_preview_timeout_id;
guint preview_tile_mode : 2;
GSList *startup_sequences;
guint work_area_later;
guint check_fullscreen_later;
MetaBell *bell;
MetaWorkspaceManager *workspace_manager;
};
struct _MetaDisplayClass
@ -322,28 +267,15 @@ struct _MetaDisplayClass
)
gboolean meta_display_open (void);
void meta_display_close (MetaDisplay *display,
guint32 timestamp);
void meta_display_unmanage_windows_for_screen (MetaDisplay *display,
MetaScreen *screen,
guint32 timestamp);
void meta_display_manage_all_windows (MetaDisplay *display);
void meta_display_unmanage_windows (MetaDisplay *display,
guint32 timestamp);
/* Utility function to compare the stacking of two windows */
int meta_display_stack_cmp (const void *a,
const void *b);
/* A given MetaWindow may have various X windows that "belong"
* to it, such as the frame window.
*/
MetaWindow* meta_display_lookup_x_window (MetaDisplay *display,
Window xwindow);
void meta_display_register_x_window (MetaDisplay *display,
Window *xwindowp,
MetaWindow *window);
void meta_display_unregister_x_window (MetaDisplay *display,
Window xwindow);
/* Each MetaWindow is uniquely identified by a 64-bit "stamp"; unlike a
* a MetaWindow *, a stamp will never be recycled
*/
@ -372,14 +304,6 @@ void meta_display_register_wayland_window (MetaDisplay *display,
void meta_display_unregister_wayland_window (MetaDisplay *display,
MetaWindow *window);
MetaWindow* meta_display_lookup_sync_alarm (MetaDisplay *display,
XSyncAlarm alarm);
void meta_display_register_sync_alarm (MetaDisplay *display,
XSyncAlarm *alarmp,
MetaWindow *window);
void meta_display_unregister_sync_alarm (MetaDisplay *display,
XSyncAlarm alarm);
void meta_display_notify_window_created (MetaDisplay *display,
MetaWindow *window);
@ -389,10 +313,8 @@ GSList* meta_display_list_windows (MetaDisplay *display,
MetaDisplay* meta_display_for_x_display (Display *xdisplay);
MetaDisplay* meta_get_display (void);
Cursor meta_display_create_x_cursor (MetaDisplay *display,
MetaCursor cursor);
void meta_display_update_cursor (MetaDisplay *display);
void meta_display_reload_cursor (MetaDisplay *display);
void meta_display_update_cursor (MetaDisplay *display);
void meta_display_check_threshold_reached (MetaDisplay *display,
int x,
@ -410,11 +332,6 @@ void meta_display_ungrab_focus_window_button (MetaDisplay *display,
/* Next function is defined in edge-resistance.c */
void meta_display_cleanup_edges (MetaDisplay *display);
/* make a request to ensure the event serial has changed */
void meta_display_increment_event_serial (MetaDisplay *display);
void meta_display_update_active_window_hint (MetaDisplay *display);
/* utility goo */
const char* meta_event_mode_to_string (int m);
const char* meta_event_detail_to_string (int d);
@ -448,16 +365,6 @@ void meta_display_accelerator_activate (MetaDisplay *display,
ClutterKeyEvent *event);
gboolean meta_display_modifiers_accelerator_activate (MetaDisplay *display);
#ifdef HAVE_XI23
gboolean meta_display_process_barrier_xevent (MetaDisplay *display,
XIEvent *event);
#endif /* HAVE_XI23 */
void meta_display_set_input_focus_xwindow (MetaDisplay *display,
MetaScreen *screen,
Window window,
guint32 timestamp);
void meta_display_sync_wayland_input_focus (MetaDisplay *display);
void meta_display_update_focus_window (MetaDisplay *display,
MetaWindow *window,
@ -485,17 +392,12 @@ gboolean meta_display_show_resize_popup (MetaDisplay *display,
int display_w,
int display_h);
void meta_restart_init (void);
void meta_restart_finish (void);
void meta_set_is_restart (gboolean whether);
void meta_display_cancel_touch (MetaDisplay *display);
gboolean meta_display_windows_are_interactable (MetaDisplay *display);
void meta_display_set_alarm_filter (MetaDisplay *display,
MetaAlarmFilter filter,
gpointer data);
void meta_display_show_tablet_mapping_notification (MetaDisplay *display,
ClutterInputDevice *pad,
const gchar *pretty_name);
@ -507,4 +409,25 @@ void meta_display_notify_pad_group_switch (MetaDisplay *display,
guint n_mode,
guint n_modes);
void meta_display_foreach_window (MetaDisplay *display,
MetaListWindowsFlags flags,
MetaDisplayWindowFunc func,
gpointer data);
void meta_display_restacked (MetaDisplay *display);
void meta_display_update_tile_preview (MetaDisplay *display,
gboolean delay);
void meta_display_hide_tile_preview (MetaDisplay *display);
gboolean meta_display_apply_startup_properties (MetaDisplay *display,
MetaWindow *window);
void meta_display_queue_workarea_recalc (MetaDisplay *display);
void meta_display_queue_check_fullscreen (MetaDisplay *display);
MetaWindow *meta_display_get_pointer_window (MetaDisplay *display,
MetaWindow *not_this_one);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -23,6 +23,7 @@
#include "edge-resistance.h"
#include "boxes-private.h"
#include "display-private.h"
#include "meta-workspace-manager-private.h"
#include "workspace-private.h"
/* A simple macro for whether a given window's edges are potentially
@ -999,6 +1000,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
* in the layer that we are working on
*/
GSList *rem_windows, *rem_win_stacking;
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
g_assert (display->grab_window != NULL);
meta_topic (META_DEBUG_WINDOW_OPS,
@ -1009,8 +1011,8 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
* 1st: Get the list of relevant windows, from bottom to top
*/
stacked_windows =
meta_stack_list_windows (display->screen->stack,
display->screen->active_workspace);
meta_stack_list_windows (display->stack,
workspace_manager->active_workspace);
/*
* 2nd: we need to separate that stacked list into a list of windows that
@ -1064,14 +1066,18 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
{
GList *new_edges;
MetaEdge *new_edge;
MetaRectangle display_rect = { 0 };
MetaRectangle reduced;
meta_display_get_size (display,
&display_rect.width, &display_rect.height);
/* We don't care about snapping to any portion of the window that
* is offscreen (we also don't care about parts of edges covered
* by other windows or DOCKS, but that's handled below).
*/
meta_rectangle_intersect (&cur_rect,
&display->screen->rect,
&display_rect,
&reduced);
new_edges = NULL;
@ -1168,8 +1174,8 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
*/
cache_edges (display,
edges,
display->screen->active_workspace->monitor_edges,
display->screen->active_workspace->screen_edges);
workspace_manager->active_workspace->monitor_edges,
workspace_manager->active_workspace->screen_edges);
g_list_free (edges);
/*

View File

@ -269,7 +269,7 @@ meta_display_handle_event (MetaDisplay *display,
event->type == CLUTTER_BUTTON_PRESS ||
event->type == CLUTTER_TOUCH_BEGIN))
{
if (CurrentTime == display->current_time)
if (META_CURRENT_TIME == display->current_time)
{
/* We can't use missing (i.e. invalid) timestamps to set user time,
* nor do we want to use them to sanity check other timestamps.
@ -410,7 +410,7 @@ meta_display_handle_event (MetaDisplay *display,
}
#endif
display->current_time = CurrentTime;
display->current_time = META_CURRENT_TIME;
return bypass_clutter;
}

View File

@ -24,9 +24,10 @@
#include <config.h>
#include "frame.h"
#include "bell.h"
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "keybindings-private.h"
#include "backends/x11/meta-backend-x11.h"
#include "x11/meta-x11-display-private.h"
#define EVENT_MASK (SubstructureRedirectMask | \
StructureNotifyMask | SubstructureNotifyMask | \
@ -38,10 +39,13 @@ meta_window_ensure_frame (MetaWindow *window)
MetaFrame *frame;
XSetWindowAttributes attrs;
gulong create_serial;
MetaX11Display *x11_display;
if (window->frame)
return;
x11_display = window->display->x11_display;
frame = g_new (MetaFrame, 1);
frame->window = window;
@ -61,8 +65,8 @@ meta_window_ensure_frame (MetaWindow *window)
frame->rect.x, frame->rect.y,
frame->rect.width, frame->rect.height);
frame->ui_frame = meta_ui_create_frame (window->screen->ui,
window->display->xdisplay,
frame->ui_frame = meta_ui_create_frame (x11_display->ui,
x11_display->xdisplay,
frame->window,
window->xvisual,
frame->rect.x,
@ -72,18 +76,18 @@ meta_window_ensure_frame (MetaWindow *window)
&create_serial);
frame->xwindow = frame->ui_frame->xwindow;
meta_stack_tracker_record_add (window->screen->stack_tracker,
meta_stack_tracker_record_add (window->display->stack_tracker,
frame->xwindow,
create_serial);
meta_verbose ("Frame for %s is 0x%lx\n", frame->window->desc, frame->xwindow);
attrs.event_mask = EVENT_MASK;
XChangeWindowAttributes (window->display->xdisplay,
XChangeWindowAttributes (x11_display->xdisplay,
frame->xwindow, CWEventMask, &attrs);
meta_display_register_x_window (window->display, &frame->xwindow, window);
meta_x11_display_register_x_window (x11_display, &frame->xwindow, window);
meta_error_trap_push (window->display);
meta_x11_error_trap_push (x11_display);
if (window->mapped)
{
window->mapped = FALSE; /* the reparent will unmap the window,
@ -94,16 +98,16 @@ meta_window_ensure_frame (MetaWindow *window)
window->unmaps_pending += 1;
}
meta_stack_tracker_record_remove (window->screen->stack_tracker,
meta_stack_tracker_record_remove (window->display->stack_tracker,
window->xwindow,
XNextRequest (window->display->xdisplay));
XReparentWindow (window->display->xdisplay,
XNextRequest (x11_display->xdisplay));
XReparentWindow (x11_display->xdisplay,
window->xwindow,
frame->xwindow,
frame->child_x,
frame->child_y);
/* FIXME handle this error */
meta_error_trap_pop (window->display);
meta_x11_error_trap_pop (x11_display);
/* stick frame to the window */
window->frame = frame;
@ -114,7 +118,7 @@ meta_window_ensure_frame (MetaWindow *window)
meta_frame_update_style (frame);
meta_frame_update_title (frame);
meta_ui_map_frame (frame->window->screen->ui, frame->xwindow);
meta_ui_map_frame (x11_display->ui, frame->xwindow);
{
MetaBackend *backend = meta_get_backend ();
@ -125,7 +129,7 @@ meta_window_ensure_frame (MetaWindow *window)
/* Since the backend selects for events on another connection,
* make sure to sync the GTK+ connection to ensure that the
* frame window has been created on the server at this point. */
XSync (window->display->xdisplay, False);
XSync (x11_display->xdisplay, False);
unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
@ -152,10 +156,13 @@ meta_window_destroy_frame (MetaWindow *window)
{
MetaFrame *frame;
MetaFrameBorders borders;
MetaX11Display *x11_display;
if (window->frame == NULL)
return;
x11_display = window->display->x11_display;
meta_verbose ("Unframing window %s\n", window->desc);
frame = window->frame;
@ -167,7 +174,7 @@ meta_window_destroy_frame (MetaWindow *window)
/* Unparent the client window; it may be destroyed,
* thus the error trap.
*/
meta_error_trap_push (window->display);
meta_x11_error_trap_push (x11_display);
if (window->mapped)
{
window->mapped = FALSE; /* Keep track of unmapping it, so we
@ -178,24 +185,23 @@ meta_window_destroy_frame (MetaWindow *window)
"Incrementing unmaps_pending on %s for reparent back to root\n", window->desc);
window->unmaps_pending += 1;
}
meta_stack_tracker_record_add (window->screen->stack_tracker,
meta_stack_tracker_record_add (window->display->stack_tracker,
window->xwindow,
XNextRequest (window->display->xdisplay));
XReparentWindow (window->display->xdisplay,
XNextRequest (x11_display->xdisplay));
XReparentWindow (x11_display->xdisplay,
window->xwindow,
window->screen->xroot,
x11_display->xroot,
/* Using anything other than client root window coordinates
* coordinates here means we'll need to ensure a configure
* notify event is sent; see bug 399552.
*/
window->frame->rect.x + borders.invisible.left,
window->frame->rect.y + borders.invisible.top);
meta_error_trap_pop (window->display);
meta_x11_error_trap_pop (x11_display);
meta_ui_frame_unmanage (frame->ui_frame);
meta_display_unregister_x_window (window->display,
frame->xwindow);
meta_x11_display_unregister_x_window (x11_display, frame->xwindow);
window->frame = NULL;
if (window->frame_bounds)
@ -369,18 +375,22 @@ void
meta_frame_set_screen_cursor (MetaFrame *frame,
MetaCursor cursor)
{
MetaX11Display *x11_display;
Cursor xcursor;
if (cursor == frame->current_cursor)
return;
frame->current_cursor = cursor;
x11_display = frame->window->display->x11_display;
if (cursor == META_CURSOR_DEFAULT)
XUndefineCursor (frame->window->display->xdisplay, frame->xwindow);
XUndefineCursor (x11_display->xdisplay, frame->xwindow);
else
{
xcursor = meta_display_create_x_cursor (frame->window->display, cursor);
XDefineCursor (frame->window->display->xdisplay, frame->xwindow, xcursor);
XFlush (frame->window->display->xdisplay);
XFreeCursor (frame->window->display->xdisplay, xcursor);
xcursor = meta_x11_display_create_x_cursor (x11_display, cursor);
XDefineCursor (x11_display->xdisplay, frame->xwindow, xcursor);
XFlush (x11_display->xdisplay);
XFreeCursor (x11_display->xdisplay, xcursor);
}
}

View File

@ -127,8 +127,6 @@ typedef struct
void meta_display_init_keys (MetaDisplay *display);
void meta_display_shutdown_keys (MetaDisplay *display);
void meta_screen_grab_keys (MetaScreen *screen);
void meta_screen_ungrab_keys (MetaScreen *screen);
void meta_window_grab_keys (MetaWindow *window);
void meta_window_ungrab_keys (MetaWindow *window);
gboolean meta_window_grab_all_keys (MetaWindow *window,
@ -152,4 +150,7 @@ GList *meta_prefs_get_keybindings (void);
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
const char *meta_prefs_get_iso_next_group_option (void);
void meta_x11_display_grab_keys (MetaX11Display *x11_display);
void meta_x11_display_ungrab_keys (MetaX11Display *x11_display);
#endif

View File

@ -29,12 +29,12 @@
#include <config.h>
#include "keybindings-private.h"
#include "meta-workspace-manager-private.h"
#include "workspace-private.h"
#include <meta/compositor.h>
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "edge-resistance.h"
#include "frame.h"
#include "screen-private.h"
#include <meta/prefs.h>
#include "meta-accel-parse.h"
@ -48,6 +48,7 @@
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-logical-monitor.h"
#include "backends/x11/meta-backend-x11.h"
#include "x11/meta-x11-display-private.h"
#include "x11/window-x11.h"
#ifdef HAVE_NATIVE_BACKEND
@ -169,17 +170,14 @@ meta_key_binding_is_builtin (MetaKeyBinding *binding)
*/
static gboolean process_mouse_move_resize_grab (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event);
static gboolean process_keyboard_move_grab (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event);
static gboolean process_keyboard_resize_grab (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event);
@ -879,7 +877,8 @@ ungrab_key_bindings (MetaDisplay *display)
{
GSList *windows, *l;
meta_screen_ungrab_keys (display->screen);
if (display->x11_display)
meta_x11_display_ungrab_keys (display->x11_display);
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
for (l = windows; l; l = l->next)
@ -896,7 +895,8 @@ grab_key_bindings (MetaDisplay *display)
{
GSList *windows, *l;
meta_screen_grab_keys (display->screen);
if (display->x11_display)
meta_x11_display_grab_keys (display->x11_display);
windows = meta_display_list_windows (display, META_LIST_DEFAULT);
for (l = windows; l; l = l->next)
@ -1476,42 +1476,44 @@ change_binding_keygrabs (MetaKeyBindingManager *keys,
}
static void
meta_screen_change_keygrabs (MetaScreen *screen,
gboolean grab)
meta_x11_display_change_keygrabs (MetaX11Display *x11_display,
gboolean grab)
{
MetaDisplay *display = screen->display;
MetaKeyBindingManager *keys = &display->key_binding_manager;
MetaKeyBindingManager *keys = &x11_display->display->key_binding_manager;
int i;
if (keys->overlay_resolved_key_combo.len != 0)
meta_change_keygrab (keys, screen->xroot, grab, &keys->overlay_resolved_key_combo);
meta_change_keygrab (keys, x11_display->xroot,
grab, &keys->overlay_resolved_key_combo);
for (i = 0; i < keys->n_iso_next_group_combos; i++)
meta_change_keygrab (keys, screen->xroot, grab, &keys->iso_next_group_combo[i]);
meta_change_keygrab (keys, x11_display->xroot,
grab, &keys->iso_next_group_combo[i]);
change_binding_keygrabs (keys, screen->xroot, FALSE, grab);
change_binding_keygrabs (keys, x11_display->xroot,
FALSE, grab);
}
void
meta_screen_grab_keys (MetaScreen *screen)
meta_x11_display_grab_keys (MetaX11Display *x11_display)
{
if (screen->keys_grabbed)
if (x11_display->keys_grabbed)
return;
meta_screen_change_keygrabs (screen, TRUE);
meta_x11_display_change_keygrabs (x11_display, TRUE);
screen->keys_grabbed = TRUE;
x11_display->keys_grabbed = TRUE;
}
void
meta_screen_ungrab_keys (MetaScreen *screen)
meta_x11_display_ungrab_keys (MetaX11Display *x11_display)
{
if (!screen->keys_grabbed)
if (!x11_display->keys_grabbed)
return;
meta_screen_change_keygrabs (screen, FALSE);
meta_x11_display_change_keygrabs (x11_display, FALSE);
screen->keys_grabbed = FALSE;
x11_display->keys_grabbed = FALSE;
}
static void
@ -1579,7 +1581,6 @@ meta_window_ungrab_keys (MetaWindow *window)
static void
handle_external_grab (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -1621,7 +1622,7 @@ meta_display_grab_accelerator (MetaDisplay *display,
return META_KEYBINDING_ACTION_NONE;
}
meta_change_keygrab (keys, display->screen->xroot, TRUE, &resolved_combo);
meta_change_keygrab (keys, display->x11_display->xroot, TRUE, &resolved_combo);
grab = g_new0 (MetaKeyGrab, 1);
grab->action = next_dynamic_keybinding_action ();
@ -1665,7 +1666,8 @@ meta_display_ungrab_accelerator (MetaDisplay *display,
{
int i;
meta_change_keygrab (keys, display->screen->xroot, FALSE, &binding->resolved_combo);
meta_change_keygrab (keys, display->x11_display->xroot,
FALSE, &binding->resolved_combo);
for (i = 0; i < binding->resolved_combo.len; i++)
{
@ -1855,21 +1857,20 @@ is_modifier (xkb_keysym_t keysym)
static void
invoke_handler (MetaDisplay *display,
MetaScreen *screen,
MetaKeyHandler *handler,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding)
{
if (handler->func)
(* handler->func) (display, screen,
(* handler->func) (display,
handler->flags & META_KEY_BINDING_PER_WINDOW ?
window : NULL,
event,
binding,
handler->user_data);
else
(* handler->default_func) (display, screen,
(* handler->default_func) (display,
handler->flags & META_KEY_BINDING_PER_WINDOW ?
window: NULL,
event,
@ -1879,7 +1880,6 @@ invoke_handler (MetaDisplay *display,
static gboolean
process_event (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event)
{
@ -1929,7 +1929,7 @@ process_event (MetaDisplay *display,
*/
display->allow_terminal_deactivation = TRUE;
invoke_handler (display, screen, binding->handler, window, event, binding);
invoke_handler (display, binding->handler, window, event, binding);
return TRUE;
@ -1941,7 +1941,6 @@ process_event (MetaDisplay *display,
static gboolean
process_overlay_key (MetaDisplay *display,
MetaScreen *screen,
ClutterKeyEvent *event,
MetaWindow *window)
{
@ -1982,7 +1981,7 @@ process_overlay_key (MetaDisplay *display,
* the event. Other clients with global grabs will be out of
* luck.
*/
if (process_event (display, screen, window, event))
if (process_event (display, window, event))
{
/* As normally, after we've handled a global key
* binding, we unfreeze the keyboard but keep the grab
@ -2067,7 +2066,6 @@ process_overlay_key (MetaDisplay *display,
static gboolean
process_iso_next_group (MetaDisplay *display,
MetaScreen *screen,
ClutterKeyEvent *event)
{
MetaKeyBindingManager *keys = &display->key_binding_manager;
@ -2111,20 +2109,15 @@ process_key_event (MetaDisplay *display,
gboolean keep_grab;
gboolean all_keys_grabbed;
gboolean handled;
MetaScreen *screen;
/* window may be NULL */
screen = display->screen;
all_keys_grabbed = window ? window->all_keys_grabbed : FALSE;
if (!all_keys_grabbed)
{
handled = process_overlay_key (display, screen, event, window);
handled = process_overlay_key (display, event, window);
if (handled)
return TRUE;
handled = process_iso_next_group (display, screen, event);
handled = process_iso_next_group (display, event);
if (handled)
return TRUE;
}
@ -2158,20 +2151,20 @@ process_key_event (MetaDisplay *display,
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard move\n");
keep_grab = process_keyboard_move_grab (display, screen, window, event);
keep_grab = process_keyboard_move_grab (display, window, event);
}
else
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for keyboard resize\n");
keep_grab = process_keyboard_resize_grab (display, screen, window, event);
keep_grab = process_keyboard_resize_grab (display, window, event);
}
}
else
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Processing event for mouse-only move/resize\n");
keep_grab = process_mouse_move_resize_grab (display, screen, window, event);
keep_grab = process_mouse_move_resize_grab (display, window, event);
}
}
if (!keep_grab)
@ -2181,7 +2174,7 @@ process_key_event (MetaDisplay *display,
}
/* Do the normal keybindings */
return process_event (display, screen, window, event);
return process_event (display, window, event);
}
/* Handle a key event. May be called recursively: some key events cause
@ -2223,7 +2216,6 @@ meta_keybindings_process_event (MetaDisplay *display,
static gboolean
process_mouse_move_resize_grab (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event)
{
@ -2236,8 +2228,8 @@ process_mouse_move_resize_grab (MetaDisplay *display,
MetaTileMode tile_mode;
/* Hide the tiling preview if necessary */
if (screen->preview_tile_mode != META_TILE_NONE)
meta_screen_hide_tile_preview (screen);
if (display->preview_tile_mode != META_TILE_NONE)
meta_display_hide_tile_preview (display);
/* Restore the original tile mode */
tile_mode = display->grab_tile_mode;
@ -2272,7 +2264,6 @@ process_mouse_move_resize_grab (MetaDisplay *display,
static gboolean
process_keyboard_move_grab (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event)
{
@ -2389,7 +2380,6 @@ process_keyboard_move_grab (MetaDisplay *display,
static gboolean
process_keyboard_resize_grab_op_change (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event)
{
@ -2510,7 +2500,6 @@ process_keyboard_resize_grab_op_change (MetaDisplay *display,
static gboolean
process_keyboard_resize_grab (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event)
{
@ -2545,7 +2534,7 @@ process_keyboard_resize_grab (MetaDisplay *display,
return FALSE;
}
if (process_keyboard_resize_grab_op_change (display, screen, window, event))
if (process_keyboard_resize_grab_op_change (display, window, event))
return TRUE;
width = window->rect.width;
@ -2740,26 +2729,26 @@ process_keyboard_resize_grab (MetaDisplay *display,
static void
handle_switch_to_last_workspace (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *event_window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
gint target = meta_screen_get_n_workspaces(screen) - 1;
MetaWorkspace *workspace = meta_screen_get_workspace_by_index (screen, target);
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
gint target = meta_workspace_manager_get_n_workspaces (workspace_manager) - 1;
MetaWorkspace *workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, target);
meta_workspace_activate (workspace, event->time);
}
static void
handle_switch_to_workspace (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *event_window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
gint which = binding->handler->data;
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
MetaWorkspace *workspace;
if (which < 0)
@ -2768,12 +2757,12 @@ handle_switch_to_workspace (MetaDisplay *display,
* current workspace.
*/
workspace = meta_workspace_get_neighbor (screen->active_workspace,
workspace = meta_workspace_get_neighbor (workspace_manager->active_workspace,
which);
}
else
{
workspace = meta_screen_get_workspace_by_index (screen, which);
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
}
if (workspace)
@ -2789,7 +2778,6 @@ handle_switch_to_workspace (MetaDisplay *display,
static void
handle_maximize_vertically (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -2806,7 +2794,6 @@ handle_maximize_vertically (MetaDisplay *display,
static void
handle_maximize_horizontally (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -2823,7 +2810,6 @@ handle_maximize_horizontally (MetaDisplay *display,
static void
handle_always_on_top (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -2837,7 +2823,6 @@ handle_always_on_top (MetaDisplay *display,
static void
handle_move_to_corner_backend (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
int gravity)
{
@ -2896,95 +2881,86 @@ handle_move_to_corner_backend (MetaDisplay *display,
static void
handle_move_to_corner_nw (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, NorthWestGravity);
handle_move_to_corner_backend (display, window, NorthWestGravity);
}
static void
handle_move_to_corner_ne (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, NorthEastGravity);
handle_move_to_corner_backend (display, window, NorthEastGravity);
}
static void
handle_move_to_corner_sw (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, SouthWestGravity);
handle_move_to_corner_backend (display, window, SouthWestGravity);
}
static void
handle_move_to_corner_se (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, SouthEastGravity);
handle_move_to_corner_backend (display, window, SouthEastGravity);
}
static void
handle_move_to_side_n (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, NorthGravity);
handle_move_to_corner_backend (display, window, NorthGravity);
}
static void
handle_move_to_side_s (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, SouthGravity);
handle_move_to_corner_backend (display, window, SouthGravity);
}
static void
handle_move_to_side_e (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, EastGravity);
handle_move_to_corner_backend (display, window, EastGravity);
}
static void
handle_move_to_side_w (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
handle_move_to_corner_backend (display, screen, window, WestGravity);
handle_move_to_corner_backend (display, window, WestGravity);
}
static void
handle_move_to_center (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3004,32 +2980,33 @@ handle_move_to_center (MetaDisplay *display,
static void
handle_show_desktop (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
if (screen->active_workspace->showing_desktop)
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
if (workspace_manager->active_workspace->showing_desktop)
{
meta_screen_unshow_desktop (screen);
meta_workspace_focus_default_window (screen->active_workspace,
meta_workspace_manager_unshow_desktop (workspace_manager);
meta_workspace_focus_default_window (workspace_manager->active_workspace,
NULL,
event->time);
}
else
meta_screen_show_desktop (screen, event->time);
meta_workspace_manager_show_desktop (workspace_manager, event->time);
}
static void
handle_panel (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
MetaKeyBindingAction action = binding->handler->data;
MetaX11Display *x11_display = display->x11_display;
Atom action_atom;
XClientMessageEvent ev;
@ -3038,18 +3015,18 @@ handle_panel (MetaDisplay *display,
{
/* FIXME: The numbers are wrong */
case META_KEYBINDING_ACTION_PANEL_MAIN_MENU:
action_atom = display->atom__GNOME_PANEL_ACTION_MAIN_MENU;
action_atom = x11_display->atom__GNOME_PANEL_ACTION_MAIN_MENU;
break;
case META_KEYBINDING_ACTION_PANEL_RUN_DIALOG:
action_atom = display->atom__GNOME_PANEL_ACTION_RUN_DIALOG;
action_atom = x11_display->atom__GNOME_PANEL_ACTION_RUN_DIALOG;
break;
default:
return;
}
ev.type = ClientMessage;
ev.window = screen->xroot;
ev.message_type = display->atom__GNOME_PANEL_ACTION;
ev.window = x11_display->xroot;
ev.message_type = x11_display->atom__GNOME_PANEL_ACTION;
ev.format = 32;
ev.data.l[0] = action_atom;
ev.data.l[1] = event->time;
@ -3059,23 +3036,22 @@ handle_panel (MetaDisplay *display,
"off due to keybinding press\n", event->time);
display->mouse_mode = FALSE;
meta_error_trap_push (display);
meta_x11_error_trap_push (x11_display);
/* Release the grab for the panel before sending the event */
XUngrabKeyboard (display->xdisplay, event->time);
XUngrabKeyboard (x11_display->xdisplay, event->time);
XSendEvent (display->xdisplay,
screen->xroot,
XSendEvent (x11_display->xdisplay,
x11_display->xroot,
False,
StructureNotifyMask,
(XEvent*) &ev);
meta_error_trap_pop (display);
meta_x11_error_trap_pop (x11_display);
}
static void
handle_activate_window_menu (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *event_window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3101,12 +3077,12 @@ handle_activate_window_menu (MetaDisplay *display,
static void
do_choose_window (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *event_window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gboolean backward)
{
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
MetaTabList type = binding->handler->data;
MetaWindow *window;
@ -3115,7 +3091,7 @@ do_choose_window (MetaDisplay *display,
window = meta_display_get_tab_next (display,
type,
screen->active_workspace,
workspace_manager->active_workspace,
NULL,
backward);
@ -3125,31 +3101,28 @@ do_choose_window (MetaDisplay *display,
static void
handle_switch (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *event_window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
gboolean backwards = meta_key_binding_is_reversed (binding);
do_choose_window (display, screen, event_window, event, binding, backwards);
do_choose_window (display, event_window, event, binding, backwards);
}
static void
handle_cycle (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *event_window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
gboolean backwards = meta_key_binding_is_reversed (binding);
do_choose_window (display, screen, event_window, event, binding, backwards);
do_choose_window (display, event_window, event, binding, backwards);
}
static void
handle_toggle_fullscreen (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3163,7 +3136,6 @@ handle_toggle_fullscreen (MetaDisplay *display,
static void
handle_toggle_above (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3177,7 +3149,6 @@ handle_toggle_above (MetaDisplay *display,
static void
handle_toggle_tiled (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3214,7 +3185,6 @@ handle_toggle_tiled (MetaDisplay *display,
static void
handle_toggle_maximized (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3228,7 +3198,6 @@ handle_toggle_maximized (MetaDisplay *display,
static void
handle_maximize (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3240,7 +3209,6 @@ handle_maximize (MetaDisplay *display,
static void
handle_unmaximize (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3252,7 +3220,6 @@ handle_unmaximize (MetaDisplay *display,
static void
handle_toggle_shaded (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3266,7 +3233,6 @@ handle_toggle_shaded (MetaDisplay *display,
static void
handle_close (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3278,7 +3244,6 @@ handle_close (MetaDisplay *display,
static void
handle_minimize (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3290,7 +3255,6 @@ handle_minimize (MetaDisplay *display,
static void
handle_begin_move (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3307,7 +3271,6 @@ handle_begin_move (MetaDisplay *display,
static void
handle_begin_resize (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3324,7 +3287,6 @@ handle_begin_resize (MetaDisplay *display,
static void
handle_toggle_on_all_workspaces (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3338,32 +3300,32 @@ handle_toggle_on_all_workspaces (MetaDisplay *display,
static void
handle_move_to_workspace_last (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
gint which;
MetaWorkspace *workspace;
if (window->always_sticky)
return;
which = meta_screen_get_n_workspaces (screen) - 1;
workspace = meta_screen_get_workspace_by_index (screen, which);
which = meta_workspace_manager_get_n_workspaces (workspace_manager) - 1;
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
meta_window_change_workspace (window, workspace);
}
static void
handle_move_to_workspace (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
gpointer dummy)
{
MetaWorkspaceManager *workspace_manager = display->workspace_manager;
gint which = binding->handler->data;
gboolean flip = (which < 0);
MetaWorkspace *workspace;
@ -3382,12 +3344,12 @@ handle_move_to_workspace (MetaDisplay *display,
workspace = NULL;
if (flip)
{
workspace = meta_workspace_get_neighbor (screen->active_workspace,
workspace = meta_workspace_get_neighbor (workspace_manager->active_workspace,
which);
}
else
{
workspace = meta_screen_get_workspace_by_index (screen, which);
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, which);
}
if (workspace)
@ -3399,7 +3361,7 @@ handle_move_to_workspace (MetaDisplay *display,
meta_topic (META_DEBUG_FOCUS,
"Resetting mouse_mode to FALSE due to "
"handle_move_to_workspace() call with flip set.\n");
meta_display_clear_mouse_mode (workspace->screen->display);
meta_display_clear_mouse_mode (workspace->display);
meta_workspace_activate_with_focus (workspace,
window,
event->time);
@ -3413,7 +3375,6 @@ handle_move_to_workspace (MetaDisplay *display,
static void
handle_move_to_monitor (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3437,7 +3398,6 @@ handle_move_to_monitor (MetaDisplay *display,
static void
handle_raise_or_lower (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3448,7 +3408,7 @@ handle_raise_or_lower (MetaDisplay *display,
MetaWindow *above = NULL;
/* Check if top */
if (meta_stack_get_top (window->screen->stack) == window)
if (meta_stack_get_top (window->display->stack) == window)
{
meta_window_lower (window);
return;
@ -3456,7 +3416,7 @@ handle_raise_or_lower (MetaDisplay *display,
/* else check if windows in same layer are intersecting it */
above = meta_stack_get_above (window->screen->stack, window, TRUE);
above = meta_stack_get_above (window->display->stack, window, TRUE);
while (above)
{
@ -3475,7 +3435,7 @@ handle_raise_or_lower (MetaDisplay *display,
}
}
above = meta_stack_get_above (window->screen->stack, above, TRUE);
above = meta_stack_get_above (window->display->stack, above, TRUE);
}
/* window is not obscured */
@ -3484,7 +3444,6 @@ handle_raise_or_lower (MetaDisplay *display,
static void
handle_raise (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3495,7 +3454,6 @@ handle_raise (MetaDisplay *display,
static void
handle_lower (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3506,7 +3464,6 @@ handle_lower (MetaDisplay *display,
static void
handle_set_spew_mark (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3518,7 +3475,6 @@ handle_set_spew_mark (MetaDisplay *display,
#ifdef HAVE_NATIVE_BACKEND
static void
handle_switch_vt (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3537,7 +3493,6 @@ handle_switch_vt (MetaDisplay *display,
static void
handle_switch_monitor (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3558,7 +3513,6 @@ handle_switch_monitor (MetaDisplay *display,
static void
handle_rotate_monitor (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -3573,7 +3527,6 @@ handle_rotate_monitor (MetaDisplay *display,
static void
handle_restore_shortcuts (MetaDisplay *display,
MetaScreen *screen,
MetaWindow *window,
ClutterKeyEvent *event,
MetaKeyBinding *binding,
@ -4216,28 +4169,28 @@ init_builtin_key_bindings (MetaDisplay *display)
common_keybindings,
META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT,
handle_move_to_monitor, META_SCREEN_LEFT);
handle_move_to_monitor, META_DISPLAY_LEFT);
add_builtin_keybinding (display,
"move-to-monitor-right",
common_keybindings,
META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT,
handle_move_to_monitor, META_SCREEN_RIGHT);
handle_move_to_monitor, META_DISPLAY_RIGHT);
add_builtin_keybinding (display,
"move-to-monitor-down",
common_keybindings,
META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN,
handle_move_to_monitor, META_SCREEN_DOWN);
handle_move_to_monitor, META_DISPLAY_DOWN);
add_builtin_keybinding (display,
"move-to-monitor-up",
common_keybindings,
META_KEY_BINDING_PER_WINDOW,
META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP,
handle_move_to_monitor, META_SCREEN_UP);
handle_move_to_monitor, META_DISPLAY_UP);
add_builtin_keybinding (display,
"raise-or-lower",

View File

@ -31,4 +31,6 @@ typedef enum _MetaCompositorType
void meta_override_compositor_configuration (MetaCompositorType compositor_type,
GType backend_gtype);
gboolean meta_should_autostart_x11_display (void);
#endif /* META_MAIN_PRIVATE_H */

View File

@ -47,7 +47,7 @@
#include <meta/main.h>
#include "util-private.h"
#include "display-private.h"
#include <meta/errors.h>
#include <meta/meta-x11-errors.h>
#include "ui.h"
#include <meta/prefs.h>
#include <meta/compositor.h>
@ -177,6 +177,7 @@ static gboolean opt_sync;
#ifdef HAVE_WAYLAND
static gboolean opt_wayland;
static gboolean opt_nested;
static gboolean opt_no_x11;
#endif
#ifdef HAVE_NATIVE_BACKEND
static gboolean opt_display_server;
@ -232,6 +233,12 @@ static GOptionEntry meta_options[] = {
N_("Run as a nested compositor"),
NULL
},
{
"no-x11", 0, 0, G_OPTION_ARG_NONE,
&opt_no_x11,
N_("Run wayland compositor without starting Xwayland"),
NULL
},
#endif
#ifdef HAVE_NATIVE_BACKEND
{
@ -300,7 +307,7 @@ meta_finalize (void)
if (display)
meta_display_close (display,
CurrentTime); /* I doubt correct timestamps matter here */
META_CURRENT_TIME); /* I doubt correct timestamps matter here */
#ifdef HAVE_WAYLAND
if (meta_is_wayland_compositor ())
@ -417,7 +424,7 @@ check_for_wayland_session_type (void)
*
* If no flag is passed that forces the compositor type, the compositor type
* is determined first from the logind session type, or if that fails, from the
* XDG_SESSION_TYPE enviornment variable.
* XDG_SESSION_TYPE environment variable.
*
* If no flag is passed that forces the backend type, the backend type is
* determined given the compositor type. If the compositor is a Wayland
@ -453,6 +460,12 @@ calculate_compositor_configuration (MetaCompositorType *compositor_type,
run_as_wayland_compositor = check_for_wayland_session_type ();
#endif /* HAVE_NATIVE_BACKEND */
if (!run_as_wayland_compositor && opt_no_x11)
{
meta_warning ("Can't disable X11 support on X11 compositor\n");
meta_exit (META_EXIT_ERROR);
}
if (run_as_wayland_compositor)
*compositor_type = META_COMPOSITOR_TYPE_WAYLAND;
else
@ -600,9 +613,21 @@ meta_init (void)
meta_main_loop = g_main_loop_new (NULL, FALSE);
meta_ui_init ();
/*
* We need to make sure the first client connecting to the X server
* (e.g. Xwayland started from meta_wayland_init() above) is a permanent one,
* so prepare the GDK X11 connection now already. Without doing this, if
* there are any functionality that relies on X11 after here before
* meta_display_open(), the X server will terminate itself when such a client
* disconnects before the permanent GDK client connects.
*/
if (meta_should_autostart_x11_display ())
{
GError *error = NULL;
meta_restart_init ();
if (!meta_x11_init_gdk_display (&error))
g_error ("Failed to open X11 display: %s", error->message);
}
}
/**
@ -713,3 +738,16 @@ prefs_changed_callback (MetaPreference pref,
break;
}
}
gboolean
meta_should_autostart_x11_display (void)
{
MetaBackend *backend = meta_get_backend ();
gboolean wants_x11 = TRUE;
#ifdef HAVE_WAYLAND
wants_x11 = !opt_no_x11;
#endif
return META_IS_BACKEND_X11_CM (backend) || wants_x11;
}

View File

@ -28,6 +28,7 @@
#include "window-private.h"
#include <meta/meta-close-dialog.h>
#include "meta-close-dialog-default-private.h"
#include "x11/meta-x11-display-private.h"
#include <sys/types.h>
#include <sys/wait.h>
@ -157,7 +158,7 @@ meta_close_dialog_default_show (MetaCloseDialog *dialog)
dialog_pid =
meta_show_dialog ("--question",
window_content, NULL,
window->screen->screen_name,
window->display->x11_display->screen_name,
_("_Force Quit"), _("_Wait"),
"face-sad-symbolic", window->xwindow,
NULL, NULL);

View File

@ -0,0 +1,96 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
* Copyright (C) 2003, 2004 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
*
* 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_WORKSPACE_MANAGER_PRIVATE_H
#define META_WORKSPACE_MANAGER_PRIVATE_H
#include <glib.h>
#include "core/display-private.h"
#include "meta/common.h"
#include "meta/types.h"
#include "meta/meta-workspace-manager.h"
struct _MetaWorkspaceManager
{
GObject parent;
MetaDisplay *display;
MetaWorkspace *active_workspace;
GList *workspaces;
int rows_of_workspaces;
int columns_of_workspaces;
MetaDisplayCorner starting_corner;
guint vertical_workspaces : 1;
guint workspace_layout_overridden : 1;
};
MetaWorkspaceManager *meta_workspace_manager_new (MetaDisplay *display);
void meta_workspace_manager_init_workspaces (MetaWorkspaceManager *workspace_manager);
void meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_manager,
MetaDisplayCorner starting_corner,
gboolean vertical_layout,
int n_rows,
int n_columns);
void meta_workspace_manager_reload_work_areas (MetaWorkspaceManager *workspace_manager);
typedef struct MetaWorkspaceLayout MetaWorkspaceLayout;
struct MetaWorkspaceLayout
{
int rows;
int cols;
int *grid;
int grid_area;
int current_row;
int current_col;
};
void meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_manager,
int num_workspaces,
int current_space,
MetaWorkspaceLayout *layout);
void meta_workspace_manager_free_workspace_layout (MetaWorkspaceLayout *layout);
void meta_workspace_manager_minimize_all_on_active_workspace_except (MetaWorkspaceManager *workspace_manager,
MetaWindow *keep);
/* Show/hide the desktop (temporarily hide all windows) */
void meta_workspace_manager_show_desktop (MetaWorkspaceManager *workspace_manager,
guint32 timestamp);
void meta_workspace_manager_unshow_desktop (MetaWorkspaceManager *workspace_manager);
void meta_workspace_manager_workspace_switched (MetaWorkspaceManager *workspace_manager,
int from,
int to,
MetaMotionDirection direction);
void meta_workspace_manager_update_num_workspaces (MetaWorkspaceManager *workspace_manager,
guint32 timestamp,
int new_num);
#endif /* META_WORKSPACE_MANAGER_PRIVATE_H */

View File

@ -0,0 +1,951 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
* Copyright (C) 2003, 2004 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren
*
* 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 "core/meta-workspace-manager-private.h"
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "core/window-private.h"
#include "core/workspace-private.h"
#include "meta/meta-enum-types.h"
#include "meta/prefs.h"
#include "meta/util.h"
G_DEFINE_TYPE (MetaWorkspaceManager, meta_workspace_manager, G_TYPE_OBJECT)
enum
{
WORKSPACE_ADDED,
WORKSPACE_REMOVED,
WORKSPACE_SWITCHED,
ACTIVE_WORKSPACE_CHANGED,
SHOWING_DESKTOP_CHANGED,
LAST_SIGNAL
};
enum {
PROP_0,
PROP_N_WORKSPACES
};
static guint workspace_manager_signals [LAST_SIGNAL] = { 0 };
static void prefs_changed_callback (MetaPreference pref,
gpointer data);
static void
meta_workspace_manager_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaWorkspaceManager *workspace_manager = META_WORKSPACE_MANAGER (object);
switch (prop_id)
{
case PROP_N_WORKSPACES:
g_value_set_int (value, meta_workspace_manager_get_n_workspaces (workspace_manager));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
meta_workspace_manager_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
meta_workspace_manager_finalize (GObject *object)
{
MetaWorkspaceManager *workspace_manager = META_WORKSPACE_MANAGER (object);
meta_prefs_remove_listener (prefs_changed_callback, workspace_manager);
G_OBJECT_CLASS (meta_workspace_manager_parent_class)->finalize (object);
}
static void
meta_workspace_manager_class_init (MetaWorkspaceManagerClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->get_property = meta_workspace_manager_get_property;
object_class->set_property = meta_workspace_manager_set_property;
object_class->finalize = meta_workspace_manager_finalize;
workspace_manager_signals[WORKSPACE_ADDED] =
g_signal_new ("workspace-added",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE,
1,
G_TYPE_INT);
workspace_manager_signals[WORKSPACE_REMOVED] =
g_signal_new ("workspace-removed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE,
1,
G_TYPE_INT);
workspace_manager_signals[WORKSPACE_SWITCHED] =
g_signal_new ("workspace-switched",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE,
3,
G_TYPE_INT,
G_TYPE_INT,
META_TYPE_MOTION_DIRECTION);
workspace_manager_signals[ACTIVE_WORKSPACE_CHANGED] =
g_signal_new ("active-workspace-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
workspace_manager_signals[SHOWING_DESKTOP_CHANGED] =
g_signal_new ("showing-desktop-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
g_object_class_install_property (object_class,
PROP_N_WORKSPACES,
g_param_spec_int ("n-workspaces",
"N Workspaces",
"Number of workspaces",
1, G_MAXINT, 1,
G_PARAM_READABLE));
}
static void
meta_workspace_manager_init (MetaWorkspaceManager *workspace_manager)
{
}
void
meta_workspace_manager_reload_work_areas (MetaWorkspaceManager *workspace_manager)
{
GList *l;
for (l = workspace_manager->workspaces; l; l = l->next)
{
MetaWorkspace *workspace = l->data;
meta_workspace_invalidate_work_area (workspace);
}
}
MetaWorkspaceManager *
meta_workspace_manager_new (MetaDisplay *display)
{
MetaWorkspaceManager *workspace_manager;
workspace_manager = g_object_new (META_TYPE_WORKSPACE_MANAGER, NULL);
workspace_manager->display = display;
workspace_manager->active_workspace = NULL;
workspace_manager->workspaces = NULL;
workspace_manager->rows_of_workspaces = 1;
workspace_manager->columns_of_workspaces = -1;
workspace_manager->vertical_workspaces = FALSE;
workspace_manager->starting_corner = META_DISPLAY_TOPLEFT;
/* This is the default layout extracted from default
* variable values in update_num_workspaces ()
* This can be overriden using _NET_DESKTOP_LAYOUT in
* meta_x11_display_new (), if it's specified */
meta_workspace_manager_update_workspace_layout (workspace_manager,
META_DISPLAY_TOPLEFT,
FALSE,
-1,
1);
/* There must be at least one workspace at all times,
* so create that required workspace.
*/
meta_workspace_new (workspace_manager);
meta_workspace_manager_init_workspaces (workspace_manager);
meta_prefs_add_listener (prefs_changed_callback, workspace_manager);
return workspace_manager;
}
void
meta_workspace_manager_init_workspaces (MetaWorkspaceManager *workspace_manager)
{
int num;
g_return_if_fail (META_IS_WORKSPACE_MANAGER (workspace_manager));
if (meta_prefs_get_dynamic_workspaces ())
/* This will be properly updated using _NET_NUMBER_OF_DESKTOPS
* (if set) in meta_x11_display_new () */
num = 1;
else
num = meta_prefs_get_num_workspaces ();
meta_workspace_manager_update_num_workspaces (workspace_manager, META_CURRENT_TIME, num);
meta_workspace_activate (workspace_manager->workspaces->data, META_CURRENT_TIME);
meta_workspace_manager_reload_work_areas (workspace_manager);
}
int
meta_workspace_manager_get_n_workspaces (MetaWorkspaceManager *workspace_manager)
{
return g_list_length (workspace_manager->workspaces);
}
/**
* meta_workspace_manager_get_workspace_by_index:
* @workspace_manager: a #MetaWorkspaceManager
* @index: index of one of the display's workspaces
*
* Gets the workspace object for one of a workspace manager's workspaces given the workspace
* index. It's valid to call this function with an out-of-range index and it
* will robustly return %NULL.
*
* Return value: (transfer none): the workspace object with specified index, or %NULL
* if the index is out of range.
*/
MetaWorkspace *
meta_workspace_manager_get_workspace_by_index (MetaWorkspaceManager *workspace_manager,
int idx)
{
return g_list_nth_data (workspace_manager->workspaces, idx);
}
void
meta_workspace_manager_remove_workspace (MetaWorkspaceManager *workspace_manager,
MetaWorkspace *workspace,
guint32 timestamp)
{
GList *l;
GList *next;
MetaWorkspace *neighbour = NULL;
int index;
int active_index;
gboolean active_index_changed;
int new_num;
l = g_list_find (workspace_manager->workspaces, workspace);
if (!l)
return;
next = l->next;
if (l->prev)
neighbour = l->prev->data;
else if (l->next)
neighbour = l->next->data;
else
{
/* Cannot remove the only workspace! */
return;
}
meta_workspace_relocate_windows (workspace, neighbour);
if (workspace == workspace_manager->active_workspace)
meta_workspace_activate (neighbour, timestamp);
/* To emit the signal after removing the workspace */
index = meta_workspace_index (workspace);
active_index = meta_workspace_manager_get_active_workspace_index (workspace_manager);
active_index_changed = index < active_index;
/* This also removes the workspace from the displays list */
meta_workspace_remove (workspace);
new_num = g_list_length (workspace_manager->workspaces);
if (!meta_prefs_get_dynamic_workspaces ())
meta_prefs_set_num_workspaces (new_num);
/* If deleting a workspace before the current workspace, the active
* workspace index changes, so we need to update that hint */
if (active_index_changed)
g_signal_emit (workspace_manager,
workspace_manager_signals[ACTIVE_WORKSPACE_CHANGED],
0, NULL);
for (l = next; l; l = l->next)
{
MetaWorkspace *w = l->data;
meta_workspace_index_changed (w);
}
meta_display_queue_workarea_recalc (workspace_manager->display);
g_signal_emit (workspace_manager,
workspace_manager_signals[WORKSPACE_REMOVED],
0, index);
g_object_notify (G_OBJECT (workspace_manager), "n-workspaces");
}
/**
* meta_workspace_manager_append_new_workspace:
* @workspace_manager: a #MetaWorkspaceManager
* @activate: %TRUE if the workspace should be switched to after creation
* @timestamp: if switching to a new workspace, timestamp to be used when
* focusing a window on the new workspace. (Doesn't hurt to pass a valid
* timestamp when available even if not switching workspaces.)
*
* Append a new workspace to the workspace manager and (optionally) switch to that
* display.
*
* Return value: (transfer none): the newly appended workspace.
*/
MetaWorkspace *
meta_workspace_manager_append_new_workspace (MetaWorkspaceManager *workspace_manager,
gboolean activate,
guint32 timestamp)
{
MetaWorkspace *w;
int new_num;
/* This also adds the workspace to the workspace manager list */
w = meta_workspace_new (workspace_manager);
if (!w)
return NULL;
if (activate)
meta_workspace_activate (w, timestamp);
new_num = g_list_length (workspace_manager->workspaces);
if (!meta_prefs_get_dynamic_workspaces ())
meta_prefs_set_num_workspaces (new_num);
meta_display_queue_workarea_recalc (workspace_manager->display);
g_signal_emit (workspace_manager, workspace_manager_signals[WORKSPACE_ADDED],
0, meta_workspace_index (w));
g_object_notify (G_OBJECT (workspace_manager), "n-workspaces");
return w;
}
void
meta_workspace_manager_update_num_workspaces (MetaWorkspaceManager *workspace_manager,
guint32 timestamp,
int new_num)
{
int old_num;
GList *l;
int i = 0;
GList *extras = NULL;
MetaWorkspace *last_remaining = NULL;
gboolean need_change_space = FALSE;
g_assert (new_num > 0);
if (g_list_length (workspace_manager->workspaces) == (guint) new_num)
return;
for (l = workspace_manager->workspaces; l; l = l->next)
{
MetaWorkspace *w = l->data;
if (i >= new_num)
extras = g_list_prepend (extras, w);
else
last_remaining = w;
++i;
}
old_num = i;
g_assert (last_remaining);
/* Get rid of the extra workspaces by moving all their windows
* to last_remaining, then activating last_remaining if
* one of the removed workspaces was active. This will be a bit
* wacky if the config tool for changing number of workspaces
* is on a removed workspace ;-)
*/
for (l = extras; l; l = l->next)
{
MetaWorkspace *w = l->data;
meta_workspace_relocate_windows (w, last_remaining);
if (w == workspace_manager->active_workspace)
need_change_space = TRUE;
}
if (need_change_space)
meta_workspace_activate (last_remaining, timestamp);
/* Should now be safe to free the workspaces */
for (l = extras; l; l = l->next)
{
MetaWorkspace *w = l->data;
meta_workspace_remove (w);
}
g_list_free (extras);
for (i = old_num; i < new_num; i++)
meta_workspace_new (workspace_manager);
meta_display_queue_workarea_recalc (workspace_manager->display);
for (i = old_num; i < new_num; i++)
g_signal_emit (workspace_manager,
workspace_manager_signals[WORKSPACE_ADDED],
0, i);
g_object_notify (G_OBJECT (workspace_manager), "n-workspaces");
}
void
meta_workspace_manager_update_workspace_layout (MetaWorkspaceManager *workspace_manager,
MetaDisplayCorner starting_corner,
gboolean vertical_layout,
int n_rows,
int n_columns)
{
g_return_if_fail (META_IS_WORKSPACE_MANAGER (workspace_manager));
g_return_if_fail (n_rows > 0 || n_columns > 0);
g_return_if_fail (n_rows != 0 && n_columns != 0);
if (workspace_manager->workspace_layout_overridden)
return;
workspace_manager->vertical_workspaces = vertical_layout != FALSE;
workspace_manager->starting_corner = starting_corner;
workspace_manager->rows_of_workspaces = n_rows;
workspace_manager->columns_of_workspaces = n_columns;
meta_verbose ("Workspace layout rows = %d cols = %d orientation = %d starting corner = %u\n",
workspace_manager->rows_of_workspaces,
workspace_manager->columns_of_workspaces,
workspace_manager->vertical_workspaces,
workspace_manager->starting_corner);
}
/**
* meta_workspace_manager_override_workspace_layout:
* @workspace_manager: a #MetaWorkspaceManager
* @starting_corner: the corner at which the first workspace is found
* @vertical_layout: if %TRUE the workspaces are laid out in columns rather than rows
* @n_rows: number of rows of workspaces, or -1 to determine the number of rows from
* @n_columns and the total number of workspaces
* @n_columns: number of columns of workspaces, or -1 to determine the number of columns from
* @n_rows and the total number of workspaces
*
* Explicitly set the layout of workspaces. Once this has been called, the contents of the
* _NET_DESKTOP_LAYOUT property on the root window are completely ignored.
*/
void
meta_workspace_manager_override_workspace_layout (MetaWorkspaceManager *workspace_manager,
MetaDisplayCorner starting_corner,
gboolean vertical_layout,
int n_rows,
int n_columns)
{
meta_workspace_manager_update_workspace_layout (workspace_manager,
starting_corner,
vertical_layout,
n_rows,
n_columns);
workspace_manager->workspace_layout_overridden = TRUE;
}
#ifdef WITH_VERBOSE_MODE
static const char *
meta_workspace_manager_corner_to_string (MetaDisplayCorner corner)
{
switch (corner)
{
case META_DISPLAY_TOPLEFT:
return "TopLeft";
case META_DISPLAY_TOPRIGHT:
return "TopRight";
case META_DISPLAY_BOTTOMLEFT:
return "BottomLeft";
case META_DISPLAY_BOTTOMRIGHT:
return "BottomRight";
}
return "Unknown";
}
#endif /* WITH_VERBOSE_MODE */
void
meta_workspace_manager_calc_workspace_layout (MetaWorkspaceManager *workspace_manager,
int num_workspaces,
int current_space,
MetaWorkspaceLayout *layout)
{
int rows, cols;
int grid_area;
int *grid;
int i, r, c;
int current_row, current_col;
rows = workspace_manager->rows_of_workspaces;
cols = workspace_manager->columns_of_workspaces;
if (rows <= 0 && cols <= 0)
cols = num_workspaces;
if (rows <= 0)
rows = num_workspaces / cols + ((num_workspaces % cols) > 0 ? 1 : 0);
if (cols <= 0)
cols = num_workspaces / rows + ((num_workspaces % rows) > 0 ? 1 : 0);
/* paranoia */
if (rows < 1)
rows = 1;
if (cols < 1)
cols = 1;
g_assert (rows != 0 && cols != 0);
grid_area = rows * cols;
meta_verbose ("Getting layout rows = %d cols = %d current = %d "
"num_spaces = %d vertical = %s corner = %s\n",
rows, cols, current_space, num_workspaces,
workspace_manager->vertical_workspaces ? "(true)" : "(false)",
meta_workspace_manager_corner_to_string (workspace_manager->starting_corner));
/* ok, we want to setup the distances in the workspace array to go
* in each direction. Remember, there are many ways that a workspace
* array can be setup.
* see http://www.freedesktop.org/standards/wm-spec/1.2/html/x109.html
* and look at the _NET_DESKTOP_LAYOUT section for details.
* For instance:
*/
/* starting_corner = META_DISPLAY_TOPLEFT
* vertical_workspaces = 0 vertical_workspaces=1
* 1234 1357
* 5678 2468
*
* starting_corner = META_DISPLAY_TOPRIGHT
* vertical_workspaces = 0 vertical_workspaces=1
* 4321 7531
* 8765 8642
*
* starting_corner = META_DISPLAY_BOTTOMLEFT
* vertical_workspaces = 0 vertical_workspaces=1
* 5678 2468
* 1234 1357
*
* starting_corner = META_DISPLAY_BOTTOMRIGHT
* vertical_workspaces = 0 vertical_workspaces=1
* 8765 8642
* 4321 7531
*
*/
/* keep in mind that we could have a ragged layout, e.g. the "8"
* in the above grids could be missing
*/
grid = g_new (int, grid_area);
current_row = -1;
current_col = -1;
i = 0;
switch (workspace_manager->starting_corner)
{
case META_DISPLAY_TOPLEFT:
if (workspace_manager->vertical_workspaces)
{
c = 0;
while (c < cols)
{
r = 0;
while (r < rows)
{
grid[r*cols+c] = i;
++i;
++r;
}
++c;
}
}
else
{
r = 0;
while (r < rows)
{
c = 0;
while (c < cols)
{
grid[r*cols+c] = i;
++i;
++c;
}
++r;
}
}
break;
case META_DISPLAY_TOPRIGHT:
if (workspace_manager->vertical_workspaces)
{
c = cols - 1;
while (c >= 0)
{
r = 0;
while (r < rows)
{
grid[r*cols+c] = i;
++i;
++r;
}
--c;
}
}
else
{
r = 0;
while (r < rows)
{
c = cols - 1;
while (c >= 0)
{
grid[r*cols+c] = i;
++i;
--c;
}
++r;
}
}
break;
case META_DISPLAY_BOTTOMLEFT:
if (workspace_manager->vertical_workspaces)
{
c = 0;
while (c < cols)
{
r = rows - 1;
while (r >= 0)
{
grid[r*cols+c] = i;
++i;
--r;
}
++c;
}
}
else
{
r = rows - 1;
while (r >= 0)
{
c = 0;
while (c < cols)
{
grid[r*cols+c] = i;
++i;
++c;
}
--r;
}
}
break;
case META_DISPLAY_BOTTOMRIGHT:
if (workspace_manager->vertical_workspaces)
{
c = cols - 1;
while (c >= 0)
{
r = rows - 1;
while (r >= 0)
{
grid[r*cols+c] = i;
++i;
--r;
}
--c;
}
}
else
{
r = rows - 1;
while (r >= 0)
{
c = cols - 1;
while (c >= 0)
{
grid[r*cols+c] = i;
++i;
--c;
}
--r;
}
}
break;
}
if (i != grid_area)
meta_bug ("did not fill in the whole workspace grid in %s (%d filled)\n",
G_STRFUNC, i);
current_row = 0;
current_col = 0;
r = 0;
while (r < rows)
{
c = 0;
while (c < cols)
{
if (grid[r*cols+c] == current_space)
{
current_row = r;
current_col = c;
}
else if (grid[r*cols+c] >= num_workspaces)
{
/* flag nonexistent spaces with -1 */
grid[r*cols+c] = -1;
}
++c;
}
++r;
}
layout->rows = rows;
layout->cols = cols;
layout->grid = grid;
layout->grid_area = grid_area;
layout->current_row = current_row;
layout->current_col = current_col;
#ifdef WITH_VERBOSE_MODE
if (meta_is_verbose ())
{
r = 0;
while (r < layout->rows)
{
meta_verbose (" ");
meta_push_no_msg_prefix ();
c = 0;
while (c < layout->cols)
{
if (r == layout->current_row &&
c == layout->current_col)
meta_verbose ("*%2d ", layout->grid[r*layout->cols+c]);
else
meta_verbose ("%3d ", layout->grid[r*layout->cols+c]);
++c;
}
meta_verbose ("\n");
meta_pop_no_msg_prefix ();
++r;
}
}
#endif /* WITH_VERBOSE_MODE */
}
void
meta_workspace_manager_free_workspace_layout (MetaWorkspaceLayout *layout)
{
g_free (layout->grid);
}
static void
queue_windows_showing (MetaWorkspaceManager *workspace_manager)
{
GSList *windows, *l;
/* Must operate on all windows on display instead of just on the
* active_workspace's window list, because the active_workspace's
* window list may not contain the on_all_workspace windows.
*/
windows = meta_display_list_windows (workspace_manager->display, META_LIST_DEFAULT);
for (l = windows; l; l = l->next)
{
MetaWindow *w = l->data;
meta_window_queue (w, META_QUEUE_CALC_SHOWING);
}
g_slist_free (windows);
}
void
meta_workspace_manager_minimize_all_on_active_workspace_except (MetaWorkspaceManager *workspace_manager,
MetaWindow *keep)
{
GList *l;
for (l = workspace_manager->active_workspace->windows; l; l = l->next)
{
MetaWindow *w = l->data;
if (w->has_minimize_func && w != keep)
meta_window_minimize (w);
}
}
void
meta_workspace_manager_show_desktop (MetaWorkspaceManager *workspace_manager,
guint32 timestamp)
{
GList *l;
if (workspace_manager->active_workspace->showing_desktop)
return;
workspace_manager->active_workspace->showing_desktop = TRUE;
queue_windows_showing (workspace_manager);
/* Focus the most recently used META_WINDOW_DESKTOP window, if there is one;
* see bug 159257.
*/
for (l = workspace_manager->active_workspace->mru_list; l; l = l->next)
{
MetaWindow *w = l->data;
if (w->type == META_WINDOW_DESKTOP)
{
meta_window_focus (w, timestamp);
break;
}
}
g_signal_emit (workspace_manager,
workspace_manager_signals[SHOWING_DESKTOP_CHANGED],
0, NULL);
}
void
meta_workspace_manager_unshow_desktop (MetaWorkspaceManager *workspace_manager)
{
if (!workspace_manager->active_workspace->showing_desktop)
return;
workspace_manager->active_workspace->showing_desktop = FALSE;
queue_windows_showing (workspace_manager);
g_signal_emit (workspace_manager,
workspace_manager_signals[SHOWING_DESKTOP_CHANGED],
0, NULL);
}
/**
* meta_workspace_manager_get_workspaces: (skip)
* @workspace_manager: a #MetaWorkspaceManager
*
* Returns: (transfer none) (element-type Meta.Workspace): The workspaces for @display
*/
GList *
meta_workspace_manager_get_workspaces (MetaWorkspaceManager *workspace_manager)
{
return workspace_manager->workspaces;
}
int
meta_workspace_manager_get_active_workspace_index (MetaWorkspaceManager *workspace_manager)
{
MetaWorkspace *active = workspace_manager->active_workspace;
if (!active)
return -1;
return meta_workspace_index (active);
}
/**
* meta_workspace_manager_get_active_workspace:
* @workspace_manager: A #MetaWorkspaceManager
*
* Returns: (transfer none): The current workspace
*/
MetaWorkspace *
meta_workspace_manager_get_active_workspace (MetaWorkspaceManager *workspace_manager)
{
return workspace_manager->active_workspace;
}
void
meta_workspace_manager_workspace_switched (MetaWorkspaceManager *workspace_manager,
int from,
int to,
MetaMotionDirection direction)
{
g_signal_emit (workspace_manager,
workspace_manager_signals[WORKSPACE_SWITCHED], 0,
from, to, direction);
}
static void
prefs_changed_callback (MetaPreference pref,
gpointer data)
{
MetaWorkspaceManager *workspace_manager = data;
if ((pref == META_PREF_NUM_WORKSPACES ||
pref == META_PREF_DYNAMIC_WORKSPACES) &&
!meta_prefs_get_dynamic_workspaces ())
{
guint32 timestamp;
int new_num;
timestamp =
meta_display_get_current_time_roundtrip (workspace_manager->display);
new_num = meta_prefs_get_num_workspaces ();
meta_workspace_manager_update_num_workspaces (workspace_manager,
timestamp, new_num);
}
}

View File

@ -36,6 +36,7 @@
#include <stdlib.h>
#include "keybindings-private.h"
#include "meta-accel-parse.h"
#include "x11/meta-x11-display-private.h"
/* If you add a key, it needs updating in init() and in the gsettings
* notify listener and of course in the .schemas file.
@ -52,6 +53,7 @@
#define KEY_GNOME_ACCESSIBILITY "toolkit-accessibility"
#define KEY_GNOME_ANIMATIONS "enable-animations"
#define KEY_GNOME_CURSOR_THEME "cursor-theme"
#define KEY_GNOME_CURSOR_SIZE "cursor-size"
#define KEY_XKB_OPTIONS "xkb-options"
#define KEY_OVERLAY_KEY "overlay-key"
@ -127,9 +129,6 @@ static gboolean update_binding (MetaKeyPref *binding,
static gboolean update_key_binding (const char *key,
gchar **strokes);
static void wayland_settings_changed (GSettings *settings,
gchar *key,
gpointer data);
static void settings_changed (GSettings *settings,
gchar *key,
gpointer data);
@ -137,15 +136,6 @@ static void bindings_changed (GSettings *settings,
gchar *key,
gpointer data);
static void shell_shows_app_menu_changed (GtkSettings *settings,
GParamSpec *pspec,
gpointer data);
static void update_cursor_size_from_gtk (GtkSettings *settings,
GParamSpec *pspec,
gpointer data);
static void update_cursor_size (void);
static void queue_changed (MetaPreference pref);
static void maybe_give_disable_workarounds_warning (void);
@ -160,7 +150,6 @@ static void do_override (char *key, char *schema);
static void init_bindings (void);
typedef struct
{
MetaPrefsChangedFunc func;
@ -493,6 +482,13 @@ static MetaIntPreference preferences_int[] =
},
&drag_threshold
},
{
{ "cursor-size",
SCHEMA_INTERFACE,
META_PREF_CURSOR_SIZE,
},
&cursor_size
},
{ { NULL, 0, 0 }, NULL },
};
@ -860,8 +856,6 @@ meta_prefs_remove_listener (MetaPrefsChangedFunc func,
tmp = tmp->next;
}
meta_bug ("Did not find listener to remove\n");
}
static void
@ -971,19 +965,10 @@ meta_prefs_init (void)
G_CALLBACK (settings_changed), NULL);
g_signal_connect (settings, "changed::" KEY_GNOME_CURSOR_THEME,
G_CALLBACK (settings_changed), NULL);
if (meta_is_wayland_compositor ())
g_signal_connect (settings, "changed::cursor-size",
G_CALLBACK (wayland_settings_changed), NULL);
g_signal_connect (settings, "changed::" KEY_GNOME_CURSOR_SIZE,
G_CALLBACK (settings_changed), NULL);
g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
g_signal_connect (gtk_settings_get_default (),
"notify::gtk-shell-shows-app-menu",
G_CALLBACK (shell_shows_app_menu_changed), NULL);
if (!meta_is_wayland_compositor ())
g_signal_connect (gtk_settings_get_default (), "notify::gtk-cursor-theme-size",
G_CALLBACK (update_cursor_size_from_gtk), NULL);
settings = g_settings_new (SCHEMA_INPUT_SOURCES);
g_signal_connect (settings, "changed::" KEY_XKB_OPTIONS,
G_CALLBACK (settings_changed), NULL);
@ -1004,9 +989,6 @@ meta_prefs_init (void)
handle_preference_init_string_array ();
handle_preference_init_int ();
update_cursor_size ();
shell_shows_app_menu_changed (gtk_settings_get_default (), NULL, NULL);
init_bindings ();
}
@ -1145,20 +1127,6 @@ meta_prefs_override_preference_schema (const char *key, const char *schema)
/****************************************************************************/
static void
wayland_settings_changed (GSettings *settings,
gchar *key,
gpointer data)
{
GVariant *value = g_settings_get_value (settings, key);
const GVariantType *type = g_variant_get_type (value);
g_return_if_fail (g_variant_type_equal (type, G_VARIANT_TYPE_INT32));
g_return_if_fail (g_str_equal (key, "cursor-size"));
update_cursor_size ();
}
static void
settings_changed (GSettings *settings,
gchar *key,
@ -1220,69 +1188,6 @@ bindings_changed (GSettings *settings,
g_strfreev (strokes);
}
static void
shell_shows_app_menu_changed (GtkSettings *settings,
GParamSpec *pspec,
gpointer data)
{
int shell_shows_app_menu = 1;
gboolean changed = FALSE;
g_object_get (settings,
"gtk-shell-shows-app-menu", &shell_shows_app_menu,
NULL);
changed = (show_fallback_app_menu == !!shell_shows_app_menu);
show_fallback_app_menu = !shell_shows_app_menu;
if (changed)
queue_changed (META_PREF_BUTTON_LAYOUT);
}
static void
update_cursor_size (void)
{
if (meta_is_wayland_compositor ())
{
/* When running as a Wayland compositor, since we size of the cursor
* depends on what output it is on, we cannot use the GTK+
* "gtk-cursor-theme-size" setting because it has already been multiplied
* by the primary monitor scale. So, instead get the non-premultiplied
* cursor size value directly from gsettings instead.
*/
cursor_size =
g_settings_get_int (SETTINGS (SCHEMA_INTERFACE), "cursor-size");
}
else
{
update_cursor_size_from_gtk (gtk_settings_get_default (), NULL, NULL);
}
}
static void
update_cursor_size_from_gtk (GtkSettings *settings,
GParamSpec *pspec,
gpointer data)
{
GdkScreen *screen = gdk_screen_get_default ();
GValue value = G_VALUE_INIT;
int xsettings_cursor_size = 24;
g_value_init (&value, G_TYPE_INT);
if (gdk_screen_get_setting (screen, "gtk-cursor-theme-size", &value))
{
xsettings_cursor_size = g_value_get_int (&value);
}
if (xsettings_cursor_size != cursor_size)
{
cursor_size = xsettings_cursor_size;
queue_changed (META_PREF_CURSOR_SIZE);
}
}
/**
* maybe_give_disable_workaround_warning:
*
@ -1345,6 +1250,19 @@ meta_prefs_get_show_fallback_app_menu (void)
return show_fallback_app_menu;
}
void
meta_prefs_set_show_fallback_app_menu (gboolean whether)
{
gboolean changed = FALSE;
changed = (show_fallback_app_menu == !whether);
show_fallback_app_menu = whether;
if (changed)
queue_changed (META_PREF_BUTTON_LAYOUT);
}
const char*
meta_prefs_get_cursor_theme (void)
{

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