Compare commits

..

82 Commits

Author SHA1 Message Date
GNOME Translation Robot
543d031a55 Update Scottish Gaelic translation 2018-03-01 10:46:14 +00:00
Jonas Ådahl
4b2d21ff03 renderer/x11: Enable GPU memory purge error extension if available
This was done by the clutter X11 backend before prior to introducing
MetaRenderer, but during that work, enabling of said extension was lost.
Let's turn it on again.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2018-02-07 11:07:59 +08:00
Jonas Ådahl
a97d1dedf5 cogl/x11/renderer: Silence introspection warning
We don't introspect CoglRenderer, so we shouldn't introspect API using it
either.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2018-02-07 11:07:59 +08:00
Carlos Garnacho
c02679f917 backends/x11: Preserve XI1 XDevice throughout ClutterInputDevice lifetime
Opening and closing the device may result into XI2 grabs being cut short,
resulting into pad buttons being rendered ineffective, and other possible
misbehaviors. This is an XInput flaw that fell in the gap between XI1 and
XI2, and has no easy fix. It pays us for mixing both versions, I guess...

Work this around by keeping the XI1 XDevice attached to the
ClutterInputDevice, this way it will live long enough that this is not
a concern.

Investigation of this bug was mostly carried by Peter Hutterer, I'm just
the executing hand.

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

Closes: #7
2018-02-01 11:38:53 +01:00
Balázs Úr
d32d358a69 Update Hungarian translation 2018-01-27 08:01:38 +00:00
Hans de Goede
84ee785399 monitor: Set MINIMUM_LOGICAL_HEIGHT to 480
Using 800x600 as minimum logical size is very 4:3 thinking, while a lot of
modern devices are 16:9. The specific reason for this commit is to allow
1.5 scaling at mini-laptops (clamshell devices) with e.g. a 5.5"
1280x720 screen. Given that this device has a keyboard, one obviously
is not holding it very close to ones eyes and at 220 dpi that means the text
is too small at scale 1.0. For one real world example of such a device see:
https://en.wikipedia.org/wiki/GPD_Win

https://bugzilla.gnome.org/show_bug.cgi?id=792765
2018-01-23 11:08:53 +08:00
Jeremy Nickurak
71b4ef5940 Don't attempt to get monitor geometry on non-existent monitors
https://bugzilla.gnome.org/show_bug.cgi?id=788834
2018-01-21 14:47:33 +01:00
Olivier Fourdan
77dd1bf635 wayland: shortcuts inhibitor requires a window
Issuing a shortcut inhibit request for a surface without a window set
will lead to a crash when trying to show the shortcut inhibitor dialog.

In such a case, it's safer to deny the request.

https://bugzilla.gnome.org/show_bug.cgi?id=792599
2018-01-18 15:46:46 +01:00
Jonas Ådahl
6df02e5429 input-settings/x11: Fix tap-and-drag libinput property name
It's "libinput Tapping Drag Enabled", not "libinput TappingDrag
Enabled".

https://bugzilla.gnome.org/show_bug.cgi?id=775755
2018-01-12 19:03:01 +08:00
Jonas Ådahl
97f099d8ce clutter/evdev: Ignore unknown touch points
We might receive touch events for unknown touch points, for example
when starting mutter while touching the screen (resulting in no
touch-down event ever being received). Avoid crashing when this happens
by just dropping these events on the floor.

https://bugzilla.gnome.org/show_bug.cgi?id=791371
2018-01-12 19:03:01 +08:00
Daniel van Vugt
294cceaeb8 wayland: Ensure wl_shell_surfaces are set reactive
Wayland clients using the wl_shell interface were never receiving mouse
input. It meant they also couldn't be raised with a click.

This was because the call to meta_wayland_surface_set_window for wl_shell
surfaces did nothing while surface->window == window already. As such, it
never called clutter_actor_set_reactive() and the wl_shell window remained
a non-reactive actor.

Just make sure surface->window isn't already set before calling
meta_wayland_surface_set_window so it can actually do what it's meant to.

https://bugzilla.gnome.org/show_bug.cgi?id=790309
2018-01-09 11:29:55 -05:00
Matej Urbančič
0bd1d7cf09 Updated Slovenian translation 2017-12-31 11:40:29 +01:00
Georges Basile Stavracas Neto
415584344a Revert "window: Raise and lower tile match in tandem"
Raising and lowering windows in tandem without a proper grouping
mechanism ended up being more annoying than functional.

This reverts commit e76a0f564c.
2017-12-22 17:48:46 -02:00
Carlos Garnacho
699fd31e77 wayland: Only send full sequences of touch events to clients
If input happens to be grabbed somewhere along the shell, and ungrabbed
while a touch operation is ongoing, the wayland bits will happily start
sending wl_touch.update events from an undeterminate point, without
clients having ever received wl_touch.down for that id.

Consider those touches grabbed for the entirety of their lifetime, if
wl_touch.down wasn't received by the client, no other events will.

https://bugzilla.gnome.org/show_bug.cgi?id=776220
2017-12-21 12:39:06 +01:00
Marco Trevisan (Treviño)
7ef3ed0f82 stage: Push framebuffer before setting up viewport
When capture_view* functions are called with the paint flag set
to TRUE, we need to setup the framebuffer, however this was
happening after setting up the viewport, while the viewport
needs the framebuffer to be valid when calling cogl_set_viewport.

https://bugzilla.gnome.org/show_bug.cgi?id=791809
2017-12-20 11:58:58 +01:00
Jonas Ådahl
827d0b3f7f keybindings: Only add multiple keycodes from the same level
The reason why multiple keycodes could be mapped to a single keysym was
to support having both KEY_FAVORITES and KEY_BOOKMARK map to
XF86Favorites. However, iterating through all layout levels adding all
key codes has severe consequences on layouts with levels that map
things like numbers and arrow. The result is that keybindings that
should only have been added for keycodes from the first level, are
replaced by some unexpected keycode where the same keysym was found on
another level.

An example of this is the up-arrow key and l symbol. Normally you'd find
both the up-arrow symbol and the l symbol on the first level and be done
with it. However, on the German Neo-2 layout, layout level 4 maps the
KEY_E to the l symbol, while layout level 4 maps KEY_E to up-arrow.
Which ever gets to take priority is arbitrary, but for this particular
case KEY_E incorrectly mapped to up-arrow instead of the l symbol,
causing the keyboard shortcut Super+l, which would normally lock the
screen, to trigger the workspace-up (Super+up-arrow) key binding.

https://bugzilla.gnome.org/show_bug.cgi?id=789300
2017-12-20 15:03:42 +08:00
Rui Matos
cde5454622 wayland-outputs: Delay wl_output destruction
This tries to avoid wayland clients getting disconnected for binding
to a wl_output that we already destroyed which is a known protocol
race condition, see https://phabricator.freedesktop.org/T7722 .

https://bugzilla.gnome.org/show_bug.cgi?id=789070
2017-12-15 14:45:27 +01:00
Benjamin Berg
ae460046ed monitor-manager-kms: Fix recently introduced build issue
The recent commit 6dd28bd2c7 "poll() on KMS fd on EAGAIN" backported
error handling code that does not apply to the gnome-3-26 branch.

https://bugzilla.gnome.org/show_bug.cgi?id=791024
2017-12-14 20:42:45 +01:00
Benjamin Berg
6dd28bd2c7 monitor-manager-kms: poll() on KMS fd on EAGAIN
When drmHandleEvent() returns an error and errno is set to EAGAIN,
instead of ending up in a busy loop, poll() the fd until there is
anything to read.

This is a simple backport of commit 406359bba1.

https://bugzilla.gnome.org/show_bug.cgi?id=791024
2017-12-11 10:44:28 +00:00
Marco Trevisan (Treviño)
bf91e2b4ca compositor: reset top_window_actor and remove it from windows when destroyed
When the top window actor is destroyed, we need to make sure that
all its references are removed or it could be picked again in next
windows sync, causing crashes.
Since the window might or might not be destroyed when removed (depending
weather animations are in progress over it or not), it's just safer
to wait it to be destroyed before cleaning up any of its reference.

https://bugzilla.gnome.org/show_bug.cgi?id=791006
2017-11-30 22:56:38 -05:00
Jonas Ådahl
205dc28eae monitor-manager: Compare keys when checking whether a config is complete
We only counted configured monitors and whether the config was
applicable (could be assigned), howeverwe didn't include disabled
monitors when comparing. This could caused incorrect configurations to
be applied when trying to use the previous configuration.

One scenario where this happened was one a system with one laptop
screen and one external monitor that was hot plugged some point after
start up. When the laptop lid was closed, the 'previous configuration'
being the configuration where only the laptop panel was enabled, passed
'is-complete' check as the number of configured monitors were correct,
and the configuration was applicable.

Avoid this issue by simply comparing the configuration key of the
previous configuration and the configuration key of the current state.
This correctly identifies a laptop panel with the lid closed as
inaccessible, thus doesn't incorrectly revert to the previous
configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 12:01:57 +08:00
Jonas Ådahl
ea538537ec monitor-config-manager: Don't include closed laptop panel in config key
When deriving the list of disabled monitors when creating new monitors
configs, don't include the laptop panel if the lid is currently closed,
as we consider the laptop panel nonexistent when the laptop lid is
closed when it comes to configuration.

The laptop panel connector(s) will either way be appropriately disabled
anyway, as the field listing disabled monitors in the configuration do
not affect actual CRTC/connector assignments.

https://bugzilla.gnome.org/show_bug.cgi?id=788915
2017-11-30 12:01:57 +08:00
Kukuh Syafaat
2e663265ae Update Indonesian translation 2017-11-29 12:14:07 +00:00
Pawan Chitrakar
789d740add Update Nepali translation 2017-11-26 05:19:41 +00:00
Aurimas Černius
4f1e63fd0c Updated Lithuanian translation 2017-11-25 21:46:16 +02:00
Rui Matos
ed989a2989 monitor-manager: Refuse to activate closed laptop panels
There's no good reason to allow this and it allows g-c-c to properly
show that such a configuration doesn't work.

https://bugzilla.gnome.org/show_bug.cgi?id=790336
2017-11-22 15:03:04 +01:00
Daniel van Vugt
d358edd525 eglnative: Use gnome-settings-daemon font settings
While the X11 backend gets its font settings from XSettings, the native
backend did not use any user font preferences till now. So all shell fonts
were rendered with grayscale un-hinted, which some people describe as
"blurry text in Wayland sessions".

Although it's somewhat confusing using the "xsettings" schema on eglnative,
this is consistent with what GTK does already for its Wayland backend. It
is also documented here:

https://wiki.gnome.org/Initiatives/Wayland/GTK%2B#XSettings
https://wiki.gnome.org/Initiatives/Wayland/gnome-settings-daemon#xsettings

No more blurry shell text in Wayland sessions.

https://bugzilla.gnome.org/show_bug.cgi?id=645433
2017-11-17 15:35:39 -05:00
Carlos Garnacho
acab829cc4 compositor: Fix build
Unused variable definition. The fixup didn't make it to the previous
commit.
2017-11-17 17:00:05 +01:00
Carlos Garnacho
d1e32e170e compositor: End MetaDnd grab on plugin grab end
We must emit ::dnd-leave to pair the ::dnd-enter that shall be
emitted whenever the plugin grab begins, otherwise we leave
listeners unable to clean up if the plugin begins and ends a
grab while there is an ongoing DnD operation.

https://bugzilla.gnome.org/show_bug.cgi?id=784545
2017-11-17 14:44:06 +01:00
Milo Casagrande
32a151094d Update Italian translation 2017-11-17 13:31:09 +00:00
Muhammet Kara
8c45fbfb58 Update Turkish translation 2017-11-15 20:50:19 +00:00
Marek Cernocky
26ee55a7e4 Updated Czech translation 2017-11-15 13:34:07 +01:00
Charles Monzat
6797be5e1e Update French translation 2017-11-14 08:11:36 +00:00
Anders Jonsson
f4b4ef32ed Update Swedish translation 2017-11-13 23:44:18 +00:00
Christian Kirbach
cdfeecc318 Update German translation 2017-11-11 21:20:07 +00:00
Rafael Fontenelle
19cde75acc Update Brazilian Portuguese translation 2017-11-11 18:56:59 +00:00
Piotr Drąg
b86e0f0fd4 Update Polish translation 2017-11-10 19:30:41 +01:00
Piotr Drąg
7f3da7511a Update POTFILES.in 2017-11-10 19:17:44 +01:00
Olivier Fourdan
cc49f6ef78 Add restore-shortcuts to key bindings list
gnome-control-center uses this to list the keybindings, without this
users cannot change the default key combo to restore shortcuts.

https://bugzilla.gnome.org/show_bug.cgi?id=789386
2017-11-10 18:03:12 +01:00
Olivier Fourdan
1d882886ba wayland: Use Super+Escape to re-enable shortcuts
Change the default key combo to re-enable normal keyboard shortcuts
processing while a shortcut inhibitor is in effect to Super+Escape as
primary system modifier key should be Super.

This should reduce the risk of potential conflict with other shortcuts.

https://bugzilla.gnome.org/show_bug.cgi?id=789386
2017-11-10 18:03:09 +01:00
Jonas Ådahl
3572502a73 window/wayland: Handle resizing when headless
We tried to get the geometry scale, which may depend on the main
logical monitor assigned to the window. To avoid dereferencing a NULL
logical monitor when headless, instead assume the geometry scale is 1.

https://bugzilla.gnome.org/show_bug.cgi?id=788764
2017-11-10 10:21:57 +08:00
memeka
ce7dbfb3d9 renderer/native: Also allow EGL_KHR_platform_gbm extension string
Proprietary drivers such as ARM Mali export EGL_KHR_platform_gbm instead
of EGL_MESA_platform_gbm. As such, GBM platform check should be done for
both MESA and non-MESA drivers.

https://bugzilla.gnome.org/show_bug.cgi?id=780668
2017-11-09 18:20:17 +08:00
Benoit Gschwind
74e88dd18f backend: Reset current device id when current device removed
Bluetooth mouse usually goes in sleep state after a timeout, when that
happen the mouse is disconnected and on_device_removed function is
called. Before the patch if a touch device is available the
on_device_removed function hide the cursor. The issue is that the cursor
does not reappear once the bluetooth mouse is reconnected because
MetaBackend::current_device_id is not invalidated when on_device_removed
was called.

The patch set MetaBackend::current_device_id to 0 if the current device
is removed. This will make update_last_device to be triggered as soon as
another input device is used or the bluetooth mouse reconnect, as
consequence that the cursor reappear. The id 0 is never given to devices
and can safely used as undefine id.

https://bugzilla.gnome.org/show_bug.cgi?id=761067
2017-11-09 17:46:15 +08:00
Carlos Garnacho
8d7f425de4 backends: Plug leaks
The DRM properties container must be destroyed with
drmModeFreeObjectProperties.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 11:02:07 +01:00
Carlos Garnacho
2882ddec7b core: Plug leaks
The MetaWorkspaceLogicalMonitorData structs are leaked, and so is the
stamps hashtable in MetaDisplay.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 10:50:02 +01:00
Carlos Garnacho
0b10df1faa wayland: Plug leak
The remote DBus error is leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 10:49:54 +01:00
Carlos Garnacho
3db950b307 clutter: Plug evdev ClutterDeviceManager leaks
The unused ID GList element is leaked, and so is the node path.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 10:49:46 +01:00
Carlos Garnacho
cc311dc8e6 compositor: Keep reference to the screen on the MetaBackground
This is not a leak per se, but it seems too easy to make valgrind
SIGSEGV due to MetaBackground disconnecting signals from an already
destroyed MetaScreen when trying to SIGTERM gnome-shell. Keeping a
reference fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-07 10:49:38 +01:00
Marc-Antoine Perennou
0cd07cd864 build-sys: allow explicitely disabling remote-desktop and egl-device
https://bugzilla.gnome.org/show_bug.cgi?id=789958

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2017-11-06 13:44:45 +01:00
Kjartan Maraas
cac1fea4de Updated Norwegian bokmål translation. 2017-11-06 13:42:41 +01:00
Florian Müllner
17e5cd8c46 Bump version to 3.26.2
Update NEWS.
2017-11-02 16:54:54 +01:00
Jonas Ådahl
08e6aaa953 wayland/keyboard: Don't transfer layout group when replacing xkb state
The layout group determines what actual keyboard layout in the keymap
to use when translating modifier state and key codes to key syms.
When changing a keymap to another, the layout groups has no relation to
the layout groups in the old keymap, thus there is no reason to
transfer it to the new state.

This fixes an issue where the xkb state in meta-wayland-keyboard.c got
desynchronized with the xkb state in clutter-device-manager-evdev.c.

https://bugzilla.gnome.org/show_bug.cgi?id=789300
2017-11-02 12:07:56 +08:00
Jonas Ådahl
9187314216 monitor-manager-kms: Don't add outputs without modes
There seems to be a kernel race when one disconnects an external
monitor connected to a DisplayPort via a USB-C adapter. The race
results in a connector being reported as connected, but without any
modes supported.

This had the side effect that we tried to set a preferred mode to
the first listed mode, but as no modes were available, we instead tried
to dereference the first element of a NULL array, causing a
segmentation fault.

Mitigate this by skipping adding output if no supported modes are
advertised and the output doesn't support scaling, while moving the
fallback path for calculating a preferred output mode to after possibly
adding the common modes, to avoid the unvolentary NULL dereference.

https://bugzilla.gnome.org/show_bug.cgi?id=789501
2017-10-30 18:50:18 +08:00
Jonas Ådahl
634f48a1cf monitor-manager: Don't free old state until logical monitors are replaced
Logical monitors keep pointers around to monitor objects, which themself
keep pointers aronud to outputs, which keeps pointer to modes and CRTCs.
To avoid causing crashes when using the logical monitor API (which
might use monitor APIs etc) between a hot plug and the time the logical
monitors are regenerated (which is done synchronously in the native
backend but asynchronously in the X11 backend), postpone the freeing of
the state that logical monitor references, until the logical monitor
state is regenerated.

On the native backend, this should have no significant effect, as the
logical state is always regenerated immediately after the hardware
state is updated, but on X11, this should fix race conditions when
events being processed between the hot plug and the hot plug result
tries to access the yet to be up to date state.

https://bugzilla.gnome.org/show_bug.cgi?id=786929
2017-10-30 18:49:39 +08:00
Carlos Garnacho
656f64f3a5 backends: Unref variants obtained from g_variant_iter_get_next_value()
Those are being leaked.

https://bugzilla.gnome.org/show_bug.cgi?id=789553
2017-10-27 13:21:34 +02:00
Jonas Ådahl
81341ec9a9 wayland/surface: Disconnect actor handlers before unassigning role
The handlers depend on a role being assigned. Destroying the window
causes it to become unmapped, which would sometimes trigger one of the
handlers, resulting in an is-assigned assert hitting in one of the
handlers. Avoid this by disconnecting the handlers earlier, so that
there is no risk that any them being triggered before the role is
assigned.

https://bugzilla.gnome.org/show_bug.cgi?id=789552
2017-10-27 18:55:45 +08:00
Daniel van Vugt
8335a75ae5 wayland: Allow Xwayland to leave core dumps
For historical Xorg-reasons, Xwayland would disable its own core dumps by
default. This is a problem because Xwayland crashing is the biggest cause of
gnome-shell crashes [1][2], and we still have no idea why due to there being
no dumps from Xwayland. So enable core dumping from Xwayland.

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

[1] https://bugs.launchpad.net/bugs/1505409
[2] https://bugs.launchpad.net/bugs/1556601
2017-10-26 20:10:56 -05:00
Carlos Garnacho
b7fc6480dd wayland: Update pointer confinement on surface actor relocations
In the unlikely case that a surface is moved by the compositor while
holding a pointer confinement, we also need to update the pointer
position when the surface actor gets moved.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-10-26 13:02:32 +02:00
Carlos Garnacho
d9ea3ceabe wayland: Trigger wl_output updates on actor position changes
Both notify::position on the surface actor and position-changed on
MetaWindow are listened to, in order to trigger wl_output updates for
wl_surfaces whenever the surfaces move across them.

Both signals are necessary in order to cater for toplevel and subsurface
relocations (Because it's the parent window actor what changes position
in this last case).

Also, shuffle signal disconnection, so each signal goes away with
the object reference held by MetaWaylandSurface.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-10-26 13:02:32 +02:00
Carlos Garnacho
6ef08c5018 backends/native: Fix handling of trackball settings
The org.gnome.desktop.peripherals.trackball.scroll-wheel-emulation-button
setting contains buttons X11-style. Work out the BTN evcode that applies
to it when applying the setting on the libinput device.

https://bugzilla.gnome.org/show_bug.cgi?id=787804
2017-10-26 13:02:32 +02:00
Marco Trevisan (Treviño)
8c35409eed MetaWindowActor: assert that we have plugin manager on simple effect
It looks that there are some extensions that run a Mainloop on startup,
causing to dispatch a clutter paint before the compositor is even available.
In such scenario a MetaWindow could try to start a simple effect
using a compositor plugin which is not there yet.

Then in order to catch these bugs we can now assert that the expected
conditions are valid, so that gnome-shell will provide a dumpstack to
debug the real offending JS code.

https://bugzilla.gnome.org/show_bug.cgi?id=789223
2017-10-24 04:46:37 -05:00
Marco Trevisan (Treviño)
f6659928b2 MetaLogicalMonitor: free the monitors list on finalize
https://bugzilla.gnome.org/show_bug.cgi?id=789227
2017-10-24 03:19:27 -05:00
Jeremy Bicha
79fe635f5f Revert "tests: Fix actor-anchors test"
This reverts commit dd451547a5.

since we reverted commit 5cb5baa with commit 193216c
2017-10-21 19:00:46 -04:00
Michael Catanzaro
193216c2a7 Revert "ClutterActor: Optimize away idempotent scale/position updates"
This reverts commit 5cb5baa7d4.

There's a cascade of regressions that needs to be sorted out before
relanding this:

https://bugzilla.gnome.org/show_bug.cgi?id=784314
2017-10-19 19:55:49 -05:00
Rui Matos
6eacf9a398 compositor: Avoid a crash if the top window actor is finalized
Since we're not holding a reference, the top window actor might be
finalized when we paint resulting in a use after free crash.

https://bugzilla.gnome.org/show_bug.cgi?id=788493
2017-10-19 18:37:59 +02:00
Jonas Ådahl
297027b8cb monitor-unit-tests: Check non-first preferred modes
Check that if there are multiple modes with the same ID (resolution,
refresh rate and handled flags) we correctly add the preferred mode to
the list of monitor modes.

https://bugzilla.gnome.org/show_bug.cgi?id=789153
2017-10-19 10:54:28 +08:00
Jonas Ådahl
c0dc66e8c0 monitor/normal: Prefer modes with same flags as preferred mode
When generating MetaMonitorMode's, prefer CRTC modes that has the same
set of flags as the preferred mode. This not only is probably a better
set of configurable modes, but it'll guarantee that the preferred mode
is added.

This fixes a crash when the preferred mode was not the first mode with
the same resolution, refresh rate and set of handled modes.

https://bugzilla.gnome.org/show_bug.cgi?id=789153
2017-10-19 10:54:27 +08:00
Jonas Ådahl
b48c349794 monitor-manager/xrandr: Use a single supported scales list for all
Under X11 we can only ever have the same scale configured on all
monitors. In order to use e.g. scale 2 when there is a HiDPI monitor
connected, we must not disallow it because there is a monitor that does
not support scale 2. Thus we must show the same scale for every monitor
and monitor mode, even though it might result in a bad experience.

Do this by iterating through all the monitors adding all supported
scales by the preferred mode, combining all the supported scales. This
supported scales list is then used for all monitor and modes no matter
what.

https://bugzilla.gnome.org/show_bug.cgi?id=788901
2017-10-17 15:31:54 +08:00
Jonas Ådahl
d71b0d3d27 compositor: Ignore offscreen windows when unredirecting
When determining whether we should unredirect a window or not, ignore
offscreen windows, and just check the top most visible window.

Previously this was not an issue, but since 'stack-tracker: Keep
override redirect windows on top' we started sorting the UI frames
window, which is an offscreen override redirect window, on top, causing
the unredirect checking code to always check whether to unredirect the
UI frames window. This effectively disabled the compositor bypass
functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=788493
2017-10-17 14:54:54 +08:00
Rui Matos
49ee46d924 x11/window: Don't manage InputOnly windows
This was dropped by mistake in commit
f166240225.

https://bugzilla.gnome.org/show_bug.cgi?id=788493
2017-10-17 14:54:53 +08:00
Marco Trevisan (Treviño)
d6e3193c2a workspace: ensure that workarea data is valid when fetching by monitor num
https://bugzilla.gnome.org/show_bug.cgi?id=788860
2017-10-13 01:00:05 -05:00
Marco Trevisan (Treviño)
c6c777a604 backend: move the cursor render update on screen changes here
https://bugzilla.gnome.org/show_bug.cgi?id=788860
2017-10-13 00:59:51 -05:00
Marco Trevisan (Treviño)
bef9829229 monitor-manager: use g_return_val_if_fail if trying to fetch an invalid monitor
https://bugzilla.gnome.org/show_bug.cgi?id=788860
2017-10-13 00:59:33 -05:00
Marco Trevisan (Treviño)
0a3549da06 backends: add 'monitors-updated-internal' signal to only update internal state
Adding an internal signal and use it to update the internal state before
emitting "monitors-changed" which will be repeated by the screen to the world.

https://bugzilla.gnome.org/show_bug.cgi?id=788860
2017-10-13 00:59:14 -05:00
Jonas Ådahl
65d3e47987 settings: Get UI scaling factor from primary logical monitor
Don't use MAX(logical monitor scales) to determine the UI scaling
factor, just use the primary logical monitor. That's where the shell UI
will most likely be.

https://bugzilla.gnome.org/show_bug.cgi?id=788820
2017-10-12 17:45:15 +08:00
polygamma
41f7a5fdf3 x11: Protect XChangeProperty call with error traps
They may happen around the time a window is destroyed, thus could result
on BadWindow X errors.

https://bugzilla.gnome.org/show_bug.cgi?id=788666
2017-10-10 14:09:01 +02:00
Jonas Ådahl
425df31cf9 monitor-unit-tests: Check going headless -> headless
https://bugzilla.gnome.org/show_bug.cgi?id=788607
2017-10-08 09:42:56 +08:00
Jonas Ådahl
8886e1bbdc window: Handle updating from no to no monitor
When we received two hot plug events that both resulted in headless
configuration, we tried to find a new window monitor given the old.
That resulted in a null pointer dereference; avoid that by only trying
to find the same monitor if there was an old one.

https://bugzilla.gnome.org/show_bug.cgi?id=788607
2017-10-08 09:42:56 +08:00
Jonas Ådahl
7b02e2daf9 screen-cast-stream-src: Only clean up pipewire remote/core if they exist
They can could fail to create, so lets deal better with that
possibility.

https://bugzilla.gnome.org/show_bug.cgi?id=788569
2017-10-05 16:16:47 -04:00
Florian Müllner
62a772807f build: Fetch pipewire micro version
Pipewire doesn't export its version defines, so the API checks added
in commit f0c6c4eb1f effectively disable screencasting, whoops.
Breaking changes like this should disappear once the library stabilizes,
so simply define the version ourselves instead of writing a "proper"
test with AC_COMPILE_IFELSE() ...

https://bugzilla.gnome.org/show_bug.cgi?id=788572
2017-10-05 16:16:47 -04:00
Daniel Stone
edfd15b32d wayland-dma-buf: Don't send modifiers to old clients
The modifier event was only added in v3 of the client; sending it to
older clients (e.g. GStreamer waylandsink) causes them to disconnect
immediately.

Send the older 'format' event to all clients, and only send the newer
'modifier' event to resource versions 3 or above.

https://bugzilla.gnome.org/show_bug.cgi?id=788558
2017-10-05 13:11:34 -04:00
Xavi Ivars
5b07a2c0ee [l10n] Updated Catalan (Valencian) translation 2017-10-05 14:15:59 +02:00
151 changed files with 5531 additions and 14354 deletions

4
.gitignore vendored
View File

@@ -88,10 +88,6 @@ src/pointer-constraints-unstable-v*-protocol.c
src/pointer-constraints-unstable-v*-server-protocol.h
src/xdg-foreign-unstable-v*-protocol.c
src/xdg-foreign-unstable-v*-server-protocol.h
src/xdg-output-unstable-v1-protocol.c
src/xdg-output-unstable-v1-server-protocol.h
src/xwayland-keyboard-grab-unstable-v1-protocol.c
src/xwayland-keyboard-grab-unstable-v1-server-protocol.h
src/meta/meta-version.h
src/libmutter-*.pc
doc/reference/*.args

16
NEWS
View File

@@ -1,17 +1,21 @@
3.27.1
3.26.2
======
* Work with clients that require older linux_dmabuf protocol [Daniel; #788558]
* Support hybrid GPU systems [Jonas; #785381]
* Prevent crash when closing maximized windows [Jonni; #788666]
* Use the correct monitor for HiDPI scaling of shell chrome [Jonas; #788820]
* Fix unredirection of fullscreen windows [Rui, Jonas; #788493]
* Fix list of supported monitor scales on X11 [Jonas; #788901]
* Misc. bug fixes [Florian, Jonas, Marco; #788572, #788569, #788607, #788860,
#788921]
* Fix handling of trackball settings on wayland [Carlos; #787804]
* Enable XWayland core dumps [Daniel; #789086]
* Fixes of misc. multi-monitor regressions and crashes [Jonas, Marco; #788607,
#788860, #789153, #786929, #789501]
* Misc. bug fixes [Florian, Jonas, Michael, Marco, Carlos; #788572, #788569,
#784314, #789227, #789223, #782344, #789552, #789553, #789300]
Contributors:
Jonas Ådahl, Carlos Garnacho, Rui Matos, Florian Müllner, Daniel Stone,
Marco Trevisan, Jonni Westphalen
Jonas Ådahl, Jeremy Bicha, Michael Catanzaro, Carlos Garnacho, Rui Matos,
Florian Müllner, Daniel Stone, Marco Trevisan, Daniel van Vugt,
Jonni Westphalen
Translations:
Xavi Ivars [ca@valencia]

View File

@@ -87,8 +87,6 @@ source_h = \
clutter-image.h \
clutter-input-device.h \
clutter-input-device-tool.h \
clutter-input-focus.h \
clutter-input-method.h \
clutter-interval.h \
clutter-keyframe-transition.h \
clutter-keysyms.h \
@@ -171,8 +169,6 @@ source_c = \
clutter-image.c \
clutter-input-device.c \
clutter-input-device-tool.c \
clutter-input-focus.c \
clutter-input-method.c \
clutter-virtual-input-device.c \
clutter-interval.c \
clutter-keyframe-transition.c \
@@ -392,7 +388,6 @@ x11_source_c = \
x11/clutter-keymap-x11.c \
x11/clutter-stage-x11.c \
x11/clutter-x11-texture-pixmap.c \
x11/clutter-xkb-a11y-x11.c \
$(NULL)
x11_source_h = \
@@ -407,7 +402,6 @@ x11_source_h_priv = \
x11/clutter-keymap-x11.h \
x11/clutter-settings-x11.h \
x11/clutter-stage-x11.h \
x11/clutter-xkb-a11y-x11.h \
$(NULL)
x11_source_c_priv = \

View File

@@ -58,8 +58,6 @@ struct _ClutterBackend
gint32 units_serial;
GList *event_translators;
ClutterInputMethod *input_method;
};
struct _ClutterBackendClass
@@ -102,8 +100,6 @@ struct _ClutterBackendClass
PangoDirection (* get_keymap_direction) (ClutterBackend *backend);
void (* bell_notify) (ClutterBackend *backend);
/* signals */
void (* resolution_changed) (ClutterBackend *backend);
void (* font_changed) (ClutterBackend *backend);

View File

@@ -127,7 +127,6 @@ clutter_backend_finalize (GObject *gobject)
g_free (backend->font_name);
clutter_backend_set_font_options (backend, NULL);
g_clear_object (&backend->input_method);
G_OBJECT_CLASS (clutter_backend_parent_class)->finalize (gobject);
}
@@ -1364,41 +1363,3 @@ clutter_set_allowed_drivers (const char *drivers)
allowed_drivers = g_strdup (drivers);
}
void
clutter_backend_bell_notify (ClutterBackend *backend)
{
ClutterBackendClass *klass;
klass = CLUTTER_BACKEND_GET_CLASS (backend);
if (klass->bell_notify)
klass->bell_notify (backend);
}
/**
* clutter_backend_get_input_method:
* @backend: the #CLutterBackend
*
* Returns the input method used by Clutter
*
* Returns: (transfer none): the input method
**/
ClutterInputMethod *
clutter_backend_get_input_method (ClutterBackend *backend)
{
return backend->input_method;
}
/**
* clutter_backend_set_input_method:
* @backend: the #ClutterBackend
* @method: the input method
*
* Sets the input method to be used by Clutter
**/
void
clutter_backend_set_input_method (ClutterBackend *backend,
ClutterInputMethod *method)
{
g_set_object (&backend->input_method, method);
}

View File

@@ -74,15 +74,6 @@ const cairo_font_options_t * clutter_backend_get_font_options (Clutter
CLUTTER_AVAILABLE_IN_1_8
CoglContext * clutter_backend_get_cogl_context (ClutterBackend *backend);
CLUTTER_AVAILABLE_IN_ALL
void clutter_backend_bell_notify (ClutterBackend *backend);
CLUTTER_AVAILABLE_IN_MUTTER
ClutterInputMethod * clutter_backend_get_input_method (ClutterBackend *backend);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_backend_set_input_method (ClutterBackend *backend,
ClutterInputMethod *method);
G_END_DECLS
#endif /* __CLUTTER_BACKEND_H__ */

View File

@@ -145,9 +145,6 @@ struct _ClutterInputDevice
guint is_enabled : 1;
};
typedef void (*ClutterEmitInputDeviceEvent) (ClutterEvent *event,
ClutterInputDevice *device);
struct _ClutterInputDeviceClass
{
GObjectClass parent_class;
@@ -166,11 +163,6 @@ struct _ClutterInputDeviceClass
gboolean (* is_grouped) (ClutterInputDevice *device,
ClutterInputDevice *other_device);
/* Keyboard accessbility */
void (* process_kbd_a11y_event) (ClutterEvent *event,
ClutterInputDevice *device,
ClutterEmitInputDeviceEvent emit_event_func);
};
/* Platform-dependent interface */

View File

@@ -54,9 +54,6 @@ struct _ClutterDeviceManagerPrivate
{
/* back-pointer to the backend */
ClutterBackend *backend;
/* Keyboard a11y */
ClutterKbdA11ySettings kbd_a11y_settings;
};
enum
@@ -75,8 +72,6 @@ enum
DEVICE_ADDED,
DEVICE_REMOVED,
TOOL_CHANGED,
KBD_A11Y_MASK_CHANGED,
KBD_A11Y_FLAGS_CHANGED,
LAST_SIGNAL
};
@@ -201,46 +196,6 @@ clutter_device_manager_class_init (ClutterDeviceManagerClass *klass)
G_TYPE_NONE, 2,
CLUTTER_TYPE_INPUT_DEVICE,
CLUTTER_TYPE_INPUT_DEVICE_TOOL);
/**
* ClutterDeviceManager::kbd-a11y-mods-state-changed:
* @manager: the #ClutterDeviceManager that emitted the signal
* @latched_mask: the latched modifier mask from stickykeys
* @locked_mask: the locked modifier mask from stickykeys
*
* The ::kbd-a11y-mods-state-changed signal is emitted each time either the
* latched modifiers mask or locked modifiers mask are changed as the
* result of keyboard accessibilty's sticky keys operations.
*/
manager_signals[KBD_A11Y_MASK_CHANGED] =
g_signal_new (I_("kbd-a11y-mods-state-changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
_clutter_marshal_VOID__UINT_UINT,
G_TYPE_NONE, 2,
G_TYPE_UINT,
G_TYPE_UINT);
/**
* ClutterDeviceManager::kbd-a11y-flags-changed:
* @manager: the #ClutterDeviceManager that emitted the signal
* @settings_flags: the new ClutterKeyboardA11yFlags configuration
* @changed_mask: the ClutterKeyboardA11yFlags changed
*
* The ::kbd-a11y-flags-changed signal is emitted each time the
* ClutterKeyboardA11yFlags configuration is changed as the result of
* keyboard accessibilty operations.
*/
manager_signals[KBD_A11Y_FLAGS_CHANGED] =
g_signal_new (I_("kbd-a11y-flags-changed"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
_clutter_marshal_VOID__UINT_UINT,
G_TYPE_NONE, 2,
G_TYPE_UINT,
G_TYPE_UINT);
}
static void
@@ -532,43 +487,3 @@ _clutter_device_manager_compress_motion (ClutterDeviceManager *device_manager,
manager_class->compress_motion (device_manager, event, to_discard);
}
static gboolean
are_kbd_a11y_settings_equal (ClutterKbdA11ySettings *a,
ClutterKbdA11ySettings *b)
{
return (a->controls == b->controls &&
a->slowkeys_delay == b->slowkeys_delay &&
a->debounce_delay == b->debounce_delay &&
a->timeout_delay == b->timeout_delay &&
a->mousekeys_init_delay == b->mousekeys_init_delay &&
a->mousekeys_max_speed == b->mousekeys_max_speed &&
a->mousekeys_accel_time == b->mousekeys_accel_time);
}
void
clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_manager,
ClutterKbdA11ySettings *settings)
{
ClutterDeviceManagerClass *manager_class;
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
if (are_kbd_a11y_settings_equal (&device_manager->priv->kbd_a11y_settings, settings))
return;
device_manager->priv->kbd_a11y_settings = *settings;
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
if (manager_class->apply_kbd_a11y_settings)
manager_class->apply_kbd_a11y_settings (device_manager, settings);
}
void
clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
ClutterKbdA11ySettings *settings)
{
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager));
*settings = device_manager->priv->kbd_a11y_settings;
}

View File

@@ -44,25 +44,6 @@ typedef struct _ClutterDeviceManager ClutterDeviceManager;
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
typedef struct _ClutterDeviceManagerClass ClutterDeviceManagerClass;
/**
* ClutterKbdA11ySettings:
*
* The #ClutterKbdA11ySettings structure contains keyboard accessibility
* settings
*
*/
typedef struct _ClutterKbdA11ySettings
{
ClutterKeyboardA11yFlags controls;
gint slowkeys_delay;
gint debounce_delay;
gint timeout_delay;
gint mousekeys_init_delay;
gint mousekeys_max_speed;
gint mousekeys_accel_time;
} ClutterKbdA11ySettings;
/**
* ClutterDeviceManager:
*
@@ -107,9 +88,7 @@ struct _ClutterDeviceManagerClass
void (* compress_motion) (ClutterDeviceManager *device_manger,
ClutterEvent *event,
const ClutterEvent *to_discard);
/* Keyboard accessbility */
void (* apply_kbd_a11y_settings) (ClutterDeviceManager *device_manger,
ClutterKbdA11ySettings *settings);
/* padding */
gpointer _padding[6];
};
@@ -135,13 +114,6 @@ CLUTTER_AVAILABLE_IN_ALL
ClutterVirtualInputDevice *clutter_device_manager_create_virtual_device (ClutterDeviceManager *device_manager,
ClutterInputDeviceType device_type);
CLUTTER_AVAILABLE_IN_ALL
void clutter_device_manager_set_kbd_a11y_settings (ClutterDeviceManager *device_manager,
ClutterKbdA11ySettings *settings);
CLUTTER_AVAILABLE_IN_ALL
void clutter_device_manager_get_kbd_a11y_settings (ClutterDeviceManager *device_manager,
ClutterKbdA11ySettings *settings);
G_END_DECLS
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */

View File

@@ -396,43 +396,6 @@ typedef enum {
CLUTTER_MODIFIER_MASK = 0x5c001fff
} ClutterModifierType;
/**
* ClutterKeyboardA11yFlags:
* @CLUTTER_A11Y_KEYBOARD_ENABLED:
* @CLUTTER_A11Y_TIMEOUT_ENABLED:
* @CLUTTER_A11Y_MOUSE_KEYS_ENABLED:
* @CLUTTER_A11Y_SLOW_KEYS_ENABLED:
* @CLUTTER_A11Y_SLOW_KEYS_BEEP_PRESS:
* @CLUTTER_A11Y_SLOW_KEYS_BEEP_ACCEPT:
* @CLUTTER_A11Y_SLOW_KEYS_BEEP_REJECT:
* @CLUTTER_A11Y_BOUNCE_KEYS_ENABLED:
* @CLUTTER_A11Y_BOUNCE_KEYS_BEEP_REJECT:
* @CLUTTER_A11Y_TOGGLE_KEYS_ENABLED:
* @CLUTTER_A11Y_STICKY_KEYS_ENABLED:
* @CLUTTER_A11Y_STICKY_KEYS_TWO_KEY_OFF:
* @CLUTTER_A11Y_STICKY_KEYS_BEEP:
* @CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP:
*
* Keyboard accessibility features applied to a ClutterInputDevice keyboard.
*
*/
typedef enum {
CLUTTER_A11Y_KEYBOARD_ENABLED = 1 << 0,
CLUTTER_A11Y_TIMEOUT_ENABLED = 1 << 1,
CLUTTER_A11Y_MOUSE_KEYS_ENABLED = 1 << 2,
CLUTTER_A11Y_SLOW_KEYS_ENABLED = 1 << 3,
CLUTTER_A11Y_SLOW_KEYS_BEEP_PRESS = 1 << 4,
CLUTTER_A11Y_SLOW_KEYS_BEEP_ACCEPT = 1 << 5,
CLUTTER_A11Y_SLOW_KEYS_BEEP_REJECT = 1 << 6,
CLUTTER_A11Y_BOUNCE_KEYS_ENABLED = 1 << 7,
CLUTTER_A11Y_BOUNCE_KEYS_BEEP_REJECT = 1 << 8,
CLUTTER_A11Y_TOGGLE_KEYS_ENABLED = 1 << 9,
CLUTTER_A11Y_STICKY_KEYS_ENABLED = 1 << 10,
CLUTTER_A11Y_STICKY_KEYS_TWO_KEY_OFF = 1 << 11,
CLUTTER_A11Y_STICKY_KEYS_BEEP = 1 << 12,
CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP = 1 << 13,
} ClutterKeyboardA11yFlags;
/**
* ClutterActorFlags:
* @CLUTTER_ACTOR_MAPPED: the actor will be painted (is visible, and inside
@@ -767,9 +730,8 @@ typedef enum { /*< prefix=CLUTTER_DRAG >*/
* Since: 0.6
*/
typedef enum { /*< flags prefix=CLUTTER_EVENT >*/
CLUTTER_EVENT_NONE = 0,
CLUTTER_EVENT_FLAG_SYNTHETIC = 1 << 0,
CLUTTER_EVENT_FLAG_INPUT_METHOD = 1 << 1
CLUTTER_EVENT_NONE = 0,
CLUTTER_EVENT_FLAG_SYNTHETIC = 1 << 0
} ClutterEventFlags;
/**
@@ -1574,41 +1536,6 @@ typedef enum {
CLUTTER_INPUT_DEVICE_MAPPING_RELATIVE,
} ClutterInputDeviceMapping;
typedef enum {
CLUTTER_INPUT_CONTENT_HINT_COMPLETION = 1 << 0,
CLUTTER_INPUT_CONTENT_HINT_SPELLCHECK = 1 << 1,
CLUTTER_INPUT_CONTENT_HINT_AUTO_CAPITALIZATION = 1 << 2,
CLUTTER_INPUT_CONTENT_HINT_LOWERCASE = 1 << 3,
CLUTTER_INPUT_CONTENT_HINT_UPPERCASE = 1 << 4,
CLUTTER_INPUT_CONTENT_HINT_TITLECASE = 1 << 5,
CLUTTER_INPUT_CONTENT_HINT_HIDDEN_TEXT = 1 << 6,
CLUTTER_INPUT_CONTENT_HINT_SENSITIVE_DATA = 1 << 7,
CLUTTER_INPUT_CONTENT_HINT_LATIN = 1 << 8,
CLUTTER_INPUT_CONTENT_HINT_MULTILINE = 1 << 9,
} ClutterInputContentHintFlags;
typedef enum {
CLUTTER_INPUT_CONTENT_PURPOSE_NORMAL,
CLUTTER_INPUT_CONTENT_PURPOSE_ALPHA,
CLUTTER_INPUT_CONTENT_PURPOSE_DIGITS,
CLUTTER_INPUT_CONTENT_PURPOSE_NUMBER,
CLUTTER_INPUT_CONTENT_PURPOSE_PHONE,
CLUTTER_INPUT_CONTENT_PURPOSE_URL,
CLUTTER_INPUT_CONTENT_PURPOSE_EMAIL,
CLUTTER_INPUT_CONTENT_PURPOSE_NAME,
CLUTTER_INPUT_CONTENT_PURPOSE_PASSWORD,
CLUTTER_INPUT_CONTENT_PURPOSE_DATE,
CLUTTER_INPUT_CONTENT_PURPOSE_TIME,
CLUTTER_INPUT_CONTENT_PURPOSE_DATETIME,
CLUTTER_INPUT_CONTENT_PURPOSE_TERMINAL,
} ClutterInputContentPurpose;
typedef enum {
CLUTTER_INPUT_PANEL_STATE_OFF,
CLUTTER_INPUT_PANEL_STATE_ON,
CLUTTER_INPUT_PANEL_STATE_TOGGLE,
} ClutterInputPanelState;
G_END_DECLS
#endif /* __CLUTTER_ENUMS_H__ */

View File

@@ -1,229 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#include "clutter-build-config.h"
#include "clutter/clutter-input-focus.h"
enum {
FOCUS_IN,
FOCUS_OUT,
COMMIT,
DELETE_SURROUNDING,
REQUEST_SURROUNDING,
SET_PREEDIT_TEXT,
N_SIGNALS,
};
static guint signals[N_SIGNALS] = { 0 };
G_DEFINE_INTERFACE (ClutterInputFocus, clutter_input_focus, G_TYPE_OBJECT)
static void
clutter_input_focus_default_init (ClutterInputFocusInterface *iface)
{
signals[FOCUS_IN] =
g_signal_new ("focus-in",
CLUTTER_TYPE_INPUT_FOCUS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterInputFocusInterface, focus_in),
NULL, NULL, NULL,
G_TYPE_NONE, 1, CLUTTER_TYPE_INPUT_METHOD);
signals[FOCUS_OUT] =
g_signal_new ("focus-out",
CLUTTER_TYPE_INPUT_FOCUS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterInputFocusInterface, focus_out),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
signals[COMMIT] =
g_signal_new ("commit",
CLUTTER_TYPE_INPUT_FOCUS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterInputFocusInterface, commit_text),
NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_STRING);
signals[DELETE_SURROUNDING] =
g_signal_new ("delete-surrounding",
CLUTTER_TYPE_INPUT_FOCUS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterInputFocusInterface, delete_surrounding),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
signals[REQUEST_SURROUNDING] =
g_signal_new ("request-surrounding",
CLUTTER_TYPE_INPUT_FOCUS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterInputFocusInterface, request_surrounding),
NULL, NULL, NULL,
G_TYPE_NONE, 0);
signals[SET_PREEDIT_TEXT] =
g_signal_new ("set-preedit-text",
CLUTTER_TYPE_INPUT_FOCUS,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (ClutterInputFocusInterface, set_preedit_text),
NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_UINT);
}
void
clutter_input_focus_reset (ClutterInputFocus *focus)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
if (clutter_input_method_get_focus (method) != focus)
return;
CLUTTER_INPUT_METHOD_GET_CLASS (method)->reset (method);
}
void
clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
const ClutterRect *rect)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
if (clutter_input_method_get_focus (method) != focus)
return;
CLUTTER_INPUT_METHOD_GET_CLASS (method)->set_cursor_location (method, rect);
}
void
clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
const gchar *text,
guint cursor,
guint anchor)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
if (clutter_input_method_get_focus (method) != focus)
return;
CLUTTER_INPUT_METHOD_GET_CLASS (method)->set_surrounding (method, text, cursor, anchor);
}
void
clutter_input_focus_set_content_hints (ClutterInputFocus *focus,
ClutterInputContentHintFlags hints)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
if (clutter_input_method_get_focus (method) != focus)
return;
g_object_set (G_OBJECT (method), "content-hints", hints, NULL);
}
void
clutter_input_focus_set_content_purpose (ClutterInputFocus *focus,
ClutterInputContentPurpose purpose)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
if (clutter_input_method_get_focus (method) != focus)
return;
g_object_set (G_OBJECT (method), "content-purpose", purpose, NULL);
}
void
clutter_input_focus_focus_in (ClutterInputFocus *focus)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
clutter_input_method_focus_in (method, focus);
}
void
clutter_input_focus_focus_out (ClutterInputFocus *focus)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
if (clutter_input_method_get_focus (method) == focus)
clutter_input_method_focus_out (method);
}
gboolean
clutter_input_focus_filter_key_event (ClutterInputFocus *focus,
const ClutterKeyEvent *key)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
g_return_val_if_fail (CLUTTER_IS_INPUT_METHOD (method), FALSE);
if (clutter_event_get_flags ((ClutterEvent *) key) & CLUTTER_EVENT_FLAG_INPUT_METHOD)
return FALSE;
if (clutter_input_method_get_focus (method) == focus)
{
ClutterInputMethodClass *im_class = CLUTTER_INPUT_METHOD_GET_CLASS (method);
if (im_class->filter_key_event)
return im_class->filter_key_event (method, (const ClutterEvent *) key);
}
return FALSE;
}
void
clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
gboolean can_show_preedit)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
if (clutter_input_method_get_focus (method) == focus)
g_object_set (G_OBJECT (method), "can-show-preedit", can_show_preedit, NULL);
}
void
clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterInputMethod *method = clutter_backend_get_input_method (backend);
if (clutter_input_method_get_focus (method) == focus)
{
g_signal_emit_by_name (method, "input-panel-state",
CLUTTER_INPUT_PANEL_STATE_TOGGLE);
}
}

View File

@@ -1,86 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __CLUTTER_INPUT_FOCUS_H__
#define __CLUTTER_INPUT_FOCUS_H__
#include <clutter/clutter.h>
#define CLUTTER_TYPE_INPUT_FOCUS (clutter_input_focus_get_type ())
CLUTTER_AVAILABLE_IN_MUTTER
G_DECLARE_INTERFACE (ClutterInputFocus, clutter_input_focus,
CLUTTER, INPUT_FOCUS, GObject)
typedef struct _ClutterInputFocusInterface ClutterInputFocusInterface;
struct _ClutterInputFocusInterface
{
GTypeInterface iface;
void (* focus_in) (ClutterInputFocus *focus,
ClutterInputMethod *input_method);
void (* focus_out) (ClutterInputFocus *focus);
void (* request_surrounding) (ClutterInputFocus *focus);
void (* delete_surrounding) (ClutterInputFocus *focus,
guint offset,
guint len);
void (* commit_text) (ClutterInputFocus *focus,
const gchar *text);
void (* set_preedit_text) (ClutterInputFocus *focus,
const gchar *preedit,
guint cursor);
};
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_focus_in (ClutterInputFocus *focus);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_focus_out (ClutterInputFocus *focus);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_reset (ClutterInputFocus *focus);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_set_cursor_location (ClutterInputFocus *focus,
const ClutterRect *rect);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_set_surrounding (ClutterInputFocus *focus,
const gchar *text,
guint cursor,
guint anchor);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_set_content_hints (ClutterInputFocus *focus,
ClutterInputContentHintFlags hint);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_set_content_purpose (ClutterInputFocus *focus,
ClutterInputContentPurpose purpose);
CLUTTER_AVAILABLE_IN_MUTTER
gboolean clutter_input_focus_filter_key_event (ClutterInputFocus *focus,
const ClutterKeyEvent *key);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
gboolean can_show_preedit);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus);
#endif /* __CLUTTER_INPUT_FOCUS_H__ */

View File

@@ -1,359 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#include "clutter-build-config.h"
#include "clutter-private.h"
#include "clutter/clutter-input-method.h"
typedef struct _ClutterInputMethodPrivate ClutterInputMethodPrivate;
struct _ClutterInputMethodPrivate
{
ClutterInputFocus *focus;
ClutterInputContentHintFlags content_hints;
ClutterInputContentPurpose content_purpose;
gboolean can_show_preedit;
};
enum {
COMMIT,
DELETE_SURROUNDING,
REQUEST_SURROUNDING,
INPUT_PANEL_STATE,
N_SIGNALS,
};
enum {
PROP_0,
PROP_CONTENT_HINTS,
PROP_CONTENT_PURPOSE,
PROP_CAN_SHOW_PREEDIT,
N_PROPS
};
static guint signals[N_SIGNALS] = { 0 };
static GParamSpec *pspecs[N_PROPS] = { 0 };
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (ClutterInputMethod, clutter_input_method, G_TYPE_OBJECT)
static void
set_content_hints (ClutterInputMethod *method,
ClutterInputContentHintFlags content_hints)
{
ClutterInputMethodPrivate *priv;
priv = clutter_input_method_get_instance_private (method);
priv->content_hints = content_hints;
CLUTTER_INPUT_METHOD_GET_CLASS (method)->update_content_hints (method,
content_hints);
}
static void
set_content_purpose (ClutterInputMethod *method,
ClutterInputContentPurpose content_purpose)
{
ClutterInputMethodPrivate *priv;
priv = clutter_input_method_get_instance_private (method);
priv->content_purpose = content_purpose;
CLUTTER_INPUT_METHOD_GET_CLASS (method)->update_content_purpose (method,
content_purpose);
}
static void
set_can_show_preedit (ClutterInputMethod *method,
gboolean can_show_preedit)
{
ClutterInputMethodPrivate *priv;
priv = clutter_input_method_get_instance_private (method);
priv->can_show_preedit = can_show_preedit;
}
static void
clutter_input_method_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
switch (prop_id)
{
case PROP_CONTENT_HINTS:
set_content_hints (CLUTTER_INPUT_METHOD (object),
g_value_get_flags (value));
break;
case PROP_CONTENT_PURPOSE:
set_content_purpose (CLUTTER_INPUT_METHOD (object),
g_value_get_enum (value));
break;
case PROP_CAN_SHOW_PREEDIT:
set_can_show_preedit (CLUTTER_INPUT_METHOD (object),
g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_input_method_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
ClutterInputMethodPrivate *priv;
ClutterInputMethod *method;
method = CLUTTER_INPUT_METHOD (object);
priv = clutter_input_method_get_instance_private (method);
switch (prop_id)
{
case PROP_CONTENT_HINTS:
g_value_set_flags (value, priv->content_hints);
break;
case PROP_CONTENT_PURPOSE:
g_value_set_enum (value, priv->content_purpose);
break;
case PROP_CAN_SHOW_PREEDIT:
g_value_set_boolean (value, priv->can_show_preedit);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
clutter_input_method_class_init (ClutterInputMethodClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = clutter_input_method_set_property;
object_class->get_property = clutter_input_method_get_property;
signals[COMMIT] =
g_signal_new ("commit",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 1, G_TYPE_STRING);
signals[DELETE_SURROUNDING] =
g_signal_new ("delete-surrounding",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_UINT);
signals[REQUEST_SURROUNDING] =
g_signal_new ("request-surrounding",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 0);
signals[INPUT_PANEL_STATE] =
g_signal_new ("input-panel-state",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
G_TYPE_NONE, 1,
CLUTTER_TYPE_INPUT_PANEL_STATE);
pspecs[PROP_CONTENT_HINTS] =
g_param_spec_flags ("content-hints",
P_("Content hints"),
P_("Content hints"),
CLUTTER_TYPE_INPUT_CONTENT_HINT_FLAGS, 0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
pspecs[PROP_CONTENT_PURPOSE] =
g_param_spec_enum ("content-purpose",
P_("Content purpose"),
P_("Content purpose"),
CLUTTER_TYPE_INPUT_CONTENT_PURPOSE, 0,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
pspecs[PROP_CAN_SHOW_PREEDIT] =
g_param_spec_boolean ("can-show-preedit",
P_("Can show preedit"),
P_("Can show preedit"),
FALSE,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPS, pspecs);
}
static void
clutter_input_method_init (ClutterInputMethod *method)
{
}
void
clutter_input_method_focus_in (ClutterInputMethod *method,
ClutterInputFocus *focus)
{
ClutterInputMethodPrivate *priv;
ClutterInputMethodClass *klass;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
g_return_if_fail (CLUTTER_IS_INPUT_FOCUS (focus));
priv = clutter_input_method_get_instance_private (method);
if (priv->focus == focus)
return;
if (priv->focus)
clutter_input_method_focus_out (method);
g_set_object (&priv->focus, focus);
if (focus)
{
klass = CLUTTER_INPUT_METHOD_GET_CLASS (method);
klass->focus_in (method, focus);
g_signal_emit_by_name (priv->focus, "focus-in", method);
}
}
void
clutter_input_method_focus_out (ClutterInputMethod *method)
{
ClutterInputMethodPrivate *priv;
ClutterInputMethodClass *klass;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
priv = clutter_input_method_get_instance_private (method);
if (!priv->focus)
return;
g_signal_emit_by_name (priv->focus, "focus-out");
g_clear_object (&priv->focus);
klass = CLUTTER_INPUT_METHOD_GET_CLASS (method);
klass->focus_out (method);
g_signal_emit (method, signals[INPUT_PANEL_STATE],
0, CLUTTER_INPUT_PANEL_STATE_OFF);
}
/**
* clutter_input_method_get_focus:
* @method: the #ClutterInputMethod
*
* Retrieves the current focus of the input method, or %NULL
* if there is none.
*
* Returns: (transfer none) (nullable): the current focus
**/
ClutterInputFocus *
clutter_input_method_get_focus (ClutterInputMethod *method)
{
ClutterInputMethodPrivate *priv;
priv = clutter_input_method_get_instance_private (method);
return priv->focus;
}
void
clutter_input_method_commit (ClutterInputMethod *method,
const gchar *text)
{
ClutterInputMethodPrivate *priv;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
priv = clutter_input_method_get_instance_private (method);
if (priv->focus)
g_signal_emit_by_name (priv->focus, "commit", text);
}
void
clutter_input_method_delete_surrounding (ClutterInputMethod *method,
guint offset,
guint len)
{
ClutterInputMethodPrivate *priv;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
priv = clutter_input_method_get_instance_private (method);
if (priv->focus)
g_signal_emit_by_name (priv->focus, "delete-surrounding", offset, len);
}
void
clutter_input_method_request_surrounding (ClutterInputMethod *method)
{
ClutterInputMethodPrivate *priv;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
priv = clutter_input_method_get_instance_private (method);
if (priv->focus)
g_signal_emit_by_name (priv->focus, "request-surrounding");
}
/**
* clutter_input_method_set_preedit_text:
* @method: a #ClutterInputMethod
* @preedit: (nullable): the preedit text, or %NULL
*
* Sets the preedit text on the current input focus.
**/
void
clutter_input_method_set_preedit_text (ClutterInputMethod *method,
const gchar *preedit,
guint cursor)
{
ClutterInputMethodPrivate *priv;
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (method));
priv = clutter_input_method_get_instance_private (method);
if (priv->focus)
g_signal_emit_by_name (priv->focus, "set-preedit-text", preedit, cursor);
}
void
clutter_input_method_notify_key_event (ClutterInputMethod *method,
const ClutterEvent *event,
gboolean filtered)
{
if (!filtered)
{
ClutterEvent *copy;
/* XXX: we rely on the IM implementation to notify back of
* key events in the exact same order they were given.
*/
copy = clutter_event_copy (event);
clutter_event_set_flags (copy, clutter_event_get_flags (event) |
CLUTTER_EVENT_FLAG_INPUT_METHOD);
clutter_event_put (copy);
clutter_event_free (copy);
}
}

View File

@@ -1,89 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* Author: Carlos Garnacho <carlosg@gnome.org>
*/
#ifndef __CLUTTER_INPUT_METHOD_H__
#define __CLUTTER_INPUT_METHOD_H__
#include <clutter/clutter.h>
#define CLUTTER_TYPE_INPUT_METHOD (clutter_input_method_get_type ())
CLUTTER_AVAILABLE_IN_MUTTER
G_DECLARE_DERIVABLE_TYPE (ClutterInputMethod, clutter_input_method,
CLUTTER, INPUT_METHOD, GObject)
typedef struct _ClutterInputMethodClass ClutterInputMethodClass;
struct _ClutterInputMethodClass
{
GObjectClass parent_class;
void (* focus_in) (ClutterInputMethod *method,
ClutterInputFocus *actor);
void (* focus_out) (ClutterInputMethod *method);
void (* reset) (ClutterInputMethod *method);
void (* set_cursor_location) (ClutterInputMethod *method,
const ClutterRect *rect);
void (* set_surrounding) (ClutterInputMethod *method,
const gchar *text,
guint cursor,
guint anchor);
void (* update_content_hints) (ClutterInputMethod *method,
ClutterInputContentHintFlags hint);
void (* update_content_purpose) (ClutterInputMethod *method,
ClutterInputContentPurpose purpose);
gboolean (* filter_key_event) (ClutterInputMethod *method,
const ClutterEvent *key);
};
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_method_focus_in (ClutterInputMethod *method,
ClutterInputFocus *focus);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_method_focus_out (ClutterInputMethod *method);
CLUTTER_AVAILABLE_IN_MUTTER
ClutterInputFocus * clutter_input_method_get_focus (ClutterInputMethod *method);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_method_commit (ClutterInputMethod *method,
const gchar *text);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_method_delete_surrounding (ClutterInputMethod *method,
guint offset,
guint len);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_method_request_surrounding (ClutterInputMethod *method);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_method_set_preedit_text (ClutterInputMethod *method,
const gchar *preedit,
guint cursor);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_input_method_notify_key_event (ClutterInputMethod *method,
const ClutterEvent *event,
gboolean filtered);
#endif /* __CLUTTER_INPUT_METHOD_H__ */

View File

@@ -2089,21 +2089,6 @@ emit_keyboard_event (ClutterEvent *event,
}
}
static inline void
process_key_event (ClutterEvent *event,
ClutterInputDevice *device)
{
ClutterInputDeviceClass *device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
if (device_class->process_kbd_a11y_event)
{
device_class->process_kbd_a11y_event (event, device, emit_keyboard_event);
return;
}
emit_keyboard_event (event, device);
}
static gboolean
is_off_stage (ClutterActor *stage,
gfloat x,
@@ -2191,7 +2176,7 @@ _clutter_process_event_details (ClutterActor *stage,
}
}
process_key_event (event, device);
emit_keyboard_event (event, device);
}
break;

View File

@@ -63,7 +63,6 @@
#include "clutter-units.h"
#include "clutter-paint-volume-private.h"
#include "clutter-scriptable.h"
#include "clutter-input-focus.h"
/* cursor width in pixels */
#define DEFAULT_CURSOR_SIZE 2
@@ -177,9 +176,6 @@ struct _ClutterTextPrivate
/* Signal handler for when the :text-direction changes */
guint direction_changed_id;
ClutterInputContentHintFlags input_hints;
ClutterInputContentPurpose input_purpose;
/* bitfields */
guint alignment : 2;
guint wrap : 1;
@@ -240,8 +236,6 @@ enum
PROP_SINGLE_LINE_MODE,
PROP_SELECTED_TEXT_COLOR,
PROP_SELECTED_TEXT_COLOR_SET,
PROP_INPUT_HINTS,
PROP_INPUT_PURPOSE,
PROP_LAST
};
@@ -275,7 +269,6 @@ static const ClutterColor default_selected_text_color = { 0, 0, 0, 255 };
static ClutterAnimatableIface *parent_animatable_iface = NULL;
static ClutterScriptableIface *parent_scriptable_iface = NULL;
static void clutter_input_focus_iface_init (ClutterInputFocusInterface *iface);
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
@@ -283,91 +276,11 @@ G_DEFINE_TYPE_WITH_CODE (ClutterText,
clutter_text,
CLUTTER_TYPE_ACTOR,
G_ADD_PRIVATE (ClutterText)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_INPUT_FOCUS,
clutter_input_focus_iface_init)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_SCRIPTABLE,
clutter_scriptable_iface_init)
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_ANIMATABLE,
clutter_animatable_iface_init));
static void
clutter_text_input_focus_request_surrounding (ClutterInputFocus *focus)
{
ClutterText *clutter_text = CLUTTER_TEXT (focus);
ClutterTextBuffer *buffer;
const gchar *text;
gint anchor_pos, cursor_pos;
buffer = clutter_text_get_buffer (clutter_text);
text = clutter_text_buffer_get_text (buffer);
cursor_pos = clutter_text_get_cursor_position (clutter_text);
if (cursor_pos < 0)
cursor_pos = clutter_text_buffer_get_length (buffer);
anchor_pos = clutter_text_get_selection_bound (clutter_text);
if (anchor_pos < 0)
anchor_pos = cursor_pos;
clutter_input_focus_set_surrounding (focus, text,
g_utf8_offset_to_pointer (text, cursor_pos) - text,
g_utf8_offset_to_pointer (text, anchor_pos) - text);
}
static void
clutter_text_input_focus_delete_surrounding (ClutterInputFocus *focus,
guint offset,
guint len)
{
ClutterText *clutter_text = CLUTTER_TEXT (focus);
if (clutter_text_get_editable (clutter_text))
clutter_text_delete_text (clutter_text, offset, len);
}
static void
clutter_text_input_focus_commit_text (ClutterInputFocus *focus,
const gchar *text)
{
ClutterText *clutter_text = CLUTTER_TEXT (focus);
if (clutter_text_get_editable (clutter_text))
{
clutter_text_delete_selection (clutter_text);
clutter_text_insert_text (clutter_text, text,
clutter_text_get_cursor_position (clutter_text));
}
}
static void
clutter_text_input_focus_set_preedit_text (ClutterInputFocus *focus,
const gchar *preedit_text,
guint cursor_pos)
{
ClutterText *clutter_text = CLUTTER_TEXT (focus);
if (clutter_text_get_editable (clutter_text))
{
PangoAttrList *list;
list = pango_attr_list_new ();
pango_attr_list_insert (list, pango_attr_underline_new (PANGO_UNDERLINE_SINGLE));
clutter_text_set_preedit_string (clutter_text,
preedit_text, list,
cursor_pos);
pango_attr_list_unref (list);
}
}
static void
clutter_input_focus_iface_init (ClutterInputFocusInterface *iface)
{
iface->request_surrounding = clutter_text_input_focus_request_surrounding;
iface->delete_surrounding = clutter_text_input_focus_delete_surrounding;
iface->commit_text = clutter_text_input_focus_commit_text;
iface->set_preedit_text = clutter_text_input_focus_set_preedit_text;
}
static inline void
clutter_text_dirty_paint_volume (ClutterText *text)
{
@@ -1096,22 +1009,6 @@ clutter_text_position_to_coords (ClutterText *self,
return TRUE;
}
static inline void
update_cursor_location (ClutterText *self)
{
ClutterTextPrivate *priv = self->priv;
ClutterRect rect;
float x, y;
if (!priv->editable)
return;
rect = priv->cursor_rect;
clutter_actor_get_transformed_position (CLUTTER_ACTOR (self), &x, &y);
clutter_rect_offset (&rect, x, y);
clutter_input_focus_set_cursor_location (CLUTTER_INPUT_FOCUS (self), &rect);
}
static inline void
clutter_text_ensure_cursor_position (ClutterText *self)
{
@@ -1160,8 +1057,6 @@ clutter_text_ensure_cursor_position (ClutterText *self)
g_signal_emit (self, text_signals[CURSOR_EVENT], 0, &cursor_pos);
g_signal_emit (self, text_signals[CURSOR_CHANGED], 0);
update_cursor_location (self);
}
}
@@ -1964,7 +1859,6 @@ clutter_text_press (ClutterActor *actor,
return CLUTTER_EVENT_PROPAGATE;
clutter_actor_grab_key_focus (actor);
clutter_input_focus_request_toggle_input_panel (CLUTTER_INPUT_FOCUS (self));
/* if the actor is empty we just reset everything and not
* set up the dragging of the selection since there's nothing
@@ -2191,11 +2085,9 @@ clutter_text_key_press (ClutterActor *actor,
g_assert (pool != NULL);
/* we allow passing synthetic events that only contain
* the Unicode value and not the key symbol, unless they
* contain the input method flag.
* the Unicode value and not the key symbol
*/
if (event->keyval == 0 && (event->flags & CLUTTER_EVENT_FLAG_SYNTHETIC) &&
!(event->flags & CLUTTER_EVENT_FLAG_INPUT_METHOD))
if (event->keyval == 0 && (event->flags & CLUTTER_EVENT_FLAG_SYNTHETIC))
res = FALSE;
else
res = clutter_binding_pool_activate (pool, event->keyval,
@@ -2213,9 +2105,6 @@ clutter_text_key_press (ClutterActor *actor,
{
gunichar key_unichar;
if (clutter_input_focus_filter_key_event (CLUTTER_INPUT_FOCUS (actor), event))
return CLUTTER_EVENT_STOP;
/* Skip keys when control is pressed */
key_unichar = clutter_event_get_key_unicode ((ClutterEvent *) event);
@@ -2252,16 +2141,6 @@ clutter_text_key_press (ClutterActor *actor,
return CLUTTER_EVENT_PROPAGATE;
}
static gboolean
clutter_text_key_release (ClutterActor *actor,
ClutterKeyEvent *event)
{
if (clutter_input_focus_filter_key_event (CLUTTER_INPUT_FOCUS (actor), event))
return CLUTTER_EVENT_STOP;
return CLUTTER_EVENT_PROPAGATE;
}
static void
clutter_text_compute_layout_offsets (ClutterText *self,
PangoLayout *layout,
@@ -2785,9 +2664,6 @@ clutter_text_key_focus_in (ClutterActor *actor)
{
ClutterTextPrivate *priv = CLUTTER_TEXT (actor)->priv;
if (priv->editable)
clutter_input_focus_focus_in (CLUTTER_INPUT_FOCUS (actor));
priv->has_focus = TRUE;
clutter_text_queue_redraw (actor);
@@ -2800,9 +2676,6 @@ clutter_text_key_focus_out (ClutterActor *actor)
priv->has_focus = FALSE;
if (priv->editable)
clutter_input_focus_focus_out (CLUTTER_INPUT_FOCUS (actor));
clutter_text_queue_redraw (actor);
}
@@ -3496,7 +3369,6 @@ clutter_text_class_init (ClutterTextClass *klass)
actor_class->get_preferred_height = clutter_text_get_preferred_height;
actor_class->allocate = clutter_text_allocate;
actor_class->key_press_event = clutter_text_key_press;
actor_class->key_release_event = clutter_text_key_release;
actor_class->button_press_event = clutter_text_button_press;
actor_class->button_release_event = clutter_text_button_release;
actor_class->motion_event = clutter_text_motion;
@@ -3997,22 +3869,6 @@ clutter_text_class_init (ClutterTextClass *klass)
obj_props[PROP_SELECTED_TEXT_COLOR_SET] = pspec;
g_object_class_install_property (gobject_class, PROP_SELECTED_TEXT_COLOR_SET, pspec);
pspec = g_param_spec_flags ("input-hints",
P_("Input hints"),
P_("Input hints"),
CLUTTER_TYPE_INPUT_CONTENT_HINT_FLAGS,
0, CLUTTER_PARAM_READWRITE);
obj_props[PROP_INPUT_HINTS] = pspec;
g_object_class_install_property (gobject_class, PROP_INPUT_HINTS, pspec);
pspec = g_param_spec_enum ("input-purpose",
P_("Input purpose"),
P_("Input purpose"),
CLUTTER_TYPE_INPUT_CONTENT_PURPOSE,
0, CLUTTER_PARAM_READWRITE);
obj_props[PROP_INPUT_PURPOSE] = pspec;
g_object_class_install_property (gobject_class, PROP_INPUT_PURPOSE, pspec);
/**
* ClutterText::text-changed:
* @self: the #ClutterText that emitted the signal
@@ -4613,11 +4469,6 @@ clutter_text_set_editable (ClutterText *self,
{
priv->editable = editable;
if (!priv->editable)
clutter_input_focus_focus_out (CLUTTER_INPUT_FOCUS (self));
else if (priv->has_focus)
clutter_input_focus_focus_in (CLUTTER_INPUT_FOCUS (self));
clutter_text_queue_redraw (CLUTTER_ACTOR (self));
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_EDITABLE]);
@@ -6447,49 +6298,3 @@ clutter_text_get_cursor_rect (ClutterText *self,
*rect = self->priv->cursor_rect;
}
void
clutter_text_set_input_hints (ClutterText *self,
ClutterInputContentHintFlags hints)
{
g_return_if_fail (CLUTTER_IS_TEXT (self));
self->priv->input_hints = hints;
clutter_input_focus_set_content_hints (CLUTTER_INPUT_FOCUS (self), hints);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_INPUT_HINTS]);
}
ClutterInputContentHintFlags
clutter_text_get_input_hints (ClutterText *self)
{
g_return_val_if_fail (CLUTTER_IS_TEXT (self), 0);
return self->priv->input_hints;
}
void
clutter_text_set_input_purpose (ClutterText *self,
ClutterInputContentPurpose purpose)
{
g_return_if_fail (CLUTTER_IS_TEXT (self));
self->priv->input_purpose = purpose;
clutter_input_focus_set_content_purpose (CLUTTER_INPUT_FOCUS (self), purpose);
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_INPUT_PURPOSE]);
}
ClutterInputContentPurpose
clutter_text_get_input_purpose (ClutterText *self)
{
g_return_val_if_fail (CLUTTER_IS_TEXT (self), 0);
return self->priv->input_purpose;
}
gboolean
clutter_text_has_preedit (ClutterText *self)
{
g_return_val_if_fail (CLUTTER_IS_TEXT (self), FALSE);
return self->priv->preedit_set;
}

View File

@@ -302,20 +302,6 @@ void clutter_text_get_layout_offsets (ClutterText *
gint *x,
gint *y);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_text_set_input_hints (ClutterText *self,
ClutterInputContentHintFlags hints);
CLUTTER_AVAILABLE_IN_MUTTER
void clutter_text_set_input_purpose (ClutterText *self,
ClutterInputContentPurpose purpose);
CLUTTER_AVAILABLE_IN_MUTTER
ClutterInputContentHintFlags clutter_text_get_input_hints (ClutterText *self);
CLUTTER_AVAILABLE_IN_MUTTER
ClutterInputContentPurpose clutter_text_get_input_purpose (ClutterText *self);
CLUTTER_AVAILABLE_IN_MUTTER
gboolean clutter_text_has_preedit (ClutterText *self);
G_END_DECLS
#endif /* __CLUTTER_TEXT_H__ */

View File

@@ -97,9 +97,6 @@ typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;
typedef struct _ClutterInputDevice ClutterInputDevice;
typedef struct _ClutterVirtualInputDevice ClutterVirtualInputDevice;
typedef struct _ClutterInputMethod ClutterInputMethod;
typedef struct _ClutterInputFocus ClutterInputFocus;
typedef CoglMatrix ClutterMatrix;
typedef union _ClutterEvent ClutterEvent;

View File

@@ -72,8 +72,6 @@
#include "clutter-image.h"
#include "clutter-input-device.h"
#include "clutter-input-device-tool.h"
#include "clutter-input-method.h"
#include "clutter-input-focus.h"
#include "clutter-interval.h"
#include "clutter-keyframe-transition.h"
#include "clutter-keysyms.h"

View File

@@ -1459,6 +1459,8 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
slot = libinput_event_touch_get_slot (touch_event);
time_us = libinput_event_touch_get_time_usec (touch_event);
touch_state = clutter_seat_evdev_get_touch (seat, slot);
if (!touch_state)
break;
notify_touch_event (device, CLUTTER_TOUCH_END, time_us, slot,
touch_state->coords.x, touch_state->coords.y);
@@ -1497,6 +1499,9 @@ process_device_event (ClutterDeviceManagerEvdev *manager_evdev,
stage_height);
touch_state = clutter_seat_evdev_get_touch (seat, slot);
if (!touch_state)
break;
touch_state->coords.x = x;
touch_state->coords.y = y;
@@ -1923,18 +1928,6 @@ clutter_device_manager_evdev_compress_motion (ClutterDeviceManager *device_mange
dy_unaccel + dst_dy_unaccel);
}
static void
clutter_device_manager_evdev_apply_kbd_a11y_settings (ClutterDeviceManager *device_manager,
ClutterKbdA11ySettings *settings)
{
ClutterInputDevice *device;
device = clutter_device_manager_evdev_get_core_device (device_manager, CLUTTER_KEYBOARD_DEVICE);
if (device)
clutter_input_device_evdev_apply_kbd_a11y_settings (CLUTTER_INPUT_DEVICE_EVDEV (device),
settings);
}
/*
* GObject implementation
*/
@@ -2077,7 +2070,6 @@ clutter_device_manager_evdev_class_init (ClutterDeviceManagerEvdevClass *klass)
manager_class->get_device = clutter_device_manager_evdev_get_device;
manager_class->create_virtual_device = clutter_device_manager_evdev_create_virtual_device;
manager_class->compress_motion = clutter_device_manager_evdev_compress_motion;
manager_class->apply_kbd_a11y_settings = clutter_device_manager_evdev_apply_kbd_a11y_settings;
}
static void
@@ -2317,7 +2309,7 @@ clutter_evdev_update_xkb_state (ClutterDeviceManagerEvdev *manager_evdev)
0, /* depressed */
latched_mods,
locked_mods,
0, 0, seat->layout_idx);
0, 0, 0);
seat->caps_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_CAPS);
seat->num_lock_led = xkb_keymap_led_get_index (priv->keymap, XKB_LED_NAME_NUM);
@@ -2465,7 +2457,6 @@ clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
xkb_mod_mask_t latched_mods;
xkb_mod_mask_t locked_mods;
struct xkb_state *state;
GSList *l;
g_return_if_fail (CLUTTER_IS_DEVICE_MANAGER_EVDEV (evdev));
@@ -2477,12 +2468,6 @@ clutter_evdev_set_keyboard_layout_index (ClutterDeviceManager *evdev,
locked_mods = xkb_state_serialize_mods (state, XKB_STATE_MODS_LOCKED);
xkb_state_update_mask (state, depressed_mods, latched_mods, locked_mods, 0, 0, idx);
for (l = manager_evdev->priv->seats; l; l = l->next)
{
ClutterSeatEvdev *seat = l->data;
seat->layout_idx = idx;
}
}
/**
@@ -2492,9 +2477,12 @@ xkb_layout_index_t
clutter_evdev_get_keyboard_layout_index (ClutterDeviceManager *evdev)
{
ClutterDeviceManagerEvdev *manager_evdev;
struct xkb_state *state;
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (evdev);
return manager_evdev->priv->main_seat->layout_idx;
state = manager_evdev->priv->main_seat->xkb;
return xkb_state_serialize_layout (state, XKB_STATE_LAYOUT_LOCKED);
}
/**

File diff suppressed because it is too large Load Diff

View File

@@ -70,29 +70,6 @@ struct _ClutterInputDeviceEvdev
cairo_matrix_t device_matrix;
gdouble device_aspect_ratio; /* w:h */
gdouble output_ratio; /* w:h */
/* Keyboard a11y */
ClutterKeyboardA11yFlags a11y_flags;
GList *slow_keys_list;
guint debounce_timer;
guint16 debounce_key;
xkb_mod_mask_t stickykeys_depressed_mask;
xkb_mod_mask_t stickykeys_latched_mask;
xkb_mod_mask_t stickykeys_locked_mask;
guint toggle_slowkeys_timer;
guint16 shift_count;
guint32 last_shift_time;
gint mousekeys_btn;
gboolean mousekeys_btn_states[3];
guint32 mousekeys_first_motion_time; /* ms */
guint32 mousekeys_last_motion_time; /* ms */
guint mousekeys_init_delay;
guint mousekeys_accel_time;
guint mousekeys_max_speed;
gdouble mousekeys_curve_factor;
guint move_mousekeys_timer;
guint16 last_mousekeys_key;
ClutterVirtualInputDevice *mousekeys_virtual_device;
};
GType _clutter_input_device_evdev_get_type (void) G_GNUC_CONST;
@@ -134,9 +111,6 @@ void clutter_input_device_evdev_translate_coordinates (Clut
gfloat *x,
gfloat *y);
void clutter_input_device_evdev_apply_kbd_a11y_settings (ClutterInputDeviceEvdev *device,
ClutterKbdA11ySettings *settings);
G_END_DECLS
#endif /* __CLUTTER_INPUT_DEVICE_EVDEV_H__ */

View File

@@ -58,7 +58,6 @@ struct _ClutterSeatEvdev
xkb_led_index_t caps_lock_led;
xkb_led_index_t num_lock_led;
xkb_led_index_t scroll_lock_led;
xkb_layout_index_t layout_idx;
uint32_t button_state;
int button_count[KEY_CNT];

View File

@@ -37,7 +37,6 @@
#include "clutter-event-translator.h"
#include "clutter-stage-private.h"
#include "clutter-private.h"
#include "clutter-xkb-a11y-x11.h"
enum
{
@@ -353,11 +352,9 @@ static void
clutter_device_manager_x11_constructed (GObject *gobject)
{
ClutterDeviceManagerX11 *manager_x11;
ClutterDeviceManager *manager;
ClutterBackendX11 *backend_x11;
manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (gobject);
manager = CLUTTER_DEVICE_MANAGER (gobject);
g_object_get (gobject, "backend", &backend_x11, NULL);
g_assert (backend_x11 != NULL);
@@ -392,8 +389,6 @@ clutter_device_manager_x11_constructed (GObject *gobject)
_clutter_input_device_set_associated_device (manager_x11->core_keyboard,
manager_x11->core_pointer);
clutter_device_manager_x11_a11y_init (manager);
if (G_OBJECT_CLASS (clutter_device_manager_x11_parent_class)->constructed)
G_OBJECT_CLASS (clutter_device_manager_x11_parent_class)->constructed (gobject);
}
@@ -537,7 +532,6 @@ clutter_device_manager_x11_class_init (ClutterDeviceManagerX11Class *klass)
manager_class->get_core_device = clutter_device_manager_x11_get_core_device;
manager_class->get_device = clutter_device_manager_x11_get_device;
manager_class->create_virtual_device = clutter_device_manager_x11_create_virtual_device;
manager_class->apply_kbd_a11y_settings = clutter_device_manager_x11_apply_kbd_a11y_settings;
}
static void

View File

@@ -40,7 +40,6 @@
#include "clutter-event-translator.h"
#include "clutter-stage-private.h"
#include "clutter-private.h"
#include "clutter-xkb-a11y-x11.h"
#include <X11/extensions/XInput2.h>
@@ -1988,8 +1987,6 @@ clutter_device_manager_xi2_constructed (GObject *gobject)
XSync (backend_x11->xdpy, False);
clutter_device_manager_x11_a11y_init (manager);
if (G_OBJECT_CLASS (clutter_device_manager_xi2_parent_class)->constructed)
G_OBJECT_CLASS (clutter_device_manager_xi2_parent_class)->constructed (gobject);
}
@@ -2052,7 +2049,6 @@ clutter_device_manager_xi2_class_init (ClutterDeviceManagerXI2Class *klass)
manager_class->get_device = clutter_device_manager_xi2_get_device;
manager_class->select_stage_events = clutter_device_manager_xi2_select_stage_events;
manager_class->create_virtual_device = clutter_device_manager_xi2_create_virtual_device;
manager_class->apply_kbd_a11y_settings = clutter_device_manager_x11_apply_kbd_a11y_settings;
}
static void

View File

@@ -1,328 +0,0 @@
/*
*
* Copyright © 2001 Ximian, Inc.
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "clutter-device-manager-private.h"
#include "clutter-xkb-a11y-x11.h"
#include <X11/XKBlib.h>
#include <X11/extensions/XKBstr.h>
#define DEFAULT_XKB_SET_CONTROLS_MASK XkbSlowKeysMask | \
XkbBounceKeysMask | \
XkbStickyKeysMask | \
XkbMouseKeysMask | \
XkbMouseKeysAccelMask | \
XkbAccessXKeysMask | \
XkbAccessXTimeoutMask | \
XkbAccessXFeedbackMask | \
XkbControlsEnabledMask
static int _xkb_event_base;
static XkbDescRec *
get_xkb_desc_rec (ClutterBackendX11 *backend_x11)
{
XkbDescRec *desc;
Status status = Success;
clutter_x11_trap_x_errors ();
desc = XkbGetMap (backend_x11->xdpy, XkbAllMapComponentsMask, XkbUseCoreKbd);
if (desc != NULL)
{
desc->ctrls = NULL;
status = XkbGetControls (backend_x11->xdpy, XkbAllControlsMask, desc);
}
clutter_x11_untrap_x_errors ();
g_return_val_if_fail (desc != NULL, NULL);
g_return_val_if_fail (desc->ctrls != NULL, NULL);
g_return_val_if_fail (status == Success, NULL);
return desc;
}
static void
set_xkb_desc_rec (ClutterBackendX11 *backend_x11,
XkbDescRec *desc)
{
clutter_x11_trap_x_errors ();
XkbSetControls (backend_x11->xdpy, DEFAULT_XKB_SET_CONTROLS_MASK, desc);
XSync (backend_x11->xdpy, FALSE);
clutter_x11_untrap_x_errors ();
}
static void
check_settings_changed (ClutterDeviceManager *device_manager)
{
ClutterBackendX11 *backend_x11;
ClutterKbdA11ySettings kbd_a11y_settings;
ClutterKeyboardA11yFlags what_changed = 0;
XkbDescRec *desc;
backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
desc = get_xkb_desc_rec (backend_x11);
if (!desc)
return;
clutter_device_manager_get_kbd_a11y_settings (device_manager, &kbd_a11y_settings);
if (desc->ctrls->enabled_ctrls & XkbSlowKeysMask &&
!(kbd_a11y_settings.controls & CLUTTER_A11Y_SLOW_KEYS_ENABLED))
{
what_changed |= CLUTTER_A11Y_SLOW_KEYS_ENABLED;
kbd_a11y_settings.controls |= CLUTTER_A11Y_SLOW_KEYS_ENABLED;
}
else if (!(desc->ctrls->enabled_ctrls & XkbSlowKeysMask) &&
kbd_a11y_settings.controls & CLUTTER_A11Y_SLOW_KEYS_ENABLED)
{
what_changed |= CLUTTER_A11Y_SLOW_KEYS_ENABLED;
kbd_a11y_settings.controls &= ~CLUTTER_A11Y_SLOW_KEYS_ENABLED;
}
if (desc->ctrls->enabled_ctrls & XkbStickyKeysMask &&
!(kbd_a11y_settings.controls & CLUTTER_A11Y_STICKY_KEYS_ENABLED))
{
what_changed |= CLUTTER_A11Y_STICKY_KEYS_ENABLED;
kbd_a11y_settings.controls |= CLUTTER_A11Y_STICKY_KEYS_ENABLED;
}
else if (!(desc->ctrls->enabled_ctrls & XkbStickyKeysMask) &&
kbd_a11y_settings.controls & CLUTTER_A11Y_STICKY_KEYS_ENABLED)
{
what_changed |= CLUTTER_A11Y_STICKY_KEYS_ENABLED;
kbd_a11y_settings.controls &= ~CLUTTER_A11Y_STICKY_KEYS_ENABLED;
}
if (what_changed)
g_signal_emit_by_name (device_manager,
"kbd-a11y-flags-changed",
kbd_a11y_settings.controls,
what_changed);
XkbFreeKeyboard (desc, XkbAllComponentsMask, TRUE);
}
static ClutterX11FilterReturn
xkb_a11y_event_filter (XEvent *xevent,
ClutterEvent *clutter_event,
gpointer data)
{
ClutterDeviceManager *device_manager = CLUTTER_DEVICE_MANAGER (data);
XkbEvent *xkbev = (XkbEvent *) xevent;
/* 'event_type' is set to zero on notifying us of updates in
* response to client requests (including our own) and non-zero
* to notify us of key/mouse events causing changes (like
* pressing shift 5 times to enable sticky keys).
*
* We only want to update out settings when it's in response to an
* explicit user input event, so require a non-zero event_type.
*/
if (xevent->xany.type == (_xkb_event_base + XkbEventCode) &&
xkbev->any.xkb_type == XkbControlsNotify && xkbev->ctrls.event_type != 0)
check_settings_changed (device_manager);
return CLUTTER_X11_FILTER_CONTINUE;
}
static gboolean
is_xkb_available (ClutterBackendX11 *backend_x11)
{
gint opcode, error_base, event_base, major, minor;
if (_xkb_event_base)
return TRUE;
if (!XkbQueryExtension (backend_x11->xdpy,
&opcode,
&event_base,
&error_base,
&major,
&minor))
return FALSE;
if (!XkbUseExtension (backend_x11->xdpy, &major, &minor))
return FALSE;
_xkb_event_base = event_base;
return TRUE;
}
static unsigned long
set_value_mask (gboolean flag,
unsigned long value,
unsigned long mask)
{
if (flag)
return value | mask;
return value & ~mask;
}
static gboolean
set_xkb_ctrl (XkbDescRec *desc,
ClutterKeyboardA11yFlags settings,
ClutterKeyboardA11yFlags flag,
unsigned long mask)
{
gboolean result = (settings & flag) == flag;
desc->ctrls->enabled_ctrls = set_value_mask (result, desc->ctrls->enabled_ctrls, mask);
return result;
}
void
clutter_device_manager_x11_apply_kbd_a11y_settings (ClutterDeviceManager *device_manager,
ClutterKbdA11ySettings *kbd_a11y_settings)
{
ClutterBackendX11 *backend_x11;
XkbDescRec *desc;
gboolean enable_accessX;
backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
desc = get_xkb_desc_rec (backend_x11);
if (!desc)
return;
/* general */
enable_accessX = kbd_a11y_settings->controls & CLUTTER_A11Y_KEYBOARD_ENABLED;
desc->ctrls->enabled_ctrls = set_value_mask (enable_accessX,
desc->ctrls->enabled_ctrls,
XkbAccessXKeysMask);
if (set_xkb_ctrl (desc, kbd_a11y_settings->controls, CLUTTER_A11Y_TIMEOUT_ENABLED,
XkbAccessXTimeoutMask))
{
desc->ctrls->ax_timeout = kbd_a11y_settings->timeout_delay;
/* disable only the master flag via the server we will disable
* the rest on the rebound without affecting settings state
* don't change the option flags at all.
*/
desc->ctrls->axt_ctrls_mask = XkbAccessXKeysMask | XkbAccessXFeedbackMask;
desc->ctrls->axt_ctrls_values = 0;
desc->ctrls->axt_opts_mask = 0;
}
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP,
desc->ctrls->ax_options,
XkbAccessXFeedbackMask | XkbAX_FeatureFBMask | XkbAX_SlowWarnFBMask);
/* bounce keys */
if (set_xkb_ctrl (desc, kbd_a11y_settings->controls,
CLUTTER_A11Y_BOUNCE_KEYS_ENABLED, XkbBounceKeysMask))
{
desc->ctrls->debounce_delay = kbd_a11y_settings->debounce_delay;
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_BOUNCE_KEYS_BEEP_REJECT,
desc->ctrls->ax_options,
XkbAccessXFeedbackMask | XkbAX_BKRejectFBMask);
}
/* mouse keys */
if (set_xkb_ctrl (desc, kbd_a11y_settings->controls,
CLUTTER_A11Y_MOUSE_KEYS_ENABLED, XkbMouseKeysMask | XkbMouseKeysAccelMask))
{
gint mk_max_speed;
gint mk_accel_time;
desc->ctrls->mk_interval = 100; /* msec between mousekey events */
desc->ctrls->mk_curve = 50;
/* We store pixels / sec, XKB wants pixels / event */
mk_max_speed = kbd_a11y_settings->mousekeys_max_speed;
desc->ctrls->mk_max_speed = mk_max_speed / (1000 / desc->ctrls->mk_interval);
if (desc->ctrls->mk_max_speed <= 0)
desc->ctrls->mk_max_speed = 1;
mk_accel_time = kbd_a11y_settings->mousekeys_accel_time;
desc->ctrls->mk_time_to_max = mk_accel_time / desc->ctrls->mk_interval;
if (desc->ctrls->mk_time_to_max <= 0)
desc->ctrls->mk_time_to_max = 1;
desc->ctrls->mk_delay = kbd_a11y_settings->mousekeys_init_delay;
}
/* slow keys */
if (set_xkb_ctrl (desc, kbd_a11y_settings->controls,
CLUTTER_A11Y_SLOW_KEYS_ENABLED, XkbSlowKeysMask))
{
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_SLOW_KEYS_BEEP_PRESS,
desc->ctrls->ax_options, XkbAccessXFeedbackMask | XkbAX_SKPressFBMask);
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_SLOW_KEYS_BEEP_ACCEPT,
desc->ctrls->ax_options, XkbAccessXFeedbackMask | XkbAX_SKAcceptFBMask);
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_SLOW_KEYS_BEEP_REJECT,
desc->ctrls->ax_options, XkbAccessXFeedbackMask | XkbAX_SKRejectFBMask);
desc->ctrls->slow_keys_delay = kbd_a11y_settings->slowkeys_delay;
/* anything larger than 500 seems to loose all keyboard input */
if (desc->ctrls->slow_keys_delay > 500)
desc->ctrls->slow_keys_delay = 500;
}
/* sticky keys */
if (set_xkb_ctrl (desc, kbd_a11y_settings->controls,
CLUTTER_A11Y_STICKY_KEYS_ENABLED, XkbStickyKeysMask))
{
desc->ctrls->ax_options |= XkbAX_LatchToLockMask;
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_STICKY_KEYS_TWO_KEY_OFF,
desc->ctrls->ax_options, XkbAccessXFeedbackMask | XkbAX_TwoKeysMask);
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_STICKY_KEYS_BEEP,
desc->ctrls->ax_options, XkbAccessXFeedbackMask | XkbAX_StickyKeysFBMask);
}
/* toggle keys */
desc->ctrls->ax_options =
set_value_mask (kbd_a11y_settings->controls & CLUTTER_A11Y_TOGGLE_KEYS_ENABLED,
desc->ctrls->ax_options, XkbAccessXFeedbackMask | XkbAX_IndicatorFBMask);
set_xkb_desc_rec (backend_x11, desc);
XkbFreeKeyboard (desc, XkbAllComponentsMask, TRUE);
}
gboolean
clutter_device_manager_x11_a11y_init (ClutterDeviceManager *device_manager)
{
ClutterBackendX11 *backend_x11;
guint event_mask;
backend_x11 =
CLUTTER_BACKEND_X11 (_clutter_device_manager_get_backend (device_manager));
if (!is_xkb_available (backend_x11))
return FALSE;
event_mask = XkbControlsNotifyMask | XkbAccessXNotifyMask;
XkbSelectEvents (backend_x11->xdpy, XkbUseCoreKbd, event_mask, event_mask);
clutter_x11_add_filter (xkb_a11y_event_filter, device_manager);
return TRUE;
}

View File

@@ -1,39 +0,0 @@
/*
*
* Copyright © 2001 Ximian, Inc.
* Copyright (C) 2007 William Jon McCann <mccann@jhu.edu>
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef CLUTTER_XKB_A11Y_X11_H
#define CLUTTER_XKB_A11Y_X11_H
#include "clutter-device-manager-private.h"
#include "clutter-backend-x11.h"
#include <X11/Xlib.h>
void
clutter_device_manager_x11_apply_kbd_a11y_settings (ClutterDeviceManager *device_manager,
ClutterKbdA11ySettings *kbd_a11y_settings);
gboolean
clutter_device_manager_x11_a11y_init (ClutterDeviceManager *device_manager);
#endif /* CLUTTER_XKB_A11Y_X11_H */

View File

@@ -43,7 +43,6 @@
#include <cogl/winsys/cogl-winsys-private.h>
void cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglCustomWinsysVtableGetter winsys_vtable_getter,
void *user_data);
CoglCustomWinsysVtableGetter winsys_vtable_getter);
#endif /* __COGL_MUTTER_H___ */

View File

@@ -54,7 +54,6 @@ struct _CoglRenderer
const CoglDriverVtable *driver_vtable;
const CoglTextureDriver *texture_driver;
const CoglWinsysVtable *winsys_vtable;
void *custom_winsys_user_data;
CoglCustomWinsysVtableGetter custom_winsys_vtable_getter;
CoglWinsysID winsys_id_override;
GList *constraints;

View File

@@ -566,10 +566,8 @@ _cogl_renderer_choose_driver (CoglRenderer *renderer,
void
cogl_renderer_set_custom_winsys (CoglRenderer *renderer,
CoglCustomWinsysVtableGetter winsys_vtable_getter,
void *user_data)
CoglCustomWinsysVtableGetter winsys_vtable_getter)
{
renderer->custom_winsys_user_data = user_data;
renderer->custom_winsys_vtable_getter = winsys_vtable_getter;
}

View File

@@ -168,7 +168,7 @@ cogl_xlib_renderer_set_event_retrieval_enabled (CoglRenderer *renderer,
CoglBool enable);
/**
* cogl_xlib_renderer_set_threaded_swap_wait_enabled:
* cogl_xlib_renderer_set_threaded_swap_wait_enabled: (skip)
* @renderer: a #CoglRenderer
* @enable: The new value
*

View File

@@ -1,8 +1,8 @@
AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [27])
m4_define([mutter_micro_version], [1])
m4_define([mutter_minor_version], [26])
m4_define([mutter_micro_version], [2])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])
@@ -80,7 +80,6 @@ CANBERRA_GTK_VERSION=0.26
LIBWACOM_VERSION=0.13
MUTTER_PC_MODULES="
gl
egl
gtk+-3.0 >= 3.19.8
gio-unix-2.0 >= 2.35.1
@@ -105,7 +104,6 @@ MUTTER_PC_MODULES="
xcb-randr
xcb-res
"
XWAYLAND_GRAB_DEFAULT_ACCESS_RULES="gnome-boxes,remote-viewer,virt-viewer,virt-manager,vinagre,vncviewer,Xephyr"
GLIB_GSETTINGS
@@ -307,27 +305,12 @@ AS_IF([test "$have_wayland" = "yes"], [
AC_SUBST([WAYLAND_SCANNER])
AC_DEFINE([HAVE_WAYLAND],[1],[Define if you want to enable Wayland support])
PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.10],
PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.9],
[ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
])
AM_CONDITIONAL([HAVE_WAYLAND],[test "$have_wayland" = "yes"])
AC_ARG_WITH([xwayland-grab-default-access-rules],
[AS_HELP_STRING([--with-xwayland-grab-default-access-rules="app-res1,app-res2,..."],
[comma delimited list of applications ressources or class allowed to issue X11 grabs in Xwayland"])],
[with_XWAYLAND_GRAB_DEFAULT_ACCESS_RULES="$withval"],
[with_XWAYLAND_GRAB_DEFAULT_ACCESS_RULES="$XWAYLAND_GRAB_DEFAULT_ACCESS_RULES"])
case "$with_XWAYLAND_GRAB_DEFAULT_ACCESS_RULES" in
yes) with_XWAYLAND_GRAB_DEFAULT_ACCESS_RULES="$XWAYLAND_GRAB_DEFAULT_ACCESS_RULES" ;;
no) with_XWAYLAND_GRAB_DEFAULT_ACCESS_RULES='' ;;
esac
AC_DEFINE_UNQUOTED([XWAYLAND_GRAB_DEFAULT_ACCESS_RULES],
"$with_XWAYLAND_GRAB_DEFAULT_ACCESS_RULES",
[Xwayland applications allowed to issue keyboard grabs])
AC_SUBST(XWAYLAND_GRAB_DEFAULT_ACCESS_RULES)
PKG_CHECK_EXISTS([xi >= 1.6.99.1],
AC_DEFINE([HAVE_XI23],[1],[Define if you have support for XInput 2.3 or greater]))

View File

@@ -24,7 +24,6 @@ gsettings_SCHEMAS = $(gschema_in_files:.xml.in=.xml)
%.gschema.xml: %.gschema.xml.in Makefile
$(AM_V_GEN) sed -e 's|@GETTEXT_DOMAIN[@]|$(GETTEXT_PACKAGE)|g' \
-e 's|@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES[@]|$(XWAYLAND_GRAB_DEFAULT_ACCESS_RULES)|g' \
$< > $@ || rm $@
@GSETTINGS_RULES@

View File

@@ -54,48 +54,4 @@
<summary>Re-enable shortcuts</summary>
</key>
</schema>
<schema id="org.gnome.mutter.wayland" path="/org/gnome/mutter/wayland/"
gettext-domain="@GETTEXT_DOMAIN@">
<key name="xwayland-allow-grabs" type="b">
<default>false</default>
<summary>Allow grabs with Xwayland</summary>
<description>
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”.
</description>
</key>
<key name="xwayland-grab-access-rules" type="as">
<default>[]</default>
<summary>Xwayland applications allowed to issue keyboard grabs</summary>
<description>
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”.
</description>
</key>
</schema>
</schemalist>

771
po/ar.po
View File

@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: metacity.HEAD\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=mutter&"
"keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-11-03 10:20+0200\n"
"PO-Revision-Date: 2017-11-03 10:22+0200\n"
"POT-Creation-Date: 2017-06-18 21:26+0200\n"
"PO-Revision-Date: 2017-06-18 21:27+0200\n"
"Last-Translator: Khaled Hosny <khaledhosny@eglug.org>\n"
"Language-Team: Arabic <doc@arabeyes.org>\n"
"Language: ar\n"
@@ -24,10 +24,448 @@ msgstr ""
"X-Generator: Virtaal 1.0.0-beta1\n"
"X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
msgstr "الإبحار"
#: data/50-mutter-navigation.xml:9
msgid "Move window to workspace 1"
msgstr "انقل النافذة إلى مساحة العمل 1"
#: data/50-mutter-navigation.xml:12
msgid "Move window to workspace 2"
msgstr "انقل النافذة إلى مساحة العمل 2"
#: data/50-mutter-navigation.xml:15
msgid "Move window to workspace 3"
msgstr "انقل النافذة إلى مساحة العمل 3"
#: data/50-mutter-navigation.xml:18
msgid "Move window to workspace 4"
msgstr "انقل النافذة إلى مساحة العمل 4"
#: data/50-mutter-navigation.xml:21
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
msgid "Move window one workspace down"
msgstr "انقل النافذة مساحة عمل واحدة إلى الأسفل"
#: data/50-mutter-navigation.xml:36
msgid "Move window one monitor to the left"
msgstr "انقل النافذة شاشة واحدة إلى اليسار"
#: data/50-mutter-navigation.xml:39
msgid "Move window one monitor to the right"
msgstr "انقل النافذة شاشة واحدة إلى اليمين"
#: data/50-mutter-navigation.xml:42
msgid "Move window one monitor up"
msgstr "انقل النافذة شاشة واحدة إلى الأعلى"
#: data/50-mutter-navigation.xml:45
msgid "Move window one monitor down"
msgstr "انقل النافذة شاشة واحدة إلى الأسفل"
#: data/50-mutter-navigation.xml:49
msgid "Switch applications"
msgstr "تنقل بين التطبيقات"
#: data/50-mutter-navigation.xml:54
msgid "Switch to previous application"
msgstr "انتقل إلى التطبيق السابق"
#: data/50-mutter-navigation.xml:58
msgid "Switch windows"
msgstr "تنقل بين النوافذ"
#: data/50-mutter-navigation.xml:63
msgid "Switch to previous window"
msgstr "انتقل إلى النافذة السابقة"
#: data/50-mutter-navigation.xml:67
msgid "Switch windows of an application"
msgstr "تنقل بين نوافذ التطبيق"
#: data/50-mutter-navigation.xml:72
msgid "Switch to previous window of an application"
msgstr "انتقل إلى نافذة التطبيق السابقة"
#: data/50-mutter-navigation.xml:76
msgid "Switch system controls"
msgstr "تنقل بين تحكمات النظام"
#: data/50-mutter-navigation.xml:81
msgid "Switch to previous system control"
msgstr "انتقل إلى تحكم النظام السابق"
#: data/50-mutter-navigation.xml:85
msgid "Switch windows directly"
msgstr "تنقل مباشرة بين النوافذ"
#: data/50-mutter-navigation.xml:90
msgid "Switch directly to previous window"
msgstr "انتقل مباشرة إلى النافذة السابقة"
#: data/50-mutter-navigation.xml:94
msgid "Switch windows of an app directly"
msgstr "تنقل مباشرة بين نوافذ التطبيق"
#: data/50-mutter-navigation.xml:99
msgid "Switch directly to previous window of an app"
msgstr "انتقل مباشرة إلى نافذة التطبيق السابقة"
#: data/50-mutter-navigation.xml:103
msgid "Switch system controls directly"
msgstr "تنقل مباشرة بين تحكمات النظام"
#: data/50-mutter-navigation.xml:108
msgid "Switch directly to previous system control"
msgstr "انتقل مباشرة إلى تحكم النظام السابق"
#: data/50-mutter-navigation.xml:111
msgid "Hide all normal windows"
msgstr "أخفِ كل النوافذ العادية"
#: data/50-mutter-navigation.xml:114
msgid "Switch to workspace 1"
msgstr "انتقل إلى مساحة العمل 1"
#: data/50-mutter-navigation.xml:117
msgid "Switch to workspace 2"
msgstr "انتقل إلى مساحة العمل 2"
#: data/50-mutter-navigation.xml:120
msgid "Switch to workspace 3"
msgstr "انتقل إلى مساحة العمل 3"
#: data/50-mutter-navigation.xml:123
msgid "Switch to workspace 4"
msgstr "انتقل إلى مساحة العمل 4"
#: data/50-mutter-navigation.xml:126
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
msgid "Move to workspace above"
msgstr "انقل لمساحة العمل أعلى"
#: data/50-mutter-navigation.xml:138
msgid "Move to workspace below"
msgstr "انقل لمساحة العمل أسفل"
#: data/50-mutter-system.xml:6
msgid "System"
msgstr "النظام"
#: data/50-mutter-system.xml:8
msgid "Show the run command prompt"
msgstr "أظهر محث تشغيل أمر"
#: data/50-mutter-system.xml:10
msgid "Show the activities overview"
msgstr "أظهر نظرة عامة على الأنشطة"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "النوافذ"
#: data/50-mutter-windows.xml:8
msgid "Activate the window menu"
msgstr "فعّل قائمة النافذة"
#: data/50-mutter-windows.xml:10
msgid "Toggle fullscreen mode"
msgstr "بدّل نمط ملء الشاشة"
#: data/50-mutter-windows.xml:12
msgid "Toggle maximization state"
msgstr "بدّل حالة التكبير"
#: data/50-mutter-windows.xml:14
msgid "Maximize window"
msgstr "كبّر النّافذة"
#: data/50-mutter-windows.xml:16
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
msgid "Hide window"
msgstr "أخفِ النّافذة"
#: data/50-mutter-windows.xml:24
msgid "Move window"
msgstr "انقل النّافذة"
#: data/50-mutter-windows.xml:26
msgid "Resize window"
msgstr "حجّم النّافذة"
#: data/50-mutter-windows.xml:29
msgid "Toggle window on all workspaces or one"
msgstr "بدّل حالة ظهور النافذة على جميع مساحات العمل أو واحدة منها"
#: data/50-mutter-windows.xml:31
msgid "Raise window if covered, otherwise lower it"
msgstr "ارفع النافذة إذا كانت أخرى تغطيها، أو أخفضها في ما عدا ذلك"
#: data/50-mutter-windows.xml:33
msgid "Raise window above other windows"
msgstr "ارفع النافذة فوق النوافذ الأخرى"
#: data/50-mutter-windows.xml:35
msgid "Lower window below other windows"
msgstr "اخفض النافذة تحت النوافذ الأخرى"
#: data/50-mutter-windows.xml:37
msgid "Maximize window vertically"
msgstr "كبّر النافذة رأسيا"
#: data/50-mutter-windows.xml:39
msgid "Maximize window horizontally"
msgstr "كبّر النافذة أفقيا"
#: data/50-mutter-windows.xml:43
msgid "View split on left"
msgstr "المنظور مقسوم على اليمين"
#: data/50-mutter-windows.xml:47
msgid "View split on right"
msgstr "المنظور مقسوم على اليسار"
#: data/mutter.desktop.in:4
msgid "Mutter"
msgstr "مَتَر"
#: data/org.gnome.mutter.gschema.xml.in:7
msgid "Modifier to use for extended window management operations"
msgstr "المغير الذي سيُستعمل لتمديد عمليات إدارة النوافذ "
#: data/org.gnome.mutter.gschema.xml.in:8
msgid ""
"This key will initiate the “overlay”, which is a combination window overview "
"and application launching system. The default is intended to be the “Windows "
"key” on PC hardware. Its expected that this binding either the default or "
"set to the empty string."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:20
msgid "Attach modal dialogs"
msgstr ""
#: 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 "
"the parent window."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:30
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
#: 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 "
"area. Dropping windows on the top screen edge maximizes them completely."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:40
msgid "Workspaces are managed dynamically"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:41
msgid ""
"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 ""
#: data/org.gnome.mutter.gschema.xml.in:50
msgid "Workspaces only on primary"
msgstr ""
#: 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."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:59
msgid "No tab popup"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:60
msgid ""
"Determines whether the use of popup and highlight frame should be disabled "
"for window cycling."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:68
msgid "Delay focus changes until the pointer stops moving"
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."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:79
msgid "Draggable border width"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:80
msgid ""
"The amount of total draggable borders. If the themes visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:89
msgid "Auto maximize nearly monitor sized windows"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:90
msgid ""
"If enabled, new windows that are initially the size of the monitor "
"automatically get maximized."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:98
msgid "Place new windows in the center"
msgstr ""
#: 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."
msgstr ""
#: 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: • “monitor-config-manager” — use the new "
"monitor configuration system, aimed to replace the old one. This enables a "
"higher level configuration API to be used by configuration applications, as "
"well as the ability to configure per logical monitor scale. • “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. Also enabling "
"“monitor-config-manager” is required for this feature to be enabled."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:151
msgid "Select window from tab popup"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:156
msgid "Cancel tab popup"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
#, fuzzy
msgid "Switch to VT 1"
msgstr "انتقل إلى مساحة العمل 1"
#: data/org.gnome.mutter.wayland.gschema.xml.in:10
#, fuzzy
msgid "Switch to VT 2"
msgstr "انتقل إلى مساحة العمل 2"
#: data/org.gnome.mutter.wayland.gschema.xml.in:14
#, fuzzy
msgid "Switch to VT 3"
msgstr "انتقل إلى مساحة العمل 3"
#: data/org.gnome.mutter.wayland.gschema.xml.in:18
#, fuzzy
msgid "Switch to VT 4"
msgstr "انتقل إلى مساحة العمل 4"
#: data/org.gnome.mutter.wayland.gschema.xml.in:22
#, fuzzy
msgid "Switch to VT 5"
msgstr "انتقل إلى مساحة العمل 5"
#: data/org.gnome.mutter.wayland.gschema.xml.in:26
#, fuzzy
msgid "Switch to VT 6"
msgstr "انتقل إلى مساحة العمل 6"
#: data/org.gnome.mutter.wayland.gschema.xml.in:30
#, fuzzy
msgid "Switch to VT 7"
msgstr "انتقل إلى مساحة العمل 7"
#: data/org.gnome.mutter.wayland.gschema.xml.in:34
#, fuzzy
msgid "Switch to VT 8"
msgstr "انتقل إلى مساحة العمل 8"
#: data/org.gnome.mutter.wayland.gschema.xml.in:38
#, fuzzy
msgid "Switch to VT 9"
msgstr "انتقل إلى مساحة العمل 9"
#: data/org.gnome.mutter.wayland.gschema.xml.in:42
#, fuzzy
msgid "Switch to VT 10"
msgstr "انتقل إلى مساحة العمل 10"
#: data/org.gnome.mutter.wayland.gschema.xml.in:46
#, fuzzy
msgid "Switch to VT 11"
msgstr "انتقل إلى مساحة العمل 11"
#: data/org.gnome.mutter.wayland.gschema.xml.in:50
#, fuzzy
msgid "Switch to VT 12"
msgstr "انتقل إلى مساحة العمل 12"
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: ../src/backends/meta-input-settings.c:2167
#: src/backends/meta-input-settings.c:1866
#, c-format
msgid "Mode Switch (Group %d)"
msgstr ""
@@ -35,113 +473,113 @@ msgstr ""
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: ../src/backends/meta-input-settings.c:2190
#: src/backends/meta-input-settings.c:1888
msgid "Switch monitor"
msgstr "غيّر الشاشة"
#: ../src/backends/meta-input-settings.c:2192
#: src/backends/meta-input-settings.c:1890
msgid "Show on-screen help"
msgstr "اعرض المساعدة على الشاشة"
msgstr ""
#: ../src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:879
msgid "Built-in display"
msgstr "شاشة مدمجة"
#: ../src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:902
msgid "Unknown"
msgstr "غير معروفة"
#: ../src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:904
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:912
#, 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:476
#, c-format
#: src/compositor/compositor.c:476
#, fuzzy, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
msgstr "يعمل مدير مزج آخر على الشاشة %i و العرض ”%s“."
msgstr "يعمل مدير مزج آخر على الشاشة %i والعرض \"%s\"."
#: ../src/core/bell.c:194
#: src/core/bell.c:194
msgid "Bell event"
msgstr "حدث جرس"
#: ../src/core/display.c:608
#, c-format
#: src/core/display.c:608
#, fuzzy, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "فشل فتح عرض نظام نوافذ إكس %s\n"
msgstr "فشل فتح عرض نظام نوافذ إكس '%s'\n"
#: ../src/core/main.c:189
#: src/core/main.c:189
msgid "Disable connection to session manager"
msgstr "عطّل الاتصال بمدير الجلسة"
#: ../src/core/main.c:195
#: src/core/main.c:195
msgid "Replace the running window manager"
msgstr "استبدل بمدير النوافذ الذي يعمل"
#: ../src/core/main.c:201
#: src/core/main.c:201
msgid "Specify session management ID"
msgstr "حدّد رقم هويّة إدارة الجلسة"
#: ../src/core/main.c:206
#: src/core/main.c:206
msgid "X Display to use"
msgstr "معراض س الذي سيستعمل"
#: ../src/core/main.c:212
#: src/core/main.c:212
msgid "Initialize session from savefile"
msgstr "ابدأ الجلسة من ملف محفوظ"
#: ../src/core/main.c:218
#: src/core/main.c:218
msgid "Make X calls synchronous"
msgstr "اجعل نداءات س متزامنة"
#: ../src/core/main.c:225
#: src/core/main.c:225
msgid "Run as a wayland compositor"
msgstr ""
#: ../src/core/main.c:231
#: src/core/main.c:231
msgid "Run as a nested compositor"
msgstr ""
#: ../src/core/main.c:239
#: src/core/main.c:239
msgid "Run as a full display server, rather than nested"
msgstr ""
#. Translators: %s is a window title
#: ../src/core/meta-close-dialog-default.c:147
#: src/core/meta-close-dialog-default.c:147
#, c-format
msgid "“%s” is not responding."
msgstr "”‏%s“ لا يستجيب."
#: ../src/core/meta-close-dialog-default.c:149
#: src/core/meta-close-dialog-default.c:149
msgid "Application is not responding."
msgstr "لا يستجيب التطبيق"
#: ../src/core/meta-close-dialog-default.c:154
#: 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/meta-close-dialog-default.c:161
#: src/core/meta-close-dialog-default.c:161
msgid "_Force Quit"
msgstr "أ_جبر الإنهاء"
#: ../src/core/meta-close-dialog-default.c:161
#: src/core/meta-close-dialog-default.c:161
msgid "_Wait"
msgstr "ا_نتظر"
#: ../src/core/mutter.c:39
#, c-format
#: src/core/mutter.c:39
#, fuzzy, c-format
msgid ""
"mutter %s\n"
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
@@ -154,289 +592,56 @@ msgstr ""
"هذا برنامج حر، راجع المصدر لشروط النسخ.\n"
"لا يوجد أي ضمان: و لا حتى ضمان قابلية التسويق أو المناسبة لأي هدف.\n"
#: ../src/core/mutter.c:53
#: src/core/mutter.c:53
msgid "Print version"
msgstr "اطبع الإصدارة"
#: ../src/core/mutter.c:59
#: src/core/mutter.c:59
msgid "Mutter plugin to use"
msgstr "ملحق مَتَر الذي سيُستخدم"
#: ../src/core/prefs.c:1997
#: src/core/prefs.c:1997
#, c-format
msgid "Workspace %d"
msgstr "مساحة العمل %d"
#: ../src/core/screen.c:583
#, c-format
#: src/core/screen.c:580
#, fuzzy, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
"replace the current window manager."
msgstr ""
"الشاشة ”%s“ لها مدير نوافذ بالفعل، حاول استعمال خيار التبديل --replace لتحُلّ"
" محلّ مدير النوافذ الحالي."
"الشاشة \"%s\" لها مدير نوافذ بالفعل، حاول استعمال خيار التبديل --replace "
"لتحُلّ محلّ مدير النوافذ الحالي."
#: ../src/core/screen.c:668
#, c-format
#: src/core/screen.c:665
#, fuzzy, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "الشاشة %d على العرض %s غير صحيحة\n"
msgstr "الشاشة %d على العرض '%s' غير صحيحة\n"
#: ../src/core/util.c:120
#: src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr "جُمِّع مَتَر دون دعم للنمط المطنب\n"
#: ../src/wayland/meta-wayland-tablet-pad.c:563
#: src/wayland/meta-wayland-tablet-pad.c:563
#, c-format
msgid "Mode Switch: Mode %d"
msgstr ""
#: ../src/x11/session.c:1815
#: src/x11/session.c:1815
#, fuzzy
msgid ""
"These windows do not support “save current setup” and will have to be "
"restarted manually next time you log in."
msgstr ""
"هذه النوافذ لا تدعم الضبط الحالي&quot; إعادة تشغيلها يدويا عند الولوج "
"المرة القادمة."
"هذه النوافذ لا تدعم &quot;احفظ الضبط الحالي&quot; يجب إعادة تشغيلها يدويا "
"عند الولوج المرة القادمة."
#: ../src/x11/window-props.c:559
#: src/x11/window-props.c:559
#, c-format
msgid "%s (on %s)"
msgstr "%s (على %s)"
#~ msgid "Navigation"
#~ msgstr "الإبحار"
#~ msgid "Move window to workspace 1"
#~ msgstr "انقل النافذة إلى مساحة العمل 1"
#~ msgid "Move window to workspace 2"
#~ msgstr "انقل النافذة إلى مساحة العمل 2"
#~ msgid "Move window to workspace 3"
#~ msgstr "انقل النافذة إلى مساحة العمل 3"
#~ msgid "Move window to workspace 4"
#~ msgstr "انقل النافذة إلى مساحة العمل 4"
#~ msgid "Move window to last workspace"
#~ msgstr "انقل النافذة إلى مساحة العمل الأخيرة"
#~ msgid "Move window one workspace to the left"
#~ msgstr "انقل النافذة مساحة عمل واحدة إلى اليسار"
#~ msgid "Move window one workspace to the right"
#~ msgstr "انقل النافذة مساحة عمل واحدة إلى اليمين"
#~ msgid "Move window one workspace up"
#~ msgstr "انقل النافذة مساحة عمل واحدة إلى الأعلى"
#~ msgid "Move window one workspace down"
#~ msgstr "انقل النافذة مساحة عمل واحدة إلى الأسفل"
#~ msgid "Move window one monitor to the left"
#~ msgstr "انقل النافذة شاشة واحدة إلى اليسار"
#~ msgid "Move window one monitor to the right"
#~ msgstr "انقل النافذة شاشة واحدة إلى اليمين"
#~ msgid "Move window one monitor up"
#~ msgstr "انقل النافذة شاشة واحدة إلى الأعلى"
#~ msgid "Move window one monitor down"
#~ msgstr "انقل النافذة شاشة واحدة إلى الأسفل"
#~ msgid "Switch applications"
#~ msgstr "تنقل بين التطبيقات"
#~ msgid "Switch to previous application"
#~ msgstr "انتقل إلى التطبيق السابق"
#~ msgid "Switch windows"
#~ msgstr "تنقل بين النوافذ"
#~ msgid "Switch to previous window"
#~ msgstr "انتقل إلى النافذة السابقة"
#~ msgid "Switch windows of an application"
#~ msgstr "تنقل بين نوافذ التطبيق"
#~ msgid "Switch to previous window of an application"
#~ msgstr "انتقل إلى نافذة التطبيق السابقة"
#~ msgid "Switch system controls"
#~ msgstr "تنقل بين تحكمات النظام"
#~ msgid "Switch to previous system control"
#~ msgstr "انتقل إلى تحكم النظام السابق"
#~ msgid "Switch windows directly"
#~ msgstr "تنقل مباشرة بين النوافذ"
#~ msgid "Switch directly to previous window"
#~ msgstr "انتقل مباشرة إلى النافذة السابقة"
#~ msgid "Switch windows of an app directly"
#~ msgstr "تنقل مباشرة بين نوافذ التطبيق"
#~ msgid "Switch directly to previous window of an app"
#~ msgstr "انتقل مباشرة إلى نافذة التطبيق السابقة"
#~ msgid "Switch system controls directly"
#~ msgstr "تنقل مباشرة بين تحكمات النظام"
#~ msgid "Switch directly to previous system control"
#~ msgstr "انتقل مباشرة إلى تحكم النظام السابق"
#~ msgid "Hide all normal windows"
#~ msgstr "أخفِ كل النوافذ العادية"
#~ msgid "Switch to workspace 1"
#~ msgstr "انتقل إلى مساحة العمل 1"
#~ msgid "Switch to workspace 2"
#~ msgstr "انتقل إلى مساحة العمل 2"
#~ msgid "Switch to workspace 3"
#~ msgstr "انتقل إلى مساحة العمل 3"
#~ msgid "Switch to workspace 4"
#~ msgstr "انتقل إلى مساحة العمل 4"
#~ msgid "Switch to last workspace"
#~ msgstr "انتقل إلى مساحة العمل الأخيرة"
#~ msgid "Move to workspace left"
#~ msgstr "انقل لمساحة العمل على اليسار"
#~ msgid "Move to workspace right"
#~ msgstr "انقل لمساحة العمل على اليمين"
#~ msgid "Move to workspace above"
#~ msgstr "انقل لمساحة العمل أعلى"
#~ msgid "Move to workspace below"
#~ msgstr "انقل لمساحة العمل أسفل"
#~ msgid "System"
#~ msgstr "النظام"
#~ msgid "Show the run command prompt"
#~ msgstr "أظهر محث تشغيل أمر"
#~ msgid "Show the activities overview"
#~ msgstr "أظهر نظرة عامة على الأنشطة"
#~ msgid "Windows"
#~ msgstr "النوافذ"
#~ msgid "Activate the window menu"
#~ msgstr "فعّل قائمة النافذة"
#~ msgid "Toggle fullscreen mode"
#~ msgstr "بدّل نمط ملء الشاشة"
#~ msgid "Toggle maximization state"
#~ msgstr "بدّل حالة التكبير"
#~ msgid "Maximize window"
#~ msgstr "كبّر النّافذة"
#~ msgid "Restore window"
#~ msgstr "استعد النّافذة"
#~ msgid "Toggle shaded state"
#~ msgstr "بدّل حالة الإخفاء"
#~ msgid "Close window"
#~ msgstr "أغلق النّافذة"
#~ msgid "Hide window"
#~ msgstr "أخفِ النّافذة"
#~ msgid "Move window"
#~ msgstr "انقل النّافذة"
#~ msgid "Resize window"
#~ msgstr "حجّم النّافذة"
#~ msgid "Toggle window on all workspaces or one"
#~ msgstr "بدّل حالة ظهور النافذة على جميع مساحات العمل أو واحدة منها"
#~ msgid "Raise window if covered, otherwise lower it"
#~ msgstr "ارفع النافذة إذا كانت أخرى تغطيها، أو أخفضها في ما عدا ذلك"
#~ msgid "Raise window above other windows"
#~ msgstr "ارفع النافذة فوق النوافذ الأخرى"
#~ msgid "Lower window below other windows"
#~ msgstr "اخفض النافذة تحت النوافذ الأخرى"
#~ msgid "Maximize window vertically"
#~ msgstr "كبّر النافذة رأسيا"
#~ msgid "Maximize window horizontally"
#~ msgstr "كبّر النافذة أفقيا"
#~ msgid "View split on left"
#~ msgstr "المنظور مقسوم على اليمين"
#~ msgid "View split on right"
#~ msgstr "المنظور مقسوم على اليسار"
#~ msgid "Mutter"
#~ msgstr "مَتَر"
#~ msgid "Modifier to use for extended window management operations"
#~ msgstr "المغير الذي سيُستعمل لتمديد عمليات إدارة النوافذ "
#, fuzzy
#~ msgid "Switch to VT 1"
#~ msgstr "انتقل إلى مساحة العمل 1"
#, fuzzy
#~ msgid "Switch to VT 2"
#~ msgstr "انتقل إلى مساحة العمل 2"
#, fuzzy
#~ msgid "Switch to VT 3"
#~ msgstr "انتقل إلى مساحة العمل 3"
#, fuzzy
#~ msgid "Switch to VT 4"
#~ msgstr "انتقل إلى مساحة العمل 4"
#, fuzzy
#~ msgid "Switch to VT 5"
#~ msgstr "انتقل إلى مساحة العمل 5"
#, fuzzy
#~ msgid "Switch to VT 6"
#~ msgstr "انتقل إلى مساحة العمل 6"
#, fuzzy
#~ msgid "Switch to VT 7"
#~ msgstr "انتقل إلى مساحة العمل 7"
#, fuzzy
#~ msgid "Switch to VT 8"
#~ msgstr "انتقل إلى مساحة العمل 8"
#, fuzzy
#~ msgid "Switch to VT 9"
#~ msgstr "انتقل إلى مساحة العمل 9"
#, fuzzy
#~ msgid "Switch to VT 10"
#~ msgstr "انتقل إلى مساحة العمل 10"
#, fuzzy
#~ msgid "Switch to VT 11"
#~ msgstr "انتقل إلى مساحة العمل 11"
#, fuzzy
#~ msgid "Switch to VT 12"
#~ msgstr "انتقل إلى مساحة العمل 12"
#~ msgid "Unknown window information request: %d"
#~ msgstr "طلب معلومات نافذة مجهول: %d"

View File

@@ -10,11 +10,11 @@
#
msgid ""
msgstr ""
"Project-Id-Version: mutter\n"
"Project-Id-Version: mutter gnome-3.26\n"
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-11-10 18:16+0000\n"
"PO-Revision-Date: 2017-11-15 13:31+0100\n"
"POT-Creation-Date: 2017-11-10 18:18+0000\n"
"PO-Revision-Date: 2017-11-15 13:32+0100\n"
"Last-Translator: Marek Černocký <marek@manet.cz>\n"
"Language-Team: čeština <gnome-cs-list@gnome.org>\n"
"Language: cs\n"
@@ -522,22 +522,22 @@ msgstr "Přepnout monitor"
msgid "Show on-screen help"
msgstr "Zobrazit nápovědu na obrazovce"
#: src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:908
msgid "Built-in display"
msgstr "Vestavěný displej"
#: src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:931
msgid "Unknown"
msgstr "Neznámý"
#: src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:933
msgid "Unknown Display"
msgstr "Neznámý displej"
#. 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:941
#, c-format
msgid "%s %s"
msgstr "%s %s"

View File

@@ -14,8 +14,8 @@ msgstr ""
"Project-Id-Version: mutter.master\n"
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-11-17 16:03+0000\n"
"PO-Revision-Date: 2017-12-14 13:02+0100\n"
"POT-Creation-Date: 2017-08-02 10:05+0000\n"
"PO-Revision-Date: 2017-08-03 09:59+0200\n"
"Last-Translator: Daniel Mustieles <daniel.mustieles@gmail.com>\n"
"Language-Team: es <gnome-es-list@gnome.org>\n"
"Language: es\n"
@@ -177,7 +177,7 @@ msgstr "Mover al área de trabajo de la arriba"
msgid "Move to workspace below"
msgstr "Mover al área de trabajo de abajo"
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
#: data/50-mutter-system.xml:6
msgid "System"
msgstr "Sistema"
@@ -189,10 +189,6 @@ msgstr "Mostrar el elemento «ejecutar comando»"
msgid "Show the activities overview"
msgstr "Mostrar la vista de actividades"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Restaurar los atajos de teclado"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Ventanas"
@@ -418,59 +414,49 @@ msgid "Enable experimental features"
msgstr "Activar las características experimentales"
#: 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: • “monitor-config-"
#| "manager” — use the new monitor configuration system, aimed to replace the "
#| "old one. This enables a higher level configuration API to be used by "
#| "configuration applications, as well as the ability to configure per "
#| "logical monitor scale. • “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. Also enabling “monitor-config-"
#| "manager” is required for this feature to be enabled."
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."
"proof. Currently possible keywords: • “monitor-config-manager” — use the new "
"monitor configuration system, aimed to replace the old one. This enables a "
"higher level configuration API to be used by configuration applications, as "
"well as the ability to configure per logical monitor scale. • “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. Also enabling "
"“monitor-config-manager” is required for this feature to be enabled."
msgstr ""
"Para activar las características experimentales, añada la palabra clave de "
"la característica a la lista. Depende de la característica que se deba "
"reiniciar o no el compositor. Cualquier característica experimental puede no "
"estar disponible o ser configurable. No espere que lo que se añada en este "
"escenario sirva como prueba futura. Las palabras clave actualmente "
"disponibles son: • \"scale-monitor-framebuffer\" - convierte a mutter en la "
"manera predeterminada de disponer monitores lógicos en un espacio lógico de "
"disponibles son: • \"monitor-config-manager\" - utiliza el nuevo sistema de "
"configuración del monitor, destinado a sustituir el antiguo. Esto permite "
"que las aplicaciones de configuración usen una API de configuración de nivel "
"superior, así como la capacidad de configurar el escalado de monitores "
"lógicos. • \"scale-monitor-framebuffer\" - convierte a mutter en ña manera "
"predeterminada de disponer monitores lógicos en un espacio lógico de "
"coordenadas de píxeles, al escalar framebuffers de monitores framebuffers en "
"lugar del contenido de ventana, para administrar monitores HiDPI. No "
"requiere un reinicio. • \"remote-desktop\" — activa el escritorio remoto. "
"Para soportarlo con compartición de pantalla es necesario activar \"screen-"
"cast\" • \"screen-cast\" — activa el soporte de compartición de pantalla."
"requiere un reinicio. También es necesario activar \"monitor-config-manager"
"\" para activar esta función."
#: data/org.gnome.mutter.gschema.xml.in:145
#: data/org.gnome.mutter.gschema.xml.in:151
msgid "Select window from tab popup"
msgstr "Seleccionar ventana de la pestaña emergente"
#: data/org.gnome.mutter.gschema.xml.in:150
#: data/org.gnome.mutter.gschema.xml.in:156
msgid "Cancel tab popup"
msgstr "Cancelar pestaña emergente"
#: data/org.gnome.mutter.gschema.xml.in:155
#: data/org.gnome.mutter.gschema.xml.in:161
msgid "Switch monitor configurations"
msgstr "Cambiar la configuración del monitor"
#: data/org.gnome.mutter.gschema.xml.in:160
#: data/org.gnome.mutter.gschema.xml.in:166
msgid "Rotates the built-in monitor configuration"
msgstr "Rota la configuración del monitor empotrado"
@@ -529,7 +515,7 @@ msgstr "Volver a activar los atajos"
#. 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:2118
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Cambiar modo (grupo %d)"
@@ -537,37 +523,37 @@ msgstr "Cambiar modo (grupo %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:2141
msgid "Switch monitor"
msgstr "Cambiar monitor"
#: src/backends/meta-input-settings.c:2285
#: src/backends/meta-input-settings.c:2143
msgid "Show on-screen help"
msgstr "Mostrar la ayuda en pantalla"
#: src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:927
msgid "Built-in display"
msgstr "Pantalla integrada"
#: src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:950
msgid "Unknown"
msgstr "Desconocida"
#: src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:952
msgid "Unknown Display"
msgstr "Pantalla desconocida"
#. 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:960
#, 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:479
#: src/compositor/compositor.c:476
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -675,7 +661,7 @@ msgstr "Complemento de mutter que usar"
msgid "Workspace %d"
msgstr "Área de trabajo %d"
#: src/core/screen.c:583
#: src/core/screen.c:580
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -684,7 +670,7 @@ msgstr ""
"La pantalla «%s» ya tiene un gestor de ventanas; pruebe a usar la opción «--"
"replace» para reemplazar el gestor de ventanas activo."
#: src/core/screen.c:668
#: src/core/screen.c:665
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "La ventana %d en la pantalla «%s» no es válida\n"

335
po/gd.po
View File

@@ -1,14 +1,13 @@
# Scottish Gaelic translation for mutter.
# Copyright (C) 2016 mutter's COPYRIGHT HOLDER
# This file is distributed under the same license as the mutter package.
# GunChleoc <fios@foramnagaidhlig.net>, 2016, 2017.
# GunChleoc <fios@foramnagaidhlig.net>, 2016, 2017, 2018.
msgid ""
msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=mutte"
"r&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-03-02 11:37+0000\n"
"PO-Revision-Date: 2017-03-07 11:59+0100\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2018-01-27 08:02+0000\n"
"PO-Revision-Date: 2018-03-01 10:45+0100\n"
"Last-Translator: GunChleoc <fios@foramnagaidhlig.net>\n"
"Language-Team: Fòram na Gàidhlig\n"
"Language: gd\n"
@@ -18,6 +17,7 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=(n==1 || n==11) ? 0 : (n==2 || n==12) ? 1 : "
"(n > 2 && n < 20) ? 2 : 3;\n"
"X-Generator: Virtaal 0.7.1\n"
"(n > 2 && n < 20) ? 2: 3;\n"
"X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6
@@ -166,13 +166,13 @@ msgstr "Gluais dhan rum-obrach air an taobh deas"
#: data/50-mutter-navigation.xml:135
msgid "Move to workspace above"
msgstr "Gluais dhan rum-obrach aig a' bharr"
msgstr "Gluais dhan rum-obrach aig a bharr"
#: data/50-mutter-navigation.xml:138
msgid "Move to workspace below"
msgstr "Gluais dhan rum-obrach aig a' bhonn"
msgstr "Gluais dhan rum-obrach aig a bhonn"
#: data/50-mutter-system.xml:6
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
msgid "System"
msgstr "An siostam"
@@ -184,6 +184,10 @@ msgstr ""
msgid "Show the activities overview"
msgstr "Foir-shealladh air na gnìomhachdan"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Aisig ath-ghoiridean a mheur-chlàir"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Uinneagan"
@@ -250,7 +254,7 @@ msgstr "Làn-mheudaich an uinneag gu h-ingearach"
#: data/50-mutter-windows.xml:39
msgid "Maximize window horizontally"
msgstr "Làn-mheudaich an uinneag air a' chòmhnard"
msgstr "Làn-mheudaich an uinneag air a chòmhnard"
#: data/50-mutter-windows.xml:43
msgid "View split on left"
@@ -262,284 +266,135 @@ msgstr "Sgoilt an t-sealladh air an taobh deas"
#: data/mutter.desktop.in:4
msgid "Mutter"
msgstr ""
msgstr "Mutter"
#: data/org.gnome.mutter.gschema.xml.in:7
msgid "Modifier to use for extended window management operations"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:155
#| msgid "Switch monitor"
msgid "Switch monitor configurations"
msgstr "Gearr leum eadar rèiteachaidhean monatair"
#: 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."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:20
msgid "Attach modal dialogs"
msgstr ""
#: 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 "
"the parent window."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:30
msgid "Enable edge tiling when dropping windows on screen edges"
msgstr ""
#: 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 "
"area. Dropping windows on the top screen edge maximizes them completely."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:40
msgid "Workspaces are managed dynamically"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:41
msgid ""
"Determines whether workspaces are managed dynamically or whether there's a "
"static number of workspaces (determined by the num-workspaces key in org."
"gnome.desktop.wm.preferences)."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:50
msgid "Workspaces only on primary"
msgstr ""
#: 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."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:59
msgid "No tab popup"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:60
msgid ""
"Determines whether the use of popup and highlight frame should be disabled "
"for window cycling."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:68
msgid "Delay focus changes until the pointer stops moving"
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."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:79
msgid "Draggable border width"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:80
msgid ""
"The amount of total draggable borders. If the theme's visible borders are "
"not enough, invisible borders will be added to meet this value."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:89
msgid "Auto maximize nearly monitor sized windows"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:90
msgid ""
"If enabled, new windows that are initially the size of the monitor "
"automatically get maximized."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:98
msgid "Place new windows in the center"
msgstr ""
#: 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."
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:120
msgid "Select window from tab popup"
msgstr ""
#: data/org.gnome.mutter.gschema.xml.in:125
msgid "Cancel tab popup"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
msgid "Switch to VT 1"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:10
msgid "Switch to VT 2"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:14
msgid "Switch to VT 3"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:18
msgid "Switch to VT 4"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:22
msgid "Switch to VT 5"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:26
msgid "Switch to VT 6"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:30
msgid "Switch to VT 7"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:34
msgid "Switch to VT 8"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:38
msgid "Switch to VT 9"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:42
msgid "Switch to VT 10"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:46
msgid "Switch to VT 11"
msgstr ""
#: data/org.gnome.mutter.wayland.gschema.xml.in:50
msgid "Switch to VT 12"
msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2167
#, c-format
#| msgid "Mode Switch: Mode %d"
msgid "Mode Switch (Group %d)"
msgstr "Suidse nam modh (Buidheann %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:1913
#| msgid "Switch system controls"
#: src/backends/meta-input-settings.c:2190
msgid "Switch monitor"
msgstr "Gearr leum gu monatair eile"
#: src/backends/meta-input-settings.c:1915
#: src/backends/meta-input-settings.c:2192
msgid "Show on-screen help"
msgstr "Seall a' chobhair air an sgrìn"
msgstr "Seall a chobhair air an sgrìn"
#: src/backends/meta-monitor-manager.c:515
#: src/backends/meta-monitor-manager.c:908
msgid "Built-in display"
msgstr "Uidheam-taisbeanaidh 'na broinn"
msgstr "Uidheam-taisbeanaidh na broinn"
#: src/backends/meta-monitor-manager.c:538
#: src/backends/meta-monitor-manager.c:931
msgid "Unknown"
msgstr "Chan eil fhios"
#: src/backends/meta-monitor-manager.c:540
#: src/backends/meta-monitor-manager.c:933
msgid "Unknown Display"
msgstr "Uidheam-taisbeanaidh nach aithne dhuinn"
#. 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:941
#, 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:479
#, 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 ""
#: 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 ""
#: src/core/main.c:189
msgid "Disable connection to session manager"
msgstr ""
#: src/core/main.c:195
msgid "Replace the running window manager"
msgstr ""
#: src/core/main.c:201
msgid "Specify session management ID"
msgstr ""
#: src/core/main.c:206
msgid "X Display to use"
msgstr ""
#: src/core/main.c:212
msgid "Initialize session from savefile"
msgstr ""
#: src/core/main.c:218
msgid "Make X calls synchronous"
msgstr ""
#: src/core/main.c:225
msgid "Run as a wayland compositor"
msgstr ""
#: src/core/main.c:231
msgid "Run as a nested compositor"
msgstr ""
#: src/core/main.c:239
msgid "Run as a full display server, rather than nested"
msgstr ""
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:147
#, c-format
msgid "“%s” is not responding."
msgstr ""
#: 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 "_Fuirich"
#: src/core/delete.c:141
#: src/core/meta-close-dialog-default.c:161
msgid "_Force Quit"
msgstr "Sparr _fàgail air"
#: src/core/display.c:590
#, c-format
msgid "Failed to open X Window System display '%s'\n"
msgstr ""
#: 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 ""
#: src/core/main.c:199
msgid "X Display to use"
msgstr ""
#: src/core/main.c:205
msgid "Initialize session from savefile"
msgstr ""
#: src/core/main.c:211
msgid "Make X calls synchronous"
msgstr ""
#: src/core/main.c:218
msgid "Run as a wayland compositor"
msgstr ""
#: 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 "_Fuirich"
#: 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"
@@ -558,34 +413,34 @@ msgstr ""
msgid "Workspace %d"
msgstr "Rum-obrach %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 ""
#: 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 ""
#: src/core/util.c:120
msgid "Mutter was compiled without support for verbose mode\n"
msgstr ""
#: src/wayland/meta-wayland-tablet-pad.c:595
#: src/wayland/meta-wayland-tablet-pad.c:563
#, c-format
msgid "Mode Switch: Mode %d"
msgstr "Suidse nam modh: Modh %d"
#: src/x11/session.c:1815
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 ""
#: src/x11/window-props.c:548
#: src/x11/window-props.c:559
#, c-format
msgid "%s (on %s)"
msgstr "%s (air %s)"

133
po/he.po
View File

@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: metacity.HEAD.he\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-11-26 17:12+0200\n"
"PO-Revision-Date: 2017-11-26 17:14+0200\n"
"POT-Creation-Date: 2017-03-30 18:41+0300\n"
"PO-Revision-Date: 2017-03-30 18:46+0300\n"
"Last-Translator: Yosef Or Boczko <yoseforb@gmail.com>\n"
"Language-Team: עברית <>\n"
"Language: he\n"
@@ -174,7 +174,7 @@ msgstr "העברה למרחב העבודה שמלמעלה"
msgid "Move to workspace below"
msgstr "העברה למרחב העבודה שמלמטה"
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
#: data/50-mutter-system.xml:6
msgid "System"
msgstr "מערכת"
@@ -186,10 +186,6 @@ msgstr "הצגת החלונית להרצת פקודה"
msgid "Show the activities overview"
msgstr "הצגת סקירת הפעילויות"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "שחזור צירופי מקשים"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "חלונות"
@@ -275,6 +271,7 @@ msgid "Modifier to use for extended window management operations"
msgstr "Modifier to use for extended window management operations"
#: 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 "
@@ -319,6 +316,7 @@ msgid "Workspaces are managed dynamically"
msgstr "Workspaces are managed dynamically"
#: data/org.gnome.mutter.gschema.xml.in:41
#,
msgid ""
"Determines whether workspaces are managed dynamically or whether theres a "
"static number of workspaces (determined by the num-workspaces key in org."
@@ -357,6 +355,7 @@ msgid "Delay focus changes until the pointer stops moving"
msgstr "Delay focus changes until the pointer stops moving"
#: 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 "
@@ -402,52 +401,14 @@ msgstr ""
"When true, the new windows will always be put in the center of the active "
"screen of the monitor."
#: data/org.gnome.mutter.gschema.xml.in:107
msgid "Enable experimental features"
msgstr "Enable experimental features"
#: 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 ""
"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."
#: data/org.gnome.mutter.gschema.xml.in:145
#: data/org.gnome.mutter.gschema.xml.in:120
msgid "Select window from tab popup"
msgstr "Select window from tab popup"
#: data/org.gnome.mutter.gschema.xml.in:150
#: data/org.gnome.mutter.gschema.xml.in:125
msgid "Cancel tab popup"
msgstr "Cancel tab popup"
#: 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 "Rotates the built-in monitor configuration"
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
msgid "Switch to VT 1"
msgstr "מעבר ל־VT 1"
@@ -496,14 +457,10 @@ 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 "לאפשר מחדש צירופי מקשים"
#. 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:1848
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "מצב העברה (קבוצה %d)"
@@ -511,37 +468,37 @@ msgstr "מצב העברה (קבוצה %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2283
#: src/backends/meta-input-settings.c:1870
msgid "Switch monitor"
msgstr "החלפה בין צגים"
#: src/backends/meta-input-settings.c:2285
#: src/backends/meta-input-settings.c:1872
msgid "Show on-screen help"
msgstr "הצגת עזרה על המסך"
#: src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:630
msgid "Built-in display"
msgstr "תצוגה מובנית"
#: src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:653
msgid "Unknown"
msgstr "לא ידוע"
#: src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:655
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:663
#, 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:479
#: src/compositor/compositor.c:474
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -551,6 +508,31 @@ msgstr "מנהל תצוגת חלונות אחר כבר פועל במסך %i בת
msgid "Bell event"
msgstr "אירוע פעמון"
#. Translators: %s is a window title
#: src/core/delete.c:127
#, c-format
msgid "“%s” is not responding."
msgstr "„%s“ אינו מגיב."
#: src/core/delete.c:129
msgid "Application is not responding."
msgstr "היישום אינו מגיב."
#: src/core/delete.c:134
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr ""
"באפשרותך להמתין זמן קצר ולתת ליישום להמשיך או להכריח את היישום להסתיים."
#: src/core/delete.c:141
msgid "_Force Quit"
msgstr "_אילוץ סגירה"
#: src/core/delete.c:141
msgid "_Wait"
msgstr "ה_מתנה"
#: src/core/display.c:608
#, c-format
msgid "Failed to open X Window System display “%s”\n"
@@ -592,31 +574,6 @@ msgstr "Run as a nested compositor"
msgid "Run as a full display server, rather than nested"
msgstr "Run as a full display server, rather than nested"
#. 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/meta-close-dialog-default.c:149
msgid "Application is not responding."
msgstr "היישום אינו מגיב."
#: 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/meta-close-dialog-default.c:161
msgid "_Force Quit"
msgstr "_אילוץ סגירה"
#: src/core/meta-close-dialog-default.c:161
msgid "_Wait"
msgstr "ה_מתנה"
#: src/core/mutter.c:39
#, c-format
msgid ""
@@ -644,7 +601,7 @@ msgstr "תוסף ה־mutter לשימוש"
msgid "Workspace %d"
msgstr "מרחב עבודה %d"
#: src/core/screen.c:583
#: src/core/screen.c:580
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -653,7 +610,7 @@ msgstr ""
"Display “%s” already has a window manager; try using the --replace option to "
"replace the current window manager."
#: src/core/screen.c:668
#: src/core/screen.c:665
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Screen %d on display “%s” is invalid\n"
@@ -672,8 +629,8 @@ msgid ""
"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:559
#, c-format

View File

@@ -1,19 +1,19 @@
# Hungarian translation of mutter.
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Free Software Foundation, Inc.
# Hungarian translation for mutter.
# Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Free Software Foundation, Inc.
# This file is distributed under the same license as the mutter package.
#
# Andras Timar <timar at gnome dot hu>, 2002, 2003.
# Gabor Sari <saga at externet dot hu>, 2003.
# Laszlo Dvornik <dvornik at gnome dot hu>, 2004.
# Gabor Kelemen <kelemeng at gnome dot hu>, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013.
# Balázs Úr <urbalazs at gmail dot com>, 2013, 2014, 2015, 2016, 2017.
# Balázs Úr <urbalazs at gmail dot com>, 2013, 2014, 2015, 2016, 2017, 2018.
msgid ""
msgstr ""
"Project-Id-Version: mutter master\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-09-05 17:35+0200\n"
"POT-Creation-Date: 2017-11-17 16:03+0000\n"
"PO-Revision-Date: 2018-01-27 09:00+0100\n"
"Last-Translator: Balázs Úr <urbalazs@gmail.com>\n"
"Language-Team: Hungarian <gnome-hu-list at gnome dot org>\n"
"Language: hu\n"
@@ -175,7 +175,7 @@ msgstr "Áthelyezés a felső munkaterületre"
msgid "Move to workspace below"
msgstr "Áthelyezés az alsó munkaterületre"
#: data/50-mutter-system.xml:6
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
msgid "System"
msgstr "Rendszer"
@@ -187,6 +187,10 @@ msgstr "A parancs futtatása ablak megjelenítése"
msgid "Show the activities overview"
msgstr "A tevékenységek áttekintés megjelenítése"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Gyorsbillentyűk helyreállítása"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Ablakok"
@@ -404,20 +408,6 @@ msgid "Enable experimental features"
msgstr "Kísérleti funkciók engedélyezése"
#: 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: • “monitor-config-"
#| "manager” — use the new monitor configuration system, aimed to replace the "
#| "old one. This enables a higher level configuration API to be used by "
#| "configuration applications, as well as the ability to configure per "
#| "logical monitor scale. • “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. Also enabling “monitor-config-"
#| "manager” is required for this feature to be enabled."
msgid ""
"To enable experimental features, add the feature keyword to the list. "
"Whether the feature requires restarting the compositor depends on the given "
@@ -432,12 +422,12 @@ msgid ""
"screen cast support."
msgstr ""
"A kísérleti funkciók engedélyezéséhez adja hozzá a funkció kulcsszavát a "
"listához. A funkció a betűszedő újraindítását igényelheti az adott funkciótól "
"függően. Egyik kísérleti funkciónál sem szükséges, hogy továbbra is elérhető "
"vagy beállítható legyen. Ne várja el azt, hogy ha bármit hozzáad ehhez a "
"beállításhoz, akkor az a jövőben is elérhető lesz. Jelenleg lehetséges "
"kulcsszavak: • „scale-monitor-framebuffer” — alapértelmezetté teszi a mutter "
"programot a logikai monitorok elrendezéséhez egy logikai "
"listához. A funkció a betűszedő újraindítását igényelheti az adott "
"funkciótól függően. Egyik kísérleti funkciónál sem szükséges, hogy továbbra "
"is elérhető vagy beállítható legyen. Ne várja el azt, hogy ha bármit hozzáad "
"ehhez a beállításhoz, akkor az a jövőben is elérhető lesz. Jelenleg "
"lehetséges kulcsszavak: • „scale-monitor-framebuffer” — alapértelmezetté "
"teszi a mutter programot a logikai monitorok elrendezéséhez egy logikai "
"képpontkoordináta-térben, miközben átméretezi a monitor keretpufferét az "
"ablaktartalom helyett azért, hogy kezelje a HiDPI monitorokat. Nem igényel "
"újraindítást. • „remote-desktop” — engedélyezi a távoli asztal támogatást. A "
@@ -516,7 +506,7 @@ msgstr "Gyorsbillentyűk újraengedélyezése"
#. 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:2167
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Módkapcsoló (%d. csoport)"
@@ -524,37 +514,37 @@ msgstr "Módkapcsoló (%d. csoport)"
#. 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:2190
msgid "Switch monitor"
msgstr "Monitorváltás"
#: src/backends/meta-input-settings.c:2176
#: src/backends/meta-input-settings.c:2192
msgid "Show on-screen help"
msgstr "Képernyősúgó megjelenítése"
#: src/backends/meta-monitor-manager.c:903
#: src/backends/meta-monitor-manager.c:908
msgid "Built-in display"
msgstr "Beépített kijelző"
#: src/backends/meta-monitor-manager.c:926
#: src/backends/meta-monitor-manager.c:931
msgid "Unknown"
msgstr "Ismeretlen"
#: src/backends/meta-monitor-manager.c:928
#: src/backends/meta-monitor-manager.c:933
msgid "Unknown Display"
msgstr "Ismeretlen kijelző"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: src/backends/meta-monitor-manager.c:936
#: src/backends/meta-monitor-manager.c:941
#, 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:476
#: src/compositor/compositor.c:479
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -662,7 +652,7 @@ msgstr "Használandó Mutter bővítmény"
msgid "Workspace %d"
msgstr "%d. munkaterület"
#: 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 "
@@ -671,7 +661,7 @@ msgstr ""
"A(z) „%s” kijelző már rendelkezik ablakkezelővel; próbálja a --replace "
"kapcsolóval helyettesíteni a jelenlegi ablakkezelőt."
#: src/core/screen.c:665
#: src/core/screen.c:668
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "A(z) %d. képernyő a(z) „%s” megjelenítőn érvénytelen\n"

View File

@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-11-10 18:16+0000\n"
"PO-Revision-Date: 2017-11-16 11:36+0700\n"
"POT-Creation-Date: 2017-11-17 16:03+0000\n"
"PO-Revision-Date: 2017-11-28 16:02+0700\n"
"Last-Translator: Kukuh Syafaat <syafaatkukuh@gmail.com>\n"
"Language-Team: Indonesian <gnome-l10n-id@googlegroups.com>\n"
"Language: id\n"
@@ -520,29 +520,29 @@ msgstr "Berpindah monitor"
msgid "Show on-screen help"
msgstr "Tampilkan bantuan pada layar"
#: src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:908
msgid "Built-in display"
msgstr "Tampilan bawaan"
#: src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:931
msgid "Unknown"
msgstr "Tak Dikenal"
#: src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:933
msgid "Unknown Display"
msgstr "Tampilan Tak Dikenal"
#. 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:941
#, 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:476
#: src/compositor/compositor.c:479
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."

View File

@@ -13,8 +13,8 @@ msgstr ""
"Project-Id-Version: lt\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 06:41+0000\n"
"PO-Revision-Date: 2017-08-29 15:57+0300\n"
"POT-Creation-Date: 2017-11-17 16:03+0000\n"
"PO-Revision-Date: 2017-11-25 21:45+0200\n"
"Last-Translator: Aurimas Černius <aurisc4@gmail.com>\n"
"Language-Team: Lietuvių <gnome-lt@lists.akl.lt>\n"
"Language: lt\n"
@@ -177,7 +177,7 @@ msgstr "Perkelti į darbo sritį viršuje"
msgid "Move to workspace below"
msgstr "Perkelti į darbo sritį apačioje"
#: data/50-mutter-system.xml:6
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
msgid "System"
msgstr "Sistema"
@@ -189,6 +189,10 @@ msgstr "Rodyti komandų paleidimo langelį"
msgid "Show the activities overview"
msgstr "Rodyti veiklų apžvalgą"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Atstatyti klaviatūros trumpinius"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Langai"
@@ -406,16 +410,6 @@ msgid "Enable experimental features"
msgstr "Įjungti eksperimentines savybes"
#: 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."
msgid ""
"To enable experimental features, add the feature keyword to the list. "
"Whether the feature requires restarting the compositor depends on the given "
@@ -513,7 +507,7 @@ msgstr "Iš naujo įjungti trumpinius"
#. 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:2167
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Veiksenos perjungimas (Grupė %d)"
@@ -521,37 +515,37 @@ msgstr "Veiksenos perjungimas (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:2190
msgid "Switch monitor"
msgstr "Perjungti monitorių"
#: src/backends/meta-input-settings.c:2176
#: src/backends/meta-input-settings.c:2192
msgid "Show on-screen help"
msgstr "Rodyti pagalbą ekrane"
#: src/backends/meta-monitor-manager.c:903
#: src/backends/meta-monitor-manager.c:908
msgid "Built-in display"
msgstr "Integruotas vaizduoklis"
#: src/backends/meta-monitor-manager.c:926
#: src/backends/meta-monitor-manager.c:931
msgid "Unknown"
msgstr "Nežinomas"
#: src/backends/meta-monitor-manager.c:928
#: src/backends/meta-monitor-manager.c:933
msgid "Unknown Display"
msgstr "Nežinomas vaizduoklis"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: src/backends/meta-monitor-manager.c:936
#: src/backends/meta-monitor-manager.c:941
#, 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:476
#: src/compositor/compositor.c:479
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -655,7 +649,7 @@ msgstr "Naudojamas Mutter įskiepis"
msgid "Workspace %d"
msgstr "Darbo sritis %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 "
@@ -664,7 +658,7 @@ msgstr ""
"Vaizduoklis „%s“ jau turi langų tvarkytuvę; pabandykite pakeisti esamą langų "
"tvarkytuvę, naudodami parametrą --replace."
#: src/core/screen.c:665
#: src/core/screen.c:668
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Ekranas %d vaizduoklyje „%s“ yra netinkamas\n"

128
po/nb.po
View File

@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
"Project-Id-Version: mutter 3.27.x\n"
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-11-10 18:31+0000\n"
"PO-Revision-Date: 2017-11-11 18:19+0100\n"
"Project-Id-Version: mutter 3.26.x\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-16 21:09+0000\n"
"PO-Revision-Date: 2017-11-06 13:42+0100\n"
"Last-Translator: Kjartan Maraas <kmaraas@gnome.org>\n"
"Language-Team: Norwegian bokmål <i18n-no@lister.ping.uio.no>\n"
"Language: nb\n"
@@ -167,7 +167,7 @@ msgstr "Flytt til arbeidsområdet over"
msgid "Move to workspace below"
msgstr "Flytt til arbeidsområdet under"
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
#: data/50-mutter-system.xml:6
msgid "System"
msgstr "System"
@@ -179,10 +179,6 @@ msgstr "Vis kommandolinje"
msgid "Show the activities overview"
msgstr "Vis oversikt over aktiviteter"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Gjenopprett tastatursnarveier"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Vinduer"
@@ -396,41 +392,14 @@ msgstr ""
"Når denne er «true» vil mye vinduer alltid plasseres midt på aktivt område "
"på skjermen."
#: data/org.gnome.mutter.gschema.xml.in:107
msgid "Enable experimental features"
msgstr "Slå på eksperimentelle funksjoner"
#: 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 ""
#: data/org.gnome.mutter.gschema.xml.in:145
#: data/org.gnome.mutter.gschema.xml.in:120
msgid "Select window from tab popup"
msgstr "Fjern vindu fra tabulatordialog"
#: data/org.gnome.mutter.gschema.xml.in:150
#: data/org.gnome.mutter.gschema.xml.in:125
msgid "Cancel tab popup"
msgstr "Avbryt tabulatordialog"
#: data/org.gnome.mutter.gschema.xml.in:155
msgid "Switch monitor configurations"
msgstr "Bytt skjermkonfigurasjon"
#: data/org.gnome.mutter.gschema.xml.in:160
msgid "Rotates the built-in monitor configuration"
msgstr "Roterer mellom innebyggede skjermkonfigurasjoner"
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
msgid "Switch to VT 1"
msgstr "Bytt til VT 1"
@@ -479,14 +448,10 @@ msgstr "Bytt til VT 11"
msgid "Switch to VT 12"
msgstr "Bytt til VT 12"
#: data/org.gnome.mutter.wayland.gschema.xml.in:54
msgid "Re-enable shortcuts"
msgstr "Slå på snarveier igjen"
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2167
#: src/backends/meta-input-settings.c:1800
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Modusbytte: (Gruppe %d)"
@@ -494,37 +459,37 @@ msgstr "Modusbytte: (Gruppe %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2190
#: src/backends/meta-input-settings.c:1822
msgid "Switch monitor"
msgstr "Bytt skjerm"
#: src/backends/meta-input-settings.c:2192
#: src/backends/meta-input-settings.c:1824
msgid "Show on-screen help"
msgstr "Vis hjelp på skjermen"
#: src/backends/meta-monitor-manager.c:900
#: src/backends/meta-monitor-manager.c:675
msgid "Built-in display"
msgstr "Innebygget skjerm"
#: src/backends/meta-monitor-manager.c:923
#: src/backends/meta-monitor-manager.c:698
msgid "Unknown"
msgstr "Ukjent"
#: src/backends/meta-monitor-manager.c:925
#: src/backends/meta-monitor-manager.c:700
msgid "Unknown Display"
msgstr "Ukjent skjerm"
#. 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:708
#, 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:476
#: src/compositor/compositor.c:471
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -534,6 +499,32 @@ msgstr "En annen compositing manager kjører skjerm %i på display «%s»."
msgid "Bell event"
msgstr "Klokkehendelse"
#. Translators: %s is a window title
#: src/core/delete.c:127
#, c-format
msgid "“%s” is not responding."
msgstr "«%s» svarer ikke."
#: src/core/delete.c:129
msgid "Application is not responding."
msgstr "Programmet svarer ikke."
#: src/core/delete.c:134
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
msgstr ""
"Du kan velge å vente en kort stund for å se om det fortsetter eller tvinge "
"programmet til å avslutte helt."
#: src/core/delete.c:141
msgid "_Force Quit"
msgstr "_Tvungen nedstenging"
#: src/core/delete.c:141
msgid "_Wait"
msgstr "_Vent"
#: src/core/display.c:608
#, c-format
msgid "Failed to open X Window System display “%s”\n"
@@ -575,32 +566,6 @@ msgstr "Kjør som en nøstet kompositør"
msgid "Run as a full display server, rather than nested"
msgstr "Kjør som en full skjermtjener, heller enn nøstet"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:147
#, c-format
msgid "“%s” is not responding."
msgstr "«%s» svarer ikke."
#: src/core/meta-close-dialog-default.c:149
msgid "Application is not responding."
msgstr "Programmet svarer ikke."
#: 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 ""
"Du kan velge å vente en kort stund for å se om det fortsetter eller tvinge "
"programmet til å avslutte helt."
#: src/core/meta-close-dialog-default.c:161
msgid "_Force Quit"
msgstr "_Tvungen nedstenging"
#: src/core/meta-close-dialog-default.c:161
msgid "_Wait"
msgstr "_Vent"
#: src/core/mutter.c:39
#, c-format
msgid ""
@@ -613,8 +578,7 @@ msgstr ""
"mutter %s\n"
"Opphavsrett © 2001-%d Havoc Pennington, Red Hat, Inc, og andre\n"
"Dette er fri programvare; se i kildekoden for kopibetingelser.\n"
"Det gis INGEN garanti; ikke en gang for SALGBARHET eller PASSENDE FOR ET "
"BESTEMT FORMÅL.\n"
"Det gis INGEN garanti; ikke en gang for SALGBARHET eller PASSENDE FOR ET BESTEMT FORMÅL.\n"
#: src/core/mutter.c:53
msgid "Print version"
@@ -629,7 +593,7 @@ msgstr "Mutter-tillegg som skal brukes"
msgid "Workspace %d"
msgstr "Arbeidsområde %d"
#: src/core/screen.c:583
#: src/core/screen.c:580
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -638,7 +602,7 @@ msgstr ""
"Skjerm «%s» har allerede en vindushåndterer; prøv å bruke flagget --replace "
"for å erstatte aktiv vindushåndterer."
#: src/core/screen.c:668
#: src/core/screen.c:665
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Skjerm %d på display «%s» er ugyldig\n"
@@ -656,9 +620,7 @@ msgstr "Modusbytte: Modus %d"
msgid ""
"These windows do not support “save current setup” and will have to be "
"restarted manually next time you log in."
msgstr ""
"Disse vinduene støtter ikke «lagre aktiv konfigurasjon», og vil måtte "
"startes på nytt manuelt neste gang du logger inn."
msgstr "Disse vinduene støtter ikke «lagre aktiv konfigurasjon», og vil måtte startes på nytt manuelt neste gang du logger inn."
#: src/x11/window-props.c:559
#, c-format

View File

@@ -11,8 +11,8 @@ msgstr ""
"Project-Id-Version: mutter master\n"
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2017-09-08 11:30+0200\n"
"PO-Revision-Date: 2017-09-08 11:36+0200\n"
"POT-Creation-Date: 2017-11-17 16:03+0000\n"
"PO-Revision-Date: 2017-12-31 11:04+0100\n"
"Last-Translator: Matej Urbančič <mateju@svn.gnome.org>\n"
"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
"Language: sl_SI\n"
@@ -22,7 +22,7 @@ msgstr ""
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n"
"%100==4 ? 3 : 0);\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Generator: Poedit 2.0.1\n"
"X-Generator: Poedit 2.0.4\n"
#: data/50-mutter-navigation.xml:6
msgid "Navigation"
@@ -176,7 +176,7 @@ msgstr "Premakni na zgornjo delovno površino"
msgid "Move to workspace below"
msgstr "Premakni na spodnjo delovno površino"
#: data/50-mutter-system.xml:6
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
msgid "System"
msgstr "Sistem"
@@ -188,6 +188,10 @@ msgstr "Pokaži možnost zagona ukazne vrstice"
msgid "Show the activities overview"
msgstr "Pokaži okno pregleda dejavnosti"
#: data/50-mutter-wayland.xml:8
msgid "Restore the keyboard shortcuts"
msgstr "Obnovi tipkovne bližnjice"
#: data/50-mutter-windows.xml:6
msgid "Windows"
msgstr "Okna"
@@ -499,7 +503,7 @@ msgstr "Ponovno omogoči tipkovne bližnjice"
#. 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:2167
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Preklop načina (skupina %d)"
@@ -507,37 +511,37 @@ msgstr "Preklop načina (skupina %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:2190
msgid "Switch monitor"
msgstr "Nadzornik preklopa"
#: src/backends/meta-input-settings.c:2176
#: src/backends/meta-input-settings.c:2192
msgid "Show on-screen help"
msgstr "Pokaži zaslonsko pomoč"
#: src/backends/meta-monitor-manager.c:903
#: src/backends/meta-monitor-manager.c:908
msgid "Built-in display"
msgstr "Vgrajen zaslon"
#: src/backends/meta-monitor-manager.c:926
#: src/backends/meta-monitor-manager.c:931
msgid "Unknown"
msgstr "Neznano"
#: src/backends/meta-monitor-manager.c:928
#: src/backends/meta-monitor-manager.c:933
msgid "Unknown Display"
msgstr "Neznan zaslon"
#. TRANSLATORS: this is a monitor vendor name, followed by a
#. * size in inches, like 'Dell 15"'
#.
#: src/backends/meta-monitor-manager.c:936
#: src/backends/meta-monitor-manager.c:941
#, 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:476
#: src/compositor/compositor.c:479
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
@@ -643,7 +647,7 @@ msgstr "Vstavek Mutter za uporabo"
msgid "Workspace %d"
msgstr "Delovna površina %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 "
@@ -652,7 +656,7 @@ msgstr ""
"Zaslon »%s« že ima določen upravljalnik oken; poskušajte uporabiti možnost --"
"replace za zamenjavo trenutnega upravljalnika zaslona."
#: src/core/screen.c:665
#: src/core/screen.c:668
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "Zaslon %d na prikazu »%s« ni veljaven\n"

View File

@@ -82,12 +82,6 @@ mutter_built_sources += \
linux-dmabuf-unstable-v1-server-protocol.h \
keyboard-shortcuts-inhibit-unstable-v1-protocol.c \
keyboard-shortcuts-inhibit-unstable-v1-server-protocol.h \
xdg-output-unstable-v1-protocol.c \
xdg-output-unstable-v1-server-protocol.h \
xwayland-keyboard-grab-unstable-v1-protocol.c \
xwayland-keyboard-grab-unstable-v1-server-protocol.h \
gtk-text-input-protocol.c \
gtk-text-input-server-protocol.h \
$(NULL)
endif
@@ -103,8 +97,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-backend-private.h \
backends/meta-barrier.c \
backends/meta-barrier-private.h \
backends/meta-crtc.c \
backends/meta-crtc.h \
backends/meta-cursor.c \
backends/meta-cursor.h \
backends/meta-cursor-tracker.c \
@@ -115,11 +107,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-egl.c \
backends/meta-egl.h \
backends/meta-egl-ext.h \
backends/meta-gles3.c \
backends/meta-gles3.h \
backends/meta-gles3-table.h \
backends/meta-gpu.c \
backends/meta-gpu.h \
backends/meta-display-config-shared.h \
backends/meta-idle-monitor.c \
backends/meta-idle-monitor-private.h \
@@ -144,8 +131,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/meta-monitor-manager-dummy.h \
backends/meta-orientation-manager.c \
backends/meta-orientation-manager.h \
backends/meta-output.c \
backends/meta-output.h \
backends/meta-pointer-constraint.c \
backends/meta-pointer-constraint.h \
backends/meta-settings.c \
@@ -164,12 +149,8 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/x11/meta-barrier-x11.h \
backends/x11/meta-clutter-backend-x11.c \
backends/x11/meta-clutter-backend-x11.h \
backends/x11/meta-crtc-xrandr.c \
backends/x11/meta-crtc-xrandr.h \
backends/x11/meta-cursor-renderer-x11.c \
backends/x11/meta-cursor-renderer-x11.h \
backends/x11/meta-gpu-xrandr.c \
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-renderer-x11-cm.c \
@@ -186,8 +167,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
backends/x11/meta-input-settings-x11.h \
backends/x11/meta-monitor-manager-xrandr.c \
backends/x11/meta-monitor-manager-xrandr.h \
backends/x11/meta-output-xrandr.c \
backends/x11/meta-output-xrandr.h \
backends/x11/meta-renderer-x11.c \
backends/x11/meta-renderer-x11.h \
backends/x11/meta-stage-x11-nested.c \
@@ -433,8 +412,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
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-text-input.c \
wayland/meta-wayland-text-input.h \
wayland/meta-wayland-types.h \
wayland/meta-wayland-versions.h \
wayland/meta-wayland-outputs.c \
@@ -443,8 +420,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
wayland/meta-wayland-xdg-foreign.h \
wayland/meta-window-wayland.c \
wayland/meta-window-wayland.h \
wayland/meta-window-xwayland.c \
wayland/meta-window-xwayland.h \
wayland/meta-wayland-xdg-shell.c \
wayland/meta-wayland-xdg-shell.h \
wayland/meta-wayland-wl-shell.c \
@@ -455,8 +430,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
wayland/meta-wayland-inhibit-shortcuts.h \
wayland/meta-wayland-inhibit-shortcuts-dialog.c \
wayland/meta-wayland-inhibit-shortcuts-dialog.h \
wayland/meta-xwayland-grab-keyboard.c \
wayland/meta-xwayland-grab-keyboard.h \
$(NULL)
endif
@@ -467,15 +440,11 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
backends/native/meta-backend-native-private.h \
backends/native/meta-barrier-native.c \
backends/native/meta-barrier-native.h \
backends/native/meta-crtc-kms.c \
backends/native/meta-crtc-kms.h \
backends/native/meta-clutter-backend-native.c \
backends/native/meta-clutter-backend-native.h \
backends/native/meta-cursor-renderer-native.c \
backends/native/meta-cursor-renderer-native.h \
backends/native/meta-default-modes.h \
backends/native/meta-gpu-kms.c \
backends/native/meta-gpu-kms.h \
backends/native/meta-idle-monitor-native.c \
backends/native/meta-idle-monitor-native.h \
backends/native/meta-input-settings-native.c \
@@ -484,12 +453,8 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
backends/native/meta-monitor-manager-kms.h \
backends/native/meta-launcher.c \
backends/native/meta-launcher.h \
backends/native/meta-output-kms.c \
backends/native/meta-output-kms.h \
backends/native/meta-renderer-native.c \
backends/native/meta-renderer-native.h \
backends/native/meta-renderer-native-gles3.c \
backends/native/meta-renderer-native-gles3.h \
backends/native/meta-stage-native.c \
backends/native/meta-stage-native.h \
backends/native/dbus-utils.c \
@@ -754,10 +719,3 @@ keyboard-shortcuts-inhibit-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
keyboard-shortcuts-inhibit-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@
xdg-output-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
xdg-output-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xdg-output/xdg-output-unstable-v1.xml
xwayland-keyboard-grab-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) code < $< > $@
xwayland-keyboard-grab-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header < $< > $@

View File

@@ -61,11 +61,9 @@ struct _MetaBackendClass
MetaIdleMonitor * (* create_idle_monitor) (MetaBackend *backend,
int device_id);
MetaMonitorManager * (* create_monitor_manager) (MetaBackend *backend,
GError **error);
MetaMonitorManager * (* create_monitor_manager) (MetaBackend *backend);
MetaCursorRenderer * (* create_cursor_renderer) (MetaBackend *backend);
MetaRenderer * (* create_renderer) (MetaBackend *backend,
GError **error);
MetaRenderer * (* create_renderer) (MetaBackend *backend);
MetaInputSettings * (* create_input_settings) (MetaBackend *backend);
gboolean (* grab_device) (MetaBackend *backend,

View File

@@ -357,6 +357,15 @@ on_device_removed (ClutterDeviceManager *device_manager,
}
}
static MetaMonitorManager *
create_monitor_manager (MetaBackend *backend)
{
if (g_getenv ("META_DUMMY_MONITORS"))
return g_object_new (META_TYPE_MONITOR_MANAGER_DUMMY, NULL);
return META_BACKEND_GET_CLASS (backend)->create_monitor_manager (backend);
}
static void
create_device_monitors (MetaBackend *backend,
ClutterDeviceManager *device_manager)
@@ -434,7 +443,7 @@ meta_backend_real_post_init (MetaBackend *backend)
clutter_actor_realize (priv->stage);
META_BACKEND_GET_CLASS (backend)->select_stage_events (backend);
meta_monitor_manager_setup (priv->monitor_manager);
priv->monitor_manager = create_monitor_manager (backend);
meta_backend_sync_screen_size (backend);
@@ -572,24 +581,6 @@ experimental_features_changed (MetaSettings *settings,
#endif /* HAVE_REMOTE_DESKTOP */
}
static MetaMonitorManager *
meta_backend_create_monitor_manager (MetaBackend *backend,
GError **error)
{
if (g_getenv ("META_DUMMY_MONITORS"))
return g_object_new (META_TYPE_MONITOR_MANAGER_DUMMY, NULL);
return META_BACKEND_GET_CLASS (backend)->create_monitor_manager (backend,
error);
}
static MetaRenderer *
meta_backend_create_renderer (MetaBackend *backend,
GError **error)
{
return META_BACKEND_GET_CLASS (backend)->create_renderer (backend, error);
}
static gboolean
meta_backend_initable_init (GInitable *initable,
GCancellable *cancellable,
@@ -605,20 +596,21 @@ meta_backend_initable_init (GInitable *initable,
priv->egl = g_object_new (META_TYPE_EGL, NULL);
priv->orientation_manager = g_object_new (META_TYPE_ORIENTATION_MANAGER, NULL);
priv->monitor_manager = meta_backend_create_monitor_manager (backend, error);
if (!priv->monitor_manager)
return FALSE;
priv->renderer = meta_backend_create_renderer (backend, error);
priv->renderer = META_BACKEND_GET_CLASS (backend)->create_renderer (backend);
if (!priv->renderer)
return FALSE;
{
g_set_error (error, G_IO_ERROR,
G_IO_ERROR_FAILED,
"Failed to create MetaRenderer");
return FALSE;
}
priv->cursor_tracker = g_object_new (META_TYPE_CURSOR_TRACKER, NULL);
priv->dnd = g_object_new (META_TYPE_DND, NULL);
priv->orientation_manager = g_object_new (META_TYPE_ORIENTATION_MANAGER, NULL);
return TRUE;
}

View File

@@ -1,80 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include "config.h"
#include "backends/meta-crtc.h"
G_DEFINE_TYPE (MetaCrtc, meta_crtc, G_TYPE_OBJECT)
G_DEFINE_TYPE (MetaCrtcMode, meta_crtc_mode, G_TYPE_OBJECT)
MetaGpu *
meta_crtc_get_gpu (MetaCrtc *crtc)
{
return crtc->gpu;
}
static void
meta_crtc_finalize (GObject *object)
{
MetaCrtc *crtc = META_CRTC (object);
if (crtc->driver_notify)
crtc->driver_notify (crtc);
G_OBJECT_CLASS (meta_crtc_parent_class)->finalize (object);
}
static void
meta_crtc_init (MetaCrtc *crtc)
{
}
static void
meta_crtc_class_init (MetaCrtcClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_crtc_finalize;
}
static void
meta_crtc_mode_finalize (GObject *object)
{
MetaCrtcMode *crtc_mode = META_CRTC_MODE (object);
if (crtc_mode->driver_notify)
crtc_mode->driver_notify (crtc_mode);
G_OBJECT_CLASS (meta_crtc_mode_parent_class)->finalize (object);
}
static void
meta_crtc_mode_init (MetaCrtcMode *crtc_mode)
{
}
static void
meta_crtc_mode_class_init (MetaCrtcModeClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_crtc_mode_finalize;
}

View File

@@ -1,98 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_CRTC_H
#define META_CRTC_H
#include <glib-object.h>
#include "backends/meta-gpu.h"
/* Same as KMS mode flags and X11 randr flags */
typedef enum _MetaCrtcModeFlag
{
META_CRTC_MODE_FLAG_NONE = 0,
META_CRTC_MODE_FLAG_PHSYNC = (1 << 0),
META_CRTC_MODE_FLAG_NHSYNC = (1 << 1),
META_CRTC_MODE_FLAG_PVSYNC = (1 << 2),
META_CRTC_MODE_FLAG_NVSYNC = (1 << 3),
META_CRTC_MODE_FLAG_INTERLACE = (1 << 4),
META_CRTC_MODE_FLAG_DBLSCAN = (1 << 5),
META_CRTC_MODE_FLAG_CSYNC = (1 << 6),
META_CRTC_MODE_FLAG_PCSYNC = (1 << 7),
META_CRTC_MODE_FLAG_NCSYNC = (1 << 8),
META_CRTC_MODE_FLAG_HSKEW = (1 << 9),
META_CRTC_MODE_FLAG_BCAST = (1 << 10),
META_CRTC_MODE_FLAG_PIXMUX = (1 << 11),
META_CRTC_MODE_FLAG_DBLCLK = (1 << 12),
META_CRTC_MODE_FLAG_CLKDIV2 = (1 << 13),
META_CRTC_MODE_FLAG_MASK = 0x3fff
} MetaCrtcModeFlag;
struct _MetaCrtc
{
GObject parent;
MetaGpu *gpu;
glong crtc_id;
MetaRectangle rect;
MetaCrtcMode *current_mode;
MetaMonitorTransform transform;
unsigned int all_transforms;
MetaLogicalMonitor *logical_monitor;
/* Used when changing configuration */
gboolean is_dirty;
/* Used by cursor renderer backend */
void *cursor_renderer_private;
gpointer driver_private;
GDestroyNotify driver_notify;
};
struct _MetaCrtcMode
{
GObject parent;
/* The low-level ID of this mode, used to apply back configuration */
glong mode_id;
char *name;
int width;
int height;
float refresh_rate;
MetaCrtcModeFlag flags;
gpointer driver_private;
GDestroyNotify driver_notify;
};
#define META_TYPE_CRTC (meta_crtc_get_type ())
G_DECLARE_FINAL_TYPE (MetaCrtc, meta_crtc, META, CRTC, GObject)
#define META_TYPE_CRTC_MODE (meta_crtc_mode_get_type ())
G_DECLARE_FINAL_TYPE (MetaCrtcMode, meta_crtc_mode, META, CRTC_MODE, GObject)
MetaGpu * meta_crtc_get_gpu (MetaCrtc *crtc);
#endif /* META_CRTC_H */

View File

@@ -70,7 +70,7 @@ queue_redraw (MetaCursorRenderer *renderer,
MetaBackend *backend = meta_get_backend ();
ClutterActor *stage = meta_backend_get_stage (backend);
CoglTexture *texture;
ClutterRect rect = CLUTTER_RECT_INIT_ZERO;
ClutterRect rect = { 0 };
if (cursor_sprite)
rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
@@ -173,7 +173,7 @@ meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
if (!texture)
return (ClutterRect) CLUTTER_RECT_INIT_ZERO;
return (ClutterRect) { 0 };
meta_cursor_sprite_get_hotspot (cursor_sprite, &hot_x, &hot_y);
texture_scale = meta_cursor_sprite_get_texture_scale (cursor_sprite);

View File

@@ -32,7 +32,6 @@ struct _MetaCursorTracker {
gboolean is_showing;
MetaCursorSprite *effective_cursor; /* May be NULL when hidden */
MetaCursorSprite *displayed_cursor;
/* Wayland clients can set a NULL buffer as their cursor

View File

@@ -53,75 +53,47 @@ enum {
static guint signals[LAST_SIGNAL];
static void
cursor_texture_updated (MetaCursorSprite *cursor,
MetaCursorTracker *tracker)
{
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
}
static gboolean
update_displayed_cursor (MetaCursorTracker *tracker)
static MetaCursorSprite *
get_displayed_cursor (MetaCursorTracker *tracker)
{
MetaDisplay *display = meta_get_display ();
MetaCursorSprite *cursor = NULL;
if (display && meta_display_windows_are_interactable (display) &&
tracker->has_window_cursor)
cursor = tracker->window_cursor;
else
cursor = tracker->root_cursor;
if (!tracker->is_showing)
return NULL;
if (tracker->displayed_cursor == cursor)
return FALSE;
if (tracker->displayed_cursor)
if (meta_display_windows_are_interactable (display))
{
g_signal_handlers_disconnect_by_func (tracker->displayed_cursor,
cursor_texture_updated,
tracker);
if (tracker->has_window_cursor)
return tracker->window_cursor;
}
g_set_object (&tracker->displayed_cursor, cursor);
if (cursor)
{
g_signal_connect (cursor, "texture-changed",
G_CALLBACK (cursor_texture_updated), tracker);
}
return TRUE;
}
static gboolean
update_effective_cursor (MetaCursorTracker *tracker)
{
MetaCursorSprite *cursor = NULL;
if (tracker->is_showing)
cursor = tracker->displayed_cursor;
return g_set_object (&tracker->effective_cursor, cursor);
return tracker->root_cursor;
}
static void
change_cursor_renderer (MetaCursorTracker *tracker)
update_displayed_cursor (MetaCursorTracker *tracker)
{
MetaBackend *backend = meta_get_backend ();
MetaCursorRenderer *cursor_renderer =
meta_backend_get_cursor_renderer (backend);
meta_cursor_renderer_set_cursor (cursor_renderer, tracker->effective_cursor);
meta_cursor_renderer_set_cursor (cursor_renderer, tracker->displayed_cursor);
}
static void
sync_cursor (MetaCursorTracker *tracker)
{
if (update_displayed_cursor (tracker))
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
MetaCursorSprite *displayed_cursor = get_displayed_cursor (tracker);
if (update_effective_cursor (tracker))
change_cursor_renderer (tracker);
if (tracker->displayed_cursor == displayed_cursor)
return;
g_clear_object (&tracker->displayed_cursor);
if (displayed_cursor)
tracker->displayed_cursor = g_object_ref (displayed_cursor);
update_displayed_cursor (tracker);
g_signal_emit (tracker, signals[CURSOR_CHANGED], 0);
}
static void
@@ -135,8 +107,6 @@ meta_cursor_tracker_finalize (GObject *object)
{
MetaCursorTracker *self = META_CURSOR_TRACKER (object);
if (self->effective_cursor)
g_object_unref (self->effective_cursor);
if (self->displayed_cursor)
g_object_unref (self->displayed_cursor);
if (self->root_cursor)
@@ -312,14 +282,9 @@ meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker)
}
if (cursor_sprite)
{
meta_cursor_sprite_realize_texture (cursor_sprite);
return meta_cursor_sprite_get_cogl_texture (cursor_sprite);
}
return meta_cursor_sprite_get_cogl_texture (cursor_sprite);
else
{
return NULL;
}
return NULL;
}
/**

View File

@@ -37,7 +37,6 @@
enum {
PREPARE_AT,
TEXTURE_CHANGED,
LAST_SIGNAL
};
@@ -229,8 +228,6 @@ meta_cursor_sprite_load_from_theme (MetaCursorSprite *self)
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)
{
@@ -246,6 +243,8 @@ meta_cursor_sprite_load_from_theme (MetaCursorSprite *self)
image = meta_cursor_sprite_get_current_frame_image (self);
meta_cursor_sprite_load_from_xcursor_image (self, image);
self->theme_dirty = FALSE;
}
MetaCursorSprite *
@@ -267,18 +266,11 @@ meta_cursor_sprite_set_texture (MetaCursorSprite *self,
int hot_x,
int hot_y)
{
if (self->texture == COGL_TEXTURE_2D (texture) &&
self->hot_x == hot_x &&
self->hot_y == hot_y)
return;
g_clear_pointer (&self->texture, cogl_object_unref);
if (texture)
self->texture = cogl_object_ref (texture);
self->hot_x = hot_x;
self->hot_y = hot_y;
g_signal_emit (self, signals[TEXTURE_CHANGED], 0);
}
void
@@ -373,10 +365,4 @@ meta_cursor_sprite_class_init (MetaCursorSpriteClass *klass)
G_TYPE_NONE, 2,
G_TYPE_INT,
G_TYPE_INT);
signals[TEXTURE_CHANGED] = g_signal_new ("texture-changed",
G_TYPE_FROM_CLASS (object_class),
G_SIGNAL_RUN_LAST,
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
}

View File

@@ -160,11 +160,11 @@ set_egl_error (GError **error)
error_str);
}
gboolean
meta_extensions_string_has_extensions_valist (const char *extensions_str,
char ***missing_extensions,
char *first_extension,
va_list var_args)
static gboolean
extensions_string_has_extensions_valist (const char *extensions_str,
char ***missing_extensions,
char *first_extension,
va_list var_args)
{
char **extensions;
char *extension;
@@ -222,11 +222,10 @@ meta_egl_has_extensions (MetaEgl *egl,
}
va_start (var_args, first_extension);
has_extensions =
meta_extensions_string_has_extensions_valist (extensions_str,
missing_extensions,
first_extension,
var_args);
has_extensions = extensions_string_has_extensions_valist (extensions_str,
missing_extensions,
first_extension,
var_args);
va_end (var_args);
return has_extensions;
@@ -246,25 +245,6 @@ meta_egl_initialize (MetaEgl *egl,
return TRUE;
}
gpointer
meta_egl_get_proc_address (MetaEgl *egl,
const char *procname,
GError **error)
{
gpointer func;
func = (gpointer) eglGetProcAddress (procname);
if (!func)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Could not load symbol '%s': Not found",
procname);
return NULL;
}
return func;
}
gboolean
meta_egl_choose_config (MetaEgl *egl,
EGLDisplay display,
@@ -309,27 +289,6 @@ meta_egl_choose_config (MetaEgl *egl,
return TRUE;
}
EGLSurface
meta_egl_create_window_surface (MetaEgl *egl,
EGLDisplay display,
EGLConfig config,
EGLNativeWindowType native_window_type,
const EGLint *attrib_list,
GError **error)
{
EGLSurface surface;
surface = eglCreateWindowSurface (display, config,
native_window_type, attrib_list);
if (surface == EGL_NO_SURFACE)
{
set_egl_error (error);
return EGL_NO_SURFACE;
}
return surface;
}
EGLSurface
meta_egl_create_pbuffer_surface (MetaEgl *egl,
EGLDisplay display,
@@ -349,21 +308,6 @@ meta_egl_create_pbuffer_surface (MetaEgl *egl,
return surface;
}
gboolean
meta_egl_destroy_surface (MetaEgl *egl,
EGLDisplay display,
EGLSurface surface,
GError **error)
{
if (!eglDestroySurface (display, surface))
{
set_egl_error (error);
return FALSE;
}
return TRUE;
}
static gboolean
is_egl_proc_valid_real (void *proc,
const char *proc_name,
@@ -408,55 +352,6 @@ meta_egl_get_platform_display (MetaEgl *egl,
return display;
}
gboolean
meta_egl_terminate (MetaEgl *egl,
EGLDisplay display,
GError **error)
{
if (!eglTerminate (display))
{
set_egl_error (error);
return FALSE;
}
return TRUE;
}
EGLContext
meta_egl_create_context (MetaEgl *egl,
EGLDisplay display,
EGLConfig config,
EGLContext share_context,
const EGLint *attrib_list,
GError **error)
{
EGLContext context;
context = eglCreateContext (display, config, share_context, attrib_list);
if (context == EGL_NO_CONTEXT)
{
set_egl_error (error);
return EGL_NO_CONTEXT;
}
return context;
}
gboolean
meta_egl_destroy_context (MetaEgl *egl,
EGLDisplay display,
EGLContext context,
GError **error)
{
if (!eglDestroyContext (display, context))
{
set_egl_error (error);
return FALSE;
}
return TRUE;
}
EGLImageKHR
meta_egl_create_image (MetaEgl *egl,
EGLDisplay display,
@@ -500,38 +395,6 @@ meta_egl_destroy_image (MetaEgl *egl,
return TRUE;
}
gboolean
meta_egl_make_current (MetaEgl *egl,
EGLDisplay display,
EGLSurface draw,
EGLSurface read,
EGLContext context,
GError **error)
{
if (!eglMakeCurrent (display, draw, read, context))
{
set_egl_error (error);
return FALSE;
}
return TRUE;
}
gboolean
meta_egl_swap_buffers (MetaEgl *egl,
EGLDisplay display,
EGLSurface surface,
GError **error)
{
if (!eglSwapBuffers (display, surface))
{
set_egl_error (error);
return FALSE;
}
return TRUE;
}
gboolean
meta_egl_query_wayland_buffer (MetaEgl *egl,
EGLDisplay display,
@@ -616,11 +479,10 @@ meta_egl_egl_device_has_extensions (MetaEgl *egl,
}
va_start (var_args, first_extension);
has_extensions =
meta_extensions_string_has_extensions_valist (extensions_str,
missing_extensions,
first_extension,
var_args);
has_extensions = extensions_string_has_extensions_valist (extensions_str,
missing_extensions,
first_extension,
var_args);
va_end (var_args);
return has_extensions;

View File

@@ -36,12 +36,6 @@ G_DECLARE_FINAL_TYPE (MetaEgl, meta_egl, META, EGL, GObject)
GQuark meta_egl_error_quark (void);
gboolean
meta_extensions_string_has_extensions_valist (const char *extensions_str,
char ***missing_extensions,
char *first_extension,
va_list var_args);
gboolean meta_egl_has_extensions (MetaEgl *egl,
EGLDisplay display,
char ***missing_extensions,
@@ -52,28 +46,12 @@ gboolean meta_egl_initialize (MetaEgl *egl,
EGLDisplay display,
GError **error);
gpointer meta_egl_get_proc_address (MetaEgl *egl,
const char *procname,
GError **error);
gboolean meta_egl_choose_config (MetaEgl *egl,
EGLDisplay display,
const EGLint *attrib_list,
EGLConfig *chosen_config,
GError **error);
EGLContext meta_egl_create_context (MetaEgl *egl,
EGLDisplay display,
EGLConfig config,
EGLContext share_context,
const EGLint *attrib_list,
GError **error);
gboolean meta_egl_destroy_context (MetaEgl *egl,
EGLDisplay display,
EGLContext context,
GError **error);
EGLImageKHR meta_egl_create_image (MetaEgl *egl,
EGLDisplay display,
EGLContext context,
@@ -87,46 +65,18 @@ gboolean meta_egl_destroy_image (MetaEgl *egl,
EGLImageKHR image,
GError **error);
EGLSurface meta_egl_create_window_surface (MetaEgl *egl,
EGLDisplay display,
EGLConfig config,
EGLNativeWindowType native_window_type,
const EGLint *attrib_list,
GError **error);
EGLSurface meta_egl_create_pbuffer_surface (MetaEgl *egl,
EGLDisplay display,
EGLConfig config,
const EGLint *attrib_list,
GError **error);
gboolean meta_egl_destroy_surface (MetaEgl *egl,
EGLDisplay display,
EGLSurface surface,
GError **error);
EGLDisplay meta_egl_get_platform_display (MetaEgl *egl,
EGLenum platform,
void *native_display,
const EGLint *attrib_list,
GError **error);
gboolean meta_egl_terminate (MetaEgl *egl,
EGLDisplay display,
GError **error);
gboolean meta_egl_make_current (MetaEgl *egl,
EGLDisplay display,
EGLSurface draw,
EGLSurface read,
EGLContext context,
GError **error);
gboolean meta_egl_swap_buffers (MetaEgl *egl,
EGLDisplay display,
EGLSurface surface,
GError **error);
gboolean meta_egl_query_wayland_buffer (MetaEgl *egl,
EGLDisplay display,
struct wl_resource *buffer,

View File

@@ -1,36 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_GLES3_TABLE_H
#define META_GLES3_TABLE_H
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <GLES3/gl3.h>
typedef struct _MetaGles3Table
{
void (* glEGLImageTargetTexture2DOES) (GLenum target,
GLeglImageOES image);
} MetaGles3Table;
#endif /* META_GLES3_TABLE */

View File

@@ -1,163 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include <stdio.h>
#include "config.h"
#include "backends/meta-gles3.h"
#include <dlfcn.h>
#include <gio/gio.h>
#include "backends/meta-gles3-table.h"
struct _MetaGles3
{
GObject parent;
MetaEgl *egl;
MetaGles3Table table;
};
G_DEFINE_TYPE (MetaGles3, meta_gles3, G_TYPE_OBJECT)
MetaGles3Table *
meta_gles3_get_table (MetaGles3 *gles3)
{
return &gles3->table;
}
void
meta_gles3_ensure_loaded (MetaGles3 *gles3,
gpointer *func,
const char *name)
{
GError *error = NULL;
if (*func)
return;
*func = meta_egl_get_proc_address (gles3->egl, name, &error);
if (!*func)
g_error ("Failed to load GLES3 symbol: %s", error->message);
}
static const char *
get_gl_error_str (GLenum gl_error)
{
switch (gl_error)
{
case GL_NO_ERROR:
return "No error has been recorded.";
case GL_INVALID_ENUM:
return "An unacceptable value is specified for an enumerated argument.";
case GL_INVALID_VALUE:
return "A numeric argument is out of range.";
case GL_INVALID_OPERATION:
return "The specified operation is not allowed in the current state.";
case GL_INVALID_FRAMEBUFFER_OPERATION:
return "The framebuffer object is not complete.";
case GL_OUT_OF_MEMORY:
return "There is not enough memory left to execute the command.";
default:
return "Unknown error";
}
}
void
meta_gles3_clear_error (MetaGles3 *gles3)
{
while (TRUE)
{
GLenum gl_error = glGetError ();
if (gl_error == GL_NO_ERROR)
break;
}
}
gboolean
meta_gles3_validate (MetaGles3 *gles3,
GError **error)
{
GLenum gl_error;
gl_error = glGetError ();
if (gl_error != GL_NO_ERROR)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
get_gl_error_str (gl_error));
return FALSE;
}
return TRUE;
}
gboolean
meta_gles3_has_extensions (MetaGles3 *gles3,
char ***missing_extensions,
char *first_extension,
...)
{
va_list var_args;
const char *extensions_str;
gboolean has_extensions;
extensions_str = (const char *) glGetString (GL_EXTENSIONS);
if (!extensions_str)
{
g_warning ("Failed to get string: %s", get_gl_error_str (glGetError ()));
return FALSE;
}
va_start (var_args, first_extension);
has_extensions =
meta_extensions_string_has_extensions_valist (extensions_str,
missing_extensions,
first_extension,
var_args);
va_end (var_args);
return has_extensions;
}
MetaGles3 *
meta_gles3_new (MetaEgl *egl)
{
MetaGles3 *gles3;
gles3 = g_object_new (META_TYPE_GLES3, NULL);
gles3->egl = egl;
return gles3;
}
static void
meta_gles3_init (MetaGles3 *gles3)
{
}
static void
meta_gles3_class_init (MetaGles3Class *klass)
{
}

View File

@@ -1,83 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_GLES3_H
#define META_GLES3_H
#include <glib-object.h>
#include "backends/meta-egl.h"
typedef struct _MetaGles3Table MetaGles3Table;
#define META_TYPE_GLES3 (meta_gles3_get_type ())
G_DECLARE_FINAL_TYPE (MetaGles3, meta_gles3, META, GLES3, GObject)
MetaGles3Table * meta_gles3_get_table (MetaGles3 *gles3);
void meta_gles3_clear_error (MetaGles3 *gles3);
gboolean meta_gles3_validate (MetaGles3 *gles3,
GError **error);
void meta_gles3_ensure_loaded (MetaGles3 *gles,
gpointer *func,
const char *name);
gboolean meta_gles3_has_extensions (MetaGles3 *gles3,
char ***missing_extensions,
char *first_extension,
...);
MetaGles3 * meta_gles3_new (MetaEgl *egl);
#define GLBAS(gles3, func, args) \
{ \
GError *_error = NULL; \
\
func args; \
\
if (!meta_gles3_validate (gles3, &_error)) \
{ \
g_warning ("%s %s failed: %s", #func, #args, _error->message); \
g_error_free (_error); \
} \
}
#define GLEXT(gles3, func, args) \
{ \
GError *_error = NULL; \
MetaGles3Table *table; \
\
table = meta_gles3_get_table (gles3); \
meta_gles3_ensure_loaded (gles3, (gpointer *) &table->func, #func); \
\
table->func args; \
\
if (!meta_gles3_validate (gles3, &_error)) \
{ \
g_warning ("%s %s failed: %s", #func, #args, _error->message); \
g_error_free (_error); \
} \
}
#endif /* META_GLES3_H */

View File

@@ -1,224 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include "config.h"
#include "backends/meta-gpu.h"
#include "backends/meta-output.h"
enum
{
PROP_0,
PROP_MONITOR_MANAGER,
PROP_LAST
};
static GParamSpec *obj_props[PROP_LAST];
typedef struct _MetaGpuPrivate
{
MetaMonitorManager *monitor_manager;
GList *outputs;
GList *crtcs;
GList *modes;
} MetaGpuPrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaGpu, meta_gpu, G_TYPE_OBJECT)
gboolean
meta_gpu_has_hotplug_mode_update (MetaGpu *gpu)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
GList *l;
for (l = priv->outputs; l; l = l->next)
{
MetaOutput *output = l->data;
if (output->hotplug_mode_update)
return TRUE;
}
return FALSE;
}
gboolean
meta_gpu_read_current (MetaGpu *gpu,
GError **error)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
gboolean ret;
GList *old_outputs;
GList *old_crtcs;
GList *old_modes;
/* TODO: Get rid of this when objects incref:s what they need instead */
old_outputs = priv->outputs;
old_crtcs = priv->crtcs;
old_modes = priv->modes;
ret = META_GPU_GET_CLASS (gpu)->read_current (gpu, error);
g_list_free_full (old_outputs, g_object_unref);
g_list_free_full (old_modes, g_object_unref);
g_list_free_full (old_crtcs, g_object_unref);
return ret;
}
MetaMonitorManager *
meta_gpu_get_monitor_manager (MetaGpu *gpu)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
return priv->monitor_manager;
}
GList *
meta_gpu_get_outputs (MetaGpu *gpu)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
return priv->outputs;
}
GList *
meta_gpu_get_crtcs (MetaGpu *gpu)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
return priv->crtcs;
}
GList *
meta_gpu_get_modes (MetaGpu *gpu)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
return priv->modes;
}
void
meta_gpu_take_outputs (MetaGpu *gpu,
GList *outputs)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
priv->outputs = outputs;
}
void
meta_gpu_take_crtcs (MetaGpu *gpu,
GList *crtcs)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
priv->crtcs = crtcs;
}
void
meta_gpu_take_modes (MetaGpu *gpu,
GList *modes)
{
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
priv->modes = modes;
}
static void
meta_gpu_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaGpu *gpu = META_GPU (object);
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
switch (prop_id)
{
case PROP_MONITOR_MANAGER:
priv->monitor_manager = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
meta_gpu_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaGpu *gpu = META_GPU (object);
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
switch (prop_id)
{
case PROP_MONITOR_MANAGER:
g_value_set_object (value, priv->monitor_manager);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
meta_gpu_finalize (GObject *object)
{
MetaGpu *gpu = META_GPU (object);
MetaGpuPrivate *priv = meta_gpu_get_instance_private (gpu);
g_list_free_full (priv->outputs, g_object_unref);
g_list_free_full (priv->modes, g_object_unref);
g_list_free_full (priv->crtcs, g_object_unref);
G_OBJECT_CLASS (meta_gpu_parent_class)->finalize (object);
}
static void
meta_gpu_init (MetaGpu *gpu)
{
}
static void
meta_gpu_class_init (MetaGpuClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->set_property = meta_gpu_set_property;
object_class->get_property = meta_gpu_get_property;
object_class->finalize = meta_gpu_finalize;
obj_props[PROP_MONITOR_MANAGER] =
g_param_spec_object ("monitor-manager",
"monitor-manager",
"MetaMonitorManager",
META_TYPE_MONITOR_MANAGER,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
}

View File

@@ -1,66 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_GPU_H
#define META_GPU_H
#include <glib-object.h>
#include "backends/meta-monitor-manager-private.h"
#define META_TYPE_GPU (meta_gpu_get_type ())
G_DECLARE_DERIVABLE_TYPE (MetaGpu, meta_gpu, META, GPU, GObject)
struct _MetaGpuClass
{
GObjectClass parent_class;
gboolean (* read_current) (MetaGpu *gpu,
GError **error);
};
int meta_gpu_get_kms_fd (MetaGpu *gpu);
const char * meta_gpu_get_kms_file_path (MetaGpu *gpu);
gboolean meta_gpu_read_current (MetaGpu *gpu,
GError **error);
gboolean meta_gpu_has_hotplug_mode_update (MetaGpu *gpu);
MetaMonitorManager * meta_gpu_get_monitor_manager (MetaGpu *gpu);
GList * meta_gpu_get_outputs (MetaGpu *gpu);
GList * meta_gpu_get_crtcs (MetaGpu *gpu);
GList * meta_gpu_get_modes (MetaGpu *gpu);
void meta_gpu_take_outputs (MetaGpu *gpu,
GList *outputs);
void meta_gpu_take_crtcs (MetaGpu *gpu,
GList *crtcs);
void meta_gpu_take_modes (MetaGpu *gpu,
GList *modes);
#endif /* META_GPU_H */

View File

@@ -65,7 +65,6 @@ struct _MetaInputSettingsPrivate
GSettings *trackball_settings;
GSettings *keyboard_settings;
GSettings *gsd_settings;
GSettings *a11y_settings;
GHashTable *mappable_devices;
@@ -144,7 +143,6 @@ meta_input_settings_dispose (GObject *object)
g_clear_object (&priv->trackball_settings);
g_clear_object (&priv->keyboard_settings);
g_clear_object (&priv->gsd_settings);
g_clear_object (&priv->a11y_settings);
g_clear_pointer (&priv->mappable_devices, g_hash_table_unref);
if (priv->monitors_changed_id && priv->monitor_manager)
@@ -1144,90 +1142,6 @@ apply_mappable_device_settings (MetaInputSettings *input_settings,
}
}
struct _a11y_settings_flags_pair {
const char *name;
ClutterKeyboardA11yFlags flag;
} settings_flags_pair[] = {
{ "enable", CLUTTER_A11Y_KEYBOARD_ENABLED },
{ "timeout-enable", CLUTTER_A11Y_TIMEOUT_ENABLED },
{ "mousekeys-enable", CLUTTER_A11Y_MOUSE_KEYS_ENABLED },
{ "slowkeys-enable", CLUTTER_A11Y_SLOW_KEYS_ENABLED },
{ "slowkeys-beep-press", CLUTTER_A11Y_SLOW_KEYS_BEEP_PRESS },
{ "slowkeys-beep-accept", CLUTTER_A11Y_SLOW_KEYS_BEEP_ACCEPT },
{ "slowkeys-beep-reject", CLUTTER_A11Y_SLOW_KEYS_BEEP_REJECT },
{ "bouncekeys-enable", CLUTTER_A11Y_BOUNCE_KEYS_ENABLED },
{ "bouncekeys-beep-reject", CLUTTER_A11Y_BOUNCE_KEYS_BEEP_REJECT },
{ "togglekeys-enable", CLUTTER_A11Y_TOGGLE_KEYS_ENABLED },
{ "stickykeys-enable", CLUTTER_A11Y_STICKY_KEYS_ENABLED },
{ "stickykeys-modifier-beep", CLUTTER_A11Y_STICKY_KEYS_BEEP },
{ "stickykeys-two-key-off", CLUTTER_A11Y_STICKY_KEYS_TWO_KEY_OFF },
{ "feature-state-change-beep", CLUTTER_A11Y_FEATURE_STATE_CHANGE_BEEP },
};
static void
load_keyboard_a11y_settings (MetaInputSettings *input_settings,
ClutterInputDevice *device)
{
MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
ClutterKbdA11ySettings kbd_a11y_settings;
ClutterInputDevice *core_keyboard;
guint i;
core_keyboard = clutter_device_manager_get_core_device (priv->device_manager, CLUTTER_KEYBOARD_DEVICE);
if (device && device != core_keyboard)
return;
kbd_a11y_settings.controls = 0;
for (i = 0; i < G_N_ELEMENTS (settings_flags_pair); i++)
{
if (g_settings_get_boolean (priv->a11y_settings, settings_flags_pair[i].name))
kbd_a11y_settings.controls |= settings_flags_pair[i].flag;
}
kbd_a11y_settings.timeout_delay = g_settings_get_int (priv->a11y_settings,
"disable-timeout");
kbd_a11y_settings.slowkeys_delay = g_settings_get_int (priv->a11y_settings,
"slowkeys-delay");
kbd_a11y_settings.debounce_delay = g_settings_get_int (priv->a11y_settings,
"bouncekeys-delay");
kbd_a11y_settings.mousekeys_init_delay = g_settings_get_int (priv->a11y_settings,
"mousekeys-init-delay");
kbd_a11y_settings.mousekeys_max_speed = g_settings_get_int (priv->a11y_settings,
"mousekeys-max-speed");
kbd_a11y_settings.mousekeys_accel_time = g_settings_get_int (priv->a11y_settings,
"mousekeys-accel-time");
clutter_device_manager_set_kbd_a11y_settings (priv->device_manager, &kbd_a11y_settings);
}
static void
on_keyboard_a11y_settings_changed (ClutterDeviceManager *device_manager,
ClutterKeyboardA11yFlags new_flags,
ClutterKeyboardA11yFlags what_changed,
MetaInputSettings *input_settings)
{
MetaInputSettingsPrivate *priv = meta_input_settings_get_instance_private (input_settings);
guint i;
for (i = 0; i < G_N_ELEMENTS (settings_flags_pair); i++)
{
if (settings_flags_pair[i].flag & what_changed)
g_settings_set_boolean (priv->a11y_settings,
settings_flags_pair[i].name,
(new_flags & settings_flags_pair[i].flag) ? TRUE : FALSE);
}
}
static void
meta_input_a11y_settings_changed (GSettings *settings,
const char *key,
gpointer user_data)
{
MetaInputSettings *input_settings = META_INPUT_SETTINGS (user_data);
load_keyboard_a11y_settings (input_settings, NULL);
}
static GSettings *
lookup_device_settings (ClutterInputDevice *device)
{
@@ -1483,7 +1397,6 @@ apply_device_settings (MetaInputSettings *input_settings,
update_pointer_accel_profile (input_settings,
priv->trackball_settings,
device);
load_keyboard_a11y_settings (input_settings, device);
}
static void
@@ -1700,12 +1613,6 @@ meta_input_settings_init (MetaInputSettings *settings)
clutter_settings_get_default(), "double-click-time",
G_SETTINGS_BIND_GET);
priv->a11y_settings = g_settings_new ("org.gnome.desktop.a11y.keyboard");
g_signal_connect (priv->a11y_settings, "changed",
G_CALLBACK (meta_input_a11y_settings_changed), settings);
g_signal_connect (priv->device_manager, "kbd-a11y-flags-changed",
G_CALLBACK (on_keyboard_a11y_settings_changed), settings);
priv->mappable_devices =
g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) device_mapping_info_free);

View File

@@ -21,11 +21,8 @@
#include "config.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-crtc.h"
#include "backends/meta-output.h"
#include "backends/meta-logical-monitor.h"
G_DEFINE_TYPE (MetaLogicalMonitor, meta_logical_monitor, G_TYPE_OBJECT)
@@ -202,51 +199,6 @@ meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor)
return logical_monitor->monitors;
}
typedef struct _ForeachCrtcData
{
MetaLogicalMonitor *logical_monitor;
MetaLogicalMonitorCrtcFunc func;
gpointer user_data;
} ForeachCrtcData;
static gboolean
foreach_crtc (MetaMonitor *monitor,
MetaMonitorMode *mode,
MetaMonitorCrtcMode *monitor_crtc_mode,
gpointer user_data,
GError **error)
{
ForeachCrtcData *data = user_data;
data->func (data->logical_monitor,
monitor_crtc_mode->output->crtc,
data->user_data);
return TRUE;
}
void
meta_logical_monitor_foreach_crtc (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitorCrtcFunc func,
gpointer user_data)
{
GList *l;
for (l = logical_monitor->monitors; l; l = l->next)
{
MetaMonitor *monitor = l->data;
MetaMonitorMode *mode;
ForeachCrtcData data = {
.logical_monitor = logical_monitor,
.func = func,
.user_data = user_data
};
mode = meta_monitor_get_current_mode (monitor);
meta_monitor_mode_foreach_crtc (monitor, mode, foreach_crtc, &data, NULL);
}
}
static void
meta_logical_monitor_init (MetaLogicalMonitor *logical_monitor)
{

View File

@@ -61,10 +61,6 @@ G_DECLARE_FINAL_TYPE (MetaLogicalMonitor, meta_logical_monitor,
META, LOGICAL_MONITOR,
GObject)
typedef void (* MetaLogicalMonitorCrtcFunc) (MetaLogicalMonitor *logical_monitor,
MetaCrtc *crtc,
gpointer user_data);
MetaLogicalMonitor * meta_logical_monitor_new (MetaMonitorManager *monitor_manager,
MetaLogicalMonitorConfig *logical_monitor_config,
int monitor_number);
@@ -94,8 +90,4 @@ gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor
MetaLogicalMonitor *neighbor,
MetaScreenDirection neighbor_dir);
void meta_logical_monitor_foreach_crtc (MetaLogicalMonitor *logical_monitor,
MetaLogicalMonitorCrtcFunc func,
gpointer user_data);
#endif /* META_LOGICAL_MONITOR_H */

View File

@@ -26,7 +26,6 @@
#include "backends/meta-monitor-config-migration.h"
#include "backends/meta-monitor-config-store.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-output.h"
#include "core/boxes-private.h"
#define CONFIG_HISTORY_MAX_SIZE 3

View File

@@ -31,10 +31,8 @@
#include <meta/util.h>
#include "backends/meta-backend-private.h"
#include "backends/meta-crtc.h"
#include "backends/meta-monitor.h"
#include "backends/meta-monitor-config-manager.h"
#include "backends/meta-output.h"
#define ALL_TRANSFORMS ((1 << (META_MONITOR_TRANSFORM_FLIPPED_270 + 1)) - 1)
@@ -47,8 +45,6 @@ struct _MetaMonitorManagerDummy
{
MetaMonitorManager parent_instance;
MetaGpu *gpu;
gboolean is_transform_handled;
};
@@ -64,49 +60,19 @@ typedef struct _MetaOutputDummy
G_DEFINE_TYPE (MetaMonitorManagerDummy, meta_monitor_manager_dummy, META_TYPE_MONITOR_MANAGER);
struct _MetaGpuDummy
{
MetaGpu parent;
};
G_DEFINE_TYPE (MetaGpuDummy, meta_gpu_dummy, META_TYPE_GPU)
static void
meta_output_dummy_notify_destroy (MetaOutput *output);
typedef struct _CrtcModeSpec
{
int width;
int height;
float refresh_rate;
} CrtcModeSpec;
static MetaCrtcMode *
create_mode (CrtcModeSpec *spec,
long mode_id)
{
MetaCrtcMode *mode;
mode = g_object_new (META_TYPE_CRTC_MODE, NULL);
mode->mode_id = mode_id;
mode->width = spec->width;
mode->height = spec->height;
mode->refresh_rate = spec->refresh_rate;
return mode;
}
#define array_last(a, t) \
g_array_index (a, t, a->len - 1)
static void
append_monitor (MetaMonitorManager *manager,
GList **modes,
GList **crtcs,
GList **outputs,
float scale)
append_monitor (GArray *modes,
GArray *crtcs,
GArray *outputs,
float scale)
{
MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (manager);
MetaGpu *gpu = manager_dummy->gpu;
CrtcModeSpec mode_specs[] = {
MetaCrtcMode modes_decl[] = {
{
.width = 800,
.height = 600,
@@ -118,84 +84,65 @@ append_monitor (MetaMonitorManager *manager,
.refresh_rate = 60.0
}
};
GList *new_modes = NULL;
MetaCrtc *crtc;
MetaCrtc crtc;
MetaOutputDummy *output_dummy;
MetaOutput *output;
MetaOutput output;
unsigned int i;
unsigned int number;
GList *l;
for (i = 0; i < G_N_ELEMENTS (mode_specs); i++)
{
long mode_id;
MetaCrtcMode *mode;
for (i = 0; i < G_N_ELEMENTS (modes_decl); i++)
modes_decl[i].mode_id = modes->len + i;
g_array_append_vals (modes, modes_decl, G_N_ELEMENTS (modes_decl));
mode_id = g_list_length (*modes) + i + 1;
mode = create_mode (&mode_specs[i], mode_id);
new_modes = g_list_append (new_modes, mode);
}
*modes = g_list_concat (*modes, new_modes);
crtc = g_object_new (META_TYPE_CRTC, NULL);
crtc->crtc_id = g_list_length (*crtcs) + 1;
crtc->all_transforms = ALL_TRANSFORMS;
*crtcs = g_list_append (*crtcs, crtc);
output = g_object_new (META_TYPE_OUTPUT, NULL);
crtc = (MetaCrtc) {
.crtc_id = crtcs->len + 1,
.all_transforms = ALL_TRANSFORMS,
};
g_array_append_val (crtcs, crtc);
output_dummy = g_new0 (MetaOutputDummy, 1);
*output_dummy = (MetaOutputDummy) {
.scale = scale
};
number = g_list_length (*outputs) + 1;
output = (MetaOutput) {
.winsys_id = outputs->len + 1,
.name = g_strdup_printf ("LVDS%d", outputs->len + 1),
.vendor = g_strdup ("MetaProducts Inc."),
.product = g_strdup ("MetaMonitor"),
.serial = g_strdup_printf ("0xC0FFEE-%d", outputs->len + 1),
.suggested_x = -1,
.suggested_y = -1,
.width_mm = 222,
.height_mm = 125,
.subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN,
.preferred_mode = &array_last (modes, MetaCrtcMode),
.n_possible_clones = 0,
.backlight = -1,
.connector_type = META_CONNECTOR_TYPE_LVDS,
.driver_private = output_dummy,
.driver_notify =
(GDestroyNotify) meta_output_dummy_notify_destroy
};
output->gpu = gpu;
output->winsys_id = number;
output->name = g_strdup_printf ("LVDS%d", number);
output->vendor = g_strdup ("MetaProducts Inc.");
output->product = g_strdup ("MetaMonitor");
output->serial = g_strdup_printf ("0xC0FFEE-%d", number);
output->suggested_x = -1;
output->suggested_y = -1;
output->width_mm = 222;
output->height_mm = 125;
output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
output->preferred_mode = g_list_last (*modes)->data;
output->n_possible_clones = 0;
output->backlight = -1;
output->connector_type = META_CONNECTOR_TYPE_LVDS;
output->driver_private = output_dummy;
output->driver_notify =
(GDestroyNotify) meta_output_dummy_notify_destroy;
output.modes = g_new0 (MetaCrtcMode *, G_N_ELEMENTS (modes_decl));
for (i = 0; i < G_N_ELEMENTS (modes_decl); i++)
output.modes[i] = &g_array_index (modes, MetaCrtcMode,
modes->len - (i + 1));
output.n_modes = G_N_ELEMENTS (modes_decl);
output.possible_crtcs = g_new0 (MetaCrtc *, 1);
output.possible_crtcs[0] = &array_last (crtcs, MetaCrtc);
output.n_possible_crtcs = 1;
output->modes = g_new0 (MetaCrtcMode *, G_N_ELEMENTS (mode_specs));
for (l = new_modes, i = 0; l; l = l->next, i++)
{
MetaCrtcMode *mode = l->data;
output->modes[i] = mode;
}
output->n_modes = G_N_ELEMENTS (mode_specs);
output->possible_crtcs = g_new0 (MetaCrtc *, 1);
output->possible_crtcs[0] = g_list_last (*crtcs)->data;
output->n_possible_crtcs = 1;
*outputs = g_list_append (*outputs, output);
g_array_append_val (outputs, output);
}
static void
append_tiled_monitor (MetaMonitorManager *manager,
GList **modes,
GList **crtcs,
GList **outputs,
int scale)
append_tiled_monitor (GArray *modes,
GArray *crtcs,
GArray *outputs,
int scale)
{
MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (manager);
MetaGpu *gpu = manager_dummy->gpu;
CrtcModeSpec mode_specs[] = {
MetaCrtcMode modes_decl[] = {
{
.width = 800,
.height = 600,
@@ -207,105 +154,81 @@ append_tiled_monitor (MetaMonitorManager *manager,
.refresh_rate = 60.0
}
};
unsigned int n_tiles = 2;
GList *new_modes = NULL;
GList *new_crtcs = NULL;
MetaOutput *output;
MetaCrtc crtcs_decl[] = {
{
.all_transforms = ALL_TRANSFORMS,
},
{
.all_transforms = ALL_TRANSFORMS,
},
};
MetaOutput output;
unsigned int i;
uint32_t tile_group_id;
for (i = 0; i < G_N_ELEMENTS (mode_specs); i++)
{
long mode_id;
MetaCrtcMode *mode;
for (i = 0; i < G_N_ELEMENTS (modes_decl); i++)
modes_decl[i].mode_id = modes->len + i;
g_array_append_vals (modes, modes_decl, G_N_ELEMENTS (modes_decl));
mode_id = g_list_length (*modes) + i + 1;
mode = create_mode (&mode_specs[i], mode_id);
for (i = 0; i < G_N_ELEMENTS (crtcs_decl); i++)
crtcs_decl[i].crtc_id = crtcs->len + i + 1;
g_array_append_vals (crtcs, crtcs_decl, G_N_ELEMENTS (crtcs_decl));
new_modes = g_list_append (new_modes, mode);
}
*modes = g_list_concat (*modes, new_modes);
for (i = 0; i < n_tiles; i++)
{
MetaCrtc *crtc;
crtc = g_object_new (META_TYPE_CRTC, NULL);
crtc->gpu = gpu;
crtc->crtc_id = g_list_length (*crtcs) + i + 1;
crtc->all_transforms = ALL_TRANSFORMS;
new_crtcs = g_list_append (new_crtcs, crtc);
}
*crtcs = g_list_concat (*crtcs, new_crtcs);
tile_group_id = g_list_length (*outputs) + 1;
for (i = 0; i < n_tiles; i++)
tile_group_id = outputs->len + 1;
for (i = 0; i < G_N_ELEMENTS (crtcs_decl); i++)
{
MetaOutputDummy *output_dummy;
MetaCrtcMode *preferred_mode;
unsigned int j;
unsigned int number;
GList *l;
output_dummy = g_new0 (MetaOutputDummy, 1);
*output_dummy = (MetaOutputDummy) {
.scale = scale
};
/* Arbitrary ID unique for this output */
number = g_list_length (*outputs) + 1;
preferred_mode = &array_last (modes, MetaCrtcMode),
output = (MetaOutput) {
.winsys_id = outputs->len + 1,
.name = g_strdup_printf ("LVDS%d", outputs->len + 1),
.vendor = g_strdup ("MetaProducts Inc."),
.product = g_strdup ("MetaMonitor"),
.serial = g_strdup_printf ("0xC0FFEE-%d", outputs->len + 1),
.suggested_x = -1,
.suggested_y = -1,
.width_mm = 222,
.height_mm = 125,
.subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN,
.preferred_mode = preferred_mode,
.n_possible_clones = 0,
.backlight = -1,
.connector_type = META_CONNECTOR_TYPE_LVDS,
.tile_info = (MetaTileInfo) {
.group_id = tile_group_id,
.max_h_tiles = G_N_ELEMENTS (crtcs_decl),
.max_v_tiles = 1,
.loc_h_tile = i,
.loc_v_tile = 0,
.tile_w = preferred_mode->width,
.tile_h = preferred_mode->height
},
.driver_private = output_dummy,
.driver_notify =
(GDestroyNotify) meta_output_dummy_notify_destroy
};
preferred_mode = g_list_last (*modes)->data;
output.modes = g_new0 (MetaCrtcMode *, G_N_ELEMENTS (modes_decl));
for (j = 0; j < G_N_ELEMENTS (modes_decl); j++)
output.modes[j] = &g_array_index (modes, MetaCrtcMode,
modes->len - (j + 1));
output.n_modes = G_N_ELEMENTS (modes_decl);
output = g_object_new (META_TYPE_OUTPUT, NULL);
output.possible_crtcs = g_new0 (MetaCrtc *, G_N_ELEMENTS (crtcs_decl));
for (j = 0; j < G_N_ELEMENTS (crtcs_decl); j++)
output.possible_crtcs[j] = &g_array_index (crtcs, MetaCrtc,
crtcs->len - (j + 1));
output.n_possible_crtcs = G_N_ELEMENTS (crtcs_decl);
output->gpu = gpu;
output->winsys_id = number;
output->name = g_strdup_printf ("LVDS%d", number);
output->vendor = g_strdup ("MetaProducts Inc.");
output->product = g_strdup ("MetaMonitor");
output->serial = g_strdup_printf ("0xC0FFEE-%d", number);
output->suggested_x = -1;
output->suggested_y = -1;
output->width_mm = 222;
output->height_mm = 125;
output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
output->preferred_mode = preferred_mode;
output->n_possible_clones = 0;
output->backlight = -1;
output->connector_type = META_CONNECTOR_TYPE_LVDS;
output->tile_info = (MetaTileInfo) {
.group_id = tile_group_id,
.max_h_tiles = n_tiles,
.max_v_tiles = 1,
.loc_h_tile = i,
.loc_v_tile = 0,
.tile_w = preferred_mode->width,
.tile_h = preferred_mode->height
},
output->driver_private = output_dummy;
output->driver_notify =
(GDestroyNotify) meta_output_dummy_notify_destroy;
output->modes = g_new0 (MetaCrtcMode *, G_N_ELEMENTS (mode_specs));
for (l = new_modes, j = 0; l; l = l->next, j++)
{
MetaCrtcMode *mode = l->data;
output->modes[j] = mode;
}
output->n_modes = G_N_ELEMENTS (mode_specs);
output->possible_crtcs = g_new0 (MetaCrtc *, n_tiles);
for (l = new_crtcs, j = 0; l; l = l->next, j++)
{
MetaCrtc *crtc = l->data;
output->possible_crtcs[j] = crtc;
}
output->n_possible_crtcs = n_tiles;
*outputs = g_list_append (*outputs, output);
g_array_append_val (outputs, output);
}
}
@@ -318,8 +241,6 @@ meta_output_dummy_notify_destroy (MetaOutput *output)
static void
meta_monitor_manager_dummy_read_current (MetaMonitorManager *manager)
{
MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (manager);
MetaGpu *gpu = manager_dummy->gpu;
unsigned int num_monitors = 1;
float *monitor_scales = NULL;
const char *num_monitors_str;
@@ -327,9 +248,9 @@ meta_monitor_manager_dummy_read_current (MetaMonitorManager *manager)
const char *tiled_monitors_str;
gboolean tiled_monitors;
unsigned int i;
GList *outputs;
GList *crtcs;
GList *modes;
GArray *outputs;
GArray *crtcs;
GArray *modes;
/* To control what monitor configuration is generated, there are two available
* environmental variables that can be used:
@@ -398,22 +319,28 @@ meta_monitor_manager_dummy_read_current (MetaMonitorManager *manager)
tiled_monitors_str = g_getenv ("MUTTER_DEBUG_TILED_DUMMY_MONITORS");
tiled_monitors = g_strcmp0 (tiled_monitors_str, "1") == 0;
modes = NULL;
crtcs = NULL;
outputs = NULL;
modes = g_array_sized_new (FALSE, TRUE, sizeof (MetaCrtcMode), MAX_MODES);
crtcs = g_array_sized_new (FALSE, TRUE, sizeof (MetaCrtc), MAX_CRTCS);
outputs = g_array_sized_new (FALSE, TRUE, sizeof (MetaOutput), MAX_OUTPUTS);
for (i = 0; i < num_monitors; i++)
{
if (tiled_monitors)
append_tiled_monitor (manager,
&modes, &crtcs, &outputs, monitor_scales[i]);
append_tiled_monitor (modes, crtcs, outputs, monitor_scales[i]);
else
append_monitor (manager, &modes, &crtcs, &outputs, monitor_scales[i]);
append_monitor (modes, crtcs, outputs, monitor_scales[i]);
}
meta_gpu_take_modes (gpu, modes);
meta_gpu_take_crtcs (gpu, crtcs);
meta_gpu_take_outputs (gpu, outputs);
manager->modes = (MetaCrtcMode *) modes->data;
manager->n_modes = modes->len;
manager->crtcs = (MetaCrtc *) crtcs->data;
manager->n_crtcs = crtcs->len;
manager->outputs = (MetaOutput *) outputs->data;
manager->n_outputs = outputs->len;
g_array_free (modes, FALSE);
g_array_free (crtcs, FALSE);
g_array_free (outputs, FALSE);
}
static void
@@ -436,8 +363,6 @@ apply_crtc_assignments (MetaMonitorManager *manager,
MetaOutputInfo **outputs,
unsigned int n_outputs)
{
MetaMonitorManagerDummy *manager_dummy = META_MONITOR_MANAGER_DUMMY (manager);
GList *l;
unsigned i;
for (i = 0; i < n_crtcs; i++)
@@ -501,9 +426,9 @@ apply_crtc_assignments (MetaMonitorManager *manager,
}
/* Disable CRTCs not mentioned in the list */
for (l = meta_gpu_get_crtcs (manager_dummy->gpu); l; l = l->next)
for (i = 0; i < manager->n_crtcs; i++)
{
MetaCrtc *crtc = l->data;
MetaCrtc *crtc = &manager->crtcs[i];
crtc->logical_monitor = NULL;
@@ -521,9 +446,9 @@ apply_crtc_assignments (MetaMonitorManager *manager,
}
/* Disable outputs not mentioned in the list */
for (l = meta_gpu_get_outputs (manager_dummy->gpu); l; l = l->next)
for (i = 0; i < manager->n_outputs; i++)
{
MetaOutput *output = l->data;
MetaOutput *output = &manager->outputs[i];
if (output->is_dirty)
{
@@ -718,6 +643,7 @@ meta_monitor_manager_dummy_class_init (MetaMonitorManagerDummyClass *klass)
{
MetaMonitorManagerClass *manager_class = META_MONITOR_MANAGER_CLASS (klass);
manager_class->read_current = meta_monitor_manager_dummy_read_current;
manager_class->ensure_initial_config = meta_monitor_manager_dummy_ensure_initial_config;
manager_class->apply_monitors_config = meta_monitor_manager_dummy_apply_monitors_config;
manager_class->is_transform_handled = meta_monitor_manager_dummy_is_transform_handled;
@@ -729,44 +655,14 @@ meta_monitor_manager_dummy_class_init (MetaMonitorManagerDummyClass *klass)
}
static void
meta_monitor_manager_dummy_init (MetaMonitorManagerDummy *manager_dummy)
meta_monitor_manager_dummy_init (MetaMonitorManagerDummy *manager)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (manager_dummy);
const char *nested_offscreen_transform;
nested_offscreen_transform =
g_getenv ("MUTTER_DEBUG_NESTED_OFFSCREEN_TRANSFORM");
if (g_strcmp0 (nested_offscreen_transform, "1") == 0)
manager_dummy->is_transform_handled = FALSE;
manager->is_transform_handled = FALSE;
else
manager_dummy->is_transform_handled = TRUE;
manager_dummy->gpu = g_object_new (META_TYPE_GPU_DUMMY,
"monitor-manager", manager,
NULL);
meta_monitor_manager_add_gpu (manager, manager_dummy->gpu);
}
static gboolean
meta_gpu_dummy_read_current (MetaGpu *gpu,
GError **error)
{
MetaMonitorManager *manager = meta_gpu_get_monitor_manager (gpu);
meta_monitor_manager_dummy_read_current (manager);
return TRUE;
}
static void
meta_gpu_dummy_init (MetaGpuDummy *gpu_dummy)
{
}
static void
meta_gpu_dummy_class_init (MetaGpuDummyClass *klass)
{
MetaGpuClass *gpu_class = META_GPU_CLASS (klass);
gpu_class->read_current = meta_gpu_dummy_read_current;
manager->is_transform_handled = TRUE;
}

View File

@@ -24,13 +24,17 @@
#define META_MONITOR_MANAGER_DUMMY_H
#include "meta-monitor-manager-private.h"
#include "backends/meta-gpu.h"
#define META_TYPE_MONITOR_MANAGER_DUMMY (meta_monitor_manager_dummy_get_type ())
G_DECLARE_FINAL_TYPE (MetaMonitorManagerDummy, meta_monitor_manager_dummy,
META, MONITOR_MANAGER_DUMMY, MetaMonitorManager)
#define META_TYPE_MONITOR_MANAGER_DUMMY (meta_monitor_manager_dummy_get_type ())
#define META_MONITOR_MANAGER_DUMMY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_DUMMY, MetaMonitorManagerDummy))
#define META_MONITOR_MANAGER_DUMMY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MONITOR_MANAGER_DUMMY, MetaMonitorManagerDummyClass))
#define META_IS_MONITOR_MANAGER_DUMMY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_MONITOR_MANAGER_DUMMY))
#define META_IS_MONITOR_MANAGER_DUMMY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER_DUMMY))
#define META_MONITOR_MANAGER_DUMMY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER_DUMMY, MetaMonitorManagerDummyClass))
#define META_TYPE_GPU_DUMMY (meta_gpu_dummy_get_type ())
G_DECLARE_FINAL_TYPE (MetaGpuDummy, meta_gpu_dummy, META, GPU_DUMMY, MetaGpu)
typedef struct _MetaMonitorManagerDummyClass MetaMonitorManagerDummyClass;
typedef struct _MetaMonitorManagerDummy MetaMonitorManagerDummy;
GType meta_monitor_manager_dummy_get_type (void);
#endif /* META_MONITOR_MANAGER_DUMMY_H */

View File

@@ -60,8 +60,6 @@ typedef struct _MetaLogicalMonitor MetaLogicalMonitor;
typedef struct _MetaMonitorMode MetaMonitorMode;
typedef struct _MetaGpu MetaGpu;
typedef struct _MetaCrtc MetaCrtc;
typedef struct _MetaOutput MetaOutput;
typedef struct _MetaCrtcMode MetaCrtcMode;
@@ -107,6 +105,156 @@ typedef enum
META_MONITOR_TRANSFORM_FLIPPED_270,
} MetaMonitorTransform;
/* This matches the values in drm_mode.h */
typedef enum
{
META_CONNECTOR_TYPE_Unknown = 0,
META_CONNECTOR_TYPE_VGA = 1,
META_CONNECTOR_TYPE_DVII = 2,
META_CONNECTOR_TYPE_DVID = 3,
META_CONNECTOR_TYPE_DVIA = 4,
META_CONNECTOR_TYPE_Composite = 5,
META_CONNECTOR_TYPE_SVIDEO = 6,
META_CONNECTOR_TYPE_LVDS = 7,
META_CONNECTOR_TYPE_Component = 8,
META_CONNECTOR_TYPE_9PinDIN = 9,
META_CONNECTOR_TYPE_DisplayPort = 10,
META_CONNECTOR_TYPE_HDMIA = 11,
META_CONNECTOR_TYPE_HDMIB = 12,
META_CONNECTOR_TYPE_TV = 13,
META_CONNECTOR_TYPE_eDP = 14,
META_CONNECTOR_TYPE_VIRTUAL = 15,
META_CONNECTOR_TYPE_DSI = 16,
} MetaConnectorType;
/* Same as KMS mode flags and X11 randr flags */
typedef enum
{
META_CRTC_MODE_FLAG_NONE = 0,
META_CRTC_MODE_FLAG_PHSYNC = (1 << 0),
META_CRTC_MODE_FLAG_NHSYNC = (1 << 1),
META_CRTC_MODE_FLAG_PVSYNC = (1 << 2),
META_CRTC_MODE_FLAG_NVSYNC = (1 << 3),
META_CRTC_MODE_FLAG_INTERLACE = (1 << 4),
META_CRTC_MODE_FLAG_DBLSCAN = (1 << 5),
META_CRTC_MODE_FLAG_CSYNC = (1 << 6),
META_CRTC_MODE_FLAG_PCSYNC = (1 << 7),
META_CRTC_MODE_FLAG_NCSYNC = (1 << 8),
META_CRTC_MODE_FLAG_HSKEW = (1 << 9),
META_CRTC_MODE_FLAG_BCAST = (1 << 10),
META_CRTC_MODE_FLAG_PIXMUX = (1 << 11),
META_CRTC_MODE_FLAG_DBLCLK = (1 << 12),
META_CRTC_MODE_FLAG_CLKDIV2 = (1 << 13),
META_CRTC_MODE_FLAG_MASK = 0x3fff
} MetaCrtcModeFlag;
struct _MetaTileInfo
{
guint32 group_id;
guint32 flags;
guint32 max_h_tiles;
guint32 max_v_tiles;
guint32 loc_h_tile;
guint32 loc_v_tile;
guint32 tile_w;
guint32 tile_h;
};
struct _MetaOutput
{
/* 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;
char *vendor;
char *product;
char *serial;
int width_mm;
int height_mm;
CoglSubpixelOrder subpixel_order;
MetaConnectorType connector_type;
MetaCrtcMode *preferred_mode;
MetaCrtcMode **modes;
unsigned int n_modes;
MetaCrtc **possible_crtcs;
unsigned int n_possible_crtcs;
MetaOutput **possible_clones;
unsigned int n_possible_clones;
int backlight;
int backlight_min;
int backlight_max;
/* Used when changing configuration */
gboolean is_dirty;
/* The low-level bits used to build the high-level info
in MetaLogicalMonitor
XXX: flags maybe?
There is a lot of code that uses MonitorInfo->is_primary,
but nobody uses MetaOutput yet
*/
gboolean is_primary;
gboolean is_presentation;
gboolean is_underscanning;
gboolean supports_underscanning;
gpointer driver_private;
GDestroyNotify driver_notify;
/* get a new preferred mode on hotplug events, to handle dynamic guest resizing */
gboolean hotplug_mode_update;
gint suggested_x;
gint suggested_y;
MetaTileInfo tile_info;
};
struct _MetaCrtc
{
glong crtc_id;
MetaRectangle rect;
MetaCrtcMode *current_mode;
MetaMonitorTransform transform;
unsigned int all_transforms;
/* Only used to build the logical configuration
from the HW one
*/
MetaLogicalMonitor *logical_monitor;
/* Used when changing configuration */
gboolean is_dirty;
/* Used by cursor renderer backend */
void *cursor_renderer_private;
gpointer driver_private;
GDestroyNotify driver_notify;
};
struct _MetaCrtcMode
{
/* The low-level ID of this mode, used to apply back configuration */
glong mode_id;
char *name;
int width;
int height;
float refresh_rate;
MetaCrtcModeFlag flags;
gpointer driver_private;
GDestroyNotify driver_notify;
};
/*
* MetaCrtcInfo:
*
@@ -150,8 +298,6 @@ struct _MetaMonitorManager
{
MetaDBusDisplayConfigSkeleton parent_instance;
MetaBackend *backend;
/* XXX: this structure is very badly
packed, but I like the logical organization
of fields */
@@ -166,10 +312,35 @@ struct _MetaMonitorManager
int screen_width;
int screen_height;
GList *gpus;
/* Outputs refer to physical screens,
CRTCs refer to stuff that can drive outputs
(like encoders, but less tied to the HW),
while logical_monitors refer to logical ones.
*/
MetaOutput *outputs;
unsigned int n_outputs;
MetaCrtcMode *modes;
unsigned int n_modes;
MetaCrtc *crtcs;
unsigned int n_crtcs;
GList *monitors;
struct {
MetaOutput *outputs;
unsigned int n_outputs;
MetaCrtcMode *modes;
unsigned int n_modes;
MetaCrtc *crtcs;
unsigned int n_crtcs;
GList *monitors;
} pending_cleanup;
GList *logical_monitors;
MetaLogicalMonitor *primary_logical_monitor;
@@ -191,6 +362,8 @@ struct _MetaMonitorManagerClass
{
MetaDBusDisplayConfigSkeletonClass parent_class;
void (*read_current) (MetaMonitorManager *);
char* (*get_edid_file) (MetaMonitorManager *,
MetaOutput *);
GBytes* (*read_edid) (MetaMonitorManager *,
@@ -254,10 +427,6 @@ struct _MetaMonitorManagerClass
MetaLogicalMonitorLayoutMode (*get_default_layout_mode) (MetaMonitorManager *);
};
MetaBackend * meta_monitor_manager_get_backend (MetaMonitorManager *manager);
void meta_monitor_manager_setup (MetaMonitorManager *manager);
void meta_monitor_manager_rebuild (MetaMonitorManager *manager,
MetaMonitorsConfig *config);
void meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager,
@@ -295,10 +464,16 @@ MetaMonitor * meta_monitor_manager_get_monitor_from_connector (MetaMonitor
GList * meta_monitor_manager_get_monitors (MetaMonitorManager *manager);
void meta_monitor_manager_add_gpu (MetaMonitorManager *manager,
MetaGpu *gpu);
MetaOutput *meta_monitor_manager_get_outputs (MetaMonitorManager *manager,
unsigned int *n_outputs);
GList * meta_monitor_manager_get_gpus (MetaMonitorManager *manager);
void meta_monitor_manager_get_resources (MetaMonitorManager *manager,
MetaCrtcMode **modes,
unsigned int *n_modes,
MetaCrtc **crtcs,
unsigned int *n_crtcs,
MetaOutput **outputs,
unsigned int *n_outputs);
void meta_monitor_manager_get_screen_size (MetaMonitorManager *manager,
int *width,

View File

@@ -36,28 +36,15 @@
#include "util-private.h"
#include <meta/errors.h>
#include "edid.h"
#include "backends/meta-crtc.h"
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor.h"
#include "backends/meta-monitor-config-manager.h"
#include "backends/meta-orientation-manager.h"
#include "backends/meta-output.h"
#include "backends/x11/meta-monitor-manager-xrandr.h"
#include "meta-backend-private.h"
#define DEFAULT_DISPLAY_CONFIGURATION_TIMEOUT 20
enum
{
PROP_0,
PROP_BACKEND,
PROP_LAST
};
static GParamSpec *obj_props[PROP_LAST];
enum {
MONITORS_CHANGED_INTERNAL,
CONFIRM_DISPLAY_CHANGE,
@@ -89,11 +76,8 @@ static gboolean
meta_monitor_manager_is_config_complete (MetaMonitorManager *manager,
MetaMonitorsConfig *config);
MetaBackend *
meta_monitor_manager_get_backend (MetaMonitorManager *manager)
{
return manager->backend;
}
static void
cleanup_pending_cleanup_state (MetaMonitorManager *manager);
static void
meta_monitor_manager_init (MetaMonitorManager *manager)
@@ -466,13 +450,13 @@ meta_monitor_manager_apply_monitors_config (MetaMonitorManager *manager,
gboolean
meta_monitor_manager_has_hotplug_mode_update (MetaMonitorManager *manager)
{
GList *l;
unsigned int i;
for (l = manager->gpus; l; l = l->next)
for (i = 0; i < manager->n_outputs; i++)
{
MetaGpu *gpu = l->data;
MetaOutput *output = &manager->outputs[i];
if (meta_gpu_has_hotplug_mode_update (gpu))
if (output->hotplug_mode_update)
return TRUE;
}
@@ -694,27 +678,13 @@ experimental_features_changed (MetaSettings *settings,
meta_settings_update_ui_scaling_factor (settings);
}
void
meta_monitor_manager_setup (MetaMonitorManager *manager)
{
manager->in_init = TRUE;
manager->config_manager = meta_monitor_config_manager_new (manager);
meta_monitor_manager_read_current_state (manager);
meta_monitor_manager_ensure_initial_config (manager);
manager->in_init = FALSE;
}
static void
meta_monitor_manager_constructed (GObject *object)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
MetaMonitorManagerClass *manager_class =
META_MONITOR_MANAGER_GET_CLASS (manager);
MetaBackend *backend = manager->backend;
MetaBackend *backend = meta_get_backend ();
MetaSettings *settings = meta_backend_get_settings (backend);
manager->experimental_features_changed_handler_id =
@@ -739,8 +709,90 @@ meta_monitor_manager_constructed (GObject *object)
manager, 0);
manager->current_switch_config = META_MONITOR_SWITCH_CONFIG_UNKNOWN;
manager->in_init = TRUE;
manager->config_manager = meta_monitor_config_manager_new (manager);
meta_monitor_manager_read_current_state (manager);
meta_monitor_manager_ensure_initial_config (manager);
initialize_dbus_interface (manager);
manager->in_init = FALSE;
}
void
meta_monitor_manager_clear_output (MetaOutput *output)
{
g_free (output->name);
g_free (output->vendor);
g_free (output->product);
g_free (output->serial);
g_free (output->modes);
g_free (output->possible_crtcs);
g_free (output->possible_clones);
if (output->driver_notify)
output->driver_notify (output);
memset (output, 0, sizeof (*output));
}
static void
meta_monitor_manager_free_output_array (MetaOutput *old_outputs,
int n_old_outputs)
{
int i;
for (i = 0; i < n_old_outputs; i++)
meta_monitor_manager_clear_output (&old_outputs[i]);
g_free (old_outputs);
}
void
meta_monitor_manager_clear_mode (MetaCrtcMode *mode)
{
g_free (mode->name);
if (mode->driver_notify)
mode->driver_notify (mode);
memset (mode, 0, sizeof (*mode));
}
static void
meta_monitor_manager_free_mode_array (MetaCrtcMode *old_modes,
int n_old_modes)
{
int i;
for (i = 0; i < n_old_modes; i++)
meta_monitor_manager_clear_mode (&old_modes[i]);
g_free (old_modes);
}
void
meta_monitor_manager_clear_crtc (MetaCrtc *crtc)
{
if (crtc->driver_notify)
crtc->driver_notify (crtc);
memset (crtc, 0, sizeof (*crtc));
}
static void
meta_monitor_manager_free_crtc_array (MetaCrtc *old_crtcs,
int n_old_crtcs)
{
int i;
for (i = 0; i < n_old_crtcs; i++)
meta_monitor_manager_clear_crtc (&old_crtcs[i]);
g_free (old_crtcs);
}
static void
@@ -748,10 +800,14 @@ meta_monitor_manager_finalize (GObject *object)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
g_list_free_full (manager->gpus, g_object_unref);
meta_monitor_manager_free_output_array (manager->outputs, manager->n_outputs);
meta_monitor_manager_free_mode_array (manager->modes, manager->n_modes);
meta_monitor_manager_free_crtc_array (manager->crtcs, manager->n_crtcs);
g_list_free_full (manager->logical_monitors, g_object_unref);
g_signal_handler_disconnect (manager->backend,
cleanup_pending_cleanup_state (manager);
g_signal_handler_disconnect (meta_get_backend (),
manager->experimental_features_changed_handler_id);
G_OBJECT_CLASS (meta_monitor_manager_parent_class)->finalize (object);
@@ -788,42 +844,6 @@ meta_monitor_manager_real_get_edid_file (MetaMonitorManager *manager,
return NULL;
}
static void
meta_monitor_manager_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
switch (prop_id)
{
case PROP_BACKEND:
manager->backend = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
meta_monitor_manager_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
switch (prop_id)
{
case PROP_BACKEND:
g_value_set_object (value, manager->backend);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
{
@@ -832,8 +852,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
object_class->constructed = meta_monitor_manager_constructed;
object_class->dispose = meta_monitor_manager_dispose;
object_class->finalize = meta_monitor_manager_finalize;
object_class->get_property = meta_monitor_manager_get_property;
object_class->set_property = meta_monitor_manager_set_property;
klass->get_edid_file = meta_monitor_manager_real_get_edid_file;
klass->read_edid = meta_monitor_manager_real_read_edid;
@@ -854,16 +872,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
0,
NULL, NULL, NULL,
G_TYPE_NONE, 0);
obj_props[PROP_BACKEND] =
g_param_spec_object ("backend",
"backend",
"MetaBackend",
META_TYPE_BACKEND,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, PROP_LAST, obj_props);
}
static const double known_diagonals[] = {
@@ -964,61 +972,31 @@ get_connector_type_name (MetaConnectorType connector_type)
}
}
static GList *
combine_gpu_lists (MetaMonitorManager *manager,
GList * (*list_getter) (MetaGpu *gpu))
{
GList *list = NULL;
GList *l;
for (l = manager->gpus; l; l = l->next)
{
MetaGpu *gpu = l->data;
list = g_list_concat (list, g_list_copy (list_getter (gpu)));
}
return list;
}
static gboolean
meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
GDBusMethodInvocation *invocation)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (skeleton);
MetaMonitorManagerClass *manager_class = META_MONITOR_MANAGER_GET_CLASS (skeleton);
GList *combined_modes;
GList *combined_outputs;
GList *combined_crtcs;
GVariantBuilder crtc_builder, output_builder, mode_builder;
GList *l;
unsigned int i, j;
int max_screen_width;
int max_screen_height;
combined_modes = combine_gpu_lists (manager, meta_gpu_get_modes);
combined_outputs = combine_gpu_lists (manager, meta_gpu_get_outputs);
combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
g_variant_builder_init (&crtc_builder, G_VARIANT_TYPE ("a(uxiiiiiuaua{sv})"));
g_variant_builder_init (&output_builder, G_VARIANT_TYPE ("a(uxiausauaua{sv})"));
g_variant_builder_init (&mode_builder, G_VARIANT_TYPE ("a(uxuudu)"));
for (l = combined_crtcs, i = 0; l; l = l->next, i++)
for (i = 0; i < manager->n_crtcs; i++)
{
MetaCrtc *crtc = l->data;
MetaCrtc *crtc = &manager->crtcs[i];
GVariantBuilder transforms;
int current_mode_index;
g_variant_builder_init (&transforms, G_VARIANT_TYPE ("au"));
for (j = 0; j <= META_MONITOR_TRANSFORM_FLIPPED_270; j++)
if (crtc->all_transforms & (1 << j))
g_variant_builder_add (&transforms, "u", j);
if (crtc->current_mode)
current_mode_index = g_list_index (combined_modes, crtc->current_mode);
else
current_mode_index = -1;
g_variant_builder_add (&crtc_builder, "(uxiiiiiuaua{sv})",
i, /* ID */
(gint64)crtc->crtc_id,
@@ -1026,48 +1004,33 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
(int)crtc->rect.y,
(int)crtc->rect.width,
(int)crtc->rect.height,
current_mode_index,
(int)(crtc->current_mode ? crtc->current_mode - manager->modes : -1),
(guint32)crtc->transform,
&transforms,
NULL /* properties */);
}
for (l = combined_outputs; l; l = l->next)
for (i = 0; i < manager->n_outputs; i++)
{
MetaOutput *output = l->data;
MetaOutput *output = &manager->outputs[i];
GVariantBuilder crtcs, modes, clones, properties;
GBytes *edid;
char *edid_file;
int crtc_index;
g_variant_builder_init (&crtcs, G_VARIANT_TYPE ("au"));
for (j = 0; j < output->n_possible_crtcs; j++)
{
MetaCrtc *possible_crtc = output->possible_crtcs[j];
unsigned possible_crtc_index;
possible_crtc_index = g_list_index (combined_crtcs, possible_crtc);
g_variant_builder_add (&crtcs, "u", possible_crtc_index);
}
g_variant_builder_add (&crtcs, "u",
(unsigned)(output->possible_crtcs[j] - manager->crtcs));
g_variant_builder_init (&modes, G_VARIANT_TYPE ("au"));
for (j = 0; j < output->n_modes; j++)
{
unsigned mode_index;
mode_index = g_list_index (combined_modes, output->modes[j]);
g_variant_builder_add (&modes, "u", mode_index);
}
g_variant_builder_add (&modes, "u",
(unsigned)(output->modes[j] - manager->modes));
g_variant_builder_init (&clones, G_VARIANT_TYPE ("au"));
for (j = 0; j < output->n_possible_clones; j++)
{
unsigned int possible_clone_index;
possible_clone_index = g_list_index (combined_outputs,
output->possible_clones[j]);
g_variant_builder_add (&clones, "u", possible_clone_index);
}
g_variant_builder_add (&clones, "u",
(unsigned)(output->possible_clones[j] - manager->outputs));
g_variant_builder_init (&properties, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_add (&properties, "{sv}", "vendor",
@@ -1131,12 +1094,10 @@ 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;
g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
i, /* ID */
(gint64)output->winsys_id,
crtc_index,
(int)(output->crtc ? output->crtc - manager->crtcs : -1),
&crtcs,
output->name,
&modes,
@@ -1144,9 +1105,9 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
&properties);
}
for (l = combined_modes, i = 0; l; l = l->next, i++)
for (i = 0; i < manager->n_modes; i++)
{
MetaCrtcMode *mode = l->data;
MetaCrtcMode *mode = &manager->modes[i];
g_variant_builder_add (&mode_builder, "(uxuudu)",
i, /* ID */
@@ -1174,11 +1135,6 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
g_variant_builder_end (&mode_builder),
max_screen_width,
max_screen_height);
g_list_free (combined_modes);
g_list_free (combined_outputs);
g_list_free (combined_crtcs);
return TRUE;
}
@@ -1270,14 +1226,12 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
GDBusMethodInvocation *invocation)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (skeleton);
MetaSettings *settings = meta_backend_get_settings (manager->backend);
GVariantBuilder monitors_builder;
GVariantBuilder logical_monitors_builder;
GVariantBuilder properties_builder;
GList *l;
int i;
MetaMonitorManagerCapability capabilities;
int ui_scaling_factor;
int max_screen_width, max_screen_height;
g_variant_builder_init (&monitors_builder,
@@ -1455,11 +1409,6 @@ meta_monitor_manager_handle_get_current_state (MetaDBusDisplayConfig *skeleton,
g_variant_new_boolean (TRUE));
}
ui_scaling_factor = meta_settings_get_ui_scaling_factor (settings);
g_variant_builder_add (&properties_builder, "{sv}",
"legacy-ui-scaling-factor",
g_variant_new_int32 (ui_scaling_factor));
if (meta_monitor_manager_get_max_screen_size (manager,
&max_screen_width,
&max_screen_height))
@@ -2080,7 +2029,6 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
gint value)
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (skeleton);
GList *combined_outputs;
MetaOutput *output;
if (serial != manager->serial)
@@ -2091,18 +2039,14 @@ meta_monitor_manager_handle_change_backlight (MetaDBusDisplayConfig *skeleton,
return TRUE;
}
combined_outputs = combine_gpu_lists (manager, meta_gpu_get_outputs);
if (output_index >= g_list_length (combined_outputs))
if (output_index >= manager->n_outputs)
{
g_list_free (combined_outputs);
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Invalid output id");
return TRUE;
}
output = g_list_nth_data (combined_outputs, output_index);
g_list_free (combined_outputs);
output = &manager->outputs[output_index];
if (value < 0 || value > 100)
{
@@ -2135,7 +2079,6 @@ meta_monitor_manager_handle_get_crtc_gamma (MetaDBusDisplayConfig *skeleton,
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (skeleton);
MetaMonitorManagerClass *klass;
GList *combined_crtcs;
MetaCrtc *crtc;
gsize size;
unsigned short *red;
@@ -2152,18 +2095,14 @@ meta_monitor_manager_handle_get_crtc_gamma (MetaDBusDisplayConfig *skeleton,
return TRUE;
}
combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
if (crtc_id >= g_list_length (combined_crtcs))
if (crtc_id >= manager->n_crtcs)
{
g_list_free (combined_crtcs);
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Invalid crtc id");
return TRUE;
}
crtc = g_list_nth_data (combined_crtcs, crtc_id);
g_list_free (combined_crtcs);
crtc = &manager->crtcs[crtc_id];
klass = META_MONITOR_MANAGER_GET_CLASS (manager);
if (klass->get_crtc_gamma)
@@ -2203,7 +2142,6 @@ meta_monitor_manager_handle_set_crtc_gamma (MetaDBusDisplayConfig *skeleton,
{
MetaMonitorManager *manager = META_MONITOR_MANAGER (skeleton);
MetaMonitorManagerClass *klass;
GList *combined_crtcs;
MetaCrtc *crtc;
gsize size, dummy;
unsigned short *red;
@@ -2219,19 +2157,14 @@ meta_monitor_manager_handle_set_crtc_gamma (MetaDBusDisplayConfig *skeleton,
return TRUE;
}
combined_crtcs = combine_gpu_lists (manager, meta_gpu_get_crtcs);
if (crtc_id >= g_list_length (combined_crtcs))
if (crtc_id >= manager->n_crtcs)
{
g_list_free (combined_crtcs);
g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,
G_DBUS_ERROR_INVALID_ARGS,
"Invalid crtc id");
return TRUE;
}
crtc = g_list_nth_data (combined_crtcs, crtc_id);
g_list_free (combined_crtcs);
crtc = &manager->crtcs[crtc_id];
red_bytes = g_variant_get_data_as_bytes (red_v);
green_bytes = g_variant_get_data_as_bytes (green_v);
@@ -2501,17 +2434,38 @@ meta_monitor_manager_get_monitors (MetaMonitorManager *manager)
return manager->monitors;
}
void
meta_monitor_manager_add_gpu (MetaMonitorManager *manager,
MetaGpu *gpu)
MetaOutput *
meta_monitor_manager_get_outputs (MetaMonitorManager *manager,
unsigned int *n_outputs)
{
manager->gpus = g_list_append (manager->gpus, gpu);
*n_outputs = manager->n_outputs;
return manager->outputs;
}
GList *
meta_monitor_manager_get_gpus (MetaMonitorManager *manager)
void
meta_monitor_manager_get_resources (MetaMonitorManager *manager,
MetaCrtcMode **modes,
unsigned int *n_modes,
MetaCrtc **crtcs,
unsigned int *n_crtcs,
MetaOutput **outputs,
unsigned int *n_outputs)
{
return manager->gpus;
if (modes)
{
*modes = manager->modes;
*n_modes = manager->n_modes;
}
if (crtcs)
{
*crtcs = manager->crtcs;
*n_crtcs = manager->n_crtcs;
}
if (outputs)
{
*outputs = manager->outputs;
*n_outputs = manager->n_outputs;
}
}
void
@@ -2524,45 +2478,33 @@ meta_monitor_manager_get_screen_size (MetaMonitorManager *manager,
}
static void
rebuild_monitors (MetaMonitorManager *manager)
generate_monitors (MetaMonitorManager *manager)
{
GList *l;
unsigned int i;
if (manager->monitors)
for (i = 0; i < manager->n_outputs; i++)
{
g_list_free_full (manager->monitors, g_object_unref);
manager->monitors = NULL;
}
MetaOutput *output = &manager->outputs[i];
for (l = manager->gpus; l; l = l->next)
{
MetaGpu *gpu = l->data;
GList *k;
for (k = meta_gpu_get_outputs (gpu); k; k = k->next)
if (output->tile_info.group_id)
{
MetaOutput *output = k->data;
if (output->tile_info.group_id)
if (is_main_tiled_monitor_output (output))
{
if (is_main_tiled_monitor_output (output))
{
MetaMonitorTiled *monitor_tiled;
MetaMonitorTiled *monitor_tiled;
monitor_tiled = meta_monitor_tiled_new (gpu, output);
manager->monitors = g_list_append (manager->monitors,
monitor_tiled);
}
}
else
{
MetaMonitorNormal *monitor_normal;
monitor_normal = meta_monitor_normal_new (gpu, output);
monitor_tiled = meta_monitor_tiled_new (manager, output);
manager->monitors = g_list_append (manager->monitors,
monitor_normal);
monitor_tiled);
}
}
else
{
MetaMonitorNormal *monitor_normal;
monitor_normal = meta_monitor_normal_new (manager, output);
manager->monitors = g_list_append (manager->monitors,
monitor_normal);
}
}
}
@@ -2599,34 +2541,108 @@ meta_monitor_manager_is_transform_handled (MetaMonitorManager *manager,
return manager_class->is_transform_handled (manager, crtc, transform);
}
static void
cleanup_pending_cleanup_state (MetaMonitorManager *manager)
{
if (manager->pending_cleanup.monitors)
{
g_list_free_full (manager->pending_cleanup.monitors, g_object_unref);
manager->pending_cleanup.monitors = NULL;
}
if (manager->pending_cleanup.outputs)
{
meta_monitor_manager_free_output_array (manager->pending_cleanup.outputs,
manager->pending_cleanup.n_outputs);
manager->pending_cleanup.outputs = NULL;
manager->pending_cleanup.n_outputs = 0;
}
if (manager->pending_cleanup.modes)
{
meta_monitor_manager_free_mode_array (manager->pending_cleanup.modes,
manager->pending_cleanup.n_modes);
manager->pending_cleanup.modes = NULL;
manager->pending_cleanup.n_modes = 0;
}
if (manager->pending_cleanup.crtcs)
{
meta_monitor_manager_free_crtc_array (manager->pending_cleanup.crtcs,
manager->pending_cleanup.n_crtcs);
manager->pending_cleanup.crtcs = NULL;
manager->pending_cleanup.n_crtcs = 0;
}
}
void
meta_monitor_manager_read_current_state (MetaMonitorManager *manager)
{
GList *l;
MetaOutput *old_outputs;
MetaCrtc *old_crtcs;
MetaCrtcMode *old_modes;
unsigned int n_old_outputs, n_old_crtcs, n_old_modes;
/* Some implementations of read_current use the existing information
* we have available, so don't free the old configuration until after
* read_current finishes. */
old_outputs = manager->outputs;
n_old_outputs = manager->n_outputs;
old_crtcs = manager->crtcs;
n_old_crtcs = manager->n_crtcs;
old_modes = manager->modes;
n_old_modes = manager->n_modes;
manager->serial++;
META_MONITOR_MANAGER_GET_CLASS (manager)->read_current (manager);
for (l = manager->gpus; l; l = l->next)
/*
* We must delay cleaning up the old hardware state, because the current
* logical state, when running on top of X11/Xrandr, may still be based on it
* for some time. The logical state may not be updated immediately, in case
* it is reconfigured, but after getting the response from a logical state
* configuration request to the X server. To be able to handle events and
* other things needing the logical state between the request and the
* response, the hardware state the logical state points to must be kept
* alive.
*
* If there is already a hardware state pending cleaning up, it means that
* the current logical state is still using that hardware state, so we can
* destroy the just replaced state immedietaley.
*/
if (manager->pending_cleanup.outputs ||
manager->pending_cleanup.crtcs ||
manager->pending_cleanup.monitors)
{
MetaGpu *gpu = l->data;
GError *error = NULL;
if (!meta_gpu_read_current (gpu, &error))
if (manager->monitors)
{
g_warning ("Failed to read current KMS state: %s", error->message);
g_clear_error (&error);
g_list_free_full (manager->monitors, g_object_unref);
manager->monitors = NULL;
}
meta_monitor_manager_free_output_array (old_outputs, n_old_outputs);
meta_monitor_manager_free_mode_array (old_modes, n_old_modes);
meta_monitor_manager_free_crtc_array (old_crtcs, n_old_crtcs);
}
else
{
manager->pending_cleanup.outputs = old_outputs;
manager->pending_cleanup.n_outputs = n_old_outputs;
manager->pending_cleanup.modes = old_modes;
manager->pending_cleanup.n_modes = n_old_modes;
manager->pending_cleanup.crtcs = old_crtcs;
manager->pending_cleanup.n_crtcs = n_old_crtcs;
manager->pending_cleanup.monitors = manager->monitors;
manager->monitors = NULL;
}
rebuild_monitors (manager);
generate_monitors (manager);
}
static void
meta_monitor_manager_notify_monitors_changed (MetaMonitorManager *manager)
{
MetaBackend *backend = meta_get_backend ();
manager->current_switch_config = META_MONITOR_SWITCH_CONFIG_UNKNOWN;
meta_backend_monitors_changed (manager->backend);
meta_backend_monitors_changed (backend);
g_signal_emit (manager, signals[MONITORS_CHANGED_INTERNAL], 0);
g_signal_emit_by_name (manager, "monitors-changed");
@@ -2708,6 +2724,8 @@ meta_monitor_manager_rebuild (MetaMonitorManager *manager,
meta_monitor_manager_notify_monitors_changed (manager);
g_list_free_full (old_logical_monitors, g_object_unref);
cleanup_pending_cleanup_state (manager);
}
static void
@@ -2750,6 +2768,8 @@ meta_monitor_manager_rebuild_derived (MetaMonitorManager *manager,
meta_monitor_manager_notify_monitors_changed (manager);
g_list_free_full (old_logical_monitors, g_object_unref);
cleanup_pending_cleanup_state (manager);
}
void
@@ -2871,6 +2891,40 @@ meta_monitor_manager_get_monitor_matrix (MetaMonitorManager *manager,
return TRUE;
}
/**
* meta_monitor_manager_get_monitor_for_output:
* @manager: A #MetaMonitorManager
* @id: A valid #MetaOutput id
*
* Returns: The monitor index or -1 if @id isn't valid or the output
* isn't associated with a logical monitor.
*/
gint
meta_monitor_manager_get_monitor_for_output (MetaMonitorManager *manager,
guint id)
{
MetaOutput *output;
GList *l;
g_return_val_if_fail (META_IS_MONITOR_MANAGER (manager), -1);
g_return_val_if_fail (id < manager->n_outputs, -1);
output = &manager->outputs[id];
if (!output || !output->crtc)
return -1;
for (l = manager->logical_monitors; l; l = l->next)
{
MetaLogicalMonitor *logical_monitor = l->data;
if (meta_rectangle_contains_rect (&logical_monitor->rect,
&output->crtc->rect))
return logical_monitor->number;
}
return -1;
}
/**
* meta_monitor_manager_get_monitor_for_connector:
* @manager: A #MetaMonitorManager

View File

@@ -24,17 +24,14 @@
#include "backends/meta-monitor.h"
#include "backends/meta-backend-private.h"
#include "backends/meta-crtc.h"
#include "backends/meta-gpu.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-settings-private.h"
#include "backends/meta-output.h"
#define SCALE_FACTORS_PER_INTEGER 4
#define MINIMUM_SCALE_FACTOR 1.0f
#define MAXIMUM_SCALE_FACTOR 4.0f
#define MINIMUM_LOGICAL_WIDTH 800
#define MINIMUM_LOGICAL_HEIGHT 600
#define MINIMUM_LOGICAL_HEIGHT 480
#define MAXIMUM_REFRESH_RATE_DIFF 0.001
typedef struct _MetaMonitorMode
@@ -53,7 +50,7 @@ typedef struct _MetaMonitorModeTiled
typedef struct _MetaMonitorPrivate
{
MetaGpu *gpu;
MetaMonitorManager *monitor_manager;
GList *outputs;
GList *modes;
@@ -178,14 +175,6 @@ meta_monitor_generate_spec (MetaMonitor *monitor)
priv->spec = monitor_spec;
}
MetaGpu *
meta_monitor_get_gpu (MetaMonitor *monitor)
{
MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor);
return priv->gpu;
}
GList *
meta_monitor_get_outputs (MetaMonitor *monitor)
{
@@ -480,8 +469,8 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
}
MetaMonitorNormal *
meta_monitor_normal_new (MetaGpu *gpu,
MetaOutput *output)
meta_monitor_normal_new (MetaMonitorManager *monitor_manager,
MetaOutput *output)
{
MetaMonitorNormal *monitor_normal;
MetaMonitor *monitor;
@@ -491,7 +480,7 @@ meta_monitor_normal_new (MetaGpu *gpu,
monitor = META_MONITOR (monitor_normal);
monitor_priv = meta_monitor_get_instance_private (monitor);
monitor_priv->gpu = gpu;
monitor_priv->monitor_manager = monitor_manager;
monitor_priv->outputs = g_list_append (NULL, output);
monitor_priv->winsys_id = output->winsys_id;
@@ -587,18 +576,16 @@ meta_monitor_get_suggested_position (MetaMonitor *monitor,
}
static void
add_tiled_monitor_outputs (MetaGpu *gpu,
MetaMonitorTiled *monitor_tiled)
add_tiled_monitor_outputs (MetaMonitorManager *monitor_manager,
MetaMonitorTiled *monitor_tiled)
{
MetaMonitorPrivate *monitor_priv =
meta_monitor_get_instance_private (META_MONITOR (monitor_tiled));
GList *outputs;
GList *l;
unsigned int i;
outputs = meta_gpu_get_outputs (gpu);
for (l = outputs; l; l = l->next)
for (i = 0; i < monitor_manager->n_outputs; i++)
{
MetaOutput *output = l->data;
MetaOutput *output = &monitor_manager->outputs[i];
if (output->tile_info.group_id != monitor_tiled->tile_group_id)
continue;
@@ -1114,10 +1101,9 @@ meta_monitor_tiled_generate_modes (MetaMonitorTiled *monitor_tiled)
}
MetaMonitorTiled *
meta_monitor_tiled_new (MetaGpu *gpu,
MetaOutput *output)
meta_monitor_tiled_new (MetaMonitorManager *monitor_manager,
MetaOutput *output)
{
MetaMonitorManager *monitor_manager;
MetaMonitorTiled *monitor_tiled;
MetaMonitor *monitor;
MetaMonitorPrivate *monitor_priv;
@@ -1126,19 +1112,18 @@ meta_monitor_tiled_new (MetaGpu *gpu,
monitor = META_MONITOR (monitor_tiled);
monitor_priv = meta_monitor_get_instance_private (monitor);
monitor_priv->gpu = gpu;
monitor_priv->monitor_manager = monitor_manager;
monitor_tiled->tile_group_id = output->tile_info.group_id;
monitor_priv->winsys_id = output->winsys_id;
monitor_tiled->origin_output = output;
add_tiled_monitor_outputs (gpu, monitor_tiled);
add_tiled_monitor_outputs (monitor_manager, monitor_tiled);
monitor_tiled->main_output = find_untiled_output (monitor_tiled);
meta_monitor_generate_spec (monitor);
monitor_manager = meta_gpu_get_monitor_manager (gpu);
meta_monitor_manager_tiled_monitor_added (monitor_manager,
META_MONITOR (monitor_tiled));
@@ -1225,10 +1210,8 @@ meta_monitor_tiled_finalize (GObject *object)
MetaMonitor *monitor = META_MONITOR (object);
MetaMonitorPrivate *monitor_priv =
meta_monitor_get_instance_private (monitor);
MetaMonitorManager *monitor_manager;
monitor_manager = meta_gpu_get_monitor_manager (monitor_priv->gpu);
meta_monitor_manager_tiled_monitor_removed (monitor_manager,
meta_monitor_manager_tiled_monitor_removed (monitor_priv->monitor_manager,
monitor);
G_OBJECT_CLASS (meta_monitor_tiled_parent_class)->finalize (object);

View File

@@ -24,9 +24,7 @@
#include <glib-object.h>
#include "backends/meta-crtc.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-output.h"
typedef struct _MetaMonitorSpec
{
@@ -95,16 +93,14 @@ G_DECLARE_FINAL_TYPE (MetaMonitorTiled, meta_monitor_tiled,
META, MONITOR_TILED,
MetaMonitor)
MetaMonitorTiled * meta_monitor_tiled_new (MetaGpu *gpu,
MetaOutput *output);
MetaMonitorTiled * meta_monitor_tiled_new (MetaMonitorManager *monitor_manager,
MetaOutput *main_output);
MetaMonitorNormal * meta_monitor_normal_new (MetaGpu *gpu,
MetaOutput *output);
MetaMonitorNormal * meta_monitor_normal_new (MetaMonitorManager *monitor_manager,
MetaOutput *output);
MetaMonitorSpec * meta_monitor_get_spec (MetaMonitor *monitor);
MetaGpu * meta_monitor_get_gpu (MetaMonitor *monitor);
gboolean meta_monitor_is_active (MetaMonitor *monitor);
MetaOutput * meta_monitor_get_main_output (MetaMonitor *monitor);

View File

@@ -1,62 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include "config.h"
#include "backends/meta-output.h"
G_DEFINE_TYPE (MetaOutput, meta_output, G_TYPE_OBJECT)
MetaGpu *
meta_output_get_gpu (MetaOutput *output)
{
return output->gpu;
}
static void
meta_output_finalize (GObject *object)
{
MetaOutput *output = META_OUTPUT (object);
g_free (output->name);
g_free (output->vendor);
g_free (output->product);
g_free (output->serial);
g_free (output->modes);
g_free (output->possible_crtcs);
g_free (output->possible_clones);
if (output->driver_notify)
output->driver_notify (output);
G_OBJECT_CLASS (meta_output_parent_class)->finalize (object);
}
static void
meta_output_init (MetaOutput *output)
{
}
static void
meta_output_class_init (MetaOutputClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
object_class->finalize = meta_output_finalize;
}

View File

@@ -1,124 +0,0 @@
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_OUTPUT_H
#define META_OUTPUT_H
#include <glib-object.h>
#include "backends/meta-gpu.h"
struct _MetaTileInfo
{
guint32 group_id;
guint32 flags;
guint32 max_h_tiles;
guint32 max_v_tiles;
guint32 loc_h_tile;
guint32 loc_v_tile;
guint32 tile_w;
guint32 tile_h;
};
/* This matches the values in drm_mode.h */
typedef enum
{
META_CONNECTOR_TYPE_Unknown = 0,
META_CONNECTOR_TYPE_VGA = 1,
META_CONNECTOR_TYPE_DVII = 2,
META_CONNECTOR_TYPE_DVID = 3,
META_CONNECTOR_TYPE_DVIA = 4,
META_CONNECTOR_TYPE_Composite = 5,
META_CONNECTOR_TYPE_SVIDEO = 6,
META_CONNECTOR_TYPE_LVDS = 7,
META_CONNECTOR_TYPE_Component = 8,
META_CONNECTOR_TYPE_9PinDIN = 9,
META_CONNECTOR_TYPE_DisplayPort = 10,
META_CONNECTOR_TYPE_HDMIA = 11,
META_CONNECTOR_TYPE_HDMIB = 12,
META_CONNECTOR_TYPE_TV = 13,
META_CONNECTOR_TYPE_eDP = 14,
META_CONNECTOR_TYPE_VIRTUAL = 15,
META_CONNECTOR_TYPE_DSI = 16,
} MetaConnectorType;
struct _MetaOutput
{
GObject parent;
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;
char *vendor;
char *product;
char *serial;
int width_mm;
int height_mm;
CoglSubpixelOrder subpixel_order;
MetaConnectorType connector_type;
MetaCrtcMode *preferred_mode;
MetaCrtcMode **modes;
unsigned int n_modes;
MetaCrtc **possible_crtcs;
unsigned int n_possible_crtcs;
MetaOutput **possible_clones;
unsigned int n_possible_clones;
int backlight;
int backlight_min;
int backlight_max;
/* Used when changing configuration */
gboolean is_dirty;
gboolean is_primary;
gboolean is_presentation;
gboolean is_underscanning;
gboolean supports_underscanning;
gpointer driver_private;
GDestroyNotify driver_notify;
/*
* Get a new preferred mode on hotplug events, to handle dynamic guest
* resizing.
*/
gboolean hotplug_mode_update;
gint suggested_x;
gint suggested_y;
MetaTileInfo tile_info;
};
#define META_TYPE_OUTPUT (meta_output_get_type ())
G_DECLARE_FINAL_TYPE (MetaOutput, meta_output, META, OUTPUT, GObject)
MetaGpu * meta_output_get_gpu (MetaOutput *output);
#endif /* META_OUTPUT_H */

View File

@@ -58,10 +58,4 @@ void meta_settings_override_experimental_features (MetaSettings *settings);
void meta_settings_enable_experimental_feature (MetaSettings *settings,
MetaExperimentalFeature feature);
void meta_settings_get_xwayland_grab_patterns (MetaSettings *settings,
GPtrArray **whitelist_patterns,
GPtrArray **blacklist_patterns);
gboolean meta_settings_are_xwayland_grabs_allowed (MetaSettings *settings);
#endif /* META_SETTINGS_PRIVATE_H */

View File

@@ -30,11 +30,6 @@
#include "backends/meta-monitor-manager-private.h"
#include "ui/theme-private.h"
#ifndef XWAYLAND_GRAB_DEFAULT_ACCESS_RULES
# warning "XWAYLAND_GRAB_DEFAULT_ACCESS_RULES is not set"
# define XWAYLAND_GRAB_DEFAULT_ACCESS_RULES ""
#endif
enum
{
UI_SCALING_FACTOR_CHANGED,
@@ -55,7 +50,6 @@ struct _MetaSettings
GSettings *interface_settings;
GSettings *mutter_settings;
GSettings *wayland_settings;
int ui_scaling_factor;
int global_scaling_factor;
@@ -64,10 +58,6 @@ struct _MetaSettings
MetaExperimentalFeature experimental_features;
gboolean experimental_features_overridden;
gboolean xwayland_allow_grabs;
GPtrArray *xwayland_grab_whitelist_patterns;
GPtrArray *xwayland_grab_blacklist_patterns;
};
G_DEFINE_TYPE (MetaSettings, meta_settings, G_TYPE_OBJECT)
@@ -309,105 +299,6 @@ mutter_settings_changed (GSettings *mutter_settings,
(unsigned int) old_experimental_features);
}
static void
xwayland_grab_list_add_item (MetaSettings *settings,
char *item)
{
/* If first character is '!', it's a blacklisted item */
if (item[0] != '!')
g_ptr_array_add (settings->xwayland_grab_whitelist_patterns,
g_pattern_spec_new (item));
else if (item[1] != 0)
g_ptr_array_add (settings->xwayland_grab_blacklist_patterns,
g_pattern_spec_new (&item[1]));
}
static gboolean
xwayland_grab_access_rules_handler (GVariant *variant,
gpointer *result,
gpointer data)
{
MetaSettings *settings = data;
GVariantIter iter;
char *item;
/* Create a GPatternSpec for each element */
g_variant_iter_init (&iter, variant);
while (g_variant_iter_loop (&iter, "s", &item))
xwayland_grab_list_add_item (settings, item);
*result = GINT_TO_POINTER (TRUE);
return TRUE;
}
static void
update_xwayland_grab_access_rules (MetaSettings *settings)
{
gchar **system_defaults;
int i;
/* Free previous patterns and create new arrays */
g_ptr_array_free (settings->xwayland_grab_whitelist_patterns, TRUE);
settings->xwayland_grab_whitelist_patterns =
g_ptr_array_new_with_free_func ((GDestroyNotify) g_pattern_spec_free);
g_ptr_array_free (settings->xwayland_grab_blacklist_patterns, TRUE);
settings->xwayland_grab_blacklist_patterns =
g_ptr_array_new_with_free_func ((GDestroyNotify) g_pattern_spec_free);
/* Add system defaults values */
system_defaults = g_strsplit (XWAYLAND_GRAB_DEFAULT_ACCESS_RULES, ",", -1);
for (i = 0; system_defaults[i]; i++)
xwayland_grab_list_add_item (settings, system_defaults[i]);
g_strfreev (system_defaults);
/* Then add gsettings values */
g_settings_get_mapped (settings->wayland_settings,
"xwayland-grab-access-rules",
xwayland_grab_access_rules_handler,
settings);
}
static void
update_xwayland_allow_grabs (MetaSettings *settings)
{
settings->xwayland_allow_grabs =
g_settings_get_boolean (settings->wayland_settings,
"xwayland-allow-grabs");
}
static void
wayland_settings_changed (GSettings *wayland_settings,
gchar *key,
MetaSettings *settings)
{
if (g_str_equal (key, "xwayland-allow-grabs"))
{
update_xwayland_allow_grabs (settings);
}
else if (g_str_equal (key, "xwayland-grab-access-rules"))
{
update_xwayland_grab_access_rules (settings);
}
}
void
meta_settings_get_xwayland_grab_patterns (MetaSettings *settings,
GPtrArray **whitelist_patterns,
GPtrArray **blacklist_patterns)
{
*whitelist_patterns = settings->xwayland_grab_whitelist_patterns;
*blacklist_patterns = settings->xwayland_grab_blacklist_patterns;
}
gboolean
meta_settings_are_xwayland_grabs_allowed (MetaSettings *settings)
{
return (settings->xwayland_allow_grabs);
}
MetaSettings *
meta_settings_new (MetaBackend *backend)
{
@@ -426,11 +317,6 @@ meta_settings_dispose (GObject *object)
g_clear_object (&settings->mutter_settings);
g_clear_object (&settings->interface_settings);
g_clear_object (&settings->wayland_settings);
g_clear_pointer (&settings->xwayland_grab_whitelist_patterns,
g_ptr_array_unref);
g_clear_pointer (&settings->xwayland_grab_blacklist_patterns,
g_ptr_array_unref);
G_OBJECT_CLASS (meta_settings_parent_class)->dispose (object);
}
@@ -446,10 +332,6 @@ meta_settings_init (MetaSettings *settings)
g_signal_connect (settings->mutter_settings, "changed",
G_CALLBACK (mutter_settings_changed),
settings);
settings->wayland_settings = g_settings_new ("org.gnome.mutter.wayland");
g_signal_connect (settings->wayland_settings, "changed",
G_CALLBACK (wayland_settings_changed),
settings);
/* Chain up inter-dependent settings. */
g_signal_connect (settings, "global-scaling-factor-changed",
@@ -459,8 +341,6 @@ meta_settings_init (MetaSettings *settings)
update_global_scaling_factor (settings);
update_experimental_features (settings);
update_xwayland_grab_access_rules (settings);
update_xwayland_allow_grabs (settings);
}
static void

View File

@@ -51,7 +51,7 @@ common_resolutions = [
output_lines = [
"/* Generated by gen-default-modes.py */\n",
"static const drmModeModeInfo meta_default_drm_mode_infos[] = {",
"const drmModeModeInfo meta_default_drm_mode_infos[] = {",
]
def sync_flags(hsync, vsync):

View File

@@ -67,15 +67,7 @@ struct _MetaBackendNativePrivate
};
typedef struct _MetaBackendNativePrivate MetaBackendNativePrivate;
static GInitableIface *initable_parent_iface;
static void
initable_iface_init (GInitableIface *initable_iface);
G_DEFINE_TYPE_WITH_CODE (MetaBackendNative, meta_backend_native, META_TYPE_BACKEND,
G_ADD_PRIVATE (MetaBackendNative)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
initable_iface_init))
G_DEFINE_TYPE_WITH_PRIVATE (MetaBackendNative, meta_backend_native, META_TYPE_BACKEND);
static void
meta_backend_native_finalize (GObject *object)
@@ -408,33 +400,37 @@ meta_backend_native_create_idle_monitor (MetaBackend *backend,
}
static MetaMonitorManager *
meta_backend_native_create_monitor_manager (MetaBackend *backend,
GError **error)
meta_backend_native_create_monitor_manager (MetaBackend *backend)
{
return g_initable_new (META_TYPE_MONITOR_MANAGER_KMS, NULL, error,
"backend", backend,
NULL);
return g_object_new (META_TYPE_MONITOR_MANAGER_KMS, NULL);
}
static MetaCursorRenderer *
meta_backend_native_create_cursor_renderer (MetaBackend *backend)
{
return META_CURSOR_RENDERER (meta_cursor_renderer_native_new (backend));
return g_object_new (META_TYPE_CURSOR_RENDERER_NATIVE, NULL);
}
static MetaRenderer *
meta_backend_native_create_renderer (MetaBackend *backend,
GError **error)
meta_backend_native_create_renderer (MetaBackend *backend)
{
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
MetaMonitorManagerKms *monitor_manager_kms =
META_MONITOR_MANAGER_KMS (monitor_manager);
MetaBackendNative *native = META_BACKEND_NATIVE (backend);
MetaBackendNativePrivate *priv =
meta_backend_native_get_instance_private (native);
int kms_fd;
const char *kms_file_path;
GError *error = NULL;
MetaRendererNative *renderer_native;
renderer_native = meta_renderer_native_new (monitor_manager_kms, error);
kms_fd = meta_launcher_get_kms_fd (priv->launcher);
kms_file_path = meta_launcher_get_kms_file_path (priv->launcher);
renderer_native = meta_renderer_native_new (kms_fd, kms_file_path, &error);
if (!renderer_native)
return NULL;
{
meta_warning ("Failed to create renderer: %s\n", error->message);
g_error_free (error);
return NULL;
}
return META_RENDERER (renderer_native);
}
@@ -564,34 +560,14 @@ meta_backend_native_update_screen_size (MetaBackend *backend,
ClutterActor *stage = meta_backend_get_stage (backend);
stage_native = meta_clutter_backend_native_get_stage_native (clutter_backend);
meta_stage_native_rebuild_views (stage_native);
if (meta_is_stage_views_enabled ())
meta_stage_native_rebuild_views (stage_native);
else
meta_stage_native_legacy_set_size (stage_native, width, height);
clutter_actor_set_size (stage, width, height);
}
static gboolean
meta_backend_native_initable_init (GInitable *initable,
GCancellable *cancellable,
GError **error)
{
if (!meta_is_stage_views_enabled ())
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"The native backend requires stage views");
return FALSE;
}
return initable_parent_iface->init (initable, cancellable, error);
}
static void
initable_iface_init (GInitableIface *initable_iface)
{
initable_parent_iface = g_type_interface_peek_parent (initable_iface);
initable_iface->init = meta_backend_native_initable_init;
}
static void
meta_backend_native_class_init (MetaBackendNativeClass *klass)
{
@@ -649,23 +625,14 @@ meta_backend_native_init (MetaBackendNative *native)
native);
}
MetaLauncher *
meta_backend_native_get_launcher (MetaBackendNative *native)
{
MetaBackendNativePrivate *priv =
meta_backend_native_get_instance_private (native);
return priv->launcher;
}
gboolean
meta_activate_vt (int vt, GError **error)
{
MetaBackend *backend = meta_get_backend ();
MetaBackendNative *native = META_BACKEND_NATIVE (backend);
MetaLauncher *launcher = meta_backend_native_get_launcher (native);
MetaBackendNativePrivate *priv = meta_backend_native_get_instance_private (native);
return meta_launcher_activate_vt (launcher, vt, error);
return meta_launcher_activate_vt (priv->launcher, vt, error);
}
MetaBarrierManagerNative *

View File

@@ -27,7 +27,6 @@
#include "backends/meta-backend-private.h"
#include "backends/native/meta-clutter-backend-native.h"
#include "backends/native/meta-launcher.h"
#define META_TYPE_BACKEND_NATIVE (meta_backend_native_get_type ())
G_DECLARE_FINAL_TYPE (MetaBackendNative, meta_backend_native,
@@ -39,6 +38,4 @@ void meta_backend_native_pause (MetaBackendNative *backend_native);
void meta_backend_native_resume (MetaBackendNative *backend_native);
MetaLauncher * meta_backend_native_get_launcher (MetaBackendNative *native);
#endif /* META_BACKEND_NATIVE_H */

View File

@@ -32,7 +32,6 @@
#include "backends/native/meta-stage-native.h"
#include "clutter/clutter.h"
#include "meta/meta-backend.h"
#include "core/bell.h"
struct _MetaClutterBackendNative
{
@@ -80,14 +79,6 @@ meta_clutter_backend_native_create_stage (ClutterBackend *backend,
return CLUTTER_STAGE_WINDOW (clutter_backend_native->stage_native);
}
static void
meta_clutter_backend_native_bell_notify (ClutterBackend *backend)
{
MetaDisplay *display = meta_get_display ();
meta_bell_notify (display, NULL);
}
static void
meta_clutter_backend_native_init (MetaClutterBackendNative *clutter_backend_nativen)
{
@@ -100,5 +91,4 @@ meta_clutter_backend_native_class_init (MetaClutterBackendNativeClass *klass)
clutter_backend_class->get_renderer = meta_clutter_backend_native_get_renderer;
clutter_backend_class->create_stage = meta_clutter_backend_native_create_stage;
clutter_backend_class->bell_notify = meta_clutter_backend_native_bell_notify;
}

View File

@@ -1,365 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2013-2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include "config.h"
#include "backends/native/meta-crtc-kms.h"
#include "backends/meta-backend-private.h"
#include "backends/native/meta-gpu-kms.h"
#define ALL_TRANSFORMS (META_MONITOR_TRANSFORM_FLIPPED_270 + 1)
#define ALL_TRANSFORMS_MASK ((1 << ALL_TRANSFORMS) - 1)
typedef struct _MetaCrtcKms
{
unsigned int index;
uint32_t underscan_prop_id;
uint32_t underscan_hborder_prop_id;
uint32_t underscan_vborder_prop_id;
uint32_t primary_plane_id;
uint32_t rotation_prop_id;
uint32_t rotation_map[ALL_TRANSFORMS];
uint32_t all_hw_transforms;
} MetaCrtcKms;
gboolean
meta_crtc_kms_is_transform_handled (MetaCrtc *crtc,
MetaMonitorTransform transform)
{
MetaCrtcKms *crtc_kms = crtc->driver_private;
if ((1 << transform) & crtc_kms->all_hw_transforms)
return TRUE;
else
return FALSE;
}
void
meta_crtc_kms_apply_transform (MetaCrtc *crtc)
{
MetaCrtcKms *crtc_kms = crtc->driver_private;
MetaGpu *gpu = meta_crtc_get_gpu (crtc);
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
int kms_fd;
MetaMonitorTransform hw_transform;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
if (crtc_kms->all_hw_transforms & (1 << crtc->transform))
hw_transform = crtc->transform;
else
hw_transform = META_MONITOR_TRANSFORM_NORMAL;
if (!meta_crtc_kms_is_transform_handled (crtc, META_MONITOR_TRANSFORM_NORMAL))
return;
if (drmModeObjectSetProperty (kms_fd,
crtc_kms->primary_plane_id,
DRM_MODE_OBJECT_PLANE,
crtc_kms->rotation_prop_id,
crtc_kms->rotation_map[hw_transform]) != 0)
{
g_warning ("Failed to apply DRM plane transform %d: %m", hw_transform);
/*
* Blacklist this HW transform, we want to fallback to our
* fallbacks in this case.
*/
crtc_kms->all_hw_transforms &= ~(1 << hw_transform);
}
}
void
meta_crtc_kms_set_underscan (MetaCrtc *crtc,
gboolean is_underscanning)
{
MetaCrtcKms *crtc_kms = crtc->driver_private;
MetaGpu *gpu = meta_crtc_get_gpu (crtc);
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
int kms_fd;
if (!crtc_kms->underscan_prop_id)
return;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
if (is_underscanning)
{
drmModeObjectSetProperty (kms_fd, crtc->crtc_id,
DRM_MODE_OBJECT_CRTC,
crtc_kms->underscan_prop_id, (uint64_t) 1);
if (crtc_kms->underscan_hborder_prop_id)
{
uint64_t value;
value = crtc->current_mode->width * 0.05;
drmModeObjectSetProperty (kms_fd, crtc->crtc_id,
DRM_MODE_OBJECT_CRTC,
crtc_kms->underscan_hborder_prop_id, value);
}
if (crtc_kms->underscan_vborder_prop_id)
{
uint64_t value;
value = crtc->current_mode->height * 0.05;
drmModeObjectSetProperty (kms_fd, crtc->crtc_id,
DRM_MODE_OBJECT_CRTC,
crtc_kms->underscan_vborder_prop_id, value);
}
}
else
{
drmModeObjectSetProperty (kms_fd, crtc->crtc_id,
DRM_MODE_OBJECT_CRTC,
crtc_kms->underscan_prop_id, (uint64_t) 0);
}
}
static int
find_property_index (MetaGpu *gpu,
drmModeObjectPropertiesPtr props,
const char *prop_name,
drmModePropertyPtr *out_prop)
{
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
int kms_fd;
unsigned int i;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
for (i = 0; i < props->count_props; i++)
{
drmModePropertyPtr prop;
prop = drmModeGetProperty (kms_fd, props->props[i]);
if (!prop)
continue;
if (strcmp (prop->name, prop_name) == 0)
{
*out_prop = prop;
return i;
}
drmModeFreeProperty (prop);
}
return -1;
}
static void
parse_transforms (MetaCrtc *crtc,
drmModePropertyPtr prop)
{
MetaCrtcKms *crtc_kms = crtc->driver_private;
int i;
for (i = 0; i < prop->count_enums; i++)
{
int transform = -1;
if (strcmp (prop->enums[i].name, "rotate-0") == 0)
transform = META_MONITOR_TRANSFORM_NORMAL;
else if (strcmp (prop->enums[i].name, "rotate-90") == 0)
transform = META_MONITOR_TRANSFORM_90;
else if (strcmp (prop->enums[i].name, "rotate-180") == 0)
transform = META_MONITOR_TRANSFORM_180;
else if (strcmp (prop->enums[i].name, "rotate-270") == 0)
transform = META_MONITOR_TRANSFORM_270;
if (transform != -1)
{
crtc_kms->all_hw_transforms |= 1 << transform;
crtc_kms->rotation_map[transform] = 1 << prop->enums[i].value;
}
}
}
static gboolean
is_primary_plane (MetaGpu *gpu,
drmModeObjectPropertiesPtr props)
{
drmModePropertyPtr prop;
int idx;
idx = find_property_index (gpu, props, "type", &prop);
if (idx < 0)
return FALSE;
drmModeFreeProperty (prop);
return props->prop_values[idx] == DRM_PLANE_TYPE_PRIMARY;
}
static void
init_crtc_rotations (MetaCrtc *crtc,
MetaGpu *gpu)
{
MetaCrtcKms *crtc_kms = crtc->driver_private;
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
int kms_fd;
drmModeObjectPropertiesPtr props;
drmModePlaneRes *planes;
drmModePlane *drm_plane;
unsigned int i;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
planes = drmModeGetPlaneResources (kms_fd);
if (planes == NULL)
return;
for (i = 0; i < planes->count_planes; i++)
{
drmModePropertyPtr prop;
drm_plane = drmModeGetPlane (kms_fd, planes->planes[i]);
if (!drm_plane)
continue;
if ((drm_plane->possible_crtcs & (1 << crtc_kms->index)))
{
props = drmModeObjectGetProperties (kms_fd,
drm_plane->plane_id,
DRM_MODE_OBJECT_PLANE);
if (props && is_primary_plane (gpu, props))
{
int rotation_idx;
crtc_kms->primary_plane_id = drm_plane->plane_id;
rotation_idx = find_property_index (gpu, props,
"rotation", &prop);
if (rotation_idx >= 0)
{
crtc_kms->rotation_prop_id = props->props[rotation_idx];
parse_transforms (crtc, prop);
drmModeFreeProperty (prop);
}
}
if (props)
drmModeFreeObjectProperties (props);
}
drmModeFreePlane (drm_plane);
}
crtc->all_transforms |= crtc_kms->all_hw_transforms;
drmModeFreePlaneResources (planes);
}
static void
find_crtc_properties (MetaCrtc *crtc,
MetaGpuKms *gpu_kms)
{
MetaCrtcKms *crtc_kms = crtc->driver_private;
int kms_fd;
drmModeObjectPropertiesPtr props;
unsigned int i;
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
props = drmModeObjectGetProperties (kms_fd, crtc->crtc_id,
DRM_MODE_OBJECT_CRTC);
if (!props)
return;
for (i = 0; i < props->count_props; i++)
{
drmModePropertyPtr prop = drmModeGetProperty (kms_fd, props->props[i]);
if (!prop)
continue;
if ((prop->flags & DRM_MODE_PROP_ENUM) &&
strcmp (prop->name, "underscan") == 0)
crtc_kms->underscan_prop_id = prop->prop_id;
else if ((prop->flags & DRM_MODE_PROP_RANGE) &&
strcmp (prop->name, "underscan hborder") == 0)
crtc_kms->underscan_hborder_prop_id = prop->prop_id;
else if ((prop->flags & DRM_MODE_PROP_RANGE) &&
strcmp (prop->name, "underscan vborder") == 0)
crtc_kms->underscan_vborder_prop_id = prop->prop_id;
drmModeFreeProperty (prop);
}
drmModeFreeObjectProperties (props);
}
static void
meta_crtc_destroy_notify (MetaCrtc *crtc)
{
g_free (crtc->driver_private);
}
MetaCrtc *
meta_create_kms_crtc (MetaGpuKms *gpu_kms,
drmModeCrtc *drm_crtc,
unsigned int crtc_index)
{
MetaGpu *gpu = META_GPU (gpu_kms);
MetaCrtc *crtc;
MetaCrtcKms *crtc_kms;
crtc = g_object_new (META_TYPE_CRTC, NULL);
crtc->gpu = gpu;
crtc->crtc_id = drm_crtc->crtc_id;
crtc->rect.x = drm_crtc->x;
crtc->rect.y = drm_crtc->y;
crtc->rect.width = drm_crtc->width;
crtc->rect.height = drm_crtc->height;
crtc->is_dirty = FALSE;
crtc->transform = META_MONITOR_TRANSFORM_NORMAL;
crtc->all_transforms = meta_is_stage_views_enabled () ?
ALL_TRANSFORMS_MASK : META_MONITOR_TRANSFORM_NORMAL;
if (drm_crtc->mode_valid)
{
GList *l;
for (l = meta_gpu_get_modes (gpu); l; l = l->next)
{
MetaCrtcMode *mode = l->data;
if (meta_drm_mode_equal (&drm_crtc->mode, mode->driver_private))
{
crtc->current_mode = mode;
break;
}
}
}
crtc_kms = g_new0 (MetaCrtcKms, 1);
crtc_kms->index = crtc_index;
crtc->driver_private = crtc_kms;
crtc->driver_notify = (GDestroyNotify) meta_crtc_destroy_notify;
find_crtc_properties (crtc, gpu_kms);
init_crtc_rotations (crtc, gpu);
return crtc;
}

View File

@@ -1,44 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_CRTC_KMS_H
#define META_CRTC_KMS_H
#include <xf86drm.h>
#include <xf86drmMode.h>
#include "backends/meta-crtc.h"
#include "backends/meta-gpu.h"
#include "backends/native/meta-gpu-kms.h"
gboolean meta_crtc_kms_is_transform_handled (MetaCrtc *crtc,
MetaMonitorTransform transform);
void meta_crtc_kms_apply_transform (MetaCrtc *crtc);
void meta_crtc_kms_set_underscan (MetaCrtc *crtc,
gboolean is_underscanning);
MetaCrtc * meta_create_kms_crtc (MetaGpuKms *gpu_kms,
drmModeCrtc *drm_crtc,
unsigned int crtc_index);
#endif /* META_CRTC_KMS_H */

View File

@@ -38,7 +38,6 @@
#include "backends/meta-logical-monitor.h"
#include "backends/meta-monitor.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-output.h"
#include "backends/native/meta-renderer-native.h"
#include "core/boxes-private.h"
#include "meta/boxes.h"
@@ -65,30 +64,22 @@
static GQuark quark_cursor_sprite = 0;
struct _MetaCursorRendererNative
{
MetaCursorRenderer parent;
};
struct _MetaCursorRendererNativePrivate
{
MetaMonitorManager *monitor_manager;
gboolean hw_state_invalidated;
gboolean has_hw_cursor;
gboolean hw_cursor_broken;
MetaCursorSprite *last_cursor;
guint animation_timeout_id;
};
typedef struct _MetaCursorRendererNativePrivate MetaCursorRendererNativePrivate;
typedef struct _MetaCursorRendererNativeGpuData
{
gboolean hw_cursor_broken;
int drm_fd;
struct gbm_device *gbm;
uint64_t cursor_width;
uint64_t cursor_height;
} MetaCursorRendererNativeGpuData;
};
typedef struct _MetaCursorRendererNativePrivate MetaCursorRendererNativePrivate;
typedef enum _MetaCursorGbmBoState
{
@@ -97,57 +88,18 @@ typedef enum _MetaCursorGbmBoState
META_CURSOR_GBM_BO_STATE_INVALIDATED,
} MetaCursorGbmBoState;
typedef struct _MetaCursorNativeGpuState
typedef struct _MetaCursorNativePrivate
{
guint active_bo;
MetaCursorGbmBoState pending_bo_state;
struct gbm_bo *bos[HW_CURSOR_BUFFER_COUNT];
} MetaCursorNativeGpuState;
typedef struct _MetaCursorNativePrivate
{
GHashTable *gpu_states;
} MetaCursorNativePrivate;
static GQuark quark_cursor_renderer_native_gpu_data = 0;
G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRendererNative, meta_cursor_renderer_native, META_TYPE_CURSOR_RENDERER);
static MetaCursorNativeGpuState *
get_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
MetaGpuKms *gpu_kms);
static MetaCursorNativeGpuState *
ensure_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
MetaGpuKms *gpu_kms);
static MetaCursorNativePrivate *
ensure_cursor_priv (MetaCursorSprite *cursor_sprite);
static MetaCursorNativePrivate *
get_cursor_priv (MetaCursorSprite *cursor_sprite);
static MetaCursorRendererNativeGpuData *
meta_cursor_renderer_native_gpu_data_from_gpu (MetaGpuKms *gpu_kms)
{
return g_object_get_qdata (G_OBJECT (gpu_kms),
quark_cursor_renderer_native_gpu_data);
}
static MetaCursorRendererNativeGpuData *
meta_create_cursor_renderer_native_gpu_data (MetaGpuKms *gpu_kms)
{
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
cursor_renderer_gpu_data = g_new0 (MetaCursorRendererNativeGpuData, 1);
g_object_set_qdata_full (G_OBJECT (gpu_kms),
quark_cursor_renderer_native_gpu_data,
cursor_renderer_gpu_data,
g_free);
return cursor_renderer_gpu_data;
}
static void
meta_cursor_renderer_native_finalize (GObject *object)
{
@@ -161,41 +113,52 @@ meta_cursor_renderer_native_finalize (GObject *object)
}
static guint
get_pending_cursor_sprite_gbm_bo_index (MetaCursorNativeGpuState *cursor_gpu_state)
get_pending_cursor_sprite_gbm_bo_index (MetaCursorSprite *cursor_sprite)
{
return (cursor_gpu_state->active_bo + 1) % HW_CURSOR_BUFFER_COUNT;
MetaCursorNativePrivate *cursor_priv =
g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
return (cursor_priv->active_bo + 1) % HW_CURSOR_BUFFER_COUNT;
}
static struct gbm_bo *
get_pending_cursor_sprite_gbm_bo (MetaCursorNativeGpuState *cursor_gpu_state)
get_pending_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite)
{
MetaCursorNativePrivate *cursor_priv =
g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
guint pending_bo;
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_gpu_state);
return cursor_gpu_state->bos[pending_bo];
if (!cursor_priv)
return NULL;
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_sprite);
return cursor_priv->bos[pending_bo];
}
static struct gbm_bo *
get_active_cursor_sprite_gbm_bo (MetaCursorNativeGpuState *cursor_gpu_state)
get_active_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite)
{
return cursor_gpu_state->bos[cursor_gpu_state->active_bo];
MetaCursorNativePrivate *cursor_priv =
g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
if (!cursor_priv)
return NULL;
return cursor_priv->bos[cursor_priv->active_bo];
}
static void
set_pending_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite,
MetaGpuKms *gpu_kms,
struct gbm_bo *bo)
{
MetaCursorNativePrivate *cursor_priv;
MetaCursorNativeGpuState *cursor_gpu_state;
guint pending_bo;
cursor_priv = ensure_cursor_priv (cursor_sprite);
cursor_gpu_state = ensure_cursor_gpu_state (cursor_priv, gpu_kms);
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_gpu_state);
cursor_gpu_state->bos[pending_bo] = bo;
cursor_gpu_state->pending_bo_state = META_CURSOR_GBM_BO_STATE_SET;
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_sprite);
cursor_priv->bos[pending_bo] = bo;
cursor_priv->pending_bo_state = META_CURSOR_GBM_BO_STATE_SET;
}
static void
@@ -204,30 +167,19 @@ set_crtc_cursor (MetaCursorRendererNative *native,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
MetaGpuKms *gpu_kms;
int kms_fd;
gpu_kms = META_GPU_KMS (meta_crtc_get_gpu (crtc));
cursor_renderer_gpu_data =
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
if (cursor_sprite)
{
MetaCursorNativePrivate *cursor_priv;
MetaCursorNativeGpuState *cursor_gpu_state;
MetaCursorNativePrivate *cursor_priv =
g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
struct gbm_bo *bo;
union gbm_bo_handle handle;
int hot_x, hot_y;
cursor_priv = get_cursor_priv (cursor_sprite);
cursor_gpu_state = get_cursor_gpu_state (cursor_priv, gpu_kms);
if (cursor_gpu_state->pending_bo_state == META_CURSOR_GBM_BO_STATE_SET)
bo = get_pending_cursor_sprite_gbm_bo (cursor_gpu_state);
if (cursor_priv->pending_bo_state == META_CURSOR_GBM_BO_STATE_SET)
bo = get_pending_cursor_sprite_gbm_bo (cursor_sprite);
else
bo = get_active_cursor_sprite_gbm_bo (cursor_gpu_state);
bo = get_active_cursor_sprite_gbm_bo (cursor_sprite);
if (!priv->hw_state_invalidated && bo == crtc->cursor_renderer_private)
return;
@@ -237,33 +189,29 @@ set_crtc_cursor (MetaCursorRendererNative *native,
handle = gbm_bo_get_handle (bo);
meta_cursor_sprite_get_hotspot (cursor_sprite, &hot_x, &hot_y);
if (drmModeSetCursor2 (kms_fd, crtc->crtc_id, handle.u32,
cursor_renderer_gpu_data->cursor_width,
cursor_renderer_gpu_data->cursor_height,
if (drmModeSetCursor2 (priv->drm_fd, crtc->crtc_id, handle.u32,
priv->cursor_width, priv->cursor_height,
hot_x, hot_y) < 0)
{
if (errno != EACCES)
{
g_warning ("drmModeSetCursor2 failed with (%s), "
"drawing cursor with OpenGL from now on",
strerror (errno));
priv->has_hw_cursor = FALSE;
cursor_renderer_gpu_data->hw_cursor_broken = TRUE;
}
g_warning ("drmModeSetCursor2 failed with (%s), "
"drawing cursor with OpenGL from now on",
strerror (errno));
priv->has_hw_cursor = FALSE;
priv->hw_cursor_broken = TRUE;
}
if (cursor_gpu_state->pending_bo_state == META_CURSOR_GBM_BO_STATE_SET)
if (cursor_priv->pending_bo_state == META_CURSOR_GBM_BO_STATE_SET)
{
cursor_gpu_state->active_bo =
(cursor_gpu_state->active_bo + 1) % HW_CURSOR_BUFFER_COUNT;
cursor_gpu_state->pending_bo_state = META_CURSOR_GBM_BO_STATE_NONE;
cursor_priv->active_bo =
(cursor_priv->active_bo + 1) % HW_CURSOR_BUFFER_COUNT;
cursor_priv->pending_bo_state = META_CURSOR_GBM_BO_STATE_NONE;
}
}
else
{
if (priv->hw_state_invalidated || crtc->cursor_renderer_private != NULL)
{
drmModeSetCursor2 (kms_fd, crtc->crtc_id, 0, 0, 0, 0, 0);
drmModeSetCursor2 (priv->drm_fd, crtc->crtc_id, 0, 0, 0, 0, 0);
crtc->cursor_renderer_private = NULL;
}
}
@@ -321,21 +269,17 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
&data->in_local_cursor_rect,
NULL))
{
MetaGpuKms *gpu_kms;
int kms_fd;
float crtc_cursor_x, crtc_cursor_y;
set_crtc_cursor (data->in_cursor_renderer_native,
monitor_crtc_mode->output->crtc,
data->in_cursor_sprite);
gpu_kms = META_GPU_KMS (meta_monitor_get_gpu (monitor));
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
crtc_cursor_x = (data->in_local_cursor_rect.origin.x -
scaled_crtc_rect.origin.x) * scale;
crtc_cursor_y = (data->in_local_cursor_rect.origin.y -
scaled_crtc_rect.origin.y) * scale;
drmModeMoveCursor (kms_fd,
drmModeMoveCursor (priv->drm_fd,
monitor_crtc_mode->output->crtc->crtc_id,
roundf (crtc_cursor_x),
roundf (crtc_cursor_y));
@@ -357,7 +301,9 @@ update_hw_cursor (MetaCursorRendererNative *native,
{
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
MetaCursorRenderer *renderer = META_CURSOR_RENDERER (native);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
GList *logical_monitors;
GList *l;
ClutterRect rect;
@@ -413,24 +359,18 @@ update_hw_cursor (MetaCursorRendererNative *native,
}
static gboolean
has_valid_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite,
MetaGpuKms *gpu_kms)
has_valid_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite)
{
MetaCursorNativePrivate *cursor_priv;
MetaCursorNativeGpuState *cursor_gpu_state;
MetaCursorNativePrivate *cursor_priv =
g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
cursor_priv = get_cursor_priv (cursor_sprite);
if (!cursor_priv)
return FALSE;
cursor_gpu_state = get_cursor_gpu_state (cursor_priv, gpu_kms);
if (!cursor_gpu_state)
return FALSE;
switch (cursor_gpu_state->pending_bo_state)
switch (cursor_priv->pending_bo_state)
{
case META_CURSOR_GBM_BO_STATE_NONE:
return get_active_cursor_sprite_gbm_bo (cursor_gpu_state) != NULL;
return get_active_cursor_sprite_gbm_bo (cursor_sprite) != NULL;
case META_CURSOR_GBM_BO_STATE_SET:
return TRUE;
case META_CURSOR_GBM_BO_STATE_INVALIDATED:
@@ -446,17 +386,14 @@ static gboolean
cursor_over_transformed_logical_monitor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNative *cursor_renderer_native =
META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
MetaBackend *backend = meta_get_backend ();
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
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)
@@ -495,11 +432,8 @@ static gboolean
can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite)
{
MetaCursorRendererNative *cursor_renderer_native =
META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
MetaMonitorManager *monitor_manager = priv->monitor_manager;
MetaBackend *backend;
MetaMonitorManager *monitor_manager;
ClutterRect cursor_rect;
GList *logical_monitors;
GList *l;
@@ -508,6 +442,8 @@ can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
if (!meta_is_stage_views_scaled ())
return meta_cursor_sprite_get_texture_scale (cursor_sprite) == 1.0;
backend = meta_get_backend ();
monitor_manager = meta_backend_get_monitor_manager (backend);
logical_monitors =
meta_monitor_manager_get_logical_monitors (monitor_manager);
@@ -543,31 +479,14 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
GList *gpus;
GList *l;
CoglTexture *texture;
if (priv->hw_cursor_broken)
return FALSE;
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;
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
cursor_renderer_gpu_data =
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
if (!cursor_renderer_gpu_data)
return FALSE;
if (cursor_renderer_gpu_data->hw_cursor_broken)
return FALSE;
if (!has_valid_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms))
return FALSE;
}
if (cursor_over_transformed_logical_monitor (renderer, cursor_sprite))
return FALSE;
@@ -578,6 +497,9 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
if (!can_draw_cursor_unscaled (renderer, cursor_sprite))
return FALSE;
if (!has_valid_cursor_sprite_gbm_bo (cursor_sprite))
return FALSE;
return TRUE;
}
@@ -649,94 +571,62 @@ meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *renderer,
}
static void
cursor_gpu_state_free (MetaCursorNativeGpuState *cursor_gpu_state)
get_hardware_cursor_size (MetaCursorRendererNative *native,
uint64_t *width, uint64_t *height)
{
int i;
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
for (i = 0; i < HW_CURSOR_BUFFER_COUNT; i++)
g_clear_pointer (&cursor_gpu_state->bos[i], (GDestroyNotify) gbm_bo_destroy);
g_free (cursor_gpu_state);
}
static MetaCursorNativeGpuState *
get_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
MetaGpuKms *gpu_kms)
{
return g_hash_table_lookup (cursor_priv->gpu_states, gpu_kms);
}
static MetaCursorNativeGpuState *
ensure_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
MetaGpuKms *gpu_kms)
{
MetaCursorNativeGpuState *cursor_gpu_state;
cursor_gpu_state = get_cursor_gpu_state (cursor_priv, gpu_kms);
if (cursor_gpu_state)
return cursor_gpu_state;
cursor_gpu_state = g_new0 (MetaCursorNativeGpuState, 1);
g_hash_table_insert (cursor_priv->gpu_states, gpu_kms, cursor_gpu_state);
return cursor_gpu_state;
*width = priv->cursor_width;
*height = priv->cursor_height;
}
static void
cursor_priv_free (MetaCursorNativePrivate *cursor_priv)
cursor_priv_free (gpointer data)
{
g_hash_table_destroy (cursor_priv->gpu_states);
}
MetaCursorNativePrivate *cursor_priv = data;
guint i;
static MetaCursorNativePrivate *
get_cursor_priv (MetaCursorSprite *cursor_sprite)
{
return g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
if (!data)
return;
for (i = 0; i < HW_CURSOR_BUFFER_COUNT; i++)
g_clear_pointer (&cursor_priv->bos[0], (GDestroyNotify) gbm_bo_destroy);
g_slice_free (MetaCursorNativePrivate, cursor_priv);
}
static MetaCursorNativePrivate *
ensure_cursor_priv (MetaCursorSprite *cursor_sprite)
{
MetaCursorNativePrivate *cursor_priv;
MetaCursorNativePrivate *cursor_priv =
g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
cursor_priv = get_cursor_priv (cursor_sprite);
if (cursor_priv)
return cursor_priv;
cursor_priv = g_new0 (MetaCursorNativePrivate, 1);
cursor_priv->gpu_states =
g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
(GDestroyNotify) cursor_gpu_state_free);
g_object_set_qdata_full (G_OBJECT (cursor_sprite),
quark_cursor_sprite,
cursor_priv,
(GDestroyNotify) cursor_priv_free);
if (!cursor_priv)
{
cursor_priv = g_slice_new0 (MetaCursorNativePrivate);
g_object_set_qdata_full (G_OBJECT (cursor_sprite),
quark_cursor_sprite,
cursor_priv,
cursor_priv_free);
}
return cursor_priv;
}
static void
load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite,
uint8_t *pixels,
uint width,
uint height,
int rowstride,
uint32_t gbm_format)
load_cursor_sprite_gbm_buffer (MetaCursorRendererNative *native,
MetaCursorSprite *cursor_sprite,
uint8_t *pixels,
uint width,
uint height,
int rowstride,
uint32_t gbm_format)
{
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
uint64_t cursor_width, cursor_height;
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
struct gbm_device *gbm_device;
cursor_renderer_gpu_data =
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
if (!cursor_renderer_gpu_data)
return;
cursor_width = (uint64_t) cursor_renderer_gpu_data->cursor_width;
cursor_height = (uint64_t) cursor_renderer_gpu_data->cursor_height;
get_hardware_cursor_size (native, &cursor_width, &cursor_height);
if (width > cursor_width || height > cursor_height)
{
@@ -745,15 +635,14 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
return;
}
gbm_device = meta_gbm_device_from_gpu (gpu_kms);
if (gbm_device_is_format_supported (gbm_device, gbm_format,
if (gbm_device_is_format_supported (priv->gbm, gbm_format,
GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE))
{
struct gbm_bo *bo;
uint8_t buf[4 * cursor_width * cursor_height];
uint i;
bo = gbm_bo_create (gbm_device, cursor_width, cursor_height,
bo = gbm_bo_create (priv->gbm, cursor_width, cursor_height,
gbm_format, GBM_BO_USE_CURSOR | GBM_BO_USE_WRITE);
if (!bo)
{
@@ -772,7 +661,7 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
return;
}
set_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms, bo);
set_pending_cursor_sprite_gbm_bo (cursor_sprite, bo);
}
else
{
@@ -781,50 +670,42 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
}
static void
invalidate_pending_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite,
MetaGpuKms *gpu_kms)
invalidate_pending_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite)
{
MetaCursorNativePrivate *cursor_priv;
MetaCursorNativeGpuState *cursor_gpu_state;
MetaCursorNativePrivate *cursor_priv =
g_object_get_qdata (G_OBJECT (cursor_sprite), quark_cursor_sprite);
guint pending_bo;
cursor_priv = get_cursor_priv (cursor_sprite);
if (!cursor_priv)
return;
cursor_gpu_state = get_cursor_gpu_state (cursor_priv, gpu_kms);
if (!cursor_gpu_state)
return;
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_gpu_state);
g_clear_pointer (&cursor_gpu_state->bos[pending_bo],
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_sprite);
g_clear_pointer (&cursor_priv->bos[pending_bo],
(GDestroyNotify) gbm_bo_destroy);
cursor_gpu_state->pending_bo_state = META_CURSOR_GBM_BO_STATE_INVALIDATED;
cursor_priv->pending_bo_state = META_CURSOR_GBM_BO_STATE_INVALIDATED;
}
#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)
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);
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
uint32_t gbm_format;
uint64_t cursor_width, cursor_height;
CoglTexture *texture;
uint width, height;
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)
if (!priv->gbm || priv->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);
invalidate_pending_cursor_sprite_gbm_bo (cursor_sprite);
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
width = cogl_texture_get_width (texture);
@@ -861,18 +742,16 @@ meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRen
}
buffer_data = wl_shm_buffer_get_data (shm_buffer);
load_cursor_sprite_gbm_buffer_for_gpu (native,
gpu_kms,
cursor_sprite,
buffer_data,
width, height, rowstride,
gbm_format);
load_cursor_sprite_gbm_buffer (native,
cursor_sprite,
buffer_data,
width, height, rowstride,
gbm_format);
wl_shm_buffer_end_access (shm_buffer);
}
else
{
struct gbm_device *gbm_device;
struct gbm_bo *bo;
/* HW cursors have a predefined size (at least 64x64), which usually is
@@ -881,8 +760,7 @@ meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRen
* access to the data, but it's not possible if the buffer is in GPU
* memory (and possibly tiled too), so if we don't get the right size, we
* fallback to GL. */
cursor_width = (uint64_t) cursor_renderer_gpu_data->cursor_width;
cursor_height = (uint64_t) cursor_renderer_gpu_data->cursor_height;
get_hardware_cursor_size (native, &cursor_width, &cursor_height);
if (width != cursor_width || height != cursor_height)
{
@@ -890,8 +768,7 @@ meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRen
return;
}
gbm_device = meta_gbm_device_from_gpu (gpu_kms);
bo = gbm_bo_import (gbm_device,
bo = gbm_bo_import (priv->gbm,
GBM_BO_IMPORT_WL_BUFFER,
buffer,
GBM_BO_USE_CURSOR);
@@ -901,83 +778,32 @@ meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRen
return;
}
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);
set_pending_cursor_sprite_gbm_bo (cursor_sprite, bo);
}
}
#endif
static void
meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
MetaGpuKms *gpu_kms,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
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);
load_cursor_sprite_gbm_buffer_for_gpu (native,
gpu_kms,
cursor_sprite,
(uint8_t *) xc_image->pixels,
xc_image->width,
xc_image->height,
xc_image->width * 4,
GBM_FORMAT_ARGB8888);
}
static void
meta_cursor_renderer_native_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
MetaCursorSprite *cursor_sprite,
XcursorImage *xc_image)
{
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (native);
GList *gpus;
GList *l;
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
for (l = gpus; l; l = l->next)
{
MetaGpuKms *gpu_kms = l->data;
if (!priv->gbm || priv->hw_cursor_broken)
return;
meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (
renderer,
gpu_kms,
cursor_sprite,
xc_image);
}
invalidate_pending_cursor_sprite_gbm_bo (cursor_sprite);
load_cursor_sprite_gbm_buffer (native,
cursor_sprite,
(uint8_t *) xc_image->pixels,
xc_image->width,
xc_image->height,
xc_image->width * 4,
GBM_FORMAT_ARGB8888);
}
static void
@@ -996,8 +822,6 @@ meta_cursor_renderer_native_class_init (MetaCursorRendererNativeClass *klass)
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 =
g_quark_from_static_string ("-meta-cursor-renderer-native-gpu-data");
}
static void
@@ -1020,72 +844,49 @@ on_monitors_changed (MetaMonitorManager *monitors,
}
static void
init_hw_cursor_support (MetaCursorRendererNative *cursor_renderer_native)
meta_cursor_renderer_native_init (MetaCursorRendererNative *native)
{
MetaCursorRendererNativePrivate *priv =
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
GList *gpus;
GList *l;
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
MetaMonitorManager *monitors;
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
for (l = gpus; l; l = l->next)
monitors = meta_monitor_manager_get ();
g_signal_connect_object (monitors, "monitors-changed-internal",
G_CALLBACK (on_monitors_changed), native, 0);
priv->hw_state_invalidated = TRUE;
#if defined(CLUTTER_WINDOWING_EGL)
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_EGL))
{
MetaGpuKms *gpu_kms = l->data;
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
int kms_fd;
struct gbm_device *gbm_device;
MetaBackend *backend = meta_get_backend ();
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
priv->drm_fd = meta_renderer_native_get_kms_fd (renderer_native);
priv->gbm = meta_renderer_native_get_gbm (renderer_native);
uint64_t width, height;
gbm_device = meta_gbm_device_from_gpu (gpu_kms);
if (!gbm_device)
continue;
cursor_renderer_gpu_data =
meta_create_cursor_renderer_native_gpu_data (gpu_kms);
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
if (drmGetCap (kms_fd, DRM_CAP_CURSOR_WIDTH, &width) == 0 &&
drmGetCap (kms_fd, DRM_CAP_CURSOR_HEIGHT, &height) == 0)
if (drmGetCap (priv->drm_fd, DRM_CAP_CURSOR_WIDTH, &width) == 0 &&
drmGetCap (priv->drm_fd, DRM_CAP_CURSOR_HEIGHT, &height) == 0)
{
cursor_renderer_gpu_data->cursor_width = width;
cursor_renderer_gpu_data->cursor_height = height;
priv->cursor_width = width;
priv->cursor_height = height;
}
else
{
cursor_renderer_gpu_data->cursor_width = 64;
cursor_renderer_gpu_data->cursor_height = 64;
priv->cursor_width = 64;
priv->cursor_height = 64;
}
}
#endif
}
MetaCursorRendererNative *
meta_cursor_renderer_native_new (MetaBackend *backend)
struct gbm_device *
meta_cursor_renderer_native_get_gbm_device (MetaCursorRendererNative *native)
{
MetaMonitorManager *monitor_manager =
meta_backend_get_monitor_manager (backend);
MetaCursorRendererNative *cursor_renderer_native;
MetaCursorRendererNativePrivate *priv;
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
cursor_renderer_native =
g_object_new (META_TYPE_CURSOR_RENDERER_NATIVE, NULL);
priv =
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
g_signal_connect_object (monitor_manager, "monitors-changed-internal",
G_CALLBACK (on_monitors_changed),
cursor_renderer_native, 0);
priv->monitor_manager = monitor_manager;
priv->hw_state_invalidated = TRUE;
init_hw_cursor_support (cursor_renderer_native);
return cursor_renderer_native;
}
static void
meta_cursor_renderer_native_init (MetaCursorRendererNative *native)
{
return priv->gbm;
}
void

View File

@@ -27,13 +27,30 @@
#include "meta-cursor-renderer.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)
#define META_TYPE_CURSOR_RENDERER_NATIVE (meta_cursor_renderer_native_get_type ())
#define META_CURSOR_RENDERER_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_CURSOR_RENDERER_NATIVE, MetaCursorRendererNative))
#define META_CURSOR_RENDERER_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_CURSOR_RENDERER_NATIVE, MetaCursorRendererNativeClass))
#define META_IS_CURSOR_RENDERER_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_CURSOR_RENDERER_NATIVE))
#define META_IS_CURSOR_RENDERER_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_CURSOR_RENDERER_NATIVE))
#define META_CURSOR_RENDERER_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_CURSOR_RENDERER_NATIVE, MetaCursorRendererNativeClass))
typedef struct _MetaCursorRendererNative MetaCursorRendererNative;
typedef struct _MetaCursorRendererNativeClass MetaCursorRendererNativeClass;
struct _MetaCursorRendererNative
{
MetaCursorRenderer parent;
};
struct _MetaCursorRendererNativeClass
{
MetaCursorRendererClass parent_class;
};
GType meta_cursor_renderer_native_get_type (void) G_GNUC_CONST;
struct gbm_device * meta_cursor_renderer_native_get_gbm_device (MetaCursorRendererNative *renderer);
void meta_cursor_renderer_native_get_cursor_size (MetaCursorRendererNative *native, uint64_t *width, uint64_t *height);
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

@@ -1,6 +1,6 @@
/* Generated by gen-default-modes.py */
static const drmModeModeInfo meta_default_drm_mode_infos[] = {
const drmModeModeInfo meta_default_drm_mode_infos[] = {
{ 38250, 800, 832, 912, 1024, 0, 600, 603, 607, 624, 0, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC, DRM_MODE_TYPE_DEFAULT, "800x600_60.00" },
{ 63500, 1024, 1072, 1176, 1328, 0, 768, 771, 775, 798, 0, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC, DRM_MODE_TYPE_DEFAULT, "1024x768_60.00" },
{ 81750, 1152, 1216, 1336, 1520, 0, 864, 867, 871, 897, 0, 0, DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC, DRM_MODE_TYPE_DEFAULT, "1152x864_60.00" },

View File

@@ -1,821 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include "config.h"
#include "backends/native/meta-gpu-kms.h"
#include <drm.h>
#include <errno.h>
#include <poll.h>
#include <string.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include "backends/meta-crtc.h"
#include "backends/meta-monitor-manager-private.h"
#include "backends/meta-output.h"
#include "backends/native/meta-backend-native.h"
#include "backends/native/meta-crtc-kms.h"
#include "backends/native/meta-launcher.h"
#include "backends/native/meta-output-kms.h"
#include "backends/native/meta-default-modes.h"
typedef struct _MetaKmsSource
{
GSource source;
gpointer fd_tag;
MetaGpuKms *gpu_kms;
} MetaKmsSource;
struct _MetaGpuKms
{
MetaGpu parent;
int fd;
char *file_path;
GSource *source;
drmModeConnector **connectors;
unsigned int n_connectors;
int max_buffer_width;
int max_buffer_height;
gboolean page_flips_not_supported;
};
G_DEFINE_TYPE (MetaGpuKms, meta_gpu_kms, META_TYPE_GPU)
static gboolean
kms_event_check (GSource *source)
{
MetaKmsSource *kms_source = (MetaKmsSource *) source;
return g_source_query_unix_fd (source, kms_source->fd_tag) & G_IO_IN;
}
static gboolean
kms_event_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data)
{
MetaKmsSource *kms_source = (MetaKmsSource *) source;
meta_gpu_kms_wait_for_flip (kms_source->gpu_kms, NULL);
return G_SOURCE_CONTINUE;
}
static GSourceFuncs kms_event_funcs = {
NULL,
kms_event_check,
kms_event_dispatch
};
static void
get_crtc_drm_connectors (MetaGpu *gpu,
MetaCrtc *crtc,
uint32_t **connectors,
unsigned int *n_connectors)
{
GArray *connectors_array = g_array_new (FALSE, FALSE, sizeof (uint32_t));
GList *l;
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
{
MetaOutput *output = l->data;
if (output->crtc == crtc)
g_array_append_val (connectors_array, output->winsys_id);
}
*n_connectors = connectors_array->len;
*connectors = (uint32_t *) g_array_free (connectors_array, FALSE);
}
gboolean
meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
MetaCrtc *crtc,
int x,
int y,
uint32_t fb_id)
{
MetaGpu *gpu = meta_crtc_get_gpu (crtc);
int kms_fd = meta_gpu_kms_get_fd (gpu_kms);
uint32_t *connectors;
unsigned int n_connectors;
drmModeModeInfo *mode;
get_crtc_drm_connectors (gpu, crtc, &connectors, &n_connectors);
if (connectors)
mode = crtc->current_mode->driver_private;
else
mode = NULL;
if (drmModeSetCrtc (kms_fd,
crtc->crtc_id,
fb_id,
x, y,
connectors, n_connectors,
mode) != 0)
{
g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
g_free (connectors);
return FALSE;
}
g_free (connectors);
return TRUE;
}
static void
invoke_flip_closure (GClosure *flip_closure,
MetaGpuKms *gpu_kms)
{
GValue params[] = {
G_VALUE_INIT,
G_VALUE_INIT
};
g_value_init (&params[0], G_TYPE_POINTER);
g_value_set_pointer (&params[0], flip_closure);
g_value_init (&params[1], G_TYPE_OBJECT);
g_value_set_object (&params[1], gpu_kms);
g_closure_invoke (flip_closure, NULL, 2, params, NULL);
g_closure_unref (flip_closure);
}
gboolean
meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
MetaCrtc *crtc)
{
MetaGpu *gpu = META_GPU (gpu_kms);
MetaMonitorManager *monitor_manager = meta_gpu_get_monitor_manager (gpu);
GList *l;
gboolean connected_crtc_found;
g_assert (meta_crtc_get_gpu (crtc) == META_GPU (gpu_kms));
if (monitor_manager->power_save_mode != META_POWER_SAVE_ON)
return FALSE;
connected_crtc_found = FALSE;
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
{
MetaOutput *output = l->data;
if (output->crtc == crtc)
{
connected_crtc_found = TRUE;
break;
}
}
if (!connected_crtc_found)
return FALSE;
return TRUE;
}
typedef struct _GpuClosureContainer
{
GClosure *flip_closure;
MetaGpuKms *gpu_kms;
} GpuClosureContainer;
gboolean
meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
MetaCrtc *crtc,
int x,
int y,
uint32_t fb_id,
GClosure *flip_closure,
gboolean *fb_in_use)
{
MetaGpu *gpu = META_GPU (gpu_kms);
MetaMonitorManager *monitor_manager = meta_gpu_get_monitor_manager (gpu);
uint32_t *connectors;
unsigned int n_connectors;
int ret = -1;
g_assert (meta_crtc_get_gpu (crtc) == gpu);
g_assert (monitor_manager->power_save_mode == META_POWER_SAVE_ON);
get_crtc_drm_connectors (gpu, crtc, &connectors, &n_connectors);
g_assert (n_connectors > 0);
g_free (connectors);
if (!gpu_kms->page_flips_not_supported)
{
GpuClosureContainer *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
};
ret = drmModePageFlip (kms_fd,
crtc->crtc_id,
fb_id,
DRM_MODE_PAGE_FLIP_EVENT,
closure_container);
if (ret != 0 && ret != -EACCES)
{
g_free (closure_container);
g_warning ("Failed to flip: %s", strerror (-ret));
gpu_kms->page_flips_not_supported = TRUE;
}
}
if (gpu_kms->page_flips_not_supported)
{
if (meta_gpu_kms_apply_crtc_mode (gpu_kms, crtc, x, y, fb_id))
{
*fb_in_use = TRUE;
return FALSE;
}
}
if (ret != 0)
return FALSE;
*fb_in_use = TRUE;
g_closure_ref (flip_closure);
return TRUE;
}
static void
page_flip_handler (int fd,
unsigned int frame,
unsigned int sec,
unsigned int usec,
void *user_data)
{
GpuClosureContainer *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);
}
gboolean
meta_gpu_kms_wait_for_flip (MetaGpuKms *gpu_kms,
GError **error)
{
drmEventContext evctx;
if (gpu_kms->page_flips_not_supported)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Page flips not supported");
return FALSE;
}
memset (&evctx, 0, sizeof evctx);
evctx.version = DRM_EVENT_CONTEXT_VERSION;
evctx.page_flip_handler = page_flip_handler;
while (TRUE)
{
if (drmHandleEvent (gpu_kms->fd, &evctx) != 0)
{
struct pollfd pfd;
int ret;
if (errno != EAGAIN)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
strerror (errno));
return FALSE;
}
pfd.fd = gpu_kms->fd;
pfd.events = POLL_IN | POLL_ERR;
do
{
ret = poll (&pfd, 1, -1);
}
while (ret == -1 && errno == EINTR);
}
else
{
break;
}
}
return TRUE;
}
void
meta_gpu_kms_get_max_buffer_size (MetaGpuKms *gpu_kms,
int *max_width,
int *max_height)
{
*max_width = gpu_kms->max_buffer_width;
*max_height = gpu_kms->max_buffer_height;
}
int
meta_gpu_kms_get_fd (MetaGpuKms *gpu_kms)
{
return gpu_kms->fd;
}
const char *
meta_gpu_kms_get_file_path (MetaGpuKms *gpu_kms)
{
return gpu_kms->file_path;
}
void
meta_gpu_kms_set_power_save_mode (MetaGpuKms *gpu_kms,
uint64_t state)
{
GList *l;
for (l = meta_gpu_get_outputs (META_GPU (gpu_kms)); l; l = l->next)
{
MetaOutput *output = l->data;
meta_output_kms_set_power_save_mode (output, state);
}
}
static void
free_resources (MetaGpuKms *gpu_kms)
{
unsigned i;
for (i = 0; i < gpu_kms->n_connectors; i++)
drmModeFreeConnector (gpu_kms->connectors[i]);
g_free (gpu_kms->connectors);
}
static int
compare_outputs (gconstpointer one,
gconstpointer two)
{
const MetaOutput *o_one = one, *o_two = two;
return strcmp (o_one->name, o_two->name);
}
static void
meta_crtc_mode_destroy_notify (MetaCrtcMode *mode)
{
g_slice_free (drmModeModeInfo, mode->driver_private);
}
gboolean
meta_drm_mode_equal (const drmModeModeInfo *one,
const drmModeModeInfo *two)
{
return (one->clock == two->clock &&
one->hdisplay == two->hdisplay &&
one->hsync_start == two->hsync_start &&
one->hsync_end == two->hsync_end &&
one->htotal == two->htotal &&
one->hskew == two->hskew &&
one->vdisplay == two->vdisplay &&
one->vsync_start == two->vsync_start &&
one->vsync_end == two->vsync_end &&
one->vtotal == two->vtotal &&
one->vscan == two->vscan &&
one->vrefresh == two->vrefresh &&
one->flags == two->flags &&
one->type == two->type &&
strncmp (one->name, two->name, DRM_DISPLAY_MODE_LEN) == 0);
}
static guint
drm_mode_hash (gconstpointer ptr)
{
const drmModeModeInfo *mode = ptr;
guint hash = 0;
/*
* We don't include the name in the hash because it's generally
* derived from the other fields (hdisplay, vdisplay and flags)
*/
hash ^= mode->clock;
hash ^= mode->hdisplay ^ mode->hsync_start ^ mode->hsync_end;
hash ^= mode->vdisplay ^ mode->vsync_start ^ mode->vsync_end;
hash ^= mode->vrefresh;
hash ^= mode->flags ^ mode->type;
return hash;
}
MetaCrtcMode *
meta_gpu_kms_get_mode_from_drm_mode (MetaGpuKms *gpu_kms,
const drmModeModeInfo *drm_mode)
{
MetaGpu *gpu = META_GPU (gpu_kms);
GList *l;
for (l = meta_gpu_get_modes (gpu); l; l = l->next)
{
MetaCrtcMode *mode = l->data;
if (meta_drm_mode_equal (drm_mode, mode->driver_private))
return mode;
}
g_assert_not_reached ();
return NULL;
}
float
meta_calculate_drm_mode_refresh_rate (const drmModeModeInfo *mode)
{
float refresh = 0.0;
if (mode->htotal > 0 && mode->vtotal > 0)
{
/* Calculate refresh rate in milliHz first for extra precision. */
refresh = (mode->clock * 1000000LL) / mode->htotal;
refresh += (mode->vtotal / 2);
refresh /= mode->vtotal;
if (mode->vscan > 1)
refresh /= mode->vscan;
refresh /= 1000.0;
}
return refresh;
}
static MetaCrtcMode *
create_mode (const drmModeModeInfo *drm_mode,
long mode_id)
{
MetaCrtcMode *mode;
mode = g_object_new (META_TYPE_CRTC_MODE, NULL);
mode->mode_id = mode_id;
mode->name = g_strndup (drm_mode->name, DRM_DISPLAY_MODE_LEN);
mode->width = drm_mode->hdisplay;
mode->height = drm_mode->vdisplay;
mode->flags = drm_mode->flags;
mode->refresh_rate = meta_calculate_drm_mode_refresh_rate (drm_mode);
mode->driver_private = g_slice_dup (drmModeModeInfo, drm_mode);
mode->driver_notify = (GDestroyNotify) meta_crtc_mode_destroy_notify;
return mode;
}
static MetaOutput *
find_output_by_id (GList *outputs,
glong id)
{
GList *l;
for (l = outputs; l; l = l->next)
{
MetaOutput *output = l->data;
if (output->winsys_id == id)
return output;
}
return NULL;
}
static void
setup_output_clones (MetaGpu *gpu)
{
GList *l;
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
{
MetaOutput *output = l->data;
GList *k;
for (k = meta_gpu_get_outputs (gpu); k; k = k->next)
{
MetaOutput *other_output = k->data;
if (other_output == output)
continue;
if (meta_output_kms_can_clone (output, other_output))
{
output->n_possible_clones++;
output->possible_clones = g_renew (MetaOutput *,
output->possible_clones,
output->n_possible_clones);
output->possible_clones[output->n_possible_clones - 1] =
other_output;
}
}
}
}
static void
init_connectors (MetaGpuKms *gpu_kms,
drmModeRes *resources)
{
unsigned int i;
gpu_kms->n_connectors = resources->count_connectors;
gpu_kms->connectors = g_new (drmModeConnector *, gpu_kms->n_connectors);
for (i = 0; i < gpu_kms->n_connectors; i++)
{
drmModeConnector *drm_connector;
drm_connector = drmModeGetConnector (gpu_kms->fd,
resources->connectors[i]);
gpu_kms->connectors[i] = drm_connector;
}
}
static void
init_modes (MetaGpuKms *gpu_kms,
drmModeRes *resources)
{
MetaGpu *gpu = META_GPU (gpu_kms);
GHashTable *modes_table;
GList *modes;
GHashTableIter iter;
drmModeModeInfo *drm_mode;
unsigned int i;
long mode_id;
/*
* Gather all modes on all connected connectors.
*/
modes_table = g_hash_table_new (drm_mode_hash, (GEqualFunc) meta_drm_mode_equal);
for (i = 0; i < gpu_kms->n_connectors; i++)
{
drmModeConnector *drm_connector;
drm_connector = gpu_kms->connectors[i];
if (drm_connector && drm_connector->connection == DRM_MODE_CONNECTED)
{
unsigned int j;
for (j = 0; j < (unsigned int) drm_connector->count_modes; j++)
g_hash_table_add (modes_table, &drm_connector->modes[j]);
}
}
modes = NULL;
g_hash_table_iter_init (&iter, modes_table);
mode_id = 0;
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &drm_mode))
{
MetaCrtcMode *mode;
mode = create_mode (drm_mode, (long) mode_id);
modes = g_list_append (modes, mode);
mode_id++;
}
g_hash_table_destroy (modes_table);
for (i = 0; i < G_N_ELEMENTS (meta_default_drm_mode_infos); i++)
{
MetaCrtcMode *mode;
mode = create_mode (&meta_default_drm_mode_infos[i], (long) mode_id);
modes = g_list_append (modes, mode);
mode_id++;
}
meta_gpu_take_modes (gpu, modes);
}
static void
init_crtcs (MetaGpuKms *gpu_kms,
MetaKmsResources *resources)
{
MetaGpu *gpu = META_GPU (gpu_kms);
GList *crtcs;
unsigned int i;
crtcs = NULL;
for (i = 0; i < (unsigned int) resources->resources->count_crtcs; i++)
{
drmModeCrtc *drm_crtc;
MetaCrtc *crtc;
drm_crtc = drmModeGetCrtc (gpu_kms->fd,
resources->resources->crtcs[i]);
crtc = meta_create_kms_crtc (gpu_kms, drm_crtc, i);
drmModeFreeCrtc (drm_crtc);
crtcs = g_list_append (crtcs, crtc);
}
meta_gpu_take_crtcs (gpu, crtcs);
}
static void
init_outputs (MetaGpuKms *gpu_kms,
MetaKmsResources *resources)
{
MetaGpu *gpu = META_GPU (gpu_kms);
GList *old_outputs;
GList *outputs;
unsigned int i;
old_outputs = meta_gpu_get_outputs (gpu);
outputs = NULL;
for (i = 0; i < gpu_kms->n_connectors; i++)
{
drmModeConnector *connector;
connector = gpu_kms->connectors[i];
if (connector && connector->connection == DRM_MODE_CONNECTED)
{
MetaOutput *output;
MetaOutput *old_output;
old_output = find_output_by_id (old_outputs, connector->connector_id);
output = meta_create_kms_output (gpu_kms, connector, resources,
old_output);
outputs = g_list_prepend (outputs, output);
}
}
/* Sort the outputs for easier handling in MetaMonitorConfig */
outputs = g_list_sort (outputs, compare_outputs);
meta_gpu_take_outputs (gpu, outputs);
setup_output_clones (gpu);
}
static void
meta_kms_resources_init (MetaKmsResources *resources,
int fd)
{
drmModeRes *drm_resources;
unsigned int i;
drm_resources = drmModeGetResources (fd);
resources->resources = drm_resources;
resources->n_encoders = (unsigned int) drm_resources->count_encoders;
resources->encoders = g_new (drmModeEncoder *, resources->n_encoders);
for (i = 0; i < resources->n_encoders; i++)
resources->encoders[i] = drmModeGetEncoder (fd, drm_resources->encoders[i]);
}
static void
meta_kms_resources_release (MetaKmsResources *resources)
{
unsigned int i;
for (i = 0; i < resources->n_encoders; i++)
drmModeFreeEncoder (resources->encoders[i]);
g_free (resources->encoders);
drmModeFreeResources (resources->resources);
}
static gboolean
meta_gpu_kms_read_current (MetaGpu *gpu,
GError **error)
{
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
MetaMonitorManager *monitor_manager =
meta_gpu_get_monitor_manager (gpu);
MetaKmsResources resources;
meta_kms_resources_init (&resources, gpu_kms->fd);
gpu_kms->max_buffer_width = resources.resources->max_width;
gpu_kms->max_buffer_height = resources.resources->max_height;
monitor_manager->power_save_mode = META_POWER_SAVE_ON;
/* Note: we must not free the public structures (output, crtc, monitor
mode and monitor info) here, they must be kept alive until the API
users are done with them after we emit monitors-changed, and thus
are freed by the platform-independent layer. */
free_resources (gpu_kms);
init_connectors (gpu_kms, resources.resources);
init_modes (gpu_kms, resources.resources);
init_crtcs (gpu_kms, &resources);
init_outputs (gpu_kms, &resources);
meta_kms_resources_release (&resources);
return TRUE;
}
MetaGpuKms *
meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
const char *kms_file_path,
GError **error)
{
MetaMonitorManager *monitor_manager =
META_MONITOR_MANAGER (monitor_manager_kms);
MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
MetaLauncher *launcher =
meta_backend_native_get_launcher (META_BACKEND_NATIVE (backend));
GSource *source;
MetaKmsSource *kms_source;
MetaGpuKms *gpu_kms;
int kms_fd;
kms_fd = meta_launcher_open_restricted (launcher, kms_file_path, error);
if (kms_fd == -1)
return FALSE;
gpu_kms = g_object_new (META_TYPE_GPU_KMS,
"monitor-manager", monitor_manager_kms,
NULL);
gpu_kms->fd = kms_fd;
gpu_kms->file_path = g_strdup (kms_file_path);
drmSetClientCap (gpu_kms->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1);
source = g_source_new (&kms_event_funcs, sizeof (MetaKmsSource));
kms_source = (MetaKmsSource *) source;
kms_source->fd_tag = g_source_add_unix_fd (source,
gpu_kms->fd,
G_IO_IN | G_IO_ERR);
kms_source->gpu_kms = gpu_kms;
gpu_kms->source = source;
g_source_attach (gpu_kms->source, NULL);
return gpu_kms;
}
static void
meta_gpu_kms_finalize (GObject *object)
{
MetaGpuKms *gpu_kms = META_GPU_KMS (object);
MetaMonitorManager *monitor_manager =
meta_gpu_get_monitor_manager (META_GPU (gpu_kms));
MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
MetaBackendNative *backend_native = META_BACKEND_NATIVE (backend);
MetaLauncher *launcher = meta_backend_native_get_launcher (backend_native);
if (gpu_kms->fd != -1)
meta_launcher_close_restricted (launcher, gpu_kms->fd);
g_clear_pointer (&gpu_kms->file_path, g_free);
g_source_destroy (gpu_kms->source);
free_resources (gpu_kms);
G_OBJECT_CLASS (meta_gpu_kms_parent_class)->finalize (object);
}
static void
meta_gpu_kms_init (MetaGpuKms *gpu_kms)
{
gpu_kms->fd = -1;
}
static void
meta_gpu_kms_class_init (MetaGpuKmsClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
MetaGpuClass *gpu_class = META_GPU_CLASS (klass);
object_class->finalize = meta_gpu_kms_finalize;
gpu_class->read_current = meta_gpu_kms_read_current;
}

View File

@@ -1,87 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_GPU_KMS_H
#define META_GPU_KMS_H
#include <glib-object.h>
#include <xf86drm.h>
#include <xf86drmMode.h>
#include "backends/meta-gpu.h"
#include "backends/native/meta-monitor-manager-kms.h"
#define META_TYPE_GPU_KMS (meta_gpu_kms_get_type ())
G_DECLARE_FINAL_TYPE (MetaGpuKms, meta_gpu_kms, META, GPU_KMS, MetaGpu)
typedef struct _MetaKmsResources
{
drmModeRes *resources;
drmModeEncoder **encoders;
unsigned int n_encoders;
} MetaKmsResources;
typedef void (*MetaKmsFlipCallback) (void *user_data);
MetaGpuKms * meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
const char *kms_file_path,
GError **error);
gboolean meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
MetaCrtc *crtc,
int x,
int y,
uint32_t fb_id);
gboolean meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
MetaCrtc *crtc);
gboolean meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
MetaCrtc *crtc,
int x,
int y,
uint32_t fb_id,
GClosure *flip_closure,
gboolean *fb_in_use);
gboolean meta_gpu_kms_wait_for_flip (MetaGpuKms *gpu_kms,
GError **error);
int meta_gpu_kms_get_fd (MetaGpuKms *gpu_kms);
const char * meta_gpu_kms_get_file_path (MetaGpuKms *gpu_kms);
void meta_gpu_kms_get_max_buffer_size (MetaGpuKms *gpu_kms,
int *max_width,
int *max_height);
void meta_gpu_kms_set_power_save_mode (MetaGpuKms *gpu_kms,
uint64_t state);
MetaCrtcMode * meta_gpu_kms_get_mode_from_drm_mode (MetaGpuKms *gpu_kms,
const drmModeModeInfo *drm_mode);
gboolean meta_drm_mode_equal (const drmModeModeInfo *one,
const drmModeModeInfo *two);
float meta_calculate_drm_mode_refresh_rate (const drmModeModeInfo *mode);
#endif /* META_GPU_KMS_H */

View File

@@ -47,21 +47,19 @@
#include "meta-idle-monitor-native.h"
#include "meta-renderer-native.h"
#define DRM_CARD_UDEV_DEVICE_TYPE "drm_minor"
struct _MetaLauncher
{
Login1Session *session_proxy;
Login1Seat *seat_proxy;
char *seat_id;
GHashTable *sysfs_fds;
gboolean session_active;
};
const char *
meta_launcher_get_seat_id (MetaLauncher *launcher)
{
return launcher->seat_id;
}
int kms_fd;
char *kms_file_path;
};
static Login1Session *
get_session_proxy (GCancellable *cancellable,
@@ -173,54 +171,6 @@ get_device_info_from_fd (int fd,
return TRUE;
}
int
meta_launcher_open_restricted (MetaLauncher *launcher,
const char *path,
GError **error)
{
int fd;
int major, minor;
if (!get_device_info_from_path (path, &major, &minor))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get device info for path %s: %m", path);
return -1;
}
if (!take_device (launcher->session_proxy, major, minor, &fd, NULL, error))
return -1;
return fd;
}
void
meta_launcher_close_restricted (MetaLauncher *launcher,
int fd)
{
int major, minor;
GError *error = NULL;
if (!get_device_info_from_fd (fd, &major, &minor))
{
g_warning ("Could not get device info for fd %d: %m", fd);
goto out;
}
if (!login1_session_call_release_device_sync (launcher->session_proxy,
major, minor,
NULL, &error))
{
g_warning ("Could not release device (%d,%d): %s",
major, minor, error->message);
}
out:
close (fd);
}
static int
on_evdev_device_open (const char *path,
int flags,
@@ -228,12 +178,12 @@ on_evdev_device_open (const char *path,
GError **error)
{
MetaLauncher *self = user_data;
int fd;
int major, minor;
/* Allow readonly access to sysfs */
if (g_str_has_prefix (path, "/sys/"))
{
int fd;
do
{
fd = open (path, flags);
@@ -253,7 +203,19 @@ on_evdev_device_open (const char *path,
return fd;
}
return meta_launcher_open_restricted (self, path, error);
if (!get_device_info_from_path (path, &major, &minor))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get device info for path %s: %m", path);
return -1;
}
if (!take_device (self->session_proxy, major, minor, &fd, NULL, error))
return -1;
return fd;
}
static void
@@ -261,6 +223,8 @@ on_evdev_device_close (int fd,
gpointer user_data)
{
MetaLauncher *self = user_data;
int major, minor;
GError *error = NULL;
if (g_hash_table_lookup (self->sysfs_fds, GINT_TO_POINTER (fd)))
{
@@ -270,7 +234,21 @@ on_evdev_device_close (int fd,
return;
}
meta_launcher_close_restricted (self, fd);
if (!get_device_info_from_fd (fd, &major, &minor))
{
g_warning ("Could not get device info for fd %d: %m", fd);
goto out;
}
if (!login1_session_call_release_device_sync (self->session_proxy,
major, minor,
NULL, &error))
{
g_warning ("Could not release device %d,%d: %s", major, minor, error->message);
}
out:
close (fd);
}
static void
@@ -300,6 +278,194 @@ on_active_changed (Login1Session *session,
sync_active (self);
}
static guint
count_devices_with_connectors (const gchar *seat_name,
GList *devices)
{
g_autoptr (GHashTable) cards = NULL;
GList *tmp;
cards = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
for (tmp = devices; tmp != NULL; tmp = tmp->next)
{
GUdevDevice *device = tmp->data;
g_autoptr (GUdevDevice) parent_device = NULL;
const gchar *parent_device_type = NULL;
const gchar *parent_device_name = NULL;
const gchar *card_seat;
/* filter out the real card devices, we only care about the connectors */
if (g_udev_device_get_device_type (device) != G_UDEV_DEVICE_TYPE_NONE)
continue;
/* only connectors have a modes attribute */
if (!g_udev_device_has_sysfs_attr (device, "modes"))
continue;
parent_device = g_udev_device_get_parent (device);
if (g_udev_device_get_device_type (parent_device) == G_UDEV_DEVICE_TYPE_CHAR)
parent_device_type = g_udev_device_get_property (parent_device, "DEVTYPE");
if (g_strcmp0 (parent_device_type, DRM_CARD_UDEV_DEVICE_TYPE) != 0)
continue;
card_seat = g_udev_device_get_property (parent_device, "ID_SEAT");
if (!card_seat)
card_seat = "seat0";
if (g_strcmp0 (seat_name, card_seat) != 0)
continue;
parent_device_name = g_udev_device_get_name (parent_device);
g_hash_table_insert (cards,
(gpointer) parent_device_name ,
g_steal_pointer (&parent_device));
}
return g_hash_table_size (cards);
}
static gchar *
get_primary_gpu_path (const gchar *seat_name)
{
const gchar *subsystems[] = {"drm", NULL};
gchar *path = NULL;
GList *devices, *tmp;
g_autoptr (GUdevClient) gudev_client = g_udev_client_new (subsystems);
g_autoptr (GUdevEnumerator) enumerator = g_udev_enumerator_new (gudev_client);
g_udev_enumerator_add_match_name (enumerator, "card*");
g_udev_enumerator_add_match_tag (enumerator, "seat");
/* We need to explicitly match the subsystem for now.
* https://bugzilla.gnome.org/show_bug.cgi?id=773224
*/
g_udev_enumerator_add_match_subsystem (enumerator, "drm");
devices = g_udev_enumerator_execute (enumerator);
if (!devices)
goto out;
/* For now, fail on systems where some of the connectors
* are connected to secondary gpus.
*
* https://bugzilla.gnome.org/show_bug.cgi?id=771442
*/
if (g_getenv ("MUTTER_ALLOW_HYBRID_GPUS") == NULL)
{
guint num_devices;
num_devices = count_devices_with_connectors (seat_name, devices);
if (num_devices != 1)
goto out;
}
for (tmp = devices; tmp != NULL; tmp = tmp->next)
{
g_autoptr (GUdevDevice) platform_device = NULL;
g_autoptr (GUdevDevice) pci_device = NULL;
GUdevDevice *dev = tmp->data;
gint boot_vga;
const gchar *device_type;
const gchar *device_seat;
/* filter out devices that are not character device, like card0-VGA-1 */
if (g_udev_device_get_device_type (dev) != G_UDEV_DEVICE_TYPE_CHAR)
continue;
device_type = g_udev_device_get_property (dev, "DEVTYPE");
if (g_strcmp0 (device_type, DRM_CARD_UDEV_DEVICE_TYPE) != 0)
continue;
device_seat = g_udev_device_get_property (dev, "ID_SEAT");
if (!device_seat)
{
/* when ID_SEAT is not set, it means seat0 */
device_seat = "seat0";
}
else if (g_strcmp0 (device_seat, "seat0") != 0)
{
/* if the device has been explicitly assigned other seat
* than seat0, it is probably the right device to use */
path = g_strdup (g_udev_device_get_device_file (dev));
break;
}
/* skip devices that do not belong to our seat */
if (g_strcmp0 (seat_name, device_seat))
continue;
platform_device = g_udev_device_get_parent_with_subsystem (dev, "platform", NULL);
if (platform_device != NULL)
{
path = g_strdup (g_udev_device_get_device_file (dev));
break;
}
pci_device = g_udev_device_get_parent_with_subsystem (dev, "pci", NULL);
if (pci_device != NULL)
{
/* get value of boot_vga attribute or 0 if the device has no boot_vga */
boot_vga = g_udev_device_get_sysfs_attr_as_int (pci_device, "boot_vga");
if (boot_vga == 1)
{
/* found the boot_vga device */
path = g_strdup (g_udev_device_get_device_file (dev));
break;
}
}
}
out:
g_list_free_full (devices, g_object_unref);
return path;
}
static gboolean
get_kms_fd (Login1Session *session_proxy,
const gchar *seat_id,
int *fd_out,
char **kms_file_path_out,
GError **error)
{
int major, minor;
int fd;
g_autofree gchar *path = get_primary_gpu_path (seat_id);
if (!path)
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"could not find drm kms device");
return FALSE;
}
if (!get_device_info_from_path (path, &major, &minor))
{
g_set_error (error,
G_IO_ERROR,
G_IO_ERROR_NOT_FOUND,
"Could not get device info for path %s: %m", path);
return FALSE;
}
if (!take_device (session_proxy, major, minor, &fd, NULL, error))
{
g_prefix_error (error, "Could not open DRM device: ");
return FALSE;
}
*fd_out = fd;
*kms_file_path_out = g_steal_pointer (&path);
return TRUE;
}
static gchar *
get_seat_id (GError **error)
{
@@ -338,6 +504,8 @@ meta_launcher_new (GError **error)
g_autoptr (Login1Seat) seat_proxy = NULL;
g_autofree char *seat_id = NULL;
gboolean have_control = FALSE;
int kms_fd;
char *kms_file_path;
session_proxy = get_session_proxy (NULL, error);
if (!session_proxy)
@@ -359,21 +527,25 @@ meta_launcher_new (GError **error)
if (!seat_proxy)
goto fail;
if (!get_kms_fd (session_proxy, seat_id, &kms_fd, &kms_file_path, error))
goto fail;
self = g_slice_new0 (MetaLauncher);
self->session_proxy = g_object_ref (session_proxy);
self->seat_proxy = g_object_ref (seat_proxy);
self->seat_id = g_steal_pointer (&seat_id);
self->sysfs_fds = g_hash_table_new (NULL, NULL);
self->session_active = TRUE;
clutter_evdev_set_seat_id (self->seat_id);
self->session_active = TRUE;
self->kms_fd = kms_fd;
self->kms_file_path = kms_file_path;
clutter_evdev_set_seat_id (seat_id);
clutter_evdev_set_device_callbacks (on_evdev_device_open,
on_evdev_device_close,
self);
g_signal_connect (self->session_proxy, "notify::active", G_CALLBACK (on_active_changed), self);
return self;
fail:
@@ -385,10 +557,10 @@ meta_launcher_new (GError **error)
void
meta_launcher_free (MetaLauncher *self)
{
g_free (self->seat_id);
g_object_unref (self->seat_proxy);
g_object_unref (self->session_proxy);
g_hash_table_destroy (self->sysfs_fds);
g_free (self->kms_file_path);
g_slice_free (MetaLauncher, self);
}
@@ -410,3 +582,15 @@ meta_launcher_activate_vt (MetaLauncher *launcher,
{
return login1_seat_call_switch_to_sync (launcher->seat_proxy, vt, NULL, error);
}
int
meta_launcher_get_kms_fd (MetaLauncher *self)
{
return self->kms_fd;
}
const char *
meta_launcher_get_kms_file_path (MetaLauncher *self)
{
return self->kms_file_path;
}

View File

@@ -34,14 +34,8 @@ gboolean meta_launcher_activate_vt (MetaLauncher *self,
signed char vt,
GError **error);
const char * meta_launcher_get_seat_id (MetaLauncher *launcher);
int meta_launcher_open_restricted (MetaLauncher *launcher,
const char *path,
GError **error);
void meta_launcher_close_restricted (MetaLauncher *launcher,
int fd);
int meta_launcher_get_kms_fd (MetaLauncher *self);
const char * meta_launcher_get_kms_file_path (MetaLauncher *self);
#endif /* META_LAUNCHER_H */

File diff suppressed because it is too large Load Diff

View File

@@ -23,19 +23,40 @@
#ifndef META_MONITOR_MANAGER_KMS_H
#define META_MONITOR_MANAGER_KMS_H
#include <xf86drm.h>
#include <xf86drmMode.h>
#include "meta-monitor-manager-private.h"
typedef struct _MetaGpuKms MetaGpuKms;
#define META_TYPE_MONITOR_MANAGER_KMS (meta_monitor_manager_kms_get_type ())
#define META_MONITOR_MANAGER_KMS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKms))
#define META_MONITOR_MANAGER_KMS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass))
#define META_IS_MONITOR_MANAGER_KMS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_MONITOR_MANAGER_KMS))
#define META_IS_MONITOR_MANAGER_KMS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_MONITOR_MANAGER_KMS))
#define META_MONITOR_MANAGER_KMS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_MONITOR_MANAGER_KMS, MetaMonitorManagerKmsClass))
#define META_TYPE_MONITOR_MANAGER_KMS (meta_monitor_manager_kms_get_type ())
G_DECLARE_FINAL_TYPE (MetaMonitorManagerKms, meta_monitor_manager_kms,
META, MONITOR_MANAGER_KMS,
MetaMonitorManager)
typedef struct _MetaMonitorManagerKmsClass MetaMonitorManagerKmsClass;
typedef struct _MetaMonitorManagerKms MetaMonitorManagerKms;
MetaGpuKms * meta_monitor_manager_kms_get_primary_gpu (MetaMonitorManagerKms *manager_kms);
GType meta_monitor_manager_kms_get_type (void);
typedef void (*MetaKmsFlipCallback) (void *user_data);
gboolean meta_monitor_manager_kms_apply_crtc_mode (MetaMonitorManagerKms *manager_kms,
MetaCrtc *crtc,
int x,
int y,
uint32_t fb_id);
gboolean meta_monitor_manager_kms_is_crtc_active (MetaMonitorManagerKms *manager_kms,
MetaCrtc *crtc);
gboolean meta_monitor_manager_kms_flip_crtc (MetaMonitorManagerKms *manager_kms,
MetaCrtc *crtc,
int x,
int y,
uint32_t fb_id,
GClosure *flip_closure,
gboolean *fb_in_use);
void meta_monitor_manager_kms_wait_for_flip (MetaMonitorManagerKms *manager_kms);
void meta_monitor_manager_kms_pause (MetaMonitorManagerKms *manager_kms);

View File

@@ -1,619 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2013-2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#include "config.h"
#include "backends/native/meta-output-kms.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "backends/meta-crtc.h"
#include "backends/native/meta-crtc-kms.h"
#include "backends/native/meta-default-modes.h"
#define SYNC_TOLERANCE 0.01 /* 1 percent */
typedef struct _MetaOutputKms
{
MetaOutput parent;
drmModeConnector *connector;
unsigned int n_encoders;
drmModeEncoderPtr *encoders;
drmModeEncoderPtr current_encoder;
/*
* Bitmasks of encoder position in the resources array (used during clone
* setup).
*/
uint32_t encoder_mask;
uint32_t enc_clone_mask;
uint32_t dpms_prop_id;
uint32_t edid_blob_id;
uint32_t tile_blob_id;
int suggested_x;
int suggested_y;
uint32_t hotplug_mode_update;
gboolean has_scaling;
} MetaOutputKms;
void
meta_output_kms_set_underscan (MetaOutput *output)
{
if (!output->crtc)
return;
meta_crtc_kms_set_underscan (output->crtc,
output->is_underscanning);
}
void
meta_output_kms_set_power_save_mode (MetaOutput *output,
uint64_t state)
{
MetaOutputKms *output_kms = output->driver_private;
MetaGpu *gpu = meta_output_get_gpu (output);
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
if (output_kms->dpms_prop_id != 0)
{
int fd;
fd = meta_gpu_kms_get_fd (gpu_kms);
if (drmModeObjectSetProperty (fd, output->winsys_id,
DRM_MODE_OBJECT_CONNECTOR,
output_kms->dpms_prop_id, state) < 0)
g_warning ("Failed to set power save mode for output %s: %s",
output->name, strerror (errno));
}
}
gboolean
meta_output_kms_can_clone (MetaOutput *output,
MetaOutput *other_output)
{
MetaOutputKms *output_kms = output->driver_private;
MetaOutputKms *other_output_kms = other_output->driver_private;
if (output_kms->enc_clone_mask == 0 ||
other_output_kms->enc_clone_mask == 0)
return FALSE;
if (output_kms->encoder_mask != other_output_kms->enc_clone_mask)
return FALSE;
return TRUE;
}
static drmModePropertyBlobPtr
read_edid_blob (MetaGpuKms *gpu_kms,
uint32_t edid_blob_id,
GError **error)
{
int fd;
drmModePropertyBlobPtr edid_blob = NULL;
fd = meta_gpu_kms_get_fd (gpu_kms);
edid_blob = drmModeGetPropertyBlob (fd, edid_blob_id);
if (!edid_blob)
{
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (errno),
"%s", strerror (errno));
return NULL;
}
return edid_blob;
}
static GBytes *
read_output_edid (MetaGpuKms *gpu_kms,
MetaOutput *output,
GError **error)
{
MetaOutputKms *output_kms = output->driver_private;
drmModePropertyBlobPtr edid_blob;
g_assert (output_kms->edid_blob_id != 0);
edid_blob = read_edid_blob (gpu_kms, output_kms->edid_blob_id, error);
if (!edid_blob)
return NULL;
if (edid_blob->length == 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "EDID blob was empty");
drmModeFreePropertyBlob (edid_blob);
return NULL;
}
return g_bytes_new_with_free_func (edid_blob->data, edid_blob->length,
(GDestroyNotify) drmModeFreePropertyBlob,
edid_blob);
}
static gboolean
output_get_tile_info (MetaGpuKms *gpu_kms,
MetaOutput *output)
{
MetaOutputKms *output_kms = output->driver_private;
int fd;
drmModePropertyBlobPtr tile_blob = NULL;
if (output_kms->tile_blob_id == 0)
return FALSE;
fd = meta_gpu_kms_get_fd (gpu_kms);
tile_blob = drmModeGetPropertyBlob (fd, output_kms->tile_blob_id);
if (!tile_blob)
{
g_warning ("Failed to read TILE of output %s: %s",
output->name, strerror (errno));
return FALSE;
}
if (tile_blob->length > 0)
{
int ret;
ret = sscanf ((char *)tile_blob->data, "%d:%d:%d:%d:%d:%d:%d:%d",
&output->tile_info.group_id,
&output->tile_info.flags,
&output->tile_info.max_h_tiles,
&output->tile_info.max_v_tiles,
&output->tile_info.loc_h_tile,
&output->tile_info.loc_v_tile,
&output->tile_info.tile_w,
&output->tile_info.tile_h);
drmModeFreePropertyBlob (tile_blob);
if (ret != 8)
{
g_warning ("Couldn't understand output tile property blob");
return FALSE;
}
return TRUE;
}
else
{
drmModeFreePropertyBlob (tile_blob);
return FALSE;
}
}
GBytes *
meta_output_kms_read_edid (MetaOutput *output)
{
MetaOutputKms *output_kms = output->driver_private;
MetaGpu *gpu = meta_output_get_gpu (output);
MetaGpuKms *gpu_kms = META_GPU_KMS (gpu);
GError *error = NULL;
GBytes *edid;
if (output_kms->edid_blob_id == 0)
return NULL;
edid = read_output_edid (gpu_kms, output, &error);
if (!edid)
{
g_warning ("Failed to read EDID from '%s': %s",
output->name, error->message);
g_error_free (error);
return NULL;
}
return edid;
}
static void
find_connector_properties (MetaGpuKms *gpu_kms,
MetaOutputKms *output_kms)
{
drmModeConnector *connector = output_kms->connector;
int fd;
int i;
fd = meta_gpu_kms_get_fd (gpu_kms);
output_kms->hotplug_mode_update = 0;
output_kms->suggested_x = -1;
output_kms->suggested_y = -1;
for (i = 0; i < connector->count_props; i++)
{
drmModePropertyPtr prop = drmModeGetProperty (fd, connector->props[i]);
if (!prop)
continue;
if ((prop->flags & DRM_MODE_PROP_ENUM) &&
strcmp (prop->name, "DPMS") == 0)
output_kms->dpms_prop_id = prop->prop_id;
else if ((prop->flags & DRM_MODE_PROP_BLOB) &&
strcmp (prop->name, "EDID") == 0)
output_kms->edid_blob_id = connector->prop_values[i];
else if ((prop->flags & DRM_MODE_PROP_BLOB) &&
strcmp (prop->name, "TILE") == 0)
output_kms->tile_blob_id = connector->prop_values[i];
else if ((prop->flags & DRM_MODE_PROP_RANGE) &&
strcmp (prop->name, "suggested X") == 0)
output_kms->suggested_x = connector->prop_values[i];
else if ((prop->flags & DRM_MODE_PROP_RANGE) &&
strcmp (prop->name, "suggested Y") == 0)
output_kms->suggested_y = connector->prop_values[i];
else if ((prop->flags & DRM_MODE_PROP_RANGE) &&
strcmp (prop->name, "hotplug_mode_update") == 0)
output_kms->hotplug_mode_update = connector->prop_values[i];
else if (strcmp (prop->name, "scaling mode") == 0)
output_kms->has_scaling = TRUE;
drmModeFreeProperty (prop);
}
}
static char *
make_output_name (drmModeConnector *connector)
{
static const char * const connector_type_names[] = {
"None",
"VGA",
"DVI-I",
"DVI-D",
"DVI-A",
"Composite",
"SVIDEO",
"LVDS",
"Component",
"DIN",
"DP",
"HDMI",
"HDMI-B",
"TV",
"eDP",
"Virtual",
"DSI",
};
if (connector->connector_type < G_N_ELEMENTS (connector_type_names))
return g_strdup_printf ("%s-%d",
connector_type_names[connector->connector_type],
connector->connector_type_id);
else
return g_strdup_printf ("Unknown%d-%d",
connector->connector_type,
connector->connector_type_id);
}
static void
meta_output_destroy_notify (MetaOutput *output)
{
MetaOutputKms *output_kms;
unsigned i;
output_kms = output->driver_private;
for (i = 0; i < output_kms->n_encoders; i++)
drmModeFreeEncoder (output_kms->encoders[i]);
g_free (output_kms->encoders);
g_slice_free (MetaOutputKms, output_kms);
}
static void
add_common_modes (MetaOutput *output,
MetaGpuKms *gpu_kms)
{
GPtrArray *array;
unsigned i;
unsigned max_hdisplay = 0;
unsigned max_vdisplay = 0;
float max_refresh_rate = 0.0;
for (i = 0; i < output->n_modes; i++)
{
const drmModeModeInfo *drm_mode;
float refresh_rate;
drm_mode = output->modes[i]->driver_private;
refresh_rate = meta_calculate_drm_mode_refresh_rate (drm_mode);
max_hdisplay = MAX (max_hdisplay, drm_mode->hdisplay);
max_vdisplay = MAX (max_vdisplay, drm_mode->vdisplay);
max_refresh_rate = MAX (max_refresh_rate, refresh_rate);
}
max_refresh_rate = MAX (max_refresh_rate, 60.0);
max_refresh_rate *= (1 + SYNC_TOLERANCE);
array = g_ptr_array_new ();
for (i = 0; i < G_N_ELEMENTS (meta_default_drm_mode_infos); i++)
{
const drmModeModeInfo *drm_mode;
float refresh_rate;
MetaCrtcMode *crtc_mode;
drm_mode = &meta_default_drm_mode_infos[i];
refresh_rate = meta_calculate_drm_mode_refresh_rate (drm_mode);
if (drm_mode->hdisplay > max_hdisplay ||
drm_mode->vdisplay > max_vdisplay ||
refresh_rate > max_refresh_rate)
continue;
crtc_mode = meta_gpu_kms_get_mode_from_drm_mode (gpu_kms,
drm_mode);
g_ptr_array_add (array, crtc_mode);
}
output->modes = g_renew (MetaCrtcMode *, output->modes,
output->n_modes + array->len);
memcpy (output->modes + output->n_modes, array->pdata,
array->len * sizeof (MetaCrtcMode *));
output->n_modes += array->len;
g_ptr_array_free (array, TRUE);
}
static int
compare_modes (const void *one,
const void *two)
{
MetaCrtcMode *a = *(MetaCrtcMode **) one;
MetaCrtcMode *b = *(MetaCrtcMode **) two;
if (a->width != b->width)
return a->width > b->width ? -1 : 1;
if (a->height != b->height)
return a->height > b->height ? -1 : 1;
if (a->refresh_rate != b->refresh_rate)
return a->refresh_rate > b->refresh_rate ? -1 : 1;
return g_strcmp0 (b->name, a->name);
}
static void
init_output_modes (MetaOutput *output,
MetaGpuKms *gpu_kms)
{
MetaOutputKms *output_kms = output->driver_private;
unsigned int i;
output->preferred_mode = NULL;
output->n_modes = output_kms->connector->count_modes;
output->modes = g_new0 (MetaCrtcMode *, output->n_modes);
for (i = 0; i < output->n_modes; i++)
{
drmModeModeInfo *drm_mode;
MetaCrtcMode *crtc_mode;
drm_mode = &output_kms->connector->modes[i];
crtc_mode = meta_gpu_kms_get_mode_from_drm_mode (gpu_kms, drm_mode);
output->modes[i] = crtc_mode;
if (output_kms->connector->modes[i].type & DRM_MODE_TYPE_PREFERRED)
output->preferred_mode = output->modes[i];
}
if (!output->preferred_mode)
output->preferred_mode = output->modes[0];
}
MetaOutput *
meta_create_kms_output (MetaGpuKms *gpu_kms,
drmModeConnector *connector,
MetaKmsResources *resources,
MetaOutput *old_output)
{
MetaGpu *gpu = META_GPU (gpu_kms);
MetaOutput *output;
MetaOutputKms *output_kms;
GArray *crtcs;
GBytes *edid;
GList *l;
unsigned int i;
unsigned int crtc_mask;
int fd;
output = g_object_new (META_TYPE_OUTPUT, NULL);
output_kms = g_slice_new0 (MetaOutputKms);
output->driver_private = output_kms;
output->driver_notify = (GDestroyNotify) meta_output_destroy_notify;
output->gpu = gpu;
output->winsys_id = connector->connector_id;
output->name = make_output_name (connector);
output->width_mm = connector->mmWidth;
output->height_mm = connector->mmHeight;
switch (connector->subpixel)
{
case DRM_MODE_SUBPIXEL_NONE:
output->subpixel_order = COGL_SUBPIXEL_ORDER_NONE;
break;
case DRM_MODE_SUBPIXEL_HORIZONTAL_RGB:
output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_RGB;
break;
case DRM_MODE_SUBPIXEL_HORIZONTAL_BGR:
output->subpixel_order = COGL_SUBPIXEL_ORDER_HORIZONTAL_BGR;
break;
case DRM_MODE_SUBPIXEL_VERTICAL_RGB:
output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_RGB;
break;
case DRM_MODE_SUBPIXEL_VERTICAL_BGR:
output->subpixel_order = COGL_SUBPIXEL_ORDER_VERTICAL_BGR;
break;
case DRM_MODE_SUBPIXEL_UNKNOWN:
default:
output->subpixel_order = COGL_SUBPIXEL_ORDER_UNKNOWN;
break;
}
output_kms->connector = connector;
find_connector_properties (gpu_kms, output_kms);
init_output_modes (output, gpu_kms);
/* FIXME: MSC feature bit? */
/* Presume that if the output supports scaling, then we have
* a panel fitter capable of adjusting any mode to suit.
*/
if (output_kms->has_scaling)
add_common_modes (output, gpu_kms);
qsort (output->modes, output->n_modes,
sizeof (MetaCrtcMode *), compare_modes);
output_kms->n_encoders = connector->count_encoders;
output_kms->encoders = g_new0 (drmModeEncoderPtr, output_kms->n_encoders);
fd = meta_gpu_kms_get_fd (gpu_kms);
crtc_mask = ~(unsigned int) 0;
for (i = 0; i < output_kms->n_encoders; i++)
{
output_kms->encoders[i] = drmModeGetEncoder (fd, connector->encoders[i]);
if (!output_kms->encoders[i])
continue;
/* We only list CRTCs as supported if they are supported by all encoders
for this connectors.
This is what xf86-video-modesetting does (see drmmode_output_init())
*/
crtc_mask &= output_kms->encoders[i]->possible_crtcs;
if (output_kms->encoders[i]->encoder_id == connector->encoder_id)
output_kms->current_encoder = output_kms->encoders[i];
}
crtcs = g_array_new (FALSE, FALSE, sizeof (MetaCrtc*));
for (l = meta_gpu_get_crtcs (gpu), i = 0; l; l = l->next, i++)
{
if (crtc_mask & (1 << i))
{
MetaCrtc *crtc = l->data;
g_array_append_val (crtcs, crtc);
}
}
output->n_possible_crtcs = crtcs->len;
output->possible_crtcs = (void*)g_array_free (crtcs, FALSE);
if (output_kms->current_encoder && output_kms->current_encoder->crtc_id != 0)
{
for (l = meta_gpu_get_crtcs (gpu); l; l = l->next)
{
MetaCrtc *crtc = l->data;
if (crtc->crtc_id == output_kms->current_encoder->crtc_id)
{
output->crtc = crtc;
break;
}
}
}
else
{
output->crtc = NULL;
}
if (old_output)
{
output->is_primary = old_output->is_primary;
output->is_presentation = old_output->is_presentation;
}
else
{
output->is_primary = FALSE;
output->is_presentation = FALSE;
}
output->suggested_x = output_kms->suggested_x;
output->suggested_y = output_kms->suggested_y;
output->hotplug_mode_update = output_kms->hotplug_mode_update;
if (output_kms->edid_blob_id != 0)
{
GError *error = NULL;
edid = read_output_edid (gpu_kms, output, &error);
if (!edid)
{
g_warning ("Failed to read EDID blob from %s: %s",
output->name, error->message);
g_error_free (error);
}
}
else
{
edid = NULL;
}
meta_output_parse_edid (output, edid);
g_bytes_unref (edid);
/* MetaConnectorType matches DRM's connector types */
output->connector_type = (MetaConnectorType) connector->connector_type;
output_get_tile_info (gpu_kms, output);
/* FIXME: backlight is a very driver specific thing unfortunately,
every DDX does its own thing, and the dumb KMS API does not include it.
For example, xf86-video-intel has a list of paths to probe in /sys/class/backlight
(one for each major HW maker, and then some).
We can't do the same because we're not root.
It might be best to leave backlight out of the story and rely on the setuid
helper in gnome-settings-daemon.
*/
output->backlight_min = 0;
output->backlight_max = 0;
output->backlight = -1;
output_kms->enc_clone_mask = 0xff;
output_kms->encoder_mask = 0;
for (i = 0; i < output_kms->n_encoders; i++)
{
drmModeEncoder *output_encoder = output_kms->encoders[i];
unsigned int j;
for (j = 0; j < resources->n_encoders; j++)
{
drmModeEncoder *encoder = resources->encoders[j];
if (output_encoder && encoder &&
output_encoder->encoder_id == encoder->encoder_id)
{
output_kms->encoder_mask |= (1 << j);
break;
}
}
output_kms->enc_clone_mask &= output_encoder->possible_clones;
}
return output;
}

View File

@@ -1,43 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/
#ifndef META_OUTPUT_KMS_H
#define META_OUTPUT_KMS_H
#include "backends/meta-output.h"
#include "backends/native/meta-gpu-kms.h"
void meta_output_kms_set_underscan (MetaOutput *output);
void meta_output_kms_set_power_save_mode (MetaOutput *output,
uint64_t state);
gboolean meta_output_kms_can_clone (MetaOutput *output,
MetaOutput *other_output);
GBytes * meta_output_kms_read_edid (MetaOutput *output);
MetaOutput * meta_create_kms_output (MetaGpuKms *gpu_kms,
drmModeConnector *connector,
MetaKmsResources *resources,
MetaOutput *old_output);
#endif /* META_OUTPUT_KMS_H */

View File

@@ -1,176 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "config.h"
#define GL_GLEXT_PROTOTYPES
#include "backends/native/meta-renderer-native-gles3.h"
#include <errno.h>
#include <gio/gio.h>
#include <GLES3/gl3.h>
#include <string.h>
#include "backends/meta-gles3.h"
#include "backends/meta-gles3-table.h"
/*
* GL/gl.h being included may conflit with gl3.h on some architectures.
* Make sure that hasn't happened on any architecture.
*/
#ifdef GL_VERSION_1_1
#error "Somehow included OpenGL headers when we shouldn't have"
#endif
static EGLImageKHR
create_egl_image (MetaEgl *egl,
EGLDisplay egl_display,
EGLContext egl_context,
unsigned int width,
unsigned int height,
uint32_t stride,
uint32_t format,
int fd,
GError **error)
{
EGLint attributes[] = {
EGL_WIDTH, width,
EGL_HEIGHT, height,
EGL_LINUX_DRM_FOURCC_EXT, format,
EGL_DMA_BUF_PLANE0_FD_EXT, fd,
EGL_DMA_BUF_PLANE0_OFFSET_EXT, 0,
EGL_DMA_BUF_PLANE0_PITCH_EXT, stride,
EGL_NONE
};
return meta_egl_create_image (egl, egl_display, EGL_NO_CONTEXT,
EGL_LINUX_DMA_BUF_EXT, NULL,
attributes,
error);
}
static void
paint_egl_image (MetaGles3 *gles3,
EGLImageKHR egl_image,
int width,
int height)
{
GLuint texture;
GLuint framebuffer;
meta_gles3_clear_error (gles3);
GLBAS (gles3, glGenFramebuffers, (1, &framebuffer));
GLBAS (gles3, glBindFramebuffer, (GL_READ_FRAMEBUFFER, framebuffer));
GLBAS (gles3, glActiveTexture, (GL_TEXTURE0));
GLBAS (gles3, glGenTextures, (1, &texture));
GLBAS (gles3, glBindTexture, (GL_TEXTURE_2D, texture));
GLEXT (gles3, glEGLImageTargetTexture2DOES, (GL_TEXTURE_2D, egl_image));
GLBAS (gles3, glTexParameteri, (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,
GL_NEAREST));
GLBAS (gles3, glTexParameteri, (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST));
GLBAS (gles3, glTexParameteri, (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
GL_CLAMP_TO_EDGE));
GLBAS (gles3, glTexParameteri, (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,
GL_CLAMP_TO_EDGE));
GLBAS (gles3, glTexParameteri, (GL_TEXTURE_2D, GL_TEXTURE_WRAP_R_OES,
GL_CLAMP_TO_EDGE));
GLBAS (gles3, glFramebufferTexture2D, (GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, texture, 0));
GLBAS (gles3, glBindFramebuffer, (GL_READ_FRAMEBUFFER, framebuffer));
GLBAS (gles3, glBlitFramebuffer, (0, height, width, 0,
0, 0, width, height,
GL_COLOR_BUFFER_BIT,
GL_NEAREST));
}
gboolean
meta_renderer_native_gles3_blit_shared_bo (MetaEgl *egl,
MetaGles3 *gles3,
EGLDisplay egl_display,
EGLContext egl_context,
EGLSurface egl_surface,
struct gbm_bo *shared_bo,
GError **error)
{
int shared_bo_fd;
unsigned int width;
unsigned int height;
uint32_t stride;
uint32_t format;
EGLImageKHR egl_image;
shared_bo_fd = gbm_bo_get_fd (shared_bo);
if (shared_bo_fd < 0)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
"Failed to export gbm_bo: %s", strerror (errno));
return FALSE;
}
width = gbm_bo_get_width (shared_bo);
height = gbm_bo_get_height (shared_bo);
stride = gbm_bo_get_stride (shared_bo);
format = gbm_bo_get_format (shared_bo);
egl_image = create_egl_image (egl,
egl_display,
egl_context,
width, height, stride,
format,
shared_bo_fd,
error);
close (shared_bo_fd);
if (!egl_image)
return FALSE;
paint_egl_image (gles3, egl_image, width, height);
meta_egl_destroy_image (egl, egl_display, egl_image, NULL);
return TRUE;
}
void
meta_renderer_native_gles3_read_pixels (MetaEgl *egl,
MetaGles3 *gles3,
int width,
int height,
uint8_t *target_data)
{
int y;
GLBAS (gles3, glFinish, ());
for (y = 0; y < height; y++)
{
GLBAS (gles3, glReadPixels, (0, height - y, width, 1,
GL_RGBA, GL_UNSIGNED_BYTE,
target_data + width * y * 4));
}
}

View File

@@ -1,45 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/*
* Copyright (C) 2017 Red Hat
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#ifndef META_RENDERER_NATIVE_GLES3_H
#define META_RENDERER_NATIVE_GLES3_H
#include <gbm.h>
#include "backends/meta-egl.h"
#include "backends/meta-gles3.h"
gboolean meta_renderer_native_gles3_blit_shared_bo (MetaEgl *egl,
MetaGles3 *gles3,
EGLDisplay egl_display,
EGLContext egl_context,
EGLSurface egl_surface,
struct gbm_bo *shared_bo,
GError **error);
void meta_renderer_native_gles3_read_pixels (MetaEgl *egl,
MetaGles3 *gles3,
int width,
int height,
uint8_t *target_data);
#endif /* META_RENDERER_NATIVE_GLES3_H */

File diff suppressed because it is too large Load Diff

View File

@@ -25,13 +25,10 @@
#ifndef META_RENDERER_NATIVE_H
#define META_RENDERER_NATIVE_H
#include <gbm.h>
#include <glib-object.h>
#include <xf86drmMode.h>
#include "backends/meta-renderer.h"
#include "backends/native/meta-gpu-kms.h"
#include "backends/native/meta-monitor-manager-kms.h"
#define META_TYPE_RENDERER_NATIVE (meta_renderer_native_get_type ())
G_DECLARE_FINAL_TYPE (MetaRendererNative, meta_renderer_native,
@@ -46,12 +43,15 @@ typedef enum _MetaRendererNativeMode
#endif
} MetaRendererNativeMode;
MetaRendererNative * meta_renderer_native_new (MetaMonitorManagerKms *monitor_manager_kms,
GError **error);
MetaRendererNative *meta_renderer_native_new (int kms_fd,
const char *kms_file_path,
GError **error);
struct gbm_device * meta_gbm_device_from_gpu (MetaGpuKms *gpu_kms);
MetaRendererNativeMode meta_renderer_native_get_mode (MetaRendererNative *renderer_native);
gboolean meta_renderer_native_supports_mirroring (MetaRendererNative *renderer_native);
struct gbm_device * meta_renderer_native_get_gbm (MetaRendererNative *renderer_native);
int meta_renderer_native_get_kms_fd (MetaRendererNative *renderer_native);
void meta_renderer_native_queue_modes_reset (MetaRendererNative *renderer_native);

View File

@@ -38,12 +38,19 @@ struct _MetaStageNative
{
ClutterStageCogl parent;
CoglOnscreen *pending_onscreen;
CoglClosure *frame_closure;
int64_t presented_frame_counter_sync;
int64_t presented_frame_counter_complete;
gboolean pending_resize;
int pending_width;
int pending_height;
};
static ClutterStageWindowIface *clutter_stage_window_parent_iface = NULL;
static void
clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
@@ -52,6 +59,20 @@ G_DEFINE_TYPE_WITH_CODE (MetaStageNative, meta_stage_native,
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
clutter_stage_window_iface_init))
static MetaRendererView *
get_legacy_view (MetaRenderer *renderer)
{
GList *views;
views = meta_renderer_get_views (renderer);
g_assert (g_list_length (views) <= 1);
if (views)
return views->data;
else
return NULL;
}
static void
frame_cb (CoglOnscreen *onscreen,
CoglFrameEvent frame_event,
@@ -143,6 +164,26 @@ meta_stage_native_rebuild_views (MetaStageNative *stage_native)
ensure_frame_callbacks (stage_native);
}
void
meta_stage_native_legacy_set_size (MetaStageNative *stage_native,
int width,
int height)
{
stage_native->pending_resize = TRUE;
stage_native->pending_width = width;
stage_native->pending_height = height;
}
static void
meta_stage_native_unrealize (ClutterStageWindow *stage_window)
{
MetaStageNative *stage_native = META_STAGE_NATIVE (stage_window);
clutter_stage_window_parent_iface->unrealize (stage_window);
g_clear_pointer (&stage_native->pending_onscreen, cogl_object_unref);
}
static gboolean
meta_stage_native_can_clip_redraws (ClutterStageWindow *stage_window)
{
@@ -176,12 +217,37 @@ meta_stage_native_get_geometry (ClutterStageWindow *stage_window,
}
}
static void
ensure_legacy_view (ClutterStageWindow *stage_window)
{
MetaStageNative *stage_native = META_STAGE_NATIVE (stage_window);
MetaBackend *backend = meta_get_backend ();
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaRendererView *legacy_view;
legacy_view = get_legacy_view (renderer);
if (legacy_view)
return;
legacy_view = meta_renderer_native_create_legacy_view (renderer_native);
if (!legacy_view)
return;
meta_renderer_set_legacy_view (renderer, legacy_view);
ensure_frame_callback (stage_native, CLUTTER_STAGE_VIEW (legacy_view));
}
static GList *
meta_stage_native_get_views (ClutterStageWindow *stage_window)
{
MetaBackend *backend = meta_get_backend ();
MetaRenderer *renderer = meta_backend_get_renderer (backend);
if (!meta_is_stage_views_enabled ())
ensure_legacy_view (stage_window);
return meta_renderer_get_views (renderer);
}
@@ -195,6 +261,46 @@ meta_stage_native_get_frame_counter (ClutterStageWindow *stage_window)
return meta_renderer_native_get_frame_counter (renderer_native);
}
static void
maybe_resize_legacy_view (MetaStageNative *stage_native)
{
MetaBackend *backend = meta_get_backend ();
MetaRenderer *renderer = meta_backend_get_renderer (backend);
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (renderer);
MetaRendererView *legacy_view;
int width = stage_native->pending_width;
int height = stage_native->pending_height;
GError *error = NULL;
if (!stage_native->pending_resize)
return;
stage_native->pending_resize = FALSE;
legacy_view = get_legacy_view (renderer);
if (!legacy_view)
return;
if (!meta_renderer_native_set_legacy_view_size (renderer_native,
legacy_view,
width, height,
&error))
{
meta_warning ("Applying display configuration failed: %s\n",
error->message);
g_error_free (error);
}
}
static void
meta_stage_native_redraw (ClutterStageWindow *stage_window)
{
MetaStageNative *stage_native = META_STAGE_NATIVE (stage_window);
maybe_resize_legacy_view (stage_native);
clutter_stage_window_parent_iface->redraw (stage_window);
}
static void
meta_stage_native_finish_frame (ClutterStageWindow *stage_window)
{
@@ -221,9 +327,13 @@ meta_stage_native_class_init (MetaStageNativeClass *klass)
static void
clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
{
clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface);
iface->unrealize = meta_stage_native_unrealize;
iface->can_clip_redraws = meta_stage_native_can_clip_redraws;
iface->get_geometry = meta_stage_native_get_geometry;
iface->get_views = meta_stage_native_get_views;
iface->get_frame_counter = meta_stage_native_get_frame_counter;
iface->redraw = meta_stage_native_redraw;
iface->finish_frame = meta_stage_native_finish_frame;
}

View File

@@ -33,4 +33,8 @@ G_DECLARE_FINAL_TYPE (MetaStageNative, meta_stage_native,
void meta_stage_native_rebuild_views (MetaStageNative *stage_native);
void meta_stage_native_legacy_set_size (MetaStageNative *stage_native,
int width,
int height);
#endif /* META_STAGE_NATIVE_H */

View File

@@ -92,19 +92,15 @@ meta_backend_x11_cm_post_init (MetaBackend *backend)
}
static MetaRenderer *
meta_backend_x11_cm_create_renderer (MetaBackend *backend,
GError **error)
meta_backend_x11_cm_create_renderer (MetaBackend *backend)
{
return g_object_new (META_TYPE_RENDERER_X11_CM, NULL);
}
static MetaMonitorManager *
meta_backend_x11_cm_create_monitor_manager (MetaBackend *backend,
GError **error)
meta_backend_x11_cm_create_monitor_manager (MetaBackend *backend)
{
return g_object_new (META_TYPE_MONITOR_MANAGER_XRANDR,
"backend", backend,
NULL);
return g_object_new (META_TYPE_MONITOR_MANAGER_XRANDR, NULL);
}
static MetaCursorRenderer *

View File

@@ -705,8 +705,6 @@ meta_backend_x11_init (MetaBackendX11 *x11)
*/
XInitThreads();
clutter_x11_request_reset_on_video_memory_purge ();
/* We do X11 event retrieval ourselves */
clutter_x11_disable_event_retrieval ();
}

View File

@@ -33,7 +33,6 @@
#include "clutter/clutter.h"
#include "clutter/clutter-mutter.h"
#include "meta/meta-backend.h"
#include "core/bell.h"
struct _MetaClutterBackendX11
{
@@ -79,14 +78,6 @@ meta_clutter_backend_x11_create_stage (ClutterBackend *backend,
return stage;
}
static void
meta_clutter_backend_x11_bell_notify (ClutterBackend *backend)
{
MetaDisplay *display = meta_get_display ();
meta_bell_notify (display, NULL);
}
static void
meta_clutter_backend_x11_init (MetaClutterBackendX11 *clutter_backend_x11)
{
@@ -99,5 +90,4 @@ meta_clutter_backend_x11_class_init (MetaClutterBackendX11Class *klass)
clutter_backend_class->get_renderer = meta_clutter_backend_x11_get_renderer;
clutter_backend_class->create_stage = meta_clutter_backend_x11_create_stage;
clutter_backend_class->bell_notify = meta_clutter_backend_x11_bell_notify;
}

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