Compare commits
193 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
5ac7109aaa | ||
![]() |
7749f4d983 | ||
![]() |
22aea3dc67 | ||
![]() |
3d5784342d | ||
![]() |
fa9e330f2c | ||
![]() |
951219650f | ||
![]() |
49b23c7490 | ||
![]() |
644a618fb1 | ||
![]() |
1e3ac3cf2c | ||
![]() |
658c373580 | ||
![]() |
6d12d2eac2 | ||
![]() |
356cad094b | ||
![]() |
161d2540e6 | ||
![]() |
94f4009882 | ||
![]() |
ec8138773a | ||
![]() |
041be7c565 | ||
![]() |
0407a8b33d | ||
![]() |
912a6f5e3f | ||
![]() |
89162a90aa | ||
![]() |
90a68f3118 | ||
![]() |
951fb03a7c | ||
![]() |
4837ea3434 | ||
![]() |
3fbeeb9072 | ||
![]() |
0ca3526627 | ||
![]() |
5b8c8a4114 | ||
![]() |
f635876eac | ||
![]() |
1caaf0cd1e | ||
![]() |
e2464660bc | ||
![]() |
81c1c70c0a | ||
![]() |
e05cd6009a | ||
![]() |
390314adfb | ||
![]() |
2ac7afe8a9 | ||
![]() |
d5c5669f2a | ||
![]() |
e8171ccdc1 | ||
![]() |
43f9cd537e | ||
![]() |
d4c4d6e64d | ||
![]() |
89727aa747 | ||
![]() |
de5e7a7175 | ||
![]() |
e6b885210c | ||
![]() |
9f1ab1c3af | ||
![]() |
9333a6da75 | ||
![]() |
8adab02757 | ||
![]() |
14d8aec4b8 | ||
![]() |
8e7e1eeef5 | ||
![]() |
0a8ae8417c | ||
![]() |
1d5e37050d | ||
![]() |
b7c3dada81 | ||
![]() |
d79ffd3976 | ||
![]() |
6458139c04 | ||
![]() |
82307dd694 | ||
![]() |
e1c67a1824 | ||
![]() |
68f261e8e2 | ||
![]() |
1530f27513 | ||
![]() |
05899596d1 | ||
![]() |
98d912ba5f | ||
![]() |
9e5ea8def4 | ||
![]() |
722c975aca | ||
![]() |
937a9853cd | ||
![]() |
cd8f4259be | ||
![]() |
c64d5ad8af | ||
![]() |
dacc041d0c | ||
![]() |
18779109de | ||
![]() |
522f9b4c38 | ||
![]() |
3d2b9a3a69 | ||
![]() |
15fa7816bd | ||
![]() |
6621a9b5a0 | ||
![]() |
04e411c2c0 | ||
![]() |
859bea629b | ||
![]() |
cbc783108e | ||
![]() |
2383801f7b | ||
![]() |
8626c69c2f | ||
![]() |
768ec15ea0 | ||
![]() |
1200182d70 | ||
![]() |
d9c18fd5bb | ||
![]() |
54709c16b5 | ||
![]() |
8da95b17f5 | ||
![]() |
d535c1eb6d | ||
![]() |
435b3c4bdb | ||
![]() |
22723ca371 | ||
![]() |
edd3634bb5 | ||
![]() |
1bf2eb95b5 | ||
![]() |
516fb524cb | ||
![]() |
596b30096d | ||
![]() |
7412794c66 | ||
![]() |
ad22b3f098 | ||
![]() |
206634e0ed | ||
![]() |
ea05d2af49 | ||
![]() |
6c7c566c6c | ||
![]() |
b596cf97ee | ||
![]() |
9dcf9782b6 | ||
![]() |
0f519ffb05 | ||
![]() |
42c78bd41f | ||
![]() |
b702c0fa5c | ||
![]() |
c80fd487f1 | ||
![]() |
817c8e568c | ||
![]() |
b7e9388906 | ||
![]() |
b8336633a7 | ||
![]() |
3c538d4a92 | ||
![]() |
2fc978ca9d | ||
![]() |
10dfc67dad | ||
![]() |
9ebcb719a1 | ||
![]() |
2a20df0c50 | ||
![]() |
d3441f7577 | ||
![]() |
65c02e26db | ||
![]() |
50ff9d4c71 | ||
![]() |
a3269dde95 | ||
![]() |
f2dea5d139 | ||
![]() |
3649795108 | ||
![]() |
36b9551f92 | ||
![]() |
6abe4703c7 | ||
![]() |
69ca584168 | ||
![]() |
8ee14a7cb7 | ||
![]() |
909dbafd67 | ||
![]() |
d5203f170e | ||
![]() |
2a45b7de7c | ||
![]() |
62c67be4c8 | ||
![]() |
0332b7394e | ||
![]() |
15f41c9f68 | ||
![]() |
2a38601b42 | ||
![]() |
d7bdc1591f | ||
![]() |
bd36764b4d | ||
![]() |
473bf38753 | ||
![]() |
f7747e4d4f | ||
![]() |
e8dc2acfca | ||
![]() |
cf734999fb | ||
![]() |
c9c3283540 | ||
![]() |
d2a8cdfd7c | ||
![]() |
3e85ac8131 | ||
![]() |
5f83d9a5c8 | ||
![]() |
ac20bf2000 | ||
![]() |
3561082aba | ||
![]() |
e34c330f66 | ||
![]() |
7655e09d00 | ||
![]() |
be069fb8ae | ||
![]() |
a30166a547 | ||
![]() |
0f9c6aef99 | ||
![]() |
332d55f7f6 | ||
![]() |
98d7024288 | ||
![]() |
82564772dc | ||
![]() |
33c2a38ff7 | ||
![]() |
52fdd24467 | ||
![]() |
2319cd9c40 | ||
![]() |
3b4319a87c | ||
![]() |
20176d0395 | ||
![]() |
762a3f89a9 | ||
![]() |
822c2666f5 | ||
![]() |
b412e6c493 | ||
![]() |
ae26cd0774 | ||
![]() |
3104d697c0 | ||
![]() |
0b3a1c9c31 | ||
![]() |
423c5f8e77 | ||
![]() |
3bbff94878 | ||
![]() |
4ef886f51e | ||
![]() |
22485ba36f | ||
![]() |
8df2a1452c | ||
![]() |
b12c92e206 | ||
![]() |
70036429bd | ||
![]() |
44502be560 | ||
![]() |
8cf42cd06c | ||
![]() |
b5328c977e | ||
![]() |
4339b23dd0 | ||
![]() |
a95cbd0aca | ||
![]() |
6df2b7af55 | ||
![]() |
c01b099dbd | ||
![]() |
2d80fd02e7 | ||
![]() |
bb65854065 | ||
![]() |
bc05e49eba | ||
![]() |
773b8384fa | ||
![]() |
7fdac6d310 | ||
![]() |
f6cd87734d | ||
![]() |
01a0fa9437 | ||
![]() |
657417a578 | ||
![]() |
4af00ae296 | ||
![]() |
84e575be77 | ||
![]() |
7945ee5beb | ||
![]() |
b6f5bab212 | ||
![]() |
5ad34e0efb | ||
![]() |
a1c34aad09 | ||
![]() |
98dfd5b887 | ||
![]() |
17a745bf81 | ||
![]() |
85bbd82ae8 | ||
![]() |
deda7a5235 | ||
![]() |
96141e28f9 | ||
![]() |
e6109cfc22 | ||
![]() |
3684f6b0ac | ||
![]() |
31b5059068 | ||
![]() |
ebff7fd7f4 | ||
![]() |
6e415353e3 | ||
![]() |
67917db45f | ||
![]() |
8286557a05 | ||
![]() |
63e2c0329f | ||
![]() |
06c357d781 | ||
![]() |
2f260edf19 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -100,6 +100,7 @@ src/linux-dmabuf-unstable-v*-protocol.c
|
||||
src/linux-dmabuf-unstable-v*-server-protocol.h
|
||||
src/xdg-shell-protocol.c
|
||||
src/xdg-shell-server-protocol.h
|
||||
src/wayland-eglstream-controller-server-protocol.h
|
||||
src/meta/meta-version.h
|
||||
src/libmutter-*.pc
|
||||
doc/reference/*.args
|
||||
|
65
NEWS
65
NEWS
@@ -1,3 +1,68 @@
|
||||
3.29.4
|
||||
======
|
||||
* Fix crash with parent-less modal dialogs [Olivier; #174]
|
||||
* Preserve paint volumes where possible to optimize CPU usage [Carlos; #782344]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Iain Lane, Bastien Nocera
|
||||
|
||||
Translators:
|
||||
Daniel Șerbănescu [ro]
|
||||
|
||||
3.29.3
|
||||
======
|
||||
* Fix Korean Hangul support on wayland [Changwoo; #152]
|
||||
* Improve support for proprietary Nvidia driver [Jonas; #790316]
|
||||
* Only upload HW cursor sprite to the GPU that will display them [Jonas; #77]
|
||||
* Improve EGLstream support [Miguel; #2, #782575]
|
||||
* Remove MetaScreen to prepare for non-mandatary X11 dependency
|
||||
[Armin, Jonas; #759538]
|
||||
* Misc. bug fixes [Olivier, Jonas, Sam; #160, !130, #786929, #788834]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Armin Krezović, Corentin Noël,
|
||||
Changwoo Ryu, Sam Spilsbury, Daniel Stone, Marco Trevisan (Treviño),
|
||||
Miguel A. Vico, Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Yi-Jyun Pan [zh_TW], Jordi Mas [ca], Daniel Șerbănescu [ro], Fabio Tomat [fur]
|
||||
|
||||
3.29.2
|
||||
======
|
||||
* Fix size change animations on wayland [Georges; #780292]
|
||||
* Handle touch events on server-side titlebars [Carlos; #770185]
|
||||
* Misc. bug fixes [Florian, Olivier, Jonas, Georges; #134, #124, !96, #138,
|
||||
!102, #781471, #150]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, Florian Müllner,
|
||||
Georges Basile Stavracas Neto, Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Daniel Șerbănescu [ro], Marcos Lans [gl], Dz Chen [zh_CN]
|
||||
|
||||
3.29.1
|
||||
======
|
||||
* Fix various input-method regressions [Carlos, Olivier; #65, #74, #66, #112]
|
||||
* Fix wayland build on FreeBSD [Ting-Wei; #792280, #792717]
|
||||
* Fix swapped colors in screenshots (again) [Carlos; #72]
|
||||
* Allow building with elogind [Rasmus; !46]
|
||||
* Consider display rotation for cursor [Olivier; #85]
|
||||
* Fall back to non-modifier GBM surfaces [Daniel; #84]
|
||||
* Take inhibitors into account for monitoring idle [Bastien; #705942]
|
||||
* Misc. bug fixes [handsome-feng, Olivier, Mario, Jonas; !45, #83, #104,
|
||||
gnome-shell#157, #130, #21]
|
||||
|
||||
Contributors:
|
||||
Jonas Ådahl, Olivier Fourdan, Carlos Garnacho, handsome-feng, Yussuf Khalil,
|
||||
Ting-Wei Lan, Aleksandr Mezin, Alberts Muktupāvels,
|
||||
Georges Basile Stavracas Neto, Bastien Nocera, Benjamin Otte,
|
||||
Mario Sanchez Prada, Daniel Stone, Ray Strode, Rasmus Thomsen,
|
||||
Marco Trevisan (Treviño), Daniel van Vugt
|
||||
|
||||
Translators:
|
||||
Emin Tufan Çetin [tr], Dušan Kazik [sk], Matej Urbančič [sl]
|
||||
|
||||
3.28.0
|
||||
======
|
||||
* Fix xdg-foreign regression [Carlos; #63]
|
||||
|
@@ -692,7 +692,7 @@ Cally_@LIBMUTTER_API_VERSION@_gir_CFLAGS = $(AM_CPPFLAGS) $(CLUTTER_CFLAGS)
|
||||
Cally_@LIBMUTTER_API_VERSION@_gir_SCANNERFLAGS = \
|
||||
--warn-all \
|
||||
--c-include='cally/cally.h' \
|
||||
--pkg-export=mutter-cally-@LIBMUTTER_API_VERSION@ \
|
||||
--pkg-export=mutter-clutter-@LIBMUTTER_API_VERSION@ \
|
||||
--include-uninstalled=$(top_builddir)/clutter/Clutter-@LIBMUTTER_API_VERSION@.gir
|
||||
|
||||
INTROSPECTION_GIRS += Cally-@LIBMUTTER_API_VERSION@.gir
|
||||
|
@@ -214,6 +214,8 @@ cally_util_simulate_snooper_install (void)
|
||||
G_CALLBACK (cally_util_stage_added_cb), cally_key_snooper);
|
||||
g_signal_connect (G_OBJECT (stage_manager), "stage-removed",
|
||||
G_CALLBACK (cally_util_stage_removed_cb), cally_key_snooper);
|
||||
|
||||
g_slist_free (stage_list);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@@ -840,6 +840,7 @@ struct _ClutterActorPrivate
|
||||
guint needs_compute_expand : 1;
|
||||
guint needs_x_expand : 1;
|
||||
guint needs_y_expand : 1;
|
||||
guint needs_paint_volume_update : 1;
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -1504,6 +1505,8 @@ clutter_actor_real_map (ClutterActor *self)
|
||||
|
||||
CLUTTER_ACTOR_SET_FLAGS (self, CLUTTER_ACTOR_MAPPED);
|
||||
|
||||
self->priv->needs_paint_volume_update = TRUE;
|
||||
|
||||
stage = _clutter_actor_get_stage_internal (self);
|
||||
priv->pick_id = _clutter_stage_acquire_pick_id (CLUTTER_STAGE (stage), self);
|
||||
|
||||
@@ -2737,6 +2740,7 @@ clutter_actor_real_queue_relayout (ClutterActor *self)
|
||||
priv->needs_width_request = TRUE;
|
||||
priv->needs_height_request = TRUE;
|
||||
priv->needs_allocation = TRUE;
|
||||
priv->needs_paint_volume_update = TRUE;
|
||||
|
||||
/* reset the cached size requests */
|
||||
memset (priv->width_requests, 0,
|
||||
@@ -2821,7 +2825,7 @@ _clutter_actor_fully_transform_vertices (ClutterActor *self,
|
||||
/* Note: we pass NULL as the ancestor because we don't just want the modelview
|
||||
* that gets us to stage coordinates, we want to go all the way to eye
|
||||
* coordinates */
|
||||
_clutter_actor_apply_relative_transformation_matrix (self, NULL, &modelview);
|
||||
_clutter_actor_get_relative_transformation_matrix (self, NULL, &modelview);
|
||||
|
||||
/* Fetch the projection and viewport */
|
||||
_clutter_stage_get_projection_matrix (CLUTTER_STAGE (stage), &projection);
|
||||
@@ -8518,6 +8522,7 @@ clutter_actor_init (ClutterActor *self)
|
||||
priv->needs_width_request = TRUE;
|
||||
priv->needs_height_request = TRUE;
|
||||
priv->needs_allocation = TRUE;
|
||||
priv->needs_paint_volume_update = TRUE;
|
||||
|
||||
priv->cached_width_age = 1;
|
||||
priv->cached_height_age = 1;
|
||||
@@ -10084,6 +10089,9 @@ clutter_actor_allocate (ClutterActor *self,
|
||||
return;
|
||||
}
|
||||
|
||||
if (CLUTTER_ACTOR_IS_MAPPED (self))
|
||||
self->priv->needs_paint_volume_update = TRUE;
|
||||
|
||||
if (!stage_allocation_changed)
|
||||
{
|
||||
/* If the actor didn't move but needs_allocation is set, we just
|
||||
@@ -12972,6 +12980,9 @@ clutter_actor_add_child_internal (ClutterActor *self,
|
||||
child->priv->needs_height_request = TRUE;
|
||||
child->priv->needs_allocation = TRUE;
|
||||
|
||||
if (CLUTTER_ACTOR_IS_MAPPED (child))
|
||||
child->priv->needs_paint_volume_update = TRUE;
|
||||
|
||||
/* we only queue a relayout here, because any possible
|
||||
* redraw has already been queued either by show() or
|
||||
* by our call to queue_redraw() above
|
||||
@@ -17514,11 +17525,16 @@ _clutter_actor_get_paint_volume_mutable (ClutterActor *self)
|
||||
priv = self->priv;
|
||||
|
||||
if (priv->paint_volume_valid)
|
||||
clutter_paint_volume_free (&priv->paint_volume);
|
||||
{
|
||||
if (!priv->needs_paint_volume_update)
|
||||
return &priv->paint_volume;
|
||||
clutter_paint_volume_free (&priv->paint_volume);
|
||||
}
|
||||
|
||||
if (_clutter_actor_get_paint_volume_real (self, &priv->paint_volume))
|
||||
{
|
||||
priv->paint_volume_valid = TRUE;
|
||||
priv->needs_paint_volume_update = FALSE;
|
||||
return &priv->paint_volume;
|
||||
}
|
||||
else
|
||||
|
@@ -353,6 +353,7 @@ clutter_input_method_notify_key_event (ClutterInputMethod *im,
|
||||
copy = clutter_event_copy (event);
|
||||
clutter_event_set_flags (copy, clutter_event_get_flags (event) |
|
||||
CLUTTER_EVENT_FLAG_INPUT_METHOD);
|
||||
clutter_event_set_source_device (copy, clutter_event_get_device (copy));
|
||||
clutter_event_put (copy);
|
||||
clutter_event_free (copy);
|
||||
}
|
||||
|
@@ -2830,6 +2830,10 @@ clutter_text_key_focus_in (ClutterActor *actor)
|
||||
if (method && priv->editable)
|
||||
{
|
||||
clutter_input_method_focus_in (method, priv->input_focus);
|
||||
clutter_input_focus_set_content_purpose (priv->input_focus,
|
||||
priv->input_purpose);
|
||||
clutter_input_focus_set_content_hints (priv->input_focus,
|
||||
priv->input_hints);
|
||||
update_cursor_location (CLUTTER_TEXT (actor));
|
||||
}
|
||||
|
||||
@@ -4511,6 +4515,27 @@ buffer_deleted_text (ClutterTextBuffer *buffer,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_text_queue_redraw_or_relayout (ClutterText *self)
|
||||
{
|
||||
ClutterActor *actor = CLUTTER_ACTOR (self);
|
||||
gfloat preferred_width;
|
||||
gfloat preferred_height;
|
||||
|
||||
clutter_text_dirty_cache (self);
|
||||
|
||||
/* we're using our private implementations here to avoid the caching done by ClutterActor */
|
||||
clutter_text_get_preferred_width (actor, -1, NULL, &preferred_width);
|
||||
clutter_text_get_preferred_height (actor, preferred_width, NULL, &preferred_height);
|
||||
|
||||
if (clutter_actor_has_allocation (actor) &&
|
||||
(fabsf (preferred_width - clutter_actor_get_width (actor)) > 0.001 ||
|
||||
fabsf (preferred_height - clutter_actor_get_height (actor)) > 0.001))
|
||||
clutter_actor_queue_relayout (actor);
|
||||
else
|
||||
clutter_text_queue_redraw (actor);
|
||||
}
|
||||
|
||||
static void
|
||||
buffer_notify_text (ClutterTextBuffer *buffer,
|
||||
GParamSpec *spec,
|
||||
@@ -4518,9 +4543,7 @@ buffer_notify_text (ClutterTextBuffer *buffer,
|
||||
{
|
||||
g_object_freeze_notify (G_OBJECT (self));
|
||||
|
||||
clutter_text_dirty_cache (self);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
|
||||
clutter_text_queue_redraw_or_relayout (self);
|
||||
|
||||
g_signal_emit (self, text_signals[TEXT_CHANGED], 0);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_TEXT]);
|
||||
@@ -4872,8 +4895,7 @@ clutter_text_set_cursor_visible (ClutterText *self,
|
||||
{
|
||||
priv->cursor_visible = cursor_visible;
|
||||
|
||||
clutter_text_dirty_cache (self);
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
|
||||
clutter_text_queue_redraw_or_relayout (self);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_CURSOR_VISIBLE]);
|
||||
}
|
||||
@@ -5774,9 +5796,7 @@ clutter_text_set_line_alignment (ClutterText *self,
|
||||
{
|
||||
priv->alignment = alignment;
|
||||
|
||||
clutter_text_dirty_cache (self);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
|
||||
clutter_text_queue_redraw_or_relayout (self);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_LINE_ALIGNMENT]);
|
||||
}
|
||||
@@ -5831,9 +5851,7 @@ clutter_text_set_use_markup (ClutterText *self,
|
||||
if (setting)
|
||||
clutter_text_set_markup_internal (self, text);
|
||||
|
||||
clutter_text_dirty_cache (self);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
|
||||
clutter_text_queue_redraw_or_relayout (self);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5880,9 +5898,7 @@ clutter_text_set_justify (ClutterText *self,
|
||||
{
|
||||
priv->justify = justify;
|
||||
|
||||
clutter_text_dirty_cache (self);
|
||||
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
|
||||
clutter_text_queue_redraw_or_relayout (self);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_JUSTIFY]);
|
||||
}
|
||||
@@ -6449,8 +6465,7 @@ clutter_text_set_preedit_string (ClutterText *self,
|
||||
priv->preedit_set = TRUE;
|
||||
}
|
||||
|
||||
clutter_text_dirty_cache (self);
|
||||
clutter_actor_queue_relayout (CLUTTER_ACTOR (self));
|
||||
clutter_text_queue_redraw_or_relayout (self);
|
||||
}
|
||||
|
||||
|
||||
@@ -6512,7 +6527,9 @@ clutter_text_set_input_hints (ClutterText *self,
|
||||
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||
|
||||
self->priv->input_hints = hints;
|
||||
clutter_input_focus_set_content_hints (self->priv->input_focus, hints);
|
||||
|
||||
if (clutter_input_focus_is_focused (self->priv->input_focus))
|
||||
clutter_input_focus_set_content_hints (self->priv->input_focus, hints);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_INPUT_HINTS]);
|
||||
}
|
||||
|
||||
@@ -6531,7 +6548,9 @@ clutter_text_set_input_purpose (ClutterText *self,
|
||||
g_return_if_fail (CLUTTER_IS_TEXT (self));
|
||||
|
||||
self->priv->input_purpose = purpose;
|
||||
clutter_input_focus_set_content_purpose (self->priv->input_focus, purpose);
|
||||
|
||||
if (clutter_input_focus_is_focused (self->priv->input_focus))
|
||||
clutter_input_focus_set_content_purpose (self->priv->input_focus, purpose);
|
||||
g_object_notify_by_pspec (G_OBJECT (self), obj_props[PROP_INPUT_PURPOSE]);
|
||||
}
|
||||
|
||||
|
@@ -793,10 +793,12 @@ evdev_add_device (ClutterDeviceManagerEvdev *manager_evdev,
|
||||
if (priv->main_seat->libinput_seat == NULL)
|
||||
seat = priv->main_seat;
|
||||
else
|
||||
seat = clutter_seat_evdev_new (manager_evdev);
|
||||
{
|
||||
seat = clutter_seat_evdev_new (manager_evdev);
|
||||
priv->seats = g_slist_append (priv->seats, seat);
|
||||
}
|
||||
|
||||
clutter_seat_evdev_set_libinput_seat (seat, libinput_seat);
|
||||
priv->seats = g_slist_append (priv->seats, seat);
|
||||
}
|
||||
|
||||
device = _clutter_input_device_evdev_new (manager, seat, libinput_device);
|
||||
@@ -919,7 +921,6 @@ clutter_device_manager_evdev_get_device (ClutterDeviceManager *manager,
|
||||
ClutterDeviceManagerEvdev *manager_evdev;
|
||||
ClutterDeviceManagerEvdevPrivate *priv;
|
||||
GSList *l;
|
||||
GSList *device_it;
|
||||
|
||||
manager_evdev = CLUTTER_DEVICE_MANAGER_EVDEV (manager);
|
||||
priv = manager_evdev->priv;
|
||||
@@ -927,14 +928,10 @@ clutter_device_manager_evdev_get_device (ClutterDeviceManager *manager,
|
||||
for (l = priv->seats; l; l = l->next)
|
||||
{
|
||||
ClutterSeatEvdev *seat = l->data;
|
||||
ClutterInputDevice *device = clutter_seat_evdev_get_device (seat, id);
|
||||
|
||||
for (device_it = seat->devices; device_it; device_it = device_it->next)
|
||||
{
|
||||
ClutterInputDevice *device = device_it->data;
|
||||
|
||||
if (clutter_input_device_get_device_id (device) == id)
|
||||
return device;
|
||||
}
|
||||
if (device)
|
||||
return device;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@@ -1967,6 +1964,7 @@ clutter_device_manager_evdev_constructed (GObject *gobject)
|
||||
xkb_context_unref (ctx);
|
||||
|
||||
priv->main_seat = clutter_seat_evdev_new (manager_evdev);
|
||||
priv->seats = g_slist_append (priv->seats, priv->main_seat);
|
||||
|
||||
dispatch_libinput (manager_evdev);
|
||||
|
||||
|
@@ -433,6 +433,8 @@ key_event_is_modifier (ClutterEvent *event)
|
||||
case XKB_KEY_Super_R:
|
||||
case XKB_KEY_Hyper_L:
|
||||
case XKB_KEY_Hyper_R:
|
||||
case XKB_KEY_Caps_Lock:
|
||||
case XKB_KEY_Shift_Lock:
|
||||
return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
@@ -584,6 +586,12 @@ handle_stickykeys_press (ClutterEvent *event,
|
||||
}
|
||||
|
||||
depressed_mods = xkb_state_serialize_mods (seat->xkb, XKB_STATE_MODS_DEPRESSED);
|
||||
/* Ignore the lock modifier mask, that one cannot be sticky, yet the
|
||||
* CAPS_LOCK key itself counts as a modifier as it might be remapped
|
||||
* to some other modifier which can be sticky.
|
||||
*/
|
||||
depressed_mods &= ~CLUTTER_LOCK_MASK;
|
||||
|
||||
new_latched_mask = device->stickykeys_latched_mask;
|
||||
new_locked_mask = device->stickykeys_locked_mask;
|
||||
|
||||
@@ -1122,6 +1130,10 @@ clutter_input_device_evdev_process_kbd_a11y_event (ClutterEvent *e
|
||||
{
|
||||
ClutterInputDeviceEvdev *device_evdev = CLUTTER_INPUT_DEVICE_EVDEV (device);
|
||||
|
||||
/* Ignore key events injected from IM */
|
||||
if (event->key.flags & CLUTTER_EVENT_FLAG_INPUT_METHOD)
|
||||
goto emit_event;
|
||||
|
||||
if (!device_evdev->a11y_flags & CLUTTER_A11Y_KEYBOARD_ENABLED)
|
||||
goto emit_event;
|
||||
|
||||
|
@@ -858,6 +858,24 @@ clutter_seat_evdev_free (ClutterSeatEvdev *seat)
|
||||
g_free (seat);
|
||||
}
|
||||
|
||||
ClutterInputDevice *
|
||||
clutter_seat_evdev_get_device (ClutterSeatEvdev *seat,
|
||||
gint id)
|
||||
{
|
||||
ClutterInputDevice *device;
|
||||
GSList *l;
|
||||
|
||||
for (l = seat->devices; l; l = l->next)
|
||||
{
|
||||
device = l->data;
|
||||
|
||||
if (clutter_input_device_get_device_id (device) == id)
|
||||
return device;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
clutter_seat_evdev_set_stage (ClutterSeatEvdev *seat,
|
||||
ClutterStage *stage)
|
||||
|
@@ -139,6 +139,9 @@ void clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
|
||||
|
||||
void clutter_seat_evdev_sync_leds (ClutterSeatEvdev *seat);
|
||||
|
||||
ClutterInputDevice * clutter_seat_evdev_get_device (ClutterSeatEvdev *seat,
|
||||
gint id);
|
||||
|
||||
ClutterTouchState * clutter_seat_evdev_acquire_touch_state (ClutterSeatEvdev *seat,
|
||||
int device_slot);
|
||||
|
||||
|
@@ -110,7 +110,8 @@ clutter_input_device_xi2_finalize (GObject *object)
|
||||
if (device_xi2->wacom_device)
|
||||
libwacom_destroy (device_xi2->wacom_device);
|
||||
|
||||
g_array_unref (device_xi2->group_modes);
|
||||
if (device_xi2->group_modes)
|
||||
g_array_unref (device_xi2->group_modes);
|
||||
#endif
|
||||
|
||||
G_OBJECT_CLASS (clutter_input_device_xi2_parent_class)->finalize (object);
|
||||
|
@@ -452,7 +452,7 @@ libmutter_cogl_@LIBMUTTER_API_VERSION@_la_LDFLAGS = \
|
||||
-avoid-version \
|
||||
-export-dynamic \
|
||||
-rpath $(mutterlibdir) \
|
||||
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_texture_set_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_|_cogl_winsys_glx_get_vtable|_cogl_winsys_egl_xlib_get_vtable|_cogl_winsys_egl_get_vtable|_cogl_closure_disconnect|_cogl_onscreen_notify_complete|_cogl_onscreen_notify_frame_sync|_cogl_winsys_egl_renderer_connect_common|_cogl_winsys_error_quark|_cogl_set_error|_cogl_poll_renderer_add_fd|_cogl_poll_renderer_add_idle|_cogl_framebuffer_winsys_update_size|_cogl_winsys_egl_make_current|_cogl_pixel_format_get_bytes_per_pixel).*"
|
||||
-export-symbols-regex "^(cogl|_cogl_debug_flags|_cogl_atlas_new|_cogl_atlas_add_reorganize_callback|_cogl_atlas_reserve_space|_cogl_callback|_cogl_util_get_eye_planes_for_screen_poly|_cogl_atlas_texture_remove_reorganize_callback|_cogl_atlas_texture_add_reorganize_callback|_cogl_texture_get_format|_cogl_texture_foreach_sub_texture_in_region|_cogl_texture_set_region|_cogl_profile_trace_message|_cogl_context_get_default|_cogl_framebuffer_get_stencil_bits|_cogl_clip_stack_push_rectangle|_cogl_framebuffer_get_modelview_stack|_cogl_object_default_unref|_cogl_pipeline_foreach_layer_internal|_cogl_clip_stack_push_primitive|_cogl_buffer_unmap_for_fill_or_fallback|_cogl_framebuffer_draw_primitive|_cogl_debug_instances|_cogl_framebuffer_get_projection_stack|_cogl_pipeline_layer_get_texture|_cogl_buffer_map_for_fill_or_fallback|_cogl_texture_can_hardware_repeat|_cogl_pipeline_prune_to_n_layers|_cogl_primitive_draw|test_|unit_test_|_cogl_winsys_glx_get_vtable|_cogl_winsys_egl_xlib_get_vtable|_cogl_winsys_egl_get_vtable|_cogl_closure_disconnect|_cogl_onscreen_notify_complete|_cogl_onscreen_notify_frame_sync|_cogl_winsys_egl_renderer_connect_common|_cogl_winsys_error_quark|_cogl_set_error|_cogl_poll_renderer_add_fd|_cogl_poll_renderer_add_idle|_cogl_framebuffer_winsys_update_size|_cogl_winsys_egl_make_current|_cogl_winsys_egl_ensure_current|_cogl_pixel_format_get_bytes_per_pixel).*"
|
||||
|
||||
libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(cogl_sources_c)
|
||||
nodist_libmutter_cogl_@LIBMUTTER_API_VERSION@_la_SOURCES = $(BUILT_SOURCES)
|
||||
|
@@ -109,7 +109,11 @@ _cogl_object_default_unref (void *object)
|
||||
void
|
||||
cogl_object_unref (void *obj)
|
||||
{
|
||||
void (* unref_func) (void *) = ((CoglObject *) obj)->klass->virt_unref;
|
||||
void (* unref_func) (void *);
|
||||
|
||||
_COGL_RETURN_IF_FAIL (obj != NULL);
|
||||
|
||||
unref_func = ((CoglObject *) obj)->klass->virt_unref;
|
||||
unref_func (obj);
|
||||
}
|
||||
|
||||
|
@@ -1412,22 +1412,12 @@ _cogl_framebuffer_gl_read_pixels_into_bitmap (CoglFramebuffer *framebuffer,
|
||||
if (!cogl_is_offscreen (framebuffer))
|
||||
y = framebuffer_height - y - height;
|
||||
|
||||
required_format = ctx->driver_vtable->pixel_format_to_gl (ctx,
|
||||
format,
|
||||
&gl_intformat,
|
||||
&gl_format,
|
||||
&gl_type);
|
||||
#if HAVE_COGL_GL
|
||||
/* As we are reading pixels, we want to consider the bitmap according to
|
||||
* its real pixel format, not the swizzled channels we pretend face to the
|
||||
* pipeline.
|
||||
*/
|
||||
if ((ctx->driver == COGL_DRIVER_GL || ctx->driver == COGL_DRIVER_GL3) &&
|
||||
(format == COGL_PIXEL_FORMAT_BGRA_8888 ||
|
||||
format == COGL_PIXEL_FORMAT_BGRA_8888_PRE) &&
|
||||
_cogl_has_private_feature (ctx, COGL_PRIVATE_FEATURE_TEXTURE_SWIZZLE))
|
||||
gl_format = GL_BGRA;
|
||||
#endif
|
||||
required_format = ctx->driver_vtable->pixel_format_to_gl_with_target (ctx,
|
||||
framebuffer->internal_format,
|
||||
format,
|
||||
&gl_intformat,
|
||||
&gl_format,
|
||||
&gl_type);
|
||||
|
||||
/* NB: All offscreen rendering is done upside down so there is no need
|
||||
* to flip in this case... */
|
||||
|
@@ -181,6 +181,9 @@ _cogl_winsys_egl_make_current (CoglDisplay *display,
|
||||
EGLSurface read,
|
||||
EGLContext context);
|
||||
|
||||
EGLBoolean
|
||||
_cogl_winsys_egl_ensure_current (CoglDisplay *display);
|
||||
|
||||
#ifdef EGL_KHR_image_base
|
||||
EGLImageKHR
|
||||
_cogl_egl_create_image (CoglContext *ctx,
|
||||
|
@@ -309,6 +309,18 @@ _cogl_winsys_egl_make_current (CoglDisplay *display,
|
||||
return ret;
|
||||
}
|
||||
|
||||
EGLBoolean
|
||||
_cogl_winsys_egl_ensure_current (CoglDisplay *display)
|
||||
{
|
||||
CoglDisplayEGL *egl_display = display->winsys;
|
||||
CoglRendererEGL *egl_renderer = display->renderer->winsys;
|
||||
|
||||
return eglMakeCurrent (egl_renderer->edpy,
|
||||
egl_display->current_draw_surface,
|
||||
egl_display->current_read_surface,
|
||||
egl_display->current_context);
|
||||
}
|
||||
|
||||
static void
|
||||
cleanup_context (CoglDisplay *display)
|
||||
{
|
||||
|
33
configure.ac
33
configure.ac
@@ -1,15 +1,15 @@
|
||||
AC_PREREQ(2.62)
|
||||
|
||||
m4_define([mutter_major_version], [3])
|
||||
m4_define([mutter_minor_version], [28])
|
||||
m4_define([mutter_micro_version], [0])
|
||||
m4_define([mutter_minor_version], [29])
|
||||
m4_define([mutter_micro_version], [4])
|
||||
|
||||
m4_define([mutter_version],
|
||||
[mutter_major_version.mutter_minor_version.mutter_micro_version])
|
||||
|
||||
m4_define([mutter_plugin_api_version], [3])
|
||||
|
||||
m4_define([libmutter_api_version], [2])
|
||||
m4_define([libmutter_api_version], [3])
|
||||
|
||||
AC_INIT([mutter], [mutter_version],
|
||||
[http://bugzilla.gnome.org/enter_bug.cgi?product=mutter])
|
||||
@@ -88,7 +88,6 @@ MUTTER_PC_MODULES="
|
||||
cairo >= 1.10.0
|
||||
gsettings-desktop-schemas >= 3.21.4
|
||||
json-glib-1.0
|
||||
upower-glib >= 0.99.0
|
||||
gnome-desktop-3.0
|
||||
xcomposite >= 0.2
|
||||
xcursor
|
||||
@@ -262,7 +261,19 @@ AC_SUBST(XWAYLAND_PATH)
|
||||
|
||||
PKG_CHECK_MODULES(MUTTER, $MUTTER_PC_MODULES)
|
||||
|
||||
MUTTER_NATIVE_BACKEND_MODULES="libdrm >= 2.4.83 libsystemd libinput >= 1.4 gudev-1.0 gbm >= 17.1"
|
||||
PKG_CHECK_MODULES(ELOGIND, [libelogind], [have_elogind=yes], [have_elogind=no])
|
||||
|
||||
if test x$have_elogind = xyes; then
|
||||
logind_provider="libelogind"
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(SYSTEMD, [libsystemd], [have_systemd=yes], [have_systemd=no])
|
||||
|
||||
if test x$have_systemd = xyes -o -z "$logind_provider"; then
|
||||
logind_provider="libsystemd"
|
||||
fi
|
||||
|
||||
MUTTER_NATIVE_BACKEND_MODULES="libdrm $logind_provider libinput >= 1.4 gudev-1.0 gbm >= 10.3"
|
||||
|
||||
AC_ARG_ENABLE(native-backend,
|
||||
AS_HELP_STRING([--disable-native-backend], [disable mutter native (KMS) backend]),,
|
||||
@@ -278,13 +289,24 @@ AS_IF([test "$have_native_backend" = "yes"], [
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_NATIVE_BACKEND],[test "$have_native_backend" = "yes"])
|
||||
|
||||
MUTTER_WAYLAND_EGLSTREAM_MODULES="wayland-eglstream-protocols"
|
||||
|
||||
AC_ARG_ENABLE(egl-device,
|
||||
AS_HELP_STRING([--enable-egl-device], [enable support for EGLDevice on top of KMS]),,
|
||||
enable_egl_device=no
|
||||
have_wayland_eglstream=no
|
||||
)
|
||||
AS_IF([test "$enable_egl_device" = "yes"], [
|
||||
AC_DEFINE([HAVE_EGL_DEVICE],[1], [Defined if EGLDevice support is enabled])
|
||||
PKG_CHECK_EXISTS([$MUTTER_WAYLAND_EGLSTREAM_MODULES], [have_wayland_eglstream=yes], [have_wayland_eglstream=no])
|
||||
])
|
||||
AS_IF([test "$have_wayland_eglstream" = "yes"], [
|
||||
AC_DEFINE([HAVE_WAYLAND_EGLSTREAM],[1],[Defined if Wayland EGLStream protocols are available])
|
||||
PKG_CHECK_MODULES(WAYLAND_EGLSTREAM, [$MUTTER_WAYLAND_EGLSTREAM_MODULES],
|
||||
[ac_wayland_eglstream_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir $MUTTER_WAYLAND_EGLSTREAM_MODULES`])
|
||||
AC_SUBST(WAYLAND_EGLSTREAM_DATADIR, $ac_wayland_eglstream_pkgdatadir)
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_WAYLAND_EGLSTREAM],[test "$have_wayland_eglstream" = "yes"])
|
||||
|
||||
MUTTER_WAYLAND_MODULES="wayland-server >= 1.13.0"
|
||||
|
||||
@@ -537,6 +559,7 @@ mutter-$VERSION
|
||||
Introspection: ${found_introspection}
|
||||
Session management: ${found_sm}
|
||||
Wayland: ${have_wayland}
|
||||
Wayland EGLStream: ${have_wayland_eglstream}
|
||||
Native (KMS) backend: ${have_native_backend}
|
||||
EGLDevice: ${enable_egl_device}
|
||||
Remote desktop: ${enable_remote_desktop}
|
||||
|
@@ -120,10 +120,6 @@
|
||||
framebuffers instead of window content,
|
||||
to manage HiDPI monitors. Does not
|
||||
require a restart.
|
||||
• “remote-desktop” — enables remote desktop support. To support
|
||||
remote desktop with screen sharing,
|
||||
“screen-cast” must also be enabled.
|
||||
• “screen-cast” — enables screen cast support.
|
||||
</description>
|
||||
</key>
|
||||
|
||||
|
@@ -14,18 +14,18 @@ src/compositor/meta-background.c
|
||||
src/core/bell.c
|
||||
src/core/core.c
|
||||
src/core/display.c
|
||||
src/core/errors.c
|
||||
src/core/keybindings.c
|
||||
src/core/main.c
|
||||
src/core/meta-close-dialog-default.c
|
||||
src/core/mutter.c
|
||||
src/core/prefs.c
|
||||
src/core/screen.c
|
||||
src/core/util.c
|
||||
src/core/window.c
|
||||
src/ui/frames.c
|
||||
src/ui/theme.c
|
||||
src/wayland/meta-wayland-tablet-pad.c
|
||||
src/x11/meta-x11-display.c
|
||||
src/x11/meta-x11-errors.c
|
||||
src/x11/session.c
|
||||
src/x11/window-props.c
|
||||
src/x11/xprops.c
|
||||
|
208
po/ca.po
208
po/ca.po
@@ -11,10 +11,9 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: metacity 2.24\n"
|
||||
"Report-Msgid-Bugs-To: https://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=mutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2017-08-29 16:09+0000\n"
|
||||
"PO-Revision-Date: 2017-08-25 13:23+0200\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
|
||||
"PO-Revision-Date: 2018-06-17 10:25+0200\n"
|
||||
"Last-Translator: Jordi Mas <jmas@softcatala.org>\n"
|
||||
"Language-Team: Catalan <tradgnome@softcatala.org>\n"
|
||||
"Language: ca\n"
|
||||
@@ -22,7 +21,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||
"X-Generator: Poedit 2.0.1\n"
|
||||
"X-Generator: Poedit 2.0.6\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@@ -49,134 +48,118 @@ msgid "Move window to last workspace"
|
||||
msgstr "Mou la finestra a l'últim espai de treball"
|
||||
|
||||
#: data/50-mutter-navigation.xml:24
|
||||
msgid "Move window one workspace to the left"
|
||||
msgstr "Mou la finestra un espai de treball a l'esquerra"
|
||||
|
||||
#: data/50-mutter-navigation.xml:27
|
||||
msgid "Move window one workspace to the right"
|
||||
msgstr "Mou la finestra un espai de treball a la dreta"
|
||||
|
||||
#: data/50-mutter-navigation.xml:30
|
||||
msgid "Move window one workspace up"
|
||||
msgstr "Mou la finestra un espai de treball amunt"
|
||||
|
||||
#: data/50-mutter-navigation.xml:33
|
||||
#: data/50-mutter-navigation.xml:27
|
||||
msgid "Move window one workspace down"
|
||||
msgstr "Mou la finestra un espai de treball avall"
|
||||
|
||||
#: data/50-mutter-navigation.xml:36
|
||||
#: data/50-mutter-navigation.xml:30
|
||||
msgid "Move window one monitor to the left"
|
||||
msgstr "Mou la finestra un monitor a l'esquerra"
|
||||
|
||||
#: data/50-mutter-navigation.xml:39
|
||||
#: data/50-mutter-navigation.xml:33
|
||||
msgid "Move window one monitor to the right"
|
||||
msgstr "Mou la finestra un monitor a la dreta"
|
||||
|
||||
#: data/50-mutter-navigation.xml:42
|
||||
#: data/50-mutter-navigation.xml:36
|
||||
msgid "Move window one monitor up"
|
||||
msgstr "Mou la finestra un monitor amunt"
|
||||
|
||||
#: data/50-mutter-navigation.xml:45
|
||||
#: data/50-mutter-navigation.xml:39
|
||||
msgid "Move window one monitor down"
|
||||
msgstr "Mou la finestra un monitor avall"
|
||||
|
||||
#: data/50-mutter-navigation.xml:49
|
||||
#: data/50-mutter-navigation.xml:43
|
||||
msgid "Switch applications"
|
||||
msgstr "Canvia d'aplicacions"
|
||||
|
||||
#: data/50-mutter-navigation.xml:54
|
||||
#: data/50-mutter-navigation.xml:48
|
||||
msgid "Switch to previous application"
|
||||
msgstr "Canvia a l'aplicació anterior"
|
||||
|
||||
#: data/50-mutter-navigation.xml:58
|
||||
#: data/50-mutter-navigation.xml:52
|
||||
msgid "Switch windows"
|
||||
msgstr "Canvia de finestres"
|
||||
|
||||
#: data/50-mutter-navigation.xml:63
|
||||
#: data/50-mutter-navigation.xml:57
|
||||
msgid "Switch to previous window"
|
||||
msgstr "Canvia a la finestra anterior"
|
||||
|
||||
#: data/50-mutter-navigation.xml:67
|
||||
#: data/50-mutter-navigation.xml:61
|
||||
msgid "Switch windows of an application"
|
||||
msgstr "Canvia entre les finestres d'una aplicació"
|
||||
|
||||
#: data/50-mutter-navigation.xml:72
|
||||
#: data/50-mutter-navigation.xml:66
|
||||
msgid "Switch to previous window of an application"
|
||||
msgstr "Canvia a la finestra anterior d'una aplicació"
|
||||
|
||||
#: data/50-mutter-navigation.xml:76
|
||||
#: data/50-mutter-navigation.xml:70
|
||||
msgid "Switch system controls"
|
||||
msgstr "Canvia els controls del sistema"
|
||||
|
||||
#: data/50-mutter-navigation.xml:81
|
||||
#: data/50-mutter-navigation.xml:75
|
||||
msgid "Switch to previous system control"
|
||||
msgstr "Canvia al control del sistema anterior"
|
||||
|
||||
#: data/50-mutter-navigation.xml:85
|
||||
#: data/50-mutter-navigation.xml:79
|
||||
msgid "Switch windows directly"
|
||||
msgstr "Canvia immediatament entre finestres"
|
||||
|
||||
#: data/50-mutter-navigation.xml:90
|
||||
#: data/50-mutter-navigation.xml:84
|
||||
msgid "Switch directly to previous window"
|
||||
msgstr "Canvia immediatament a la finestra anterior"
|
||||
|
||||
#: data/50-mutter-navigation.xml:94
|
||||
#: data/50-mutter-navigation.xml:88
|
||||
msgid "Switch windows of an app directly"
|
||||
msgstr "Canvia immediatament entre les finestres d'una aplicació"
|
||||
|
||||
#: data/50-mutter-navigation.xml:99
|
||||
#: data/50-mutter-navigation.xml:93
|
||||
msgid "Switch directly to previous window of an app"
|
||||
msgstr "Canvia immediatament a la finestra anterior d'una aplicació"
|
||||
|
||||
#: data/50-mutter-navigation.xml:103
|
||||
#: data/50-mutter-navigation.xml:97
|
||||
msgid "Switch system controls directly"
|
||||
msgstr "Canvia immediatament entre els controls del sistema"
|
||||
|
||||
#: data/50-mutter-navigation.xml:108
|
||||
#: data/50-mutter-navigation.xml:102
|
||||
msgid "Switch directly to previous system control"
|
||||
msgstr "Canvia immediatament al control del sistema anterior"
|
||||
|
||||
#: data/50-mutter-navigation.xml:111
|
||||
#: data/50-mutter-navigation.xml:105
|
||||
msgid "Hide all normal windows"
|
||||
msgstr "Oculta totes les finestres normals"
|
||||
|
||||
#: data/50-mutter-navigation.xml:114
|
||||
#: data/50-mutter-navigation.xml:108
|
||||
msgid "Switch to workspace 1"
|
||||
msgstr "Canvia a l'espai de treball 1"
|
||||
|
||||
#: data/50-mutter-navigation.xml:117
|
||||
#: data/50-mutter-navigation.xml:111
|
||||
msgid "Switch to workspace 2"
|
||||
msgstr "Canvia a l'espai de treball 2"
|
||||
|
||||
#: data/50-mutter-navigation.xml:120
|
||||
#: data/50-mutter-navigation.xml:114
|
||||
msgid "Switch to workspace 3"
|
||||
msgstr "Canvia a l'espai de treball 3"
|
||||
|
||||
#: data/50-mutter-navigation.xml:123
|
||||
#: data/50-mutter-navigation.xml:117
|
||||
msgid "Switch to workspace 4"
|
||||
msgstr "Canvia a l'espai de treball 4"
|
||||
|
||||
#: data/50-mutter-navigation.xml:126
|
||||
#: data/50-mutter-navigation.xml:120
|
||||
msgid "Switch to last workspace"
|
||||
msgstr "Canvia a l'últim espai de treball"
|
||||
|
||||
#: data/50-mutter-navigation.xml:129
|
||||
msgid "Move to workspace left"
|
||||
msgstr "Mou a l'espai de treball de l'esquerra"
|
||||
|
||||
#: data/50-mutter-navigation.xml:132
|
||||
msgid "Move to workspace right"
|
||||
msgstr "Mou a l'espai de treball de la dreta"
|
||||
|
||||
#: data/50-mutter-navigation.xml:135
|
||||
#: data/50-mutter-navigation.xml:123
|
||||
msgid "Move to workspace above"
|
||||
msgstr "Mou a l'espai de treball de sobre"
|
||||
|
||||
#: data/50-mutter-navigation.xml:138
|
||||
#: data/50-mutter-navigation.xml:126
|
||||
msgid "Move to workspace below"
|
||||
msgstr "Mou a l'espai de treball de sota"
|
||||
|
||||
#: data/50-mutter-system.xml:6
|
||||
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
|
||||
msgid "System"
|
||||
msgstr "Sistema"
|
||||
|
||||
@@ -188,6 +171,10 @@ msgstr "Mostra l'indicador d'execució d'aplicacions"
|
||||
msgid "Show the activities overview"
|
||||
msgstr "Mostra la vista general d'activitats"
|
||||
|
||||
#: data/50-mutter-wayland.xml:8
|
||||
msgid "Restore the keyboard shortcuts"
|
||||
msgstr "Restaura les dreceres de teclat"
|
||||
|
||||
#: data/50-mutter-windows.xml:6
|
||||
msgid "Windows"
|
||||
msgstr "Finestres"
|
||||
@@ -213,56 +200,52 @@ msgid "Restore window"
|
||||
msgstr "Restaura la finestra"
|
||||
|
||||
#: data/50-mutter-windows.xml:18
|
||||
msgid "Toggle shaded state"
|
||||
msgstr "Canvia l'estat d'ombrejat"
|
||||
|
||||
#: data/50-mutter-windows.xml:20
|
||||
msgid "Close window"
|
||||
msgstr "Tanca la finestra"
|
||||
|
||||
#: data/50-mutter-windows.xml:22
|
||||
#: data/50-mutter-windows.xml:20
|
||||
msgid "Hide window"
|
||||
msgstr "Oculta la finestra"
|
||||
|
||||
#: data/50-mutter-windows.xml:24
|
||||
#: data/50-mutter-windows.xml:22
|
||||
msgid "Move window"
|
||||
msgstr "Mou la finestra"
|
||||
|
||||
#: data/50-mutter-windows.xml:26
|
||||
#: data/50-mutter-windows.xml:24
|
||||
msgid "Resize window"
|
||||
msgstr "Redimensiona la finestra"
|
||||
|
||||
#: data/50-mutter-windows.xml:29
|
||||
#: data/50-mutter-windows.xml:27
|
||||
msgid "Toggle window on all workspaces or one"
|
||||
msgstr ""
|
||||
"Canvia la funció que fa que la finestra estigui en tots els espais de "
|
||||
"treball o només en un"
|
||||
|
||||
#: data/50-mutter-windows.xml:31
|
||||
#: data/50-mutter-windows.xml:29
|
||||
msgid "Raise window if covered, otherwise lower it"
|
||||
msgstr "Alça la finestra si està coberta per una altra; altrament, baixa-la"
|
||||
|
||||
#: data/50-mutter-windows.xml:33
|
||||
#: data/50-mutter-windows.xml:31
|
||||
msgid "Raise window above other windows"
|
||||
msgstr "Alça la finestra per damunt de les altres"
|
||||
|
||||
#: data/50-mutter-windows.xml:35
|
||||
#: data/50-mutter-windows.xml:33
|
||||
msgid "Lower window below other windows"
|
||||
msgstr "Baixa la finestra sota les altres"
|
||||
|
||||
#: data/50-mutter-windows.xml:37
|
||||
#: data/50-mutter-windows.xml:35
|
||||
msgid "Maximize window vertically"
|
||||
msgstr "Maximitza la finestra verticalment"
|
||||
|
||||
#: data/50-mutter-windows.xml:39
|
||||
#: data/50-mutter-windows.xml:37
|
||||
msgid "Maximize window horizontally"
|
||||
msgstr "Maximitza la finestra horitzontalment"
|
||||
|
||||
#: data/50-mutter-windows.xml:43
|
||||
#: data/50-mutter-windows.xml:41
|
||||
msgid "View split on left"
|
||||
msgstr "Mostra la partició a l'esquerra"
|
||||
|
||||
#: data/50-mutter-windows.xml:47
|
||||
#: data/50-mutter-windows.xml:45
|
||||
msgid "View split on right"
|
||||
msgstr "Mostra la partició a la dreta"
|
||||
|
||||
@@ -424,25 +407,22 @@ msgid ""
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
|
||||
"enables remote desktop support. To support remote desktop with screen "
|
||||
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
|
||||
"screen cast support."
|
||||
"manage HiDPI monitors. Does not require a restart."
|
||||
msgstr ""
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:145
|
||||
#: data/org.gnome.mutter.gschema.xml.in:141
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "Selecció de finestra entre les emergents d'una pestanya"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:150
|
||||
#: data/org.gnome.mutter.gschema.xml.in:146
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Cancel·lació de les finestres emergents a les pestanyes"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:155
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "Canvia configuracions de monitor"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:160
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "Gira la configuració del monitor integrada"
|
||||
|
||||
@@ -498,10 +478,41 @@ msgstr "Canvia al terminal virtual 12"
|
||||
msgid "Re-enable shortcuts"
|
||||
msgstr "Torna a habilitar les dreceres"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
|
||||
msgid "Allow grabs with Xwayland"
|
||||
msgstr "Permetre la captura amb Xwayland"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
|
||||
msgid ""
|
||||
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
|
||||
"taken into account. For a X11 grab to be taken into account under Wayland, "
|
||||
"the client must also either send a specific X11 ClientMessage to the root "
|
||||
"window or be among the applications white-listed in key “xwayland-grab-"
|
||||
"access-rules”."
|
||||
msgstr ""
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
|
||||
msgid "Xwayland applications allowed to issue keyboard grabs"
|
||||
msgstr "Les aplicacions Xwayland poden capturar el teclat"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
|
||||
msgid ""
|
||||
"List the resource names or resource class of X11 windows either allowed or "
|
||||
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
|
||||
"resource class of a given X11 window can be obtained using the command "
|
||||
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
|
||||
"Values starting with “!” are blacklisted, which has precedence over the "
|
||||
"whitelist, to revoke applications from the default system list. The default "
|
||||
"system list includes the following applications: "
|
||||
"“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by "
|
||||
"using the specific keyboard shortcut defined by the keybinding key “restore-"
|
||||
"shortcuts”."
|
||||
msgstr ""
|
||||
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2151
|
||||
#: src/backends/meta-input-settings.c:2325
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "Mode de commutació (grup %d)"
|
||||
@@ -509,11 +520,11 @@ msgstr "Mode de commutació (grup %d)"
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2174
|
||||
#: src/backends/meta-input-settings.c:2348
|
||||
msgid "Switch monitor"
|
||||
msgstr "Commuta el monitor"
|
||||
|
||||
#: src/backends/meta-input-settings.c:2176
|
||||
#: src/backends/meta-input-settings.c:2350
|
||||
msgid "Show on-screen help"
|
||||
msgstr "Mostra l'ajuda en pantalla"
|
||||
|
||||
@@ -539,7 +550,7 @@ msgstr "%s %s"
|
||||
|
||||
#. This probably means that a non-WM compositor like xcompmgr is running;
|
||||
#. * we have no way to get it to exit
|
||||
#: src/compositor/compositor.c:476
|
||||
#: src/compositor/compositor.c:481
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
@@ -557,31 +568,31 @@ msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr ""
|
||||
"S'ha produït un error en obrir la pantalla del sistema de finestres X «%s»\n"
|
||||
|
||||
#: src/core/main.c:189
|
||||
#: src/core/main.c:190
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "Inhabilita la connexió al gestor de sessions"
|
||||
|
||||
#: src/core/main.c:195
|
||||
#: src/core/main.c:196
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "Reemplaça el gestor de finestres en execució"
|
||||
|
||||
#: src/core/main.c:201
|
||||
#: src/core/main.c:202
|
||||
msgid "Specify session management ID"
|
||||
msgstr "Especifica l'ID de gestió de sessió"
|
||||
|
||||
#: src/core/main.c:206
|
||||
#: src/core/main.c:207
|
||||
msgid "X Display to use"
|
||||
msgstr "Visualització X per usar"
|
||||
|
||||
#: src/core/main.c:212
|
||||
#: src/core/main.c:213
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "Inicialitza la sessió des del fitxer desat"
|
||||
|
||||
#: src/core/main.c:218
|
||||
#: src/core/main.c:219
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "Fes que les crides a l'X siguin síncrones"
|
||||
|
||||
#: src/core/main.c:225
|
||||
#: src/core/main.c:226
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "Funciona com a compositor de Wayland"
|
||||
|
||||
@@ -590,14 +601,18 @@ msgstr "Funciona com a compositor de Wayland"
|
||||
#
|
||||
# Camins:
|
||||
# ../src/core/main.c:223
|
||||
#: src/core/main.c:231
|
||||
#: src/core/main.c:232
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "Funciona com a compositor imbricat"
|
||||
|
||||
#: src/core/main.c:239
|
||||
#: src/core/main.c:240
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "Funciona com a servidor de pantalla completa, en comptes d'imbricat"
|
||||
|
||||
#: src/core/main.c:246
|
||||
msgid "Run with X11 backend"
|
||||
msgstr "Executa amb un rerefons X11"
|
||||
|
||||
#. Translators: %s is a window title
|
||||
#: src/core/meta-close-dialog-default.c:147
|
||||
#, c-format
|
||||
@@ -653,7 +668,7 @@ msgstr "Connector del Mutter a utilitzar"
|
||||
msgid "Workspace %d"
|
||||
msgstr "Espai de treball %d"
|
||||
|
||||
#: src/core/screen.c:580
|
||||
#: src/core/screen.c:583
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
@@ -662,7 +677,7 @@ msgstr ""
|
||||
"La pantalla «%s» ja té un gestor de finestres; proveu l'opció --replace per "
|
||||
"reemplaçar el gestor de finestres actual."
|
||||
|
||||
#: src/core/screen.c:665
|
||||
#: src/core/screen.c:668
|
||||
#, c-format
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "El monitor %d en la pantalla '%s' no és vàlida\n"
|
||||
@@ -671,12 +686,12 @@ msgstr "El monitor %d en la pantalla '%s' no és vàlida\n"
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
msgstr "Mutter es va compilar sense compatibilitat per al mode detallat\n"
|
||||
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:563
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:567
|
||||
#, c-format
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "Mode de commutació: mode %d"
|
||||
|
||||
#: src/x11/session.c:1815
|
||||
#: src/x11/session.c:1818
|
||||
msgid ""
|
||||
"These windows do not support “save current setup” and will have to be "
|
||||
"restarted manually next time you log in."
|
||||
@@ -689,6 +704,21 @@ msgstr ""
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (a %s)"
|
||||
|
||||
#~ msgid "Move window one workspace to the left"
|
||||
#~ msgstr "Mou la finestra un espai de treball a l'esquerra"
|
||||
|
||||
#~ msgid "Move window one workspace to the right"
|
||||
#~ msgstr "Mou la finestra un espai de treball a la dreta"
|
||||
|
||||
#~ msgid "Move to workspace left"
|
||||
#~ msgstr "Mou a l'espai de treball de l'esquerra"
|
||||
|
||||
#~ msgid "Move to workspace right"
|
||||
#~ msgstr "Mou a l'espai de treball de la dreta"
|
||||
|
||||
#~ msgid "Toggle shaded state"
|
||||
#~ msgstr "Canvia l'estat d'ombrejat"
|
||||
|
||||
#~ msgid "Failed to scan themes directory: %s\n"
|
||||
#~ msgstr "No s'ha pogut analitzar el directori de temes: %s\n"
|
||||
|
||||
|
41
po/fur.po
41
po/fur.po
@@ -7,15 +7,15 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2018-02-06 04:14+0000\n"
|
||||
"PO-Revision-Date: 2018-02-06 22:43+0100\n"
|
||||
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
|
||||
"PO-Revision-Date: 2018-06-29 15:33+0200\n"
|
||||
"Last-Translator: Fabio Tomat <f.t.public@gmail.com>\n"
|
||||
"Language-Team: Friulian <fur@li.org>\n"
|
||||
"Language: fur\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.0.3\n"
|
||||
"X-Generator: Poedit 2.0.8\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@@ -391,10 +391,7 @@ msgid ""
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
|
||||
"enables remote desktop support. To support remote desktop with screen "
|
||||
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
|
||||
"screen cast support."
|
||||
"manage HiDPI monitors. Does not require a restart."
|
||||
msgstr ""
|
||||
"Par abilitâ lis funzionalitâts sperimentâls, zonte la peraule clâf de "
|
||||
"funzionalitât ae liste. Il fat che la funzionalitât e vedi bisugne di tornâ "
|
||||
@@ -405,25 +402,21 @@ msgstr ""
|
||||
"“scale-monitor-framebuffer” — al rint come predefinît par mutter, la "
|
||||
"disposizion logjiche dai visôrs intun spazi logjic di coordenadis di pixel, "
|
||||
"in plui si fâs il scjalâ dai framebuffer dai visôrs invezit che il contignût "
|
||||
"dal barcon; dut chest par gjestî i visôrs HiDPI. Nol covente tornâ a inviâ. "
|
||||
"• “remote-desktop” — al abilite il supuart pal scritori rimot. Par podê "
|
||||
"supuartâ il scritori rimot cun la condivision dal schermi si scugne abilitâ "
|
||||
"ancje “screen-cast”. • “screen-cast” — al abilite il supuart pe trasmission "
|
||||
"dal schermi."
|
||||
"dal barcon; dut chest par gjestî i visôrs HiDPI. Nol covente tornâ a inviâ."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:145
|
||||
#: data/org.gnome.mutter.gschema.xml.in:141
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "Selezione barcon dal tab popup"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:150
|
||||
#: data/org.gnome.mutter.gschema.xml.in:146
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Anule tab popup"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:155
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "Cambie configurazions visôr"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:160
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "Al volte la configurazion dal visôr integrât"
|
||||
|
||||
@@ -529,7 +522,7 @@ msgstr ""
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2260
|
||||
#: src/backends/meta-input-settings.c:2325
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "Cambie mût (Grup %d)"
|
||||
@@ -537,30 +530,30 @@ msgstr "Cambie mût (Grup %d)"
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2283
|
||||
#: src/backends/meta-input-settings.c:2348
|
||||
msgid "Switch monitor"
|
||||
msgstr "Cambie visôr"
|
||||
|
||||
#: src/backends/meta-input-settings.c:2285
|
||||
#: src/backends/meta-input-settings.c:2350
|
||||
msgid "Show on-screen help"
|
||||
msgstr "Mostre jutori a schermi"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:900
|
||||
#: src/backends/meta-monitor-manager.c:903
|
||||
msgid "Built-in display"
|
||||
msgstr "Display integrât"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:923
|
||||
#: src/backends/meta-monitor-manager.c:926
|
||||
msgid "Unknown"
|
||||
msgstr "No cognossût"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:925
|
||||
#: src/backends/meta-monitor-manager.c:928
|
||||
msgid "Unknown Display"
|
||||
msgstr "Display no cognossût"
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: src/backends/meta-monitor-manager.c:933
|
||||
#: src/backends/meta-monitor-manager.c:936
|
||||
#, c-format
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
@@ -696,7 +689,7 @@ msgstr "Schermi %d su display “%s” no valit\n"
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
msgstr "Mutter al è stât compilât cence supuart pe modalitât fetose\n"
|
||||
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:563
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:567
|
||||
#, c-format
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "Cambie mût: mût %d"
|
||||
|
12
po/gl.po
12
po/gl.po
@@ -14,16 +14,16 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: gl\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2018-03-01 10:47+0000\n"
|
||||
"PO-Revision-Date: 2018-03-03 14:18+0200\n"
|
||||
"Last-Translator: Fran Dieguez <frandieguez@gnome.org>\n"
|
||||
"POT-Creation-Date: 2018-03-03 13:19+0000\n"
|
||||
"PO-Revision-Date: 2018-05-07 19:37+0200\n"
|
||||
"Last-Translator: marcos <marcoslansgarza@gmail.com>\n"
|
||||
"Language-Team: Galician\n"
|
||||
"Language: gl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Virtaal 0.7.1\n"
|
||||
"X-Generator: Poedit 2.0.6\n"
|
||||
"X-Project-Style: gnome\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
@@ -100,7 +100,7 @@ msgstr "Cambia á xanela anterior dun aplicativo"
|
||||
|
||||
#: data/50-mutter-navigation.xml:70
|
||||
msgid "Switch system controls"
|
||||
msgstr "Cambiar entre os controles do sistema"
|
||||
msgstr "Cambiar entre os controis do sistema"
|
||||
|
||||
#: data/50-mutter-navigation.xml:75
|
||||
msgid "Switch to previous system control"
|
||||
@@ -124,7 +124,7 @@ msgstr "Cambia directamente á xanela anterior do aplicativo"
|
||||
|
||||
#: data/50-mutter-navigation.xml:97
|
||||
msgid "Switch system controls directly"
|
||||
msgstr "Cambiar entre os controles do sistema directamente"
|
||||
msgstr "Cambiar entre os controis do sistema directamente"
|
||||
|
||||
#: data/50-mutter-navigation.xml:102
|
||||
msgid "Switch directly to previous system control"
|
||||
|
575
po/ro.po
575
po/ro.po
@@ -4,15 +4,15 @@
|
||||
# Mugurel Tudor <mugurelu@gnome.ro>, 2002-2004, 2005, 2006, 2007.
|
||||
# Adi Roiban https://launchpad.net/~adiroiban, 2008, 2009
|
||||
# Lucian Adrian Grijincu <lucian.grijincu@gmail.com>, 2011.
|
||||
# Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>, 2015.
|
||||
# Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>, 2015, 2018.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: metacity.HEAD.ro\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?product=mutter&"
|
||||
"keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2015-10-21 11:43+0000\n"
|
||||
"PO-Revision-Date: 2015-10-22 19:10+0200\n"
|
||||
"Last-Translator: Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2018-07-13 13:37+0000\n"
|
||||
"PO-Revision-Date: 2018-07-17 18:56+0300\n"
|
||||
"Last-Translator: Florentina Mușat <florentina.musat.28 [at] gmail [dot] "
|
||||
"com>\n"
|
||||
"Language-Team: Gnome Romanian Translation Team\n"
|
||||
"Language: ro\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -20,275 +20,259 @@ msgstr ""
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
|
||||
"20)) ? 1 : 2);;\n"
|
||||
"X-Generator: Virtaal 0.7.1\n"
|
||||
"X-Generator: Poedit 2.0.9\n"
|
||||
"X-Project-Style: gnome\n"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:1
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
msgstr "Navigare"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:2
|
||||
#: data/50-mutter-navigation.xml:9
|
||||
msgid "Move window to workspace 1"
|
||||
msgstr "Mută fereastra pe spațiul de lucru 1"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:3
|
||||
#: data/50-mutter-navigation.xml:12
|
||||
msgid "Move window to workspace 2"
|
||||
msgstr "Mută fereastra pe spațiul de lucru 2"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:4
|
||||
#: data/50-mutter-navigation.xml:15
|
||||
msgid "Move window to workspace 3"
|
||||
msgstr "Mută fereastra pe spațiul de lucru 3"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:5
|
||||
#: data/50-mutter-navigation.xml:18
|
||||
msgid "Move window to workspace 4"
|
||||
msgstr "Mută fereastra pe spațiul de lucru 4"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:6
|
||||
#: data/50-mutter-navigation.xml:21
|
||||
msgid "Move window to last workspace"
|
||||
msgstr "Mută fereastra pe spațiul de lucru anterior"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:7
|
||||
msgid "Move window one workspace to the left"
|
||||
msgstr "Mută fereastra pe spațiul de lucru de la stânga"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:8
|
||||
msgid "Move window one workspace to the right"
|
||||
msgstr "Mută fereastra pe spațiul de lucru de la dreapta"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:9
|
||||
#: data/50-mutter-navigation.xml:24
|
||||
msgid "Move window one workspace up"
|
||||
msgstr "Mută fereastra pe spațiul de lucru de mai sus"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:10
|
||||
#: data/50-mutter-navigation.xml:27
|
||||
msgid "Move window one workspace down"
|
||||
msgstr "Mută fereastra pe spațiul de lucru de mai jos"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:11
|
||||
#: data/50-mutter-navigation.xml:30
|
||||
msgid "Move window one monitor to the left"
|
||||
msgstr "Mută fereastra cu un monitor la stânga"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:12
|
||||
#: data/50-mutter-navigation.xml:33
|
||||
msgid "Move window one monitor to the right"
|
||||
msgstr "Mută fereastra un monitor la dreapta"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:13
|
||||
#: data/50-mutter-navigation.xml:36
|
||||
msgid "Move window one monitor up"
|
||||
msgstr "Mută fereastra cu un monitor mai sus"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:14
|
||||
#: data/50-mutter-navigation.xml:39
|
||||
msgid "Move window one monitor down"
|
||||
msgstr "Mută fereastra cu un monitor mai jos"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:15
|
||||
#: data/50-mutter-navigation.xml:43
|
||||
msgid "Switch applications"
|
||||
msgstr "Comută aplicațiile"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:16
|
||||
#: data/50-mutter-navigation.xml:48
|
||||
msgid "Switch to previous application"
|
||||
msgstr "Schimbă la aplicația anterioară"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:17
|
||||
#: data/50-mutter-navigation.xml:52
|
||||
msgid "Switch windows"
|
||||
msgstr "Schimbă ferestre"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:18
|
||||
#: data/50-mutter-navigation.xml:57
|
||||
msgid "Switch to previous window"
|
||||
msgstr "Schimbă la fereastra anterioară"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:19
|
||||
#: data/50-mutter-navigation.xml:61
|
||||
msgid "Switch windows of an application"
|
||||
msgstr "Schimbă ferestrele unei aplicații"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:20
|
||||
#: data/50-mutter-navigation.xml:66
|
||||
msgid "Switch to previous window of an application"
|
||||
msgstr "Schimbă la fereastra anterioară a unei aplicații"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:21
|
||||
#: data/50-mutter-navigation.xml:70
|
||||
msgid "Switch system controls"
|
||||
msgstr "Schimbă comenzile de sistem"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:22
|
||||
#: data/50-mutter-navigation.xml:75
|
||||
msgid "Switch to previous system control"
|
||||
msgstr "Schimbă la comanda de control anterioară"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:23
|
||||
#: data/50-mutter-navigation.xml:79
|
||||
msgid "Switch windows directly"
|
||||
msgstr "Schimbă ferestrele în mod direct"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:24
|
||||
#: data/50-mutter-navigation.xml:84
|
||||
msgid "Switch directly to previous window"
|
||||
msgstr "Schimbă la fereastra anterioară în mod direct"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:25
|
||||
#: data/50-mutter-navigation.xml:88
|
||||
msgid "Switch windows of an app directly"
|
||||
msgstr "Schimbă în mod direct ferestrele uneui aplicații "
|
||||
msgstr "Comută direct ferestrele unei aplicații"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:26
|
||||
#: data/50-mutter-navigation.xml:93
|
||||
msgid "Switch directly to previous window of an app"
|
||||
msgstr "Schimbă în mod direct la fereastra anterioară a unei aplicații"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:27
|
||||
#: data/50-mutter-navigation.xml:97
|
||||
msgid "Switch system controls directly"
|
||||
msgstr "Schimbă comenzile de sistem în mod direct"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:28
|
||||
#: data/50-mutter-navigation.xml:102
|
||||
msgid "Switch directly to previous system control"
|
||||
msgstr "Schimbă în mod direct la o comandă de sistem anterioară"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:29
|
||||
#: data/50-mutter-navigation.xml:105
|
||||
msgid "Hide all normal windows"
|
||||
msgstr "Ascunde toate ferestrele normale "
|
||||
msgstr "Ascunde toate ferestrele normale"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:30
|
||||
#: data/50-mutter-navigation.xml:108
|
||||
msgid "Switch to workspace 1"
|
||||
msgstr "Comută la spațiul de lucru 1"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:31
|
||||
#: data/50-mutter-navigation.xml:111
|
||||
msgid "Switch to workspace 2"
|
||||
msgstr "Comută la spațiul de lucru 2"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:32
|
||||
#: data/50-mutter-navigation.xml:114
|
||||
msgid "Switch to workspace 3"
|
||||
msgstr "Comută la spațiul de lucru 3"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:33
|
||||
#: data/50-mutter-navigation.xml:117
|
||||
msgid "Switch to workspace 4"
|
||||
msgstr "Comută la spațiul de lucru 4"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:34
|
||||
#: data/50-mutter-navigation.xml:120
|
||||
msgid "Switch to last workspace"
|
||||
msgstr "Comută la ultimul spațiu de lucru "
|
||||
msgstr "Comută la ultimul spațiu de lucru"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:35
|
||||
msgid "Move to workspace left"
|
||||
msgstr "Mută pe spațiul de lucru din stânga"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:36
|
||||
msgid "Move to workspace right"
|
||||
msgstr "Mută pe spațiul de lucru din dreapta"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:37
|
||||
#: data/50-mutter-navigation.xml:123
|
||||
msgid "Move to workspace above"
|
||||
msgstr "Mută pe spațiul de lucru deasupra"
|
||||
|
||||
#: ../data/50-mutter-navigation.xml.in.h:38
|
||||
#: data/50-mutter-navigation.xml:126
|
||||
msgid "Move to workspace below"
|
||||
msgstr "Mută pe spațiul de lucru de jos"
|
||||
|
||||
#: ../data/50-mutter-system.xml.in.h:1
|
||||
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
|
||||
msgid "System"
|
||||
msgstr "Sistem"
|
||||
|
||||
#: ../data/50-mutter-system.xml.in.h:2
|
||||
#: data/50-mutter-system.xml:8
|
||||
msgid "Show the run command prompt"
|
||||
msgstr "Arată prompterul de comandă al comenzii run (rulează)"
|
||||
|
||||
#: ../data/50-mutter-system.xml.in.h:3
|
||||
#: data/50-mutter-system.xml:10
|
||||
msgid "Show the activities overview"
|
||||
msgstr "Arată prezentarea generală a activităților"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:1
|
||||
#: data/50-mutter-wayland.xml:8
|
||||
msgid "Restore the keyboard shortcuts"
|
||||
msgstr "Restaurează scurtăturile de tastatură"
|
||||
|
||||
#: data/50-mutter-windows.xml:6
|
||||
msgid "Windows"
|
||||
msgstr "Ferestre"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:2
|
||||
#: data/50-mutter-windows.xml:8
|
||||
msgid "Activate the window menu"
|
||||
msgstr "Activează meniul ferestrei"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:3
|
||||
#: data/50-mutter-windows.xml:10
|
||||
msgid "Toggle fullscreen mode"
|
||||
msgstr "Comută modul pe tot ecranul"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:4
|
||||
#: data/50-mutter-windows.xml:12
|
||||
msgid "Toggle maximization state"
|
||||
msgstr "Comută starea de maximizare"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:5
|
||||
#: data/50-mutter-windows.xml:14
|
||||
msgid "Maximize window"
|
||||
msgstr "Maximizează fereastra"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:6
|
||||
#: data/50-mutter-windows.xml:16
|
||||
msgid "Restore window"
|
||||
msgstr "Restabilește fereastra"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:7
|
||||
msgid "Toggle shaded state"
|
||||
msgstr "Comută starea de umbrire"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:8
|
||||
#: data/50-mutter-windows.xml:18
|
||||
msgid "Close window"
|
||||
msgstr "Închide fereastra"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:9
|
||||
#: data/50-mutter-windows.xml:20
|
||||
msgid "Hide window"
|
||||
msgstr "Ascunde fereastra"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:10
|
||||
#: data/50-mutter-windows.xml:22
|
||||
msgid "Move window"
|
||||
msgstr "Mută fereastra"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:11
|
||||
#: data/50-mutter-windows.xml:24
|
||||
msgid "Resize window"
|
||||
msgstr "Redimensionează fereastra"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:12
|
||||
#: data/50-mutter-windows.xml:27
|
||||
msgid "Toggle window on all workspaces or one"
|
||||
msgstr "Comută fereastra pe toate spațiile de lucru sau doar pe unul"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:13
|
||||
#: data/50-mutter-windows.xml:29
|
||||
msgid "Raise window if covered, otherwise lower it"
|
||||
msgstr "Ridică fereastra dacă este acoperită, altfel, coboar-o"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:14
|
||||
#: data/50-mutter-windows.xml:31
|
||||
msgid "Raise window above other windows"
|
||||
msgstr "Ridică fereastra deasupra celorlalte ferestre"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:15
|
||||
#: data/50-mutter-windows.xml:33
|
||||
msgid "Lower window below other windows"
|
||||
msgstr "Coboară fereastra sub alte ferestre"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:16
|
||||
#: data/50-mutter-windows.xml:35
|
||||
msgid "Maximize window vertically"
|
||||
msgstr "Maximizează fereastra pe verticală"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:17
|
||||
#: data/50-mutter-windows.xml:37
|
||||
msgid "Maximize window horizontally"
|
||||
msgstr "Maximizează fereastra pe orizontală"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:18
|
||||
#: data/50-mutter-windows.xml:41
|
||||
msgid "View split on left"
|
||||
msgstr "Împarte în stânga"
|
||||
|
||||
#: ../data/50-mutter-windows.xml.in.h:19
|
||||
#: data/50-mutter-windows.xml:45
|
||||
msgid "View split on right"
|
||||
msgstr "Împarte în dreapta"
|
||||
|
||||
#: ../data/mutter.desktop.in.h:1
|
||||
#: data/mutter.desktop.in:4
|
||||
msgid "Mutter"
|
||||
msgstr "Mutter"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:1
|
||||
#: data/org.gnome.mutter.gschema.xml.in:7
|
||||
msgid "Modifier to use for extended window management operations"
|
||||
msgstr ""
|
||||
"Modificatorul folosit pentru operațiile extinse de management al ferestrelor"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:2
|
||||
#: data/org.gnome.mutter.gschema.xml.in:8
|
||||
msgid ""
|
||||
"This key will initiate the \"overlay\", which is a combination window "
|
||||
"overview and application launching system. The default is intended to be the "
|
||||
"\"Windows key\" on PC hardware. It's expected that this binding either the "
|
||||
"default or set to the empty string."
|
||||
"This key will initiate the “overlay”, which is a combination window overview "
|
||||
"and application launching system. The default is intended to be the “Windows "
|
||||
"key” on PC hardware. It’s expected that this binding either the default or "
|
||||
"set to the empty string."
|
||||
msgstr ""
|
||||
"Această cheie va iniția „overlay”-ul, care este o combinație între o privire "
|
||||
"de ansamblu a ferestrelor și un sistemul de lansare de aplicații. Implicit "
|
||||
"este testa „Windows” pe hardware PC. Este de așteptat ca această cheie să "
|
||||
"fie sau implicit sau setat la șirul vid."
|
||||
"Această cheie va iniția „suprapunerea”, care este o combinație între o "
|
||||
"privire de ansamblu a ferestrelor și un sistem de lansare de aplicații. "
|
||||
"Implicit este tasta „Windows” pe hardware PC. Este de așteptat ca această "
|
||||
"legătură să fie ori stabilită la implicit sau la șirul vid."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:3
|
||||
#: data/org.gnome.mutter.gschema.xml.in:20
|
||||
msgid "Attach modal dialogs"
|
||||
msgstr "Atașează dialogurile modale"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:4
|
||||
#: data/org.gnome.mutter.gschema.xml.in:21
|
||||
msgid ""
|
||||
"When true, instead of having independent titlebars, modal dialogs appear "
|
||||
"attached to the titlebar of the parent window and are moved together with "
|
||||
@@ -298,13 +282,12 @@ msgstr ""
|
||||
"modale apar atașate la bara de titlu a ferestrei părinte și sunt mutate "
|
||||
"împreună cu fereastra părinte."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:5
|
||||
#, fuzzy
|
||||
#: data/org.gnome.mutter.gschema.xml.in:30
|
||||
msgid "Enable edge tiling when dropping windows on screen edges"
|
||||
msgstr ""
|
||||
"Activează mozaicul lateral la plasarea ferestrelor pe marginile ecranului"
|
||||
"Activează mozaicul de margine la plasarea ferestrelor pe marginile ecranului"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:6
|
||||
#: data/org.gnome.mutter.gschema.xml.in:31
|
||||
msgid ""
|
||||
"If enabled, dropping windows on vertical screen edges maximizes them "
|
||||
"vertically and resizes them horizontally to cover half of the available "
|
||||
@@ -315,25 +298,25 @@ msgstr ""
|
||||
"pentru a acoperi jumătate din suprafața disponibilă. Plasarea ferestrelor pe "
|
||||
"marginea de sus a ecranului le maximizează complet."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:7
|
||||
#: data/org.gnome.mutter.gschema.xml.in:40
|
||||
msgid "Workspaces are managed dynamically"
|
||||
msgstr "Spațiile de lucru sunt gestionate în mod dinamic"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:8
|
||||
#: data/org.gnome.mutter.gschema.xml.in:41
|
||||
msgid ""
|
||||
"Determines whether workspaces are managed dynamically or whether there's a "
|
||||
"Determines whether workspaces are managed dynamically or whether there’s a "
|
||||
"static number of workspaces (determined by the num-workspaces key in org."
|
||||
"gnome.desktop.wm.preferences)."
|
||||
msgstr ""
|
||||
"Determină dacă spațiile de lucru sunt gestionate în mod dinamic sau dacă "
|
||||
"există un număr static de spații de lucru (determinată de cheia „num-"
|
||||
"workspaces” din ”org.gnome.desktop.wm.preferences”)"
|
||||
"Determină dacă spațiile de lucru sunt administrate dinamic sau dacă există "
|
||||
"un număr static de spații de lucru (determinat de cheia num-workspaces din "
|
||||
"org.gnome.desktop.wm.preferences)"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:9
|
||||
#: data/org.gnome.mutter.gschema.xml.in:50
|
||||
msgid "Workspaces only on primary"
|
||||
msgstr "Spații de lucru doar pe ecranul principal"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:10
|
||||
#: data/org.gnome.mutter.gschema.xml.in:51
|
||||
msgid ""
|
||||
"Determines whether workspace switching should happen for windows on all "
|
||||
"monitors or only for windows on the primary monitor."
|
||||
@@ -342,11 +325,11 @@ msgstr ""
|
||||
"ferestrele de pe toate monitoarele sau doar pentru ferestrele de pe "
|
||||
"monitorul principal."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:11
|
||||
#: data/org.gnome.mutter.gschema.xml.in:59
|
||||
msgid "No tab popup"
|
||||
msgstr "Fără popup pentru tab"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:12
|
||||
#: data/org.gnome.mutter.gschema.xml.in:60
|
||||
msgid ""
|
||||
"Determines whether the use of popup and highlight frame should be disabled "
|
||||
"for window cycling."
|
||||
@@ -354,42 +337,40 @@ msgstr ""
|
||||
"Determină dacă utilizarea unui popup sau a unui cadrul evidențiat ar trebui "
|
||||
"să fie dezactivată pentru rotirea ferestrelor."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:13
|
||||
#: data/org.gnome.mutter.gschema.xml.in:68
|
||||
msgid "Delay focus changes until the pointer stops moving"
|
||||
msgstr ""
|
||||
"Întârzie schimbările de focalizare până când cursorul încetează să se miște"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:14
|
||||
#: data/org.gnome.mutter.gschema.xml.in:69
|
||||
msgid ""
|
||||
"If set to true, and the focus mode is either \"sloppy\" or \"mouse\" then "
|
||||
"the focus will not be changed immediately when entering a window, but only "
|
||||
"after the pointer stops moving."
|
||||
"If set to true, and the focus mode is either “sloppy” or “mouse” then the "
|
||||
"focus will not be changed immediately when entering a window, but only after "
|
||||
"the pointer stops moving."
|
||||
msgstr ""
|
||||
"Dacă este activat iar modul de focalizare este „alunecos” sau „maus”, "
|
||||
"focalizarea nu va fi schimbată imediat după intrarea în câmpul unei "
|
||||
"ferestre, ci doar după ce pointerul încetează să se miște."
|
||||
"Dacă este stabilit ca adevărat, iar modul de focalizare este ori „neglijent” "
|
||||
"ori „maus”, atunci focalizarea nu va fi schimbată imediat la intrarea într-o "
|
||||
"fereastră, ci doar după ce indicatorul nu se mai mișcă."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:15
|
||||
#, fuzzy
|
||||
#: data/org.gnome.mutter.gschema.xml.in:79
|
||||
msgid "Draggable border width"
|
||||
msgstr "Lățimea margini ce poate fi acționată"
|
||||
msgstr "Lățimea marginii ce poate fi plasată"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:16
|
||||
#, fuzzy
|
||||
#: data/org.gnome.mutter.gschema.xml.in:80
|
||||
msgid ""
|
||||
"The amount of total draggable borders. If the theme's visible borders are "
|
||||
"The amount of total draggable borders. If the theme’s visible borders are "
|
||||
"not enough, invisible borders will be added to meet this value."
|
||||
msgstr ""
|
||||
"Numărul marginilor ce pot fi acționate. Dacă marginile vizibile ale temei "
|
||||
"sunt insuficiente vor fi adăugate margini invizibile pentru a completa "
|
||||
"aceast număr."
|
||||
"Numărul total de margini ce pot fi plasate. Dacă marginile vizibile ale "
|
||||
"temei nu sunt suficiente, vor fi adăugate margini invizibile pentru a "
|
||||
"respecta această valoare."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:17
|
||||
#: data/org.gnome.mutter.gschema.xml.in:89
|
||||
msgid "Auto maximize nearly monitor sized windows"
|
||||
msgstr ""
|
||||
"Maximizează automat ferestrele de dimensiune apropiată de cea a monitorului"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:18
|
||||
#: data/org.gnome.mutter.gschema.xml.in:90
|
||||
msgid ""
|
||||
"If enabled, new windows that are initially the size of the monitor "
|
||||
"automatically get maximized."
|
||||
@@ -397,11 +378,11 @@ msgstr ""
|
||||
"Dacă este activată, ferestrele noi care sunt inițial de mărimea monitorului "
|
||||
"sunt maximizate în mod automat."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:19
|
||||
#: data/org.gnome.mutter.gschema.xml.in:98
|
||||
msgid "Place new windows in the center"
|
||||
msgstr "Plasează ferestre noi în centru"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:20
|
||||
#: data/org.gnome.mutter.gschema.xml.in:99
|
||||
msgid ""
|
||||
"When true, the new windows will always be put in the center of the active "
|
||||
"screen of the monitor."
|
||||
@@ -409,107 +390,255 @@ msgstr ""
|
||||
"Când este adevărat, ferestrele noi vor fi plasate în centrul ecranului activ "
|
||||
"al monitorului."
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:21
|
||||
#: data/org.gnome.mutter.gschema.xml.in:107
|
||||
msgid "Enable experimental features"
|
||||
msgstr "Activează funcționalitățile experimentale"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:108
|
||||
msgid ""
|
||||
"To enable experimental features, add the feature keyword to the list. "
|
||||
"Whether the feature requires restarting the compositor depends on the given "
|
||||
"feature. Any experimental feature is not required to still be available, or "
|
||||
"configurable. Don’t expect adding anything in this setting to be future "
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart."
|
||||
msgstr ""
|
||||
"Pentru a activa funcționalitățile experimentale, adăugați cuvântul cheie al "
|
||||
"funcționalității la listă. Dacă funcționalitatea necesită sau nu repornirea "
|
||||
"compunătorului depinde de funcționalitatea dată. Nu este necesar ca "
|
||||
"funcționalitatea experimentală să fie încă disponibilă, sau configurabilă. "
|
||||
"Nu vă așteptați să adăugați ceva la această configurare care va rezista "
|
||||
"timpului. Cuvintele cheie posibile în mod curent: • „scale-monitor-"
|
||||
"framebuffer” — face ca mutter să treacă implicit la aranjarea monitoarelor "
|
||||
"logice într-un spațiu logic de coordonate pixel, în timpul scalării de "
|
||||
"framebuffer-uri de monitor în locul conținutului ferestrei, pentru a "
|
||||
"gestiona monitoare HiDPI. Nu necesită o repornire."
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:141
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "Selectează fereastra din popup-ul tabului"
|
||||
|
||||
#: ../data/org.gnome.mutter.gschema.xml.in.h:22
|
||||
#: data/org.gnome.mutter.gschema.xml.in:146
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "Elimină popup-ul pentru tab"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:1
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "Comută configurațiile de monitor"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "Rotește configurarea de monitor integrat"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
|
||||
msgid "Switch to VT 1"
|
||||
msgstr "Comută la terminalul virtual 1"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:2
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:10
|
||||
msgid "Switch to VT 2"
|
||||
msgstr "Comută la terminalul virtual 2"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:3
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:14
|
||||
msgid "Switch to VT 3"
|
||||
msgstr "Comută la terminalul virtual 3"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:4
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:18
|
||||
msgid "Switch to VT 4"
|
||||
msgstr "Comută la terminalul virtual 4"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:5
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:22
|
||||
msgid "Switch to VT 5"
|
||||
msgstr "Comută la terminalul virtual 5"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:6
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:26
|
||||
msgid "Switch to VT 6"
|
||||
msgstr "Comută la terminalul virtual 6"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:7
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:30
|
||||
msgid "Switch to VT 7"
|
||||
msgstr "Comută la terminalul virtual 7"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:8
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:34
|
||||
msgid "Switch to VT 8"
|
||||
msgstr "Comută la terminalul virtual 8"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:9
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:38
|
||||
msgid "Switch to VT 9"
|
||||
msgstr "Comută la terminalul virtual 9"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:10
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:42
|
||||
msgid "Switch to VT 10"
|
||||
msgstr "Comută la terminalul virtual 10"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:11
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:46
|
||||
msgid "Switch to VT 11"
|
||||
msgstr "Comută la terminalul virtual 11"
|
||||
|
||||
#: ../data/org.gnome.mutter.wayland.gschema.xml.in.h:12
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:50
|
||||
msgid "Switch to VT 12"
|
||||
msgstr "Comută la terminalul virtual 12"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:500
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:54
|
||||
msgid "Re-enable shortcuts"
|
||||
msgstr "Reactivează scurtăturile"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
|
||||
msgid "Allow grabs with Xwayland"
|
||||
msgstr "Permite capturi de tastatură cu Xwayland"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
|
||||
msgid ""
|
||||
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
|
||||
"taken into account. For a X11 grab to be taken into account under Wayland, "
|
||||
"the client must also either send a specific X11 ClientMessage to the root "
|
||||
"window or be among the applications white-listed in key “xwayland-grab-"
|
||||
"access-rules”."
|
||||
msgstr ""
|
||||
"Permite capturile de tastatură emise de aplicațiile X11 care rulează în "
|
||||
"Xwayland să fie luate în considerare. Pentru ca o captură X11 să fie luată "
|
||||
"în considerare în Wayland, clientul trebuie ori să trimită un mesaj specific "
|
||||
"ClientMessage X11 la fereastra root ori să se numere printre aplicațiile "
|
||||
"permise în cheia „xwayland-grab-access-rules”."
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
|
||||
msgid "Xwayland applications allowed to issue keyboard grabs"
|
||||
msgstr "Aplicațiile Xwayland sunt permise de a emite capturi de tastatură"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
|
||||
msgid ""
|
||||
"List the resource names or resource class of X11 windows either allowed or "
|
||||
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
|
||||
"resource class of a given X11 window can be obtained using the command "
|
||||
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
|
||||
"Values starting with “!” are blacklisted, which has precedence over the "
|
||||
"whitelist, to revoke applications from the default system list. The default "
|
||||
"system list includes the following applications: "
|
||||
"“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by "
|
||||
"using the specific keyboard shortcut defined by the keybinding key “restore-"
|
||||
"shortcuts”."
|
||||
msgstr ""
|
||||
"Listează numele resurselor sau clasa resurselor ale ferestrelor X11 permise "
|
||||
"sau nepermise să emită capturi de tastatură X11 în Xwayland. Numele resursei "
|
||||
"sau clasa resursei a unei ferestre X11 date pot fi obținute utilizând "
|
||||
"comanda „xprop WM_CLASS*. Metacaracterele „*” și jokerii „?” în valori sunt "
|
||||
"suportați. Valorile care încep cu „!” sunt adăugate în lista de interziceri, "
|
||||
"care are prioritate peste lista de permisiuni, pentru a revoca aplicații din "
|
||||
"lista de sistem implicită. Lista de sistem implicită include următoarele "
|
||||
"aplicații: „@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Utilizatorii pot să "
|
||||
"întrerupă o captură existentă prin utilizarea scurtăturii de tastatură "
|
||||
"specifice definite de tasta de stabilire a combinațiilor de taste „restore-"
|
||||
"shortcuts”."
|
||||
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2325
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "Comutator de mod (grupul %d)"
|
||||
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2348
|
||||
msgid "Switch monitor"
|
||||
msgstr "Comută monitorul"
|
||||
|
||||
#: src/backends/meta-input-settings.c:2350
|
||||
msgid "Show on-screen help"
|
||||
msgstr "Arată ajutorul virtual"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:907
|
||||
msgid "Built-in display"
|
||||
msgstr "Afișaj integrat"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:526
|
||||
#: src/backends/meta-monitor-manager.c:930
|
||||
msgid "Unknown"
|
||||
msgstr "Necunoscut"
|
||||
|
||||
#: ../src/backends/meta-monitor-manager.c:528
|
||||
#: src/backends/meta-monitor-manager.c:932
|
||||
msgid "Unknown Display"
|
||||
msgstr "Afișaj necunoscut"
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: ../src/backends/meta-monitor-manager.c:536
|
||||
#: src/backends/meta-monitor-manager.c:940
|
||||
#, c-format
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#. This probably means that a non-WM compositor like xcompmgr is running;
|
||||
#. * we have no way to get it to exit
|
||||
#: ../src/compositor/compositor.c:456
|
||||
#: src/compositor/compositor.c:481
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display \"%s"
|
||||
"\"."
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
msgstr ""
|
||||
"Un alt administrator de ferestre compozit rulează deja pe ecranul %i pe "
|
||||
"Un alt administrator de ferestre de compunere rulează deja pe ecranul %i pe "
|
||||
"afișajul „%s”."
|
||||
|
||||
#: ../src/core/bell.c:185
|
||||
#: src/core/bell.c:254
|
||||
msgid "Bell event"
|
||||
msgstr "Eveniment sonor"
|
||||
|
||||
#: ../src/core/delete.c:127
|
||||
#: src/core/main.c:191
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "Dezactivează conexiunea la administratorul de sesiune"
|
||||
|
||||
#: src/core/main.c:197
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "Înlocuiește administratorul de ferestre curent"
|
||||
|
||||
#: src/core/main.c:203
|
||||
msgid "Specify session management ID"
|
||||
msgstr "Specifică ID-ul administrării de sesiune"
|
||||
|
||||
#: src/core/main.c:208
|
||||
msgid "X Display to use"
|
||||
msgstr "Ecranul X ce va fi folosit"
|
||||
|
||||
#: src/core/main.c:214
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "Inițializează sesiunea din fișierul salvat"
|
||||
|
||||
#: src/core/main.c:220
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "Realizează apelurile X sincron"
|
||||
|
||||
#: src/core/main.c:227
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "Rulează ca un compunător wayland"
|
||||
|
||||
#: src/core/main.c:233
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "Rulează ca un compunător imbricat"
|
||||
|
||||
#: src/core/main.c:239
|
||||
msgid "Run wayland compositor without starting Xwayland"
|
||||
msgstr "Rulează compunătorul wayland fără a porni Xwayland"
|
||||
|
||||
#: src/core/main.c:247
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "Rulează ca server de afișare și nu ca server imbricat"
|
||||
|
||||
#: src/core/main.c:253
|
||||
msgid "Run with X11 backend"
|
||||
msgstr "Rulează cu backend X11"
|
||||
|
||||
#. Translators: %s is a window title
|
||||
#: src/core/meta-close-dialog-default.c:148
|
||||
#, c-format
|
||||
msgid "“%s” is not responding."
|
||||
msgstr "„%s” nu răspunde."
|
||||
|
||||
#: ../src/core/delete.c:129
|
||||
#: src/core/meta-close-dialog-default.c:150
|
||||
msgid "Application is not responding."
|
||||
msgstr "Aplicația nu răspunde."
|
||||
|
||||
#: ../src/core/delete.c:134
|
||||
#: src/core/meta-close-dialog-default.c:155
|
||||
msgid ""
|
||||
"You may choose to wait a short while for it to continue or force the "
|
||||
"application to quit entirely."
|
||||
@@ -517,112 +646,104 @@ msgstr ""
|
||||
"Puteți alege între a aștepta pentru câteva secunde ca aplicația să continue "
|
||||
"sau a forța terminarea aplicației."
|
||||
|
||||
#: ../src/core/delete.c:141
|
||||
msgid "_Wait"
|
||||
msgstr "_Așteaptă"
|
||||
|
||||
#: ../src/core/delete.c:141
|
||||
#: src/core/meta-close-dialog-default.c:162
|
||||
msgid "_Force Quit"
|
||||
msgstr "_Forțează închiderea"
|
||||
|
||||
#: ../src/core/display.c:563
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "Nu s-a putut deschide afișajul X Window System „%s”\n"
|
||||
#: src/core/meta-close-dialog-default.c:162
|
||||
msgid "_Wait"
|
||||
msgstr "_Așteaptă"
|
||||
|
||||
#: ../src/core/main.c:176
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "Dezactivează conexiunea la administratorul de sesiune"
|
||||
|
||||
#: ../src/core/main.c:182
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "Înlocuiește administratorul de ferestre curent"
|
||||
|
||||
#: ../src/core/main.c:188
|
||||
msgid "Specify session management ID"
|
||||
msgstr "Specifică ID-ul administrării de sesiune"
|
||||
|
||||
#: ../src/core/main.c:193
|
||||
msgid "X Display to use"
|
||||
msgstr "Ecranul X ce va fi folosit"
|
||||
|
||||
#: ../src/core/main.c:199
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "Inițializează sesiunea din fișierul salvat"
|
||||
|
||||
#: ../src/core/main.c:205
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "Realizează apelurile X sincron"
|
||||
|
||||
#: ../src/core/main.c:212
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "Rulează ca compozitor wayland"
|
||||
|
||||
#: ../src/core/main.c:220
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "Rulează ca server de afișare și nu ca server imbricat"
|
||||
|
||||
#: ../src/core/mutter.c:39
|
||||
#: src/core/mutter.c:39
|
||||
#, c-format
|
||||
msgid ""
|
||||
"mutter %s\n"
|
||||
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"This is free software; see the source for copying conditions.\n"
|
||||
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
|
||||
"PARTICULAR PURPOSE.\n"
|
||||
msgstr ""
|
||||
"mutter %s\n"
|
||||
"Drepturi de autor (C) 2001--%d Havoc Pennington, Red Hat, Inc., și alții\n"
|
||||
"Drepturi de autor (C) 2001-%d Havoc Pennington, Red Hat, Inc., și alții\n"
|
||||
"Acesta este software liber; consultați codul sursă pentru condițiile de "
|
||||
"copiere.\n"
|
||||
"Nu există NICI O garanție; nici pentru COMERCIALIZARE sau UTILIZAREA ÎNTR-UN "
|
||||
"Nu există NICIO garanție; nici pentru COMERCIALIZARE sau UTILIZAREA ÎNTR-UN "
|
||||
"SCOP ANUME.\n"
|
||||
|
||||
#: ../src/core/mutter.c:53
|
||||
#: src/core/mutter.c:53
|
||||
msgid "Print version"
|
||||
msgstr "Afișează versiunea"
|
||||
|
||||
#: ../src/core/mutter.c:59
|
||||
#: src/core/mutter.c:59
|
||||
msgid "Mutter plugin to use"
|
||||
msgstr "Modul Mutter de utilizat"
|
||||
|
||||
#: ../src/core/prefs.c:2050
|
||||
#: src/core/prefs.c:1915
|
||||
#, c-format
|
||||
msgid "Workspace %d"
|
||||
msgstr "Spațiu de lucru %d"
|
||||
|
||||
#: ../src/core/screen.c:526
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display \"%s\" already has a window manager; try using the --replace option "
|
||||
"to replace the current window manager."
|
||||
msgstr ""
|
||||
"Afișajul „%s” are deja un administrator de ferestre; încercați să folosiți "
|
||||
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
|
||||
"ferestre actual."
|
||||
|
||||
#: ../src/core/screen.c:608
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgstr "Ecranul %d pe afișajul „%s” este invalid\n"
|
||||
|
||||
#: ../src/core/util.c:118
|
||||
#: src/core/util.c:120
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
msgstr "Mutter a fost compilat fără suport pentru modul detaliat\n"
|
||||
|
||||
#: ../src/x11/session.c:1815
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:567
|
||||
#, c-format
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "Comutator de mod: modul %d"
|
||||
|
||||
#: src/x11/meta-x11-display.c:666
|
||||
#, c-format
|
||||
msgid ""
|
||||
"These windows do not support "save current setup" and will have to "
|
||||
"be restarted manually next time you log in."
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
"replace the current window manager."
|
||||
msgstr ""
|
||||
"Afișajul „%s” are deja un administrator de ferestre; încercați să utilizați "
|
||||
"opțiunea --replace (înlocuiește) pentru a înlocui administratorul de "
|
||||
"ferestre curent."
|
||||
|
||||
#: src/x11/meta-x11-display.c:1010
|
||||
msgid "Failed to initialize GDK\n"
|
||||
msgstr "Nu s-a putut inițializa GDK\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1034
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr "Nu s-a putut deschide afișajul sistemului de ferestre X „%s”\n"
|
||||
|
||||
#: src/x11/meta-x11-display.c:1117
|
||||
#, c-format
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "Ecranul %d de pe afișajul „%s” nu este valid\n"
|
||||
|
||||
#: src/x11/session.c:1819
|
||||
msgid ""
|
||||
"These windows do not support “save current setup” and will have to be "
|
||||
"restarted manually next time you log in."
|
||||
msgstr ""
|
||||
"Aceste ferestre nu suportă „salvează configurarea curentă” și vor trebui "
|
||||
"repornite manual următoarea dată când vă veți autentifica."
|
||||
|
||||
#: ../src/x11/window-props.c:549
|
||||
#: src/x11/window-props.c:565
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (pe %s)"
|
||||
|
||||
#~ msgid "Move window one workspace to the left"
|
||||
#~ msgstr "Mută fereastra pe spațiul de lucru de la stânga"
|
||||
|
||||
#~ msgid "Move window one workspace to the right"
|
||||
#~ msgstr "Mută fereastra pe spațiul de lucru de la dreapta"
|
||||
|
||||
#~ msgid "Move to workspace left"
|
||||
#~ msgstr "Mută pe spațiul de lucru din stânga"
|
||||
|
||||
#~ msgid "Move to workspace right"
|
||||
#~ msgstr "Mută pe spațiul de lucru din dreapta"
|
||||
|
||||
#~ msgid "Toggle shaded state"
|
||||
#~ msgstr "Comută starea de umbrire"
|
||||
|
||||
#~ msgid "Switch to workspace on the left of the current workspace"
|
||||
#~ msgstr "Schimbă cu spațiul de lucru din stânga celui actual"
|
||||
|
||||
|
23
po/sl.po
23
po/sl.po
@@ -10,8 +10,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2018-03-05 19:32+0000\n"
|
||||
"PO-Revision-Date: 2018-03-06 22:02+0100\n"
|
||||
"POT-Creation-Date: 2018-04-03 20:43+0000\n"
|
||||
"PO-Revision-Date: 2018-04-09 20:28+0200\n"
|
||||
"Last-Translator: Matej Urbančič <mateju@svn.gnome.org>\n"
|
||||
"Language-Team: Slovenian GNOME Translation Team <gnome-si@googlegroups.com>\n"
|
||||
"Language: sl_SI\n"
|
||||
@@ -21,7 +21,7 @@ msgstr ""
|
||||
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n"
|
||||
"%100==4 ? 3 : 0);\n"
|
||||
"X-Poedit-SourceCharset: utf-8\n"
|
||||
"X-Generator: Poedit 2.0.4\n"
|
||||
"X-Generator: Poedit 2.0.6\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@@ -481,7 +481,7 @@ msgstr "Ponovno omogoči tipkovne bližnjice"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
|
||||
msgid "Allow grabs with Xwayland"
|
||||
msgstr ""
|
||||
msgstr "Dovoli zajemanje z XWayland"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
|
||||
msgid ""
|
||||
@@ -491,10 +491,14 @@ msgid ""
|
||||
"window or be among the applications white-listed in key “xwayland-grab-"
|
||||
"access-rules”."
|
||||
msgstr ""
|
||||
"Upošteva zajeme s tipkovnico, ki jih sprožijo programi X11, zagnani v okolju "
|
||||
"Xwayland. Če naj se programski zajem upošteva, mora odjemalec ali poslati "
|
||||
"specifično sporočilo X11 na korensko okno ali pa mora biti zaveden na "
|
||||
"seznamu programov v ključu »xwayland-garb-access-rules«."
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
|
||||
msgid "Xwayland applications allowed to issue keyboard grabs"
|
||||
msgstr ""
|
||||
msgstr "Program XWayland ima dovoljenje za zajemanje s tipkovnico"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
|
||||
msgid ""
|
||||
@@ -509,6 +513,15 @@ msgid ""
|
||||
"using the specific keyboard shortcut defined by the keybinding key “restore-"
|
||||
"shortcuts”."
|
||||
msgstr ""
|
||||
"Seznam imen ali razredov virov oken X11, ki lahko sprožijo zajeme v okolju "
|
||||
"Xwayland. Ime oziroma razred vira podanega okna X11 je mogoče pridobiti z "
|
||||
"ukazom »xprop WM_CLASS«. Uporaba pomožnih znakov » * « in » ? « je podprta. "
|
||||
"Vrednosti, ki se začnejo z znakom » ! « so uvrščeni na črni seznam. Ta "
|
||||
"seznam je obravnavan prednostno pred belim seznamom in prekliče zajeme na "
|
||||
"seznamu sistema. Privzeti seznam vključuje ključ: "
|
||||
"»@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@« Uporabniki lahko prekinejo obstoječi "
|
||||
"zajem z uporabo posebne tipkovne bližnjice, določene s tipkovnim ključem "
|
||||
"»restore-shortcuts«."
|
||||
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
|
405
po/zh_CN.po
405
po/zh_CN.po
@@ -1,6 +1,6 @@
|
||||
# translation of mutter.po to zh_CN
|
||||
# Simplified Chinese translation of mutter.
|
||||
# Copyright (C) 2002, 2003, 2004, 2009, 2010 Free Software Foundation, Inc.
|
||||
# Copyright (C) 2012-2018 mutter's COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the mutter package.
|
||||
# Sun G11n <gnome_int_l10n@ireland.sun.com>, 2002.
|
||||
# He Qiangqiang <carton@linux.net.cn>, 2002
|
||||
# Xiong Jiang <jxiong@offtopic.org>, 2003
|
||||
@@ -11,22 +11,24 @@
|
||||
# Lele Long <schemacs@gmail.com>, 2011.
|
||||
# YunQiang Su <wzssyqa@gmail.com>, 2011, 2012.
|
||||
# Tong Hui <tonghuix@gmail.com>, 2014.
|
||||
# Mandy Wang <wangmychn@gmail.com>, 2017.
|
||||
# Mingcong Bai <jeffbai@aosc.xyz>, 2017.
|
||||
# Dingzhong Chen <wsxy162@gmail.com>, 2017, 2018.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mutter master\n"
|
||||
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
|
||||
"product=mutter&keywords=I18N+L10N&component=general\n"
|
||||
"POT-Creation-Date: 2017-02-03 10:06+0000\n"
|
||||
"PO-Revision-Date: 2017-01-04 21:52+0800\n"
|
||||
"Last-Translator: Mandy Wang <wangmychn@gmail.com>\n"
|
||||
"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2018-02-09 13:01+0000\n"
|
||||
"PO-Revision-Date: 2018-02-16 22:22+0800\n"
|
||||
"Last-Translator: Dingzhong Chen <wsxy162@gmail.com>\n"
|
||||
"Language-Team: Chinese (China) <i18n-zh@googlegroups.com>\n"
|
||||
"Language: zh_CN\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Poedit 1.8.7.1\n"
|
||||
"X-Generator: Gtranslator 2.91.7\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@@ -53,134 +55,118 @@ msgid "Move window to last workspace"
|
||||
msgstr "将窗口移到最后一个工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:24
|
||||
msgid "Move window one workspace to the left"
|
||||
msgstr "将窗口左移一个工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:27
|
||||
msgid "Move window one workspace to the right"
|
||||
msgstr "将窗口右移一个工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:30
|
||||
msgid "Move window one workspace up"
|
||||
msgstr "将窗口上移一个工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:33
|
||||
#: data/50-mutter-navigation.xml:27
|
||||
msgid "Move window one workspace down"
|
||||
msgstr "将窗口下移一个工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:36
|
||||
#: data/50-mutter-navigation.xml:30
|
||||
msgid "Move window one monitor to the left"
|
||||
msgstr "将窗口左移一个显示器"
|
||||
|
||||
#: data/50-mutter-navigation.xml:39
|
||||
#: data/50-mutter-navigation.xml:33
|
||||
msgid "Move window one monitor to the right"
|
||||
msgstr "将窗口右移一个显示器"
|
||||
|
||||
#: data/50-mutter-navigation.xml:42
|
||||
#: data/50-mutter-navigation.xml:36
|
||||
msgid "Move window one monitor up"
|
||||
msgstr "将窗口上移一个显示器"
|
||||
|
||||
#: data/50-mutter-navigation.xml:45
|
||||
#: data/50-mutter-navigation.xml:39
|
||||
msgid "Move window one monitor down"
|
||||
msgstr "将窗口下移一个显示器"
|
||||
|
||||
#: data/50-mutter-navigation.xml:49
|
||||
#: data/50-mutter-navigation.xml:43
|
||||
msgid "Switch applications"
|
||||
msgstr "切换应用程序"
|
||||
|
||||
#: data/50-mutter-navigation.xml:54
|
||||
#: data/50-mutter-navigation.xml:48
|
||||
msgid "Switch to previous application"
|
||||
msgstr "切换到前一个应用程序"
|
||||
|
||||
#: data/50-mutter-navigation.xml:58
|
||||
#: data/50-mutter-navigation.xml:52
|
||||
msgid "Switch windows"
|
||||
msgstr "切换窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:63
|
||||
#: data/50-mutter-navigation.xml:57
|
||||
msgid "Switch to previous window"
|
||||
msgstr "切换到前一个窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:67
|
||||
#: data/50-mutter-navigation.xml:61
|
||||
msgid "Switch windows of an application"
|
||||
msgstr "在应用程序的窗口之间切换窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:72
|
||||
#: data/50-mutter-navigation.xml:66
|
||||
msgid "Switch to previous window of an application"
|
||||
msgstr "切换到一个应用程序的前一个窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:76
|
||||
#: data/50-mutter-navigation.xml:70
|
||||
msgid "Switch system controls"
|
||||
msgstr "切换系统控制"
|
||||
|
||||
#: data/50-mutter-navigation.xml:81
|
||||
#: data/50-mutter-navigation.xml:75
|
||||
msgid "Switch to previous system control"
|
||||
msgstr "切换到前一个系统控制"
|
||||
|
||||
#: data/50-mutter-navigation.xml:85
|
||||
#: data/50-mutter-navigation.xml:79
|
||||
msgid "Switch windows directly"
|
||||
msgstr "直接切换窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:90
|
||||
#: data/50-mutter-navigation.xml:84
|
||||
msgid "Switch directly to previous window"
|
||||
msgstr "直接切换到前一个窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:94
|
||||
#: data/50-mutter-navigation.xml:88
|
||||
msgid "Switch windows of an app directly"
|
||||
msgstr "在应用程序窗口间直接移动焦点"
|
||||
|
||||
#: data/50-mutter-navigation.xml:99
|
||||
#: data/50-mutter-navigation.xml:93
|
||||
msgid "Switch directly to previous window of an app"
|
||||
msgstr "直接切换到一个应用程序的前一个窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:103
|
||||
#: data/50-mutter-navigation.xml:97
|
||||
msgid "Switch system controls directly"
|
||||
msgstr "直接切换系统控制"
|
||||
|
||||
#: data/50-mutter-navigation.xml:108
|
||||
#: data/50-mutter-navigation.xml:102
|
||||
msgid "Switch directly to previous system control"
|
||||
msgstr "直接切换到前一个系统控制"
|
||||
|
||||
#: data/50-mutter-navigation.xml:111
|
||||
#: data/50-mutter-navigation.xml:105
|
||||
msgid "Hide all normal windows"
|
||||
msgstr "隐藏所有正常窗口"
|
||||
|
||||
#: data/50-mutter-navigation.xml:114
|
||||
#: data/50-mutter-navigation.xml:108
|
||||
msgid "Switch to workspace 1"
|
||||
msgstr "切换到工作区 1"
|
||||
|
||||
#: data/50-mutter-navigation.xml:117
|
||||
#: data/50-mutter-navigation.xml:111
|
||||
msgid "Switch to workspace 2"
|
||||
msgstr "切换到工作区 2"
|
||||
|
||||
#: data/50-mutter-navigation.xml:120
|
||||
#: data/50-mutter-navigation.xml:114
|
||||
msgid "Switch to workspace 3"
|
||||
msgstr "切换到工作区 3"
|
||||
|
||||
#: data/50-mutter-navigation.xml:123
|
||||
#: data/50-mutter-navigation.xml:117
|
||||
msgid "Switch to workspace 4"
|
||||
msgstr "切换到工作区 4"
|
||||
|
||||
#: data/50-mutter-navigation.xml:126
|
||||
#: data/50-mutter-navigation.xml:120
|
||||
msgid "Switch to last workspace"
|
||||
msgstr "切换到最后一个工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:129
|
||||
msgid "Move to workspace left"
|
||||
msgstr "移动到左侧工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:132
|
||||
msgid "Move to workspace right"
|
||||
msgstr "移动到右侧工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:135
|
||||
#: data/50-mutter-navigation.xml:123
|
||||
msgid "Move to workspace above"
|
||||
msgstr "移动到上层工作区"
|
||||
|
||||
#: data/50-mutter-navigation.xml:138
|
||||
#: data/50-mutter-navigation.xml:126
|
||||
msgid "Move to workspace below"
|
||||
msgstr "移动到下层工作区"
|
||||
|
||||
#: data/50-mutter-system.xml:6
|
||||
#: data/50-mutter-system.xml:6 data/50-mutter-wayland.xml:6
|
||||
msgid "System"
|
||||
msgstr "系统"
|
||||
|
||||
@@ -190,7 +176,11 @@ msgstr "显示运行命令提示符"
|
||||
|
||||
#: data/50-mutter-system.xml:10
|
||||
msgid "Show the activities overview"
|
||||
msgstr "显示活动大纲"
|
||||
msgstr "显示活动视图"
|
||||
|
||||
#: data/50-mutter-wayland.xml:8
|
||||
msgid "Restore the keyboard shortcuts"
|
||||
msgstr "还原键盘快捷键"
|
||||
|
||||
#: data/50-mutter-windows.xml:6
|
||||
msgid "Windows"
|
||||
@@ -217,54 +207,50 @@ msgid "Restore window"
|
||||
msgstr "恢复窗口"
|
||||
|
||||
#: data/50-mutter-windows.xml:18
|
||||
msgid "Toggle shaded state"
|
||||
msgstr "切换卷起状态"
|
||||
|
||||
#: data/50-mutter-windows.xml:20
|
||||
msgid "Close window"
|
||||
msgstr "关闭窗口"
|
||||
|
||||
#: data/50-mutter-windows.xml:22
|
||||
#: data/50-mutter-windows.xml:20
|
||||
msgid "Hide window"
|
||||
msgstr "隐藏窗口"
|
||||
|
||||
#: data/50-mutter-windows.xml:24
|
||||
#: data/50-mutter-windows.xml:22
|
||||
msgid "Move window"
|
||||
msgstr "移动窗口"
|
||||
|
||||
#: data/50-mutter-windows.xml:26
|
||||
#: data/50-mutter-windows.xml:24
|
||||
msgid "Resize window"
|
||||
msgstr "改变窗口大小"
|
||||
|
||||
#: data/50-mutter-windows.xml:29
|
||||
#: data/50-mutter-windows.xml:27
|
||||
msgid "Toggle window on all workspaces or one"
|
||||
msgstr "在位于所有或仅一个工作区的窗口间切换"
|
||||
|
||||
#: data/50-mutter-windows.xml:31
|
||||
#: data/50-mutter-windows.xml:29
|
||||
msgid "Raise window if covered, otherwise lower it"
|
||||
msgstr "如果窗口被其他窗口遮盖,则提升它,否则降低它"
|
||||
|
||||
#: data/50-mutter-windows.xml:33
|
||||
#: data/50-mutter-windows.xml:31
|
||||
msgid "Raise window above other windows"
|
||||
msgstr "将窗口提升到其它窗口之上"
|
||||
|
||||
#: data/50-mutter-windows.xml:35
|
||||
#: data/50-mutter-windows.xml:33
|
||||
msgid "Lower window below other windows"
|
||||
msgstr "将窗口降低到其它窗口之下"
|
||||
|
||||
#: data/50-mutter-windows.xml:37
|
||||
#: data/50-mutter-windows.xml:35
|
||||
msgid "Maximize window vertically"
|
||||
msgstr "垂直最大化窗口"
|
||||
|
||||
#: data/50-mutter-windows.xml:39
|
||||
#: data/50-mutter-windows.xml:37
|
||||
msgid "Maximize window horizontally"
|
||||
msgstr "水平最大化窗口"
|
||||
|
||||
#: data/50-mutter-windows.xml:43
|
||||
#: data/50-mutter-windows.xml:41
|
||||
msgid "View split on left"
|
||||
msgstr "在左侧查看分割"
|
||||
|
||||
#: data/50-mutter-windows.xml:47
|
||||
#: data/50-mutter-windows.xml:45
|
||||
msgid "View split on right"
|
||||
msgstr "在右侧查看分割"
|
||||
|
||||
@@ -278,10 +264,10 @@ msgstr "用于修改窗口点击动作的修饰键 met"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:8
|
||||
msgid ""
|
||||
"This key will initiate the \"overlay\", which is a combination window "
|
||||
"overview and application launching system. The default is intended to be the "
|
||||
"\"Windows key\" on PC hardware. It's expected that this binding either the "
|
||||
"default or set to the empty string."
|
||||
"This key will initiate the “overlay”, which is a combination window overview "
|
||||
"and application launching system. The default is intended to be the “Windows "
|
||||
"key” on PC hardware. It’s expected that this binding either the default or "
|
||||
"set to the empty string."
|
||||
msgstr ""
|
||||
"这个键指出的“覆盖”是一种混合窗口概述和应用程序运行的系统。默认要求使用 "
|
||||
"“Super 键”。可能使用默认或者空白。"
|
||||
@@ -318,12 +304,12 @@ msgstr "动态管理工作区"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:41
|
||||
msgid ""
|
||||
"Determines whether workspaces are managed dynamically or whether there's a "
|
||||
"Determines whether workspaces are managed dynamically or whether there’s a "
|
||||
"static number of workspaces (determined by the num-workspaces key in org."
|
||||
"gnome.desktop.wm.preferences)."
|
||||
msgstr ""
|
||||
"决定工作区动态管理还是静态数量的工作区(由 org.gnome.desktop.wm.preferences 中"
|
||||
"的 num-workspaces 键确定)。"
|
||||
"决定工作区动态管理还是静态数量的工作区(由 org.gnome.desktop.wm.preferences "
|
||||
"中的 num-workspaces 键确定)。"
|
||||
|
||||
# 或者 只在主显示器上显示工作区
|
||||
#: data/org.gnome.mutter.gschema.xml.in:50
|
||||
@@ -353,9 +339,9 @@ msgstr "将焦点改变推迟到光标停止移动之后"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:69
|
||||
msgid ""
|
||||
"If set to true, and the focus mode is either \"sloppy\" or \"mouse\" then "
|
||||
"the focus will not be changed immediately when entering a window, but only "
|
||||
"after the pointer stops moving."
|
||||
"If set to true, and the focus mode is either “sloppy” or “mouse” then the "
|
||||
"focus will not be changed immediately when entering a window, but only after "
|
||||
"the pointer stops moving."
|
||||
msgstr ""
|
||||
"如果为 true,而聚焦模式为“sloppy”或“mouse”,那么进入某个窗口时焦点将不会立即"
|
||||
"改变,而是等到光标停止移动之后。"
|
||||
@@ -366,7 +352,7 @@ msgstr "可拖拽的边界宽度"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:80
|
||||
msgid ""
|
||||
"The amount of total draggable borders. If the theme's visible borders are "
|
||||
"The amount of total draggable borders. If the theme’s visible borders are "
|
||||
"not enough, invisible borders will be added to meet this value."
|
||||
msgstr ""
|
||||
"可拖拽的边界总数。如果主题的可见边界不足,将添加不可见的边界来满足此值。"
|
||||
@@ -391,14 +377,50 @@ msgid ""
|
||||
"screen of the monitor."
|
||||
msgstr "为 true 时,新窗口将总是置于此显示器已激活屏幕的中央。"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:120
|
||||
#: data/org.gnome.mutter.gschema.xml.in:107
|
||||
msgid "Enable experimental features"
|
||||
msgstr "开启实验性特性"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:108
|
||||
msgid ""
|
||||
"To enable experimental features, add the feature keyword to the list. "
|
||||
"Whether the feature requires restarting the compositor depends on the given "
|
||||
"feature. Any experimental feature is not required to still be available, or "
|
||||
"configurable. Don’t expect adding anything in this setting to be future "
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
|
||||
"enables remote desktop support. To support remote desktop with screen "
|
||||
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
|
||||
"screen cast support."
|
||||
msgstr ""
|
||||
"要启用实验性特性,请将如下特性关键字添加到列表中。特性是否要求重启合成器取决"
|
||||
"于特性本身。实验性特性不需启用即可配置和使用。请不要将实验性特性作为未来保障"
|
||||
"的基础。当前可用的关键字:• “monitor-config-manager” — 使用新的监视器配置系"
|
||||
"统,用于替代老的系统。启用此特性将打开一个上级配置 API 以用于配置应用程序,并"
|
||||
"可提供基于每屏幕的逻辑缩放功能。• “scale-monitor-framebuffer” — 让 Mutter 默"
|
||||
"认基于像素座标排布多屏幕,并同时缩放监视器帧缓冲器而不是窗口内容,以便管理 "
|
||||
"HiDPI 监视器。该特性不需要重启来生效。• “remote-desktop” — 启用远程桌面支持。"
|
||||
"要支持远程桌面共享,还需要设置“screen-cast”。 • “screen-cast” — 启用屏幕广播"
|
||||
"支持。"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:145
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "从 Tab 轮换弹出界面选择窗口"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:125
|
||||
#: data/org.gnome.mutter.gschema.xml.in:150
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "取消 Tab 轮换弹出"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:155
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "切换显示器配置"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:160
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "旋转内置显示器配置"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:6
|
||||
msgid "Switch to VT 1"
|
||||
msgstr "切换到 VT 1"
|
||||
@@ -447,127 +469,183 @@ msgstr "切换到 VT 11"
|
||||
msgid "Switch to VT 12"
|
||||
msgstr "切换到 VT 12"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:54
|
||||
msgid "Re-enable shortcuts"
|
||||
msgstr "重新启用快捷键"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
|
||||
msgid "Allow grabs with Xwayland"
|
||||
msgstr "允许用 Xwayland 捕获"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:65
|
||||
msgid ""
|
||||
"Allow keyboard grabs issued by X11 applications running in Xwayland to be "
|
||||
"taken into account. For a X11 grab to be taken into account under Wayland, "
|
||||
"the client must also either send a specific X11 ClientMessage to the root "
|
||||
"window or be among the applications white-listed in key “xwayland-grab-"
|
||||
"access-rules”."
|
||||
msgstr ""
|
||||
"允许考虑运行在 Xwayland 中的 X11 应用程序发起的键盘捕获。在 Wayland 下,为了"
|
||||
"将 X11 捕获考虑在内,客户端也必须发送一个指定的 X11 ClientMessage 到根窗口,"
|
||||
"或是包含进“xwayland-grab-access-rules”键成为其中一个白名单应用程序。"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
|
||||
msgid "Xwayland applications allowed to issue keyboard grabs"
|
||||
msgstr "允许发起键盘捕获的 Xwayland 应用程序"
|
||||
|
||||
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
|
||||
msgid ""
|
||||
"List the resource names or resource class of X11 windows either allowed or "
|
||||
"not allowed to issue X11 keyboard grabs under Xwayland. The resource name or "
|
||||
"resource class of a given X11 window can be obtained using the command "
|
||||
"“xprop WM_CLASS”. Wildcards “*” and jokers “?” in the values are supported. "
|
||||
"Values starting with “!” are blacklisted, which has precedence over the "
|
||||
"whitelist, to revoke applications from the default system list. The default "
|
||||
"system list includes the following applications: "
|
||||
"“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” Users can break an existing grab by "
|
||||
"using the specific keyboard shortcut defined by the keybinding key “restore-"
|
||||
"shortcuts”."
|
||||
msgstr ""
|
||||
"Xwayland 下允许或不允许发起 X11 键盘捕获的 X11 窗口,其资源名或资源类的列表。"
|
||||
"给定 X11 窗口的资源名或资源类可以使用“xprop WM_CLASS”命令获取。支持在键值中使"
|
||||
"用通配符“*”和“?”。以“!”开头的键值会列入黑名单,它们的优先级高于白名单,用来撤"
|
||||
"销默认系统列表中的应用程序。默认系统列表包含了下列应用程"
|
||||
"序:“@XWAYLAND_GRAB_DEFAULT_ACCESS_RULES@” 用户可以使用键绑定键“restore-"
|
||||
"shortcuts”定义的键盘快捷键来中断进行中的捕获。"
|
||||
|
||||
#. TRANSLATORS: This string refers to a button that switches between
|
||||
#. * different modes.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:2260
|
||||
#, c-format
|
||||
msgid "Mode Switch (Group %d)"
|
||||
msgstr "模式切换(组别 %d)"
|
||||
|
||||
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
|
||||
#. * mapping through the available outputs.
|
||||
#.
|
||||
#: src/backends/meta-input-settings.c:1861
|
||||
#: src/backends/meta-input-settings.c:2283
|
||||
msgid "Switch monitor"
|
||||
msgstr "切换显示器"
|
||||
|
||||
#: src/backends/meta-input-settings.c:1863
|
||||
#: src/backends/meta-input-settings.c:2285
|
||||
msgid "Show on-screen help"
|
||||
msgstr "显示在屏帮助"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:515
|
||||
#: src/backends/meta-monitor-manager.c:900
|
||||
msgid "Built-in display"
|
||||
msgstr "内置显示器"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:538
|
||||
#: src/backends/meta-monitor-manager.c:923
|
||||
msgid "Unknown"
|
||||
msgstr "未知"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:540
|
||||
#: src/backends/meta-monitor-manager.c:925
|
||||
msgid "Unknown Display"
|
||||
msgstr "未知的 Display"
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: src/backends/meta-monitor-manager.c:548
|
||||
#: src/backends/meta-monitor-manager.c:933
|
||||
#, c-format
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
||||
#. This probably means that a non-WM compositor like xcompmgr is running;
|
||||
#. * we have no way to get it to exit
|
||||
#: src/compositor/compositor.c:471
|
||||
#: src/compositor/compositor.c:481
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Another compositing manager is already running on screen %i on display \"%s"
|
||||
"\"."
|
||||
"Another compositing manager is already running on screen %i on display “%s”."
|
||||
msgstr "显示器 %2$s 的屏幕 %1$i 上已有另外一个混成窗口管理器正在运行。"
|
||||
|
||||
#: src/core/bell.c:194
|
||||
msgid "Bell event"
|
||||
msgstr "响铃事件"
|
||||
|
||||
#: src/core/delete.c:127
|
||||
#: src/core/display.c:608
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display “%s”\n"
|
||||
msgstr "无法打开 X Window System 显示器“%s”\n"
|
||||
|
||||
#: src/core/main.c:190
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "禁止连接到会话管理器"
|
||||
|
||||
#: src/core/main.c:196
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "替换正在运行的窗口管理器"
|
||||
|
||||
#: src/core/main.c:202
|
||||
msgid "Specify session management ID"
|
||||
msgstr "指定会话管理 ID"
|
||||
|
||||
#: src/core/main.c:207
|
||||
msgid "X Display to use"
|
||||
msgstr "要使用的 X Display"
|
||||
|
||||
#: src/core/main.c:213
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "从保存文件中初始化会话"
|
||||
|
||||
#: src/core/main.c:219
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "使 X 调用同步"
|
||||
|
||||
#: src/core/main.c:226
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "作为 wayland 混成管理器运行"
|
||||
|
||||
#: src/core/main.c:232
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "作为嵌套混成器运行"
|
||||
|
||||
#: src/core/main.c:240
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "以完整显示服务器方式运行,而不是以嵌套方式"
|
||||
|
||||
#: src/core/main.c:246
|
||||
msgid "Run with X11 backend"
|
||||
msgstr "以 X11 后端运行"
|
||||
|
||||
#. Translators: %s is a window title
|
||||
#: src/core/meta-close-dialog-default.c:147
|
||||
#, c-format
|
||||
msgid "“%s” is not responding."
|
||||
msgstr "“%s” 未响应。"
|
||||
|
||||
#: src/core/delete.c:129
|
||||
#: src/core/meta-close-dialog-default.c:149
|
||||
msgid "Application is not responding."
|
||||
msgstr "应用程序未响应。"
|
||||
|
||||
#: src/core/delete.c:134
|
||||
#: src/core/meta-close-dialog-default.c:154
|
||||
msgid ""
|
||||
"You may choose to wait a short while for it to continue or force the "
|
||||
"application to quit entirely."
|
||||
msgstr "您可以选择稍等一会儿,或者强制退出该应用程序。"
|
||||
|
||||
#: src/core/delete.c:141
|
||||
msgid "_Wait"
|
||||
msgstr "等待(_W)"
|
||||
|
||||
#: src/core/delete.c:141
|
||||
#: src/core/meta-close-dialog-default.c:161
|
||||
msgid "_Force Quit"
|
||||
msgstr "强制退出(_F)"
|
||||
|
||||
#: src/core/display.c:590
|
||||
#, c-format
|
||||
msgid "Failed to open X Window System display '%s'\n"
|
||||
msgstr "无法打开 X Window System 显示器“%s”\n"
|
||||
|
||||
#: src/core/main.c:182
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "禁止连接到会话管理器"
|
||||
|
||||
#: src/core/main.c:188
|
||||
msgid "Replace the running window manager"
|
||||
msgstr "替换正在运行的窗口管理器"
|
||||
|
||||
#: src/core/main.c:194
|
||||
msgid "Specify session management ID"
|
||||
msgstr "指定会话管理 ID"
|
||||
|
||||
#: src/core/main.c:199
|
||||
msgid "X Display to use"
|
||||
msgstr "要使用的 X Display"
|
||||
|
||||
#: src/core/main.c:205
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "从保存文件中初始化会话"
|
||||
|
||||
#: src/core/main.c:211
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "使 X 调用同步"
|
||||
|
||||
#: src/core/main.c:218
|
||||
msgid "Run as a wayland compositor"
|
||||
msgstr "作为 wayland 混成管理器运行"
|
||||
|
||||
#: src/core/main.c:224
|
||||
msgid "Run as a nested compositor"
|
||||
msgstr "作为嵌套混成器运行"
|
||||
|
||||
#: src/core/main.c:232
|
||||
msgid "Run as a full display server, rather than nested"
|
||||
msgstr "以完整显示服务器方式运行,而不是以嵌套方式"
|
||||
#: src/core/meta-close-dialog-default.c:161
|
||||
msgid "_Wait"
|
||||
msgstr "等待(_W)"
|
||||
|
||||
#: src/core/mutter.c:39
|
||||
#, c-format
|
||||
msgid ""
|
||||
"mutter %s\n"
|
||||
"Copyright (C) 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., and others\n"
|
||||
"This is free software; see the source for copying conditions.\n"
|
||||
"There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A "
|
||||
"PARTICULAR PURPOSE.\n"
|
||||
msgstr ""
|
||||
"mutter %s\n"
|
||||
"版权所有 (C) 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
|
||||
"本软件为自由软件:版权条款请参见源码\n"
|
||||
"不存在任何保证:即便是对商业性或者特定目的的适应性也不作保证。\n"
|
||||
"Copyright © 2001-%d Havoc Pennington, Red Hat, Inc., 以及其他\n"
|
||||
"本软件为自由软件;版权条款请参见源码\n"
|
||||
"不存在任何保证;即便是对商业性或者特定目的的适应性也不作保证。\n"
|
||||
|
||||
#: src/core/mutter.c:53
|
||||
msgid "Print version"
|
||||
@@ -582,41 +660,54 @@ msgstr "要使用的 Mutter 插件"
|
||||
msgid "Workspace %d"
|
||||
msgstr "工作区 %d"
|
||||
|
||||
#: src/core/screen.c:521
|
||||
#: src/core/screen.c:583
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Display \"%s\" already has a window manager; try using the --replace option "
|
||||
"to replace the current window manager."
|
||||
"Display “%s” already has a window manager; try using the --replace option to "
|
||||
"replace the current window manager."
|
||||
msgstr ""
|
||||
"Display“%s”已经有一个窗口管理器;请尝试使用 --replace 选项替换当前的窗口管理"
|
||||
"器。"
|
||||
|
||||
#: src/core/screen.c:606
|
||||
#: src/core/screen.c:668
|
||||
#, c-format
|
||||
msgid "Screen %d on display '%s' is invalid\n"
|
||||
msgid "Screen %d on display “%s” is invalid\n"
|
||||
msgstr "显示“%2$s”上的屏幕 %1$d 无效\n"
|
||||
|
||||
#: src/core/util.c:120
|
||||
msgid "Mutter was compiled without support for verbose mode\n"
|
||||
msgstr "Mutter 编译的时候没有加入详细模式的支持\n"
|
||||
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:595
|
||||
#: src/wayland/meta-wayland-tablet-pad.c:567
|
||||
#, c-format
|
||||
msgid "Mode Switch: Mode %d"
|
||||
msgstr "模式切换:%d 模式"
|
||||
|
||||
#: src/x11/session.c:1815
|
||||
#: src/x11/session.c:1818
|
||||
msgid ""
|
||||
"These windows do not support "save current setup" and will have to "
|
||||
"be restarted manually next time you log in."
|
||||
msgstr ""
|
||||
"这些窗口不支持 "保存当前设置 " 您在下次登录时,必须手动重启动它"
|
||||
"们。"
|
||||
"These windows do not support “save current setup” and will have to be "
|
||||
"restarted manually next time you log in."
|
||||
msgstr "这些窗口不支持“保存当前设置”,并且在您下次登录时,必须手动重启它们。"
|
||||
|
||||
#: src/x11/window-props.c:548
|
||||
#: src/x11/window-props.c:559
|
||||
#, c-format
|
||||
msgid "%s (on %s)"
|
||||
msgstr "%s (于 %s)"
|
||||
msgstr "%s(于 %s)"
|
||||
|
||||
#~ msgid "Move window one workspace to the left"
|
||||
#~ msgstr "将窗口左移一个工作区"
|
||||
|
||||
#~ msgid "Move window one workspace to the right"
|
||||
#~ msgstr "将窗口右移一个工作区"
|
||||
|
||||
#~ msgid "Move to workspace left"
|
||||
#~ msgstr "移动到左侧工作区"
|
||||
|
||||
#~ msgid "Move to workspace right"
|
||||
#~ msgstr "移动到右侧工作区"
|
||||
|
||||
#~ msgid "Toggle shaded state"
|
||||
#~ msgstr "切换卷起状态"
|
||||
|
||||
#~ msgid "Failed to scan themes directory: %s\n"
|
||||
#~ msgstr "扫描主题目录失败:%s\n"
|
||||
|
31
po/zh_TW.po
31
po/zh_TW.po
@@ -9,8 +9,8 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: metacity 3.3.4\n"
|
||||
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
|
||||
"POT-Creation-Date: 2018-03-01 18:57+0000\n"
|
||||
"PO-Revision-Date: 2018-03-03 15:20+0800\n"
|
||||
"POT-Creation-Date: 2018-06-07 13:00+0000\n"
|
||||
"PO-Revision-Date: 2018-06-09 11:26+0800\n"
|
||||
"Last-Translator: Cheng-Chia Tseng <pswo10680@gmail.com>\n"
|
||||
"Language-Team: Chinese (Taiwan) <zh-l10n@lists.linux.org.tw>\n"
|
||||
"Language: zh_TW\n"
|
||||
@@ -18,7 +18,7 @@ msgstr ""
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Poedit 2.0.6\n"
|
||||
"X-Generator: Poedit 2.0.8\n"
|
||||
|
||||
#: data/50-mutter-navigation.xml:6
|
||||
msgid "Navigation"
|
||||
@@ -379,32 +379,27 @@ msgid ""
|
||||
"proof. Currently possible keywords: • “scale-monitor-framebuffer” — makes "
|
||||
"mutter default to layout logical monitors in a logical pixel coordinate "
|
||||
"space, while scaling monitor framebuffers instead of window content, to "
|
||||
"manage HiDPI monitors. Does not require a restart. • “remote-desktop” — "
|
||||
"enables remote desktop support. To support remote desktop with screen "
|
||||
"sharing, “screen-cast” must also be enabled. • “screen-cast” — enables "
|
||||
"screen cast support."
|
||||
"manage HiDPI monitors. Does not require a restart."
|
||||
msgstr ""
|
||||
"若要啟用實驗性功能,請將功能關鍵字加入列表中。置於該功能是否須要重新啟動混成"
|
||||
"器則視給予的功能而定。任何實驗性功能不一定能用、或是可以調整設定。請不要預期"
|
||||
"在此設定中加入的任何東西未來都能存在。目前可用的關鍵字有: • “scale-monitor-"
|
||||
"framebuffer” — 讓 mutter 預設採用邏輯像素座標空間的配置邏輯螢幕,而縮放螢幕 "
|
||||
"framebuffer 則取代視窗內容以管理 HiDPI 螢幕。不須要重新啟動。 • “remote-"
|
||||
"desktop” — 啟用遠端桌面支援。若要支援遠端桌面的螢幕分享,則必須也啟用“screen-"
|
||||
"cast”。• “screen-cast” — 啟用螢幕投放支援。"
|
||||
"framebuffer 則取代視窗內容以管理 HiDPI 螢幕。不須要重新啟動。"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:145
|
||||
#: data/org.gnome.mutter.gschema.xml.in:141
|
||||
msgid "Select window from tab popup"
|
||||
msgstr "從分頁彈出項選擇視窗"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:150
|
||||
#: data/org.gnome.mutter.gschema.xml.in:146
|
||||
msgid "Cancel tab popup"
|
||||
msgstr "取消分頁彈出項"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:155
|
||||
#: data/org.gnome.mutter.gschema.xml.in:151
|
||||
msgid "Switch monitor configurations"
|
||||
msgstr "切換螢幕組態"
|
||||
|
||||
#: data/org.gnome.mutter.gschema.xml.in:160
|
||||
#: data/org.gnome.mutter.gschema.xml.in:156
|
||||
msgid "Rotates the built-in monitor configuration"
|
||||
msgstr "旋轉切換內建螢幕組態"
|
||||
|
||||
@@ -520,22 +515,22 @@ msgstr "切換螢幕"
|
||||
msgid "Show on-screen help"
|
||||
msgstr "顯示螢幕求助"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:900
|
||||
#: src/backends/meta-monitor-manager.c:903
|
||||
msgid "Built-in display"
|
||||
msgstr "內建顯示"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:923
|
||||
#: src/backends/meta-monitor-manager.c:926
|
||||
msgid "Unknown"
|
||||
msgstr "不明"
|
||||
|
||||
#: src/backends/meta-monitor-manager.c:925
|
||||
#: src/backends/meta-monitor-manager.c:928
|
||||
msgid "Unknown Display"
|
||||
msgstr "不明的顯示器"
|
||||
|
||||
#. TRANSLATORS: this is a monitor vendor name, followed by a
|
||||
#. * size in inches, like 'Dell 15"'
|
||||
#.
|
||||
#: src/backends/meta-monitor-manager.c:933
|
||||
#: src/backends/meta-monitor-manager.c:936
|
||||
#, c-format
|
||||
msgid "%s %s"
|
||||
msgstr "%s %s"
|
||||
|
@@ -11,13 +11,14 @@ test_programs = \
|
||||
|
||||
if BUILDOPT_INSTALL_TESTS
|
||||
stackingdir = $(pkgdatadir)/tests/stacking
|
||||
dist_stacking_DATA = \
|
||||
tests/stacking/basic-x11.metatest \
|
||||
tests/stacking/basic-wayland.metatest \
|
||||
tests/stacking/minimized.metatest \
|
||||
tests/stacking/mixed-windows.metatest \
|
||||
tests/stacking/set-parent.metatest \
|
||||
tests/stacking/override-redirect.metatest
|
||||
dist_stacking_DATA = \
|
||||
$(srcdir)/tests/stacking/basic-x11.metatest \
|
||||
$(srcdir)/tests/stacking/basic-wayland.metatest \
|
||||
$(srcdir)/tests/stacking/minimized.metatest \
|
||||
$(srcdir)/tests/stacking/mixed-windows.metatest \
|
||||
$(srcdir)/tests/stacking/set-parent.metatest \
|
||||
$(srcdir)/tests/stacking/set-parent-exported.metatest \
|
||||
$(srcdir)/tests/stacking/override-redirect.metatest
|
||||
|
||||
mutter-all.test: tests/mutter-all.test.in
|
||||
$(AM_V_GEN) sed -e "s|@libexecdir[@]|$(libexecdir)|g" $< > $@.tmp && mv $@.tmp $@
|
||||
@@ -72,6 +73,9 @@ mutter_test_headless_start_test_LDADD = $(MUTTER_LIBS) libmutter-$(LIBMUTTER_API
|
||||
|
||||
.PHONY: run-tests run-test-runner-tests run-unit-tests run-headless-start-test
|
||||
|
||||
export G_TEST_SRCDIR = $(abs_srcdir)
|
||||
export G_TEST_BUILDDIR = $(abs_builddir)
|
||||
|
||||
run-test-runner-tests: mutter-test-client mutter-test-runner
|
||||
./mutter-test-runner $(dist_stacking_DATA)
|
||||
|
||||
|
@@ -91,6 +91,12 @@ mutter_built_sources += \
|
||||
gtk-text-input-protocol.c \
|
||||
gtk-text-input-server-protocol.h \
|
||||
$(NULL)
|
||||
|
||||
if HAVE_WAYLAND_EGLSTREAM
|
||||
mutter_built_sources += \
|
||||
wayland-eglstream-controller-server-protocol.h \
|
||||
$(NULL)
|
||||
endif
|
||||
endif
|
||||
|
||||
wayland_protocols = \
|
||||
@@ -114,6 +120,8 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
backends/meta-cursor-tracker-private.h \
|
||||
backends/meta-cursor-renderer.c \
|
||||
backends/meta-cursor-renderer.h \
|
||||
backends/meta-cursor-sprite-xcursor.c \
|
||||
backends/meta-cursor-sprite-xcursor.h \
|
||||
backends/meta-dnd-private.h \
|
||||
backends/meta-egl.c \
|
||||
backends/meta-egl.h \
|
||||
@@ -153,7 +161,7 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
backends/meta-pointer-constraint.h \
|
||||
backends/meta-settings.c \
|
||||
backends/meta-settings-private.h \
|
||||
backends/meta-stage.h \
|
||||
backends/meta-stage-private.h \
|
||||
backends/meta-stage.c \
|
||||
backends/meta-renderer.c \
|
||||
backends/meta-renderer.h \
|
||||
@@ -161,6 +169,7 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
backends/meta-renderer-view.h \
|
||||
backends/edid-parse.c \
|
||||
backends/edid.h \
|
||||
backends/gsm-inhibitor-flag.h \
|
||||
backends/x11/meta-backend-x11.c \
|
||||
backends/x11/meta-backend-x11.h \
|
||||
backends/x11/meta-barrier-x11.c \
|
||||
@@ -175,6 +184,8 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
backends/x11/meta-gpu-xrandr.h \
|
||||
backends/x11/cm/meta-backend-x11-cm.c \
|
||||
backends/x11/cm/meta-backend-x11-cm.h \
|
||||
backends/x11/cm/meta-cursor-sprite-xfixes.c \
|
||||
backends/x11/cm/meta-cursor-sprite-xfixes.h \
|
||||
backends/x11/cm/meta-renderer-x11-cm.c \
|
||||
backends/x11/cm/meta-renderer-x11-cm.h \
|
||||
backends/x11/nested/meta-backend-x11-nested.c \
|
||||
@@ -183,8 +194,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
backends/x11/nested/meta-cursor-renderer-x11-nested.h \
|
||||
backends/x11/nested/meta-renderer-x11-nested.c \
|
||||
backends/x11/nested/meta-renderer-x11-nested.h \
|
||||
backends/x11/meta-idle-monitor-xsync.c \
|
||||
backends/x11/meta-idle-monitor-xsync.h \
|
||||
backends/x11/meta-input-settings-x11.c \
|
||||
backends/x11/meta-input-settings-x11.h \
|
||||
backends/x11/meta-monitor-manager-xrandr.c \
|
||||
@@ -247,7 +256,7 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
compositor/meta-window-actor.c \
|
||||
compositor/meta-window-actor-private.h \
|
||||
compositor/meta-window-group.c \
|
||||
compositor/meta-window-group.h \
|
||||
compositor/meta-window-group-private.h \
|
||||
compositor/meta-window-shape.c \
|
||||
compositor/region-utils.c \
|
||||
compositor/region-utils.h \
|
||||
@@ -280,12 +289,13 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
core/edge-resistance.h \
|
||||
core/events.c \
|
||||
core/events.h \
|
||||
core/errors.c \
|
||||
meta/errors.h \
|
||||
core/frame.c \
|
||||
core/frame.h \
|
||||
core/meta-gesture-tracker.c \
|
||||
core/meta-gesture-tracker-private.h \
|
||||
core/meta-workspace-manager.c \
|
||||
core/meta-workspace-manager-private.h \
|
||||
meta/meta-workspace-manager.h \
|
||||
core/keybindings.c \
|
||||
core/keybindings-private.h \
|
||||
core/main-private.h \
|
||||
@@ -294,9 +304,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
core/place.h \
|
||||
core/prefs.c \
|
||||
meta/prefs.h \
|
||||
core/screen.c \
|
||||
core/screen-private.h \
|
||||
meta/screen.h \
|
||||
core/startup-notification.c \
|
||||
core/startup-notification-private.h \
|
||||
meta/types.h \
|
||||
@@ -323,6 +330,11 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES = \
|
||||
ui/theme-private.h \
|
||||
ui/ui.c \
|
||||
x11/atomnames.h \
|
||||
x11/meta-x11-display.c \
|
||||
x11/meta-x11-display-private.h \
|
||||
meta/meta-x11-display.h \
|
||||
x11/meta-x11-errors.c \
|
||||
meta/meta-x11-errors.h \
|
||||
x11/events.c \
|
||||
x11/events.h \
|
||||
x11/group-private.h \
|
||||
@@ -371,6 +383,8 @@ if HAVE_WAYLAND
|
||||
libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
|
||||
compositor/meta-surface-actor-wayland.c \
|
||||
compositor/meta-surface-actor-wayland.h \
|
||||
wayland/meta-cursor-sprite-wayland.c \
|
||||
wayland/meta-cursor-sprite-wayland.h \
|
||||
wayland/meta-wayland.c \
|
||||
wayland/meta-wayland.h \
|
||||
wayland/meta-wayland-private.h \
|
||||
@@ -432,10 +446,10 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
|
||||
wayland/meta-wayland-touch.h \
|
||||
wayland/meta-wayland-surface.c \
|
||||
wayland/meta-wayland-surface.h \
|
||||
wayland/meta-wayland-surface-role-cursor.c \
|
||||
wayland/meta-wayland-surface-role-cursor.h \
|
||||
wayland/meta-wayland-surface-role-tablet-cursor.c \
|
||||
wayland/meta-wayland-surface-role-tablet-cursor.h \
|
||||
wayland/meta-wayland-cursor-surface.c \
|
||||
wayland/meta-wayland-cursor-surface.h \
|
||||
wayland/meta-wayland-tablet-cursor-surface.c \
|
||||
wayland/meta-wayland-tablet-cursor-surface.h \
|
||||
wayland/meta-wayland-actor-surface.c \
|
||||
wayland/meta-wayland-actor-surface.h \
|
||||
wayland/meta-wayland-subsurface.c \
|
||||
@@ -487,8 +501,6 @@ libmutter_@LIBMUTTER_API_VERSION@_la_SOURCES += \
|
||||
backends/native/meta-default-modes.h \
|
||||
backends/native/meta-gpu-kms.c \
|
||||
backends/native/meta-gpu-kms.h \
|
||||
backends/native/meta-idle-monitor-native.c \
|
||||
backends/native/meta-idle-monitor-native.h \
|
||||
backends/native/meta-input-settings-native.c \
|
||||
backends/native/meta-input-settings-native.h \
|
||||
backends/native/meta-monitor-manager-kms.c \
|
||||
@@ -527,7 +539,6 @@ libmutterinclude_headers = \
|
||||
meta/compositor-mutter.h \
|
||||
meta/compositor.h \
|
||||
meta/display.h \
|
||||
meta/errors.h \
|
||||
meta/group.h \
|
||||
meta/keybindings.h \
|
||||
meta/main.h \
|
||||
@@ -546,10 +557,14 @@ libmutterinclude_headers = \
|
||||
meta/meta-settings.h \
|
||||
meta/meta-shaped-texture.h \
|
||||
meta/meta-shadow-factory.h \
|
||||
meta/meta-stage.h \
|
||||
meta/meta-window-actor.h \
|
||||
meta/meta-window-group.h \
|
||||
meta/meta-window-shape.h \
|
||||
meta/meta-workspace-manager.h \
|
||||
meta/meta-x11-display.h \
|
||||
meta/meta-x11-errors.h \
|
||||
meta/prefs.h \
|
||||
meta/screen.h \
|
||||
meta/theme.h \
|
||||
meta/types.h \
|
||||
meta/util.h \
|
||||
@@ -761,3 +776,5 @@ endef
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) code $< $@
|
||||
%-server-protocol.h : $(srcdir)/wayland/protocol/%.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header $< $@
|
||||
%-server-protocol.h : $(WAYLAND_EGLSTREAM_DATADIR)/%.xml
|
||||
$(AM_V_GEN)$(WAYLAND_SCANNER) server-header $< $@
|
||||
|
36
src/backends/gsm-inhibitor-flag.h
Normal file
36
src/backends/gsm-inhibitor-flag.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
|
||||
*
|
||||
* Copyright (C) 2008 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GSM_INHIBITOR_FLAG_H__
|
||||
#define __GSM_INHIBITOR_FLAG_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef enum {
|
||||
GSM_INHIBITOR_FLAG_LOGOUT = 1 << 0,
|
||||
GSM_INHIBITOR_FLAG_SWITCH_USER = 1 << 1,
|
||||
GSM_INHIBITOR_FLAG_SUSPEND = 1 << 2,
|
||||
GSM_INHIBITOR_FLAG_IDLE = 1 << 3,
|
||||
GSM_INHIBITOR_FLAG_AUTOMOUNT = 1 << 4
|
||||
} GsmInhibitorFlag;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GSM_INHIBITOR_FLAG_H__ */
|
@@ -59,8 +59,6 @@ struct _MetaBackendClass
|
||||
|
||||
void (* post_init) (MetaBackend *backend);
|
||||
|
||||
MetaIdleMonitor * (* create_idle_monitor) (MetaBackend *backend,
|
||||
int device_id);
|
||||
MetaMonitorManager * (* create_monitor_manager) (MetaBackend *backend,
|
||||
GError **error);
|
||||
MetaCursorRenderer * (* create_cursor_renderer) (MetaBackend *backend);
|
||||
@@ -86,6 +84,8 @@ struct _MetaBackendClass
|
||||
const char *variants,
|
||||
const char *options);
|
||||
|
||||
gboolean (* is_lid_closed) (MetaBackend *backend);
|
||||
|
||||
struct xkb_keymap * (* get_keymap) (MetaBackend *backend);
|
||||
|
||||
xkb_layout_index_t (* get_keymap_layout_group) (MetaBackend *backend);
|
||||
@@ -146,6 +146,8 @@ struct xkb_keymap * meta_backend_get_keymap (MetaBackend *backend);
|
||||
|
||||
xkb_layout_index_t meta_backend_get_keymap_layout_group (MetaBackend *backend);
|
||||
|
||||
gboolean meta_backend_is_lid_closed (MetaBackend *backend);
|
||||
|
||||
void meta_backend_update_last_device (MetaBackend *backend,
|
||||
int device_id);
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
#include "meta-input-settings-private.h"
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
#include "meta-cursor-tracker-private.h"
|
||||
#include "meta-stage.h"
|
||||
#include "meta-stage-private.h"
|
||||
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
#include "backends/meta-dbus-session-watcher.h"
|
||||
@@ -58,6 +58,7 @@ enum
|
||||
KEYMAP_CHANGED,
|
||||
KEYMAP_LAYOUT_GROUP_CHANGED,
|
||||
LAST_DEVICE_CHANGED,
|
||||
LID_IS_CLOSED_CHANGED,
|
||||
|
||||
N_SIGNALS
|
||||
};
|
||||
@@ -110,6 +111,14 @@ struct _MetaBackendPrivate
|
||||
|
||||
MetaPointerConstraint *client_pointer_constraint;
|
||||
MetaDnd *dnd;
|
||||
|
||||
guint upower_watch_id;
|
||||
GDBusProxy *upower_proxy;
|
||||
gboolean lid_is_closed;
|
||||
|
||||
guint sleep_signal_id;
|
||||
GCancellable *cancellable;
|
||||
GDBusConnection *system_bus;
|
||||
};
|
||||
typedef struct _MetaBackendPrivate MetaBackendPrivate;
|
||||
|
||||
@@ -136,6 +145,15 @@ meta_backend_finalize (GObject *object)
|
||||
g_clear_object (&priv->dbus_session_watcher);
|
||||
#endif
|
||||
|
||||
if (priv->sleep_signal_id)
|
||||
g_dbus_connection_signal_unsubscribe (priv->system_bus, priv->sleep_signal_id);
|
||||
if (priv->upower_watch_id)
|
||||
g_bus_unwatch_name (priv->upower_watch_id);
|
||||
g_cancellable_cancel (priv->cancellable);
|
||||
g_clear_object (&priv->cancellable);
|
||||
g_clear_object (&priv->system_bus);
|
||||
g_clear_object (&priv->upower_proxy);
|
||||
|
||||
if (priv->device_update_idle_id)
|
||||
g_source_remove (priv->device_update_idle_id);
|
||||
|
||||
@@ -158,7 +176,7 @@ meta_backend_sync_screen_size (MetaBackend *backend)
|
||||
}
|
||||
|
||||
static void
|
||||
center_pointer (MetaBackend *backend)
|
||||
reset_pointer_position (MetaBackend *backend)
|
||||
{
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
MetaMonitorManager *monitor_manager = priv->monitor_manager;
|
||||
@@ -167,9 +185,11 @@ center_pointer (MetaBackend *backend)
|
||||
primary =
|
||||
meta_monitor_manager_get_primary_logical_monitor (monitor_manager);
|
||||
|
||||
/* Move the pointer out of the way to avoid hovering over reactive
|
||||
* elements (e.g. users list at login) causing undesired behaviour. */
|
||||
meta_backend_warp_pointer (backend,
|
||||
primary->rect.x + primary->rect.width / 2,
|
||||
primary->rect.y + primary->rect.height / 2);
|
||||
primary->rect.x + primary->rect.width * 0.9,
|
||||
primary->rect.y + primary->rect.height * 0.9);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -192,7 +212,7 @@ meta_backend_monitors_changed (MetaBackend *backend)
|
||||
!priv->is_pointer_position_initialized) &&
|
||||
!meta_monitor_manager_is_headless (monitor_manager))
|
||||
{
|
||||
center_pointer (backend);
|
||||
reset_pointer_position (backend);
|
||||
priv->is_pointer_position_initialized = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -222,7 +242,9 @@ static MetaIdleMonitor *
|
||||
meta_backend_create_idle_monitor (MetaBackend *backend,
|
||||
int device_id)
|
||||
{
|
||||
return META_BACKEND_GET_CLASS (backend)->create_idle_monitor (backend, device_id);
|
||||
return g_object_new (META_TYPE_IDLE_MONITOR,
|
||||
"device-id", device_id,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -402,28 +424,6 @@ meta_backend_create_input_settings (MetaBackend *backend)
|
||||
return META_BACKEND_GET_CLASS (backend)->create_input_settings (backend);
|
||||
}
|
||||
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
static gboolean
|
||||
is_screen_cast_enabled (MetaBackend *backend)
|
||||
{
|
||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||
|
||||
return meta_settings_is_experimental_feature_enabled (
|
||||
settings,
|
||||
META_EXPERIMENTAL_FEATURE_SCREEN_CAST);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_remote_desktop_enabled (MetaBackend *backend)
|
||||
{
|
||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||
|
||||
return meta_settings_is_experimental_feature_enabled (
|
||||
settings,
|
||||
META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP);
|
||||
}
|
||||
#endif /* HAVE_REMOTE_DESKTOP */
|
||||
|
||||
static void
|
||||
meta_backend_real_post_init (MetaBackend *backend)
|
||||
{
|
||||
@@ -457,15 +457,13 @@ meta_backend_real_post_init (MetaBackend *backend)
|
||||
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
priv->dbus_session_watcher = g_object_new (META_TYPE_DBUS_SESSION_WATCHER, NULL);
|
||||
if (is_screen_cast_enabled (backend))
|
||||
priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
|
||||
if (is_remote_desktop_enabled (backend))
|
||||
priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
|
||||
priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
|
||||
priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
|
||||
#endif /* HAVE_REMOTE_DESKTOP */
|
||||
|
||||
if (!meta_monitor_manager_is_headless (priv->monitor_manager))
|
||||
{
|
||||
center_pointer (backend);
|
||||
reset_pointer_position (backend);
|
||||
priv->is_pointer_position_initialized = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -511,6 +509,144 @@ meta_backend_real_get_relative_motion_deltas (MetaBackend *backend,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_backend_real_is_lid_closed (MetaBackend *backend)
|
||||
{
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
return priv->lid_is_closed;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_backend_is_lid_closed (MetaBackend *backend)
|
||||
{
|
||||
return META_BACKEND_GET_CLASS (backend)->is_lid_closed (backend);
|
||||
}
|
||||
|
||||
static void
|
||||
upower_properties_changed (GDBusProxy *proxy,
|
||||
GVariant *changed_properties,
|
||||
GStrv invalidated_properties,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaBackend *backend = user_data;
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
GVariant *v;
|
||||
gboolean lid_is_closed;
|
||||
|
||||
v = g_variant_lookup_value (changed_properties,
|
||||
"LidIsClosed",
|
||||
G_VARIANT_TYPE_BOOLEAN);
|
||||
if (!v)
|
||||
return;
|
||||
|
||||
lid_is_closed = g_variant_get_boolean (v);
|
||||
g_variant_unref (v);
|
||||
|
||||
if (lid_is_closed == priv->lid_is_closed)
|
||||
return;
|
||||
|
||||
priv->lid_is_closed = lid_is_closed;
|
||||
g_signal_emit (backend, signals[LID_IS_CLOSED_CHANGED], 0,
|
||||
priv->lid_is_closed);
|
||||
|
||||
if (lid_is_closed)
|
||||
return;
|
||||
|
||||
meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
|
||||
}
|
||||
|
||||
static void
|
||||
upower_ready_cb (GObject *source_object,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaBackend *backend;
|
||||
MetaBackendPrivate *priv;
|
||||
GDBusProxy *proxy;
|
||||
GError *error = NULL;
|
||||
GVariant *v;
|
||||
|
||||
proxy = g_dbus_proxy_new_finish (res, &error);
|
||||
if (!proxy)
|
||||
{
|
||||
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||
g_warning ("Failed to create UPower proxy: %s", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
backend = META_BACKEND (user_data);
|
||||
priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
priv->upower_proxy = proxy;
|
||||
g_signal_connect (proxy, "g-properties-changed",
|
||||
G_CALLBACK (upower_properties_changed), backend);
|
||||
|
||||
v = g_dbus_proxy_get_cached_property (proxy, "LidIsClosed");
|
||||
if (!v)
|
||||
return;
|
||||
priv->lid_is_closed = g_variant_get_boolean (v);
|
||||
g_variant_unref (v);
|
||||
|
||||
if (priv->lid_is_closed)
|
||||
{
|
||||
g_signal_emit (backend, signals[LID_IS_CLOSED_CHANGED], 0,
|
||||
priv->lid_is_closed);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
upower_appeared (GDBusConnection *connection,
|
||||
const gchar *name,
|
||||
const gchar *name_owner,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaBackend *backend = META_BACKEND (user_data);
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
g_dbus_proxy_new (connection,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
NULL,
|
||||
"org.freedesktop.UPower",
|
||||
"/org/freedesktop/UPower",
|
||||
"org.freedesktop.UPower",
|
||||
priv->cancellable,
|
||||
upower_ready_cb,
|
||||
backend);
|
||||
}
|
||||
|
||||
static void
|
||||
upower_vanished (GDBusConnection *connection,
|
||||
const gchar *name,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaBackend *backend = META_BACKEND (user_data);
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
g_clear_object (&priv->upower_proxy);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_backend_constructed (GObject *object)
|
||||
{
|
||||
MetaBackend *backend = META_BACKEND (object);
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
MetaBackendClass *backend_class =
|
||||
META_BACKEND_GET_CLASS (backend);
|
||||
|
||||
if (backend_class->is_lid_closed != meta_backend_real_is_lid_closed)
|
||||
return;
|
||||
|
||||
priv->upower_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
|
||||
"org.freedesktop.UPower",
|
||||
G_BUS_NAME_WATCHER_FLAGS_NONE,
|
||||
upower_appeared,
|
||||
upower_vanished,
|
||||
backend,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_backend_class_init (MetaBackendClass *klass)
|
||||
{
|
||||
@@ -518,6 +654,7 @@ meta_backend_class_init (MetaBackendClass *klass)
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = meta_backend_finalize;
|
||||
object_class->constructed = meta_backend_constructed;
|
||||
|
||||
klass->post_init = meta_backend_real_post_init;
|
||||
klass->create_cursor_renderer = meta_backend_real_create_cursor_renderer;
|
||||
@@ -525,6 +662,7 @@ meta_backend_class_init (MetaBackendClass *klass)
|
||||
klass->ungrab_device = meta_backend_real_ungrab_device;
|
||||
klass->select_stage_events = meta_backend_real_select_stage_events;
|
||||
klass->get_relative_motion_deltas = meta_backend_real_get_relative_motion_deltas;
|
||||
klass->is_lid_closed = meta_backend_real_is_lid_closed;
|
||||
|
||||
signals[KEYMAP_CHANGED] =
|
||||
g_signal_new ("keymap-changed",
|
||||
@@ -547,31 +685,18 @@ meta_backend_class_init (MetaBackendClass *klass)
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1, G_TYPE_INT);
|
||||
signals[LID_IS_CLOSED_CHANGED] =
|
||||
g_signal_new ("lid-is-closed-changed",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
|
||||
|
||||
mutter_stage_views = g_getenv ("MUTTER_STAGE_VIEWS");
|
||||
stage_views_disabled = g_strcmp0 (mutter_stage_views, "0") == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
experimental_features_changed (MetaSettings *settings,
|
||||
MetaExperimentalFeature old_experimental_features,
|
||||
MetaBackend *backend)
|
||||
{
|
||||
#ifdef HAVE_REMOTE_DESKTOP
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
if (is_screen_cast_enabled (backend) && !priv->screen_cast)
|
||||
priv->screen_cast = meta_screen_cast_new (priv->dbus_session_watcher);
|
||||
else if (!is_screen_cast_enabled (backend))
|
||||
g_clear_object (&priv->screen_cast);
|
||||
|
||||
if (is_remote_desktop_enabled (backend) && !priv->remote_desktop)
|
||||
priv->remote_desktop = meta_remote_desktop_new (priv->dbus_session_watcher);
|
||||
else if (!is_remote_desktop_enabled (backend))
|
||||
g_clear_object (&priv->remote_desktop);
|
||||
#endif /* HAVE_REMOTE_DESKTOP */
|
||||
}
|
||||
|
||||
static MetaMonitorManager *
|
||||
meta_backend_create_monitor_manager (MetaBackend *backend,
|
||||
GError **error)
|
||||
@@ -590,6 +715,50 @@ meta_backend_create_renderer (MetaBackend *backend,
|
||||
return META_BACKEND_GET_CLASS (backend)->create_renderer (backend, error);
|
||||
}
|
||||
|
||||
static void
|
||||
prepare_for_sleep_cb (GDBusConnection *connection,
|
||||
const gchar *sender_name,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
const gchar *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean suspending;
|
||||
|
||||
g_variant_get (parameters, "(b)", &suspending);
|
||||
if (suspending)
|
||||
return;
|
||||
meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
|
||||
}
|
||||
|
||||
static void
|
||||
system_bus_gotten_cb (GObject *object,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaBackendPrivate *priv;
|
||||
GDBusConnection *bus;
|
||||
|
||||
bus = g_bus_get_finish (res, NULL);
|
||||
if (!bus)
|
||||
return;
|
||||
|
||||
priv = meta_backend_get_instance_private (user_data);
|
||||
priv->system_bus = bus;
|
||||
priv->sleep_signal_id =
|
||||
g_dbus_connection_signal_subscribe (priv->system_bus,
|
||||
"org.freedesktop.login1",
|
||||
"org.freedesktop.login1.Manager",
|
||||
"PrepareForSleep",
|
||||
"/org/freedesktop/login1",
|
||||
NULL,
|
||||
G_DBUS_SIGNAL_FLAGS_NONE,
|
||||
prepare_for_sleep_cb,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_backend_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
@@ -599,9 +768,6 @@ meta_backend_initable_init (GInitable *initable,
|
||||
MetaBackendPrivate *priv = meta_backend_get_instance_private (backend);
|
||||
|
||||
priv->settings = meta_settings_new (backend);
|
||||
g_signal_connect (priv->settings, "experimental-features-changed",
|
||||
G_CALLBACK (experimental_features_changed),
|
||||
backend);
|
||||
|
||||
priv->egl = g_object_new (META_TYPE_EGL, NULL);
|
||||
|
||||
@@ -619,6 +785,12 @@ meta_backend_initable_init (GInitable *initable,
|
||||
|
||||
priv->dnd = g_object_new (META_TYPE_DND, NULL);
|
||||
|
||||
priv->cancellable = g_cancellable_new ();
|
||||
g_bus_get (G_BUS_TYPE_SYSTEM,
|
||||
priv->cancellable,
|
||||
system_bus_gotten_cb,
|
||||
backend);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@@ -33,7 +33,7 @@
|
||||
#include <cogl/cogl.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include "meta-stage.h"
|
||||
#include "meta-stage-private.h"
|
||||
|
||||
struct _MetaCursorRendererPrivate
|
||||
{
|
||||
@@ -193,8 +193,8 @@ meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
|
||||
}
|
||||
|
||||
static void
|
||||
update_cursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
meta_cursor_renderer_update_cursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
MetaCursorRendererPrivate *priv = meta_cursor_renderer_get_instance_private (renderer);
|
||||
gboolean handled_by_backend;
|
||||
@@ -237,7 +237,7 @@ meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
|
||||
return;
|
||||
priv->displayed_cursor = cursor_sprite;
|
||||
|
||||
update_cursor (renderer, cursor_sprite);
|
||||
meta_cursor_renderer_update_cursor (renderer, cursor_sprite);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -246,7 +246,7 @@ meta_cursor_renderer_force_update (MetaCursorRenderer *renderer)
|
||||
MetaCursorRendererPrivate *priv =
|
||||
meta_cursor_renderer_get_instance_private (renderer);
|
||||
|
||||
update_cursor (renderer, priv->displayed_cursor);
|
||||
meta_cursor_renderer_update_cursor (renderer, priv->displayed_cursor);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -261,7 +261,19 @@ meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
|
||||
priv->current_x = x;
|
||||
priv->current_y = y;
|
||||
|
||||
update_cursor (renderer, priv->displayed_cursor);
|
||||
meta_cursor_renderer_update_cursor (renderer, priv->displayed_cursor);
|
||||
}
|
||||
|
||||
ClutterPoint
|
||||
meta_cursor_renderer_get_position (MetaCursorRenderer *renderer)
|
||||
{
|
||||
MetaCursorRendererPrivate *priv =
|
||||
meta_cursor_renderer_get_instance_private (renderer);
|
||||
|
||||
return (ClutterPoint) {
|
||||
.x = priv->current_x,
|
||||
.y = priv->current_y
|
||||
};
|
||||
}
|
||||
|
||||
MetaCursorSprite *
|
||||
@@ -271,28 +283,3 @@ meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer)
|
||||
|
||||
return priv->displayed_cursor;
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
void
|
||||
meta_cursor_renderer_realize_cursor_from_wl_buffer (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
struct wl_resource *buffer)
|
||||
{
|
||||
|
||||
MetaCursorRendererClass *renderer_class = META_CURSOR_RENDERER_GET_CLASS (renderer);
|
||||
|
||||
if (renderer_class->realize_cursor_from_wl_buffer)
|
||||
renderer_class->realize_cursor_from_wl_buffer (renderer, cursor_sprite, buffer);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
meta_cursor_renderer_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
XcursorImage *xc_image)
|
||||
{
|
||||
MetaCursorRendererClass *renderer_class = META_CURSOR_RENDERER_GET_CLASS (renderer);
|
||||
|
||||
if (renderer_class->realize_cursor_from_xcursor)
|
||||
renderer_class->realize_cursor_from_xcursor (renderer, cursor_sprite, xc_image);
|
||||
}
|
||||
|
@@ -26,12 +26,7 @@
|
||||
#define META_CURSOR_RENDERER_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
#ifdef HAVE_WAYLAND
|
||||
#include <wayland-server.h>
|
||||
#endif
|
||||
|
||||
#include <meta/screen.h>
|
||||
#include "meta-cursor.h"
|
||||
|
||||
#define META_TYPE_CURSOR_RENDERER (meta_cursor_renderer_get_type ())
|
||||
@@ -44,14 +39,6 @@ struct _MetaCursorRendererClass
|
||||
|
||||
gboolean (* update_cursor) (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite);
|
||||
#ifdef HAVE_WAYLAND
|
||||
void (* realize_cursor_from_wl_buffer) (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
struct wl_resource *buffer);
|
||||
#endif
|
||||
void (* realize_cursor_from_xcursor) (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
XcursorImage *xc_image);
|
||||
};
|
||||
|
||||
MetaCursorRenderer * meta_cursor_renderer_new (void);
|
||||
@@ -62,6 +49,7 @@ void meta_cursor_renderer_set_cursor (MetaCursorRenderer *renderer,
|
||||
void meta_cursor_renderer_set_position (MetaCursorRenderer *renderer,
|
||||
float x,
|
||||
float y);
|
||||
ClutterPoint meta_cursor_renderer_get_position (MetaCursorRenderer *renderer);
|
||||
void meta_cursor_renderer_force_update (MetaCursorRenderer *renderer);
|
||||
|
||||
MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer);
|
||||
@@ -69,16 +57,6 @@ MetaCursorSprite * meta_cursor_renderer_get_cursor (MetaCursorRenderer *renderer
|
||||
ClutterRect meta_cursor_renderer_calculate_rect (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite);
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
void meta_cursor_renderer_realize_cursor_from_wl_buffer (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
struct wl_resource *buffer);
|
||||
#endif
|
||||
|
||||
void meta_cursor_renderer_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
XcursorImage *xc_image);
|
||||
|
||||
void meta_cursor_renderer_emit_painted (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite);
|
||||
|
||||
|
292
src/backends/meta-cursor-sprite-xcursor.c
Normal file
292
src/backends/meta-cursor-sprite-xcursor.c
Normal file
@@ -0,0 +1,292 @@
|
||||
/*
|
||||
* Copyright 2013, 2018 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "backends/meta-cursor-sprite-xcursor.h"
|
||||
|
||||
#include "backends/meta-cursor.h"
|
||||
#include "backends/meta-cursor-renderer.h"
|
||||
#include "clutter/clutter.h"
|
||||
#include "cogl/cogl.h"
|
||||
#include "meta/prefs.h"
|
||||
|
||||
struct _MetaCursorSpriteXcursor
|
||||
{
|
||||
MetaCursorSprite parent;
|
||||
|
||||
MetaCursor cursor;
|
||||
|
||||
int current_frame;
|
||||
XcursorImages *xcursor_images;
|
||||
|
||||
int theme_scale;
|
||||
gboolean theme_dirty;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MetaCursorSpriteXcursor, meta_cursor_sprite_xcursor,
|
||||
META_TYPE_CURSOR_SPRITE)
|
||||
|
||||
static const char *
|
||||
translate_meta_cursor (MetaCursor cursor)
|
||||
{
|
||||
switch (cursor)
|
||||
{
|
||||
case META_CURSOR_DEFAULT:
|
||||
return "left_ptr";
|
||||
case META_CURSOR_NORTH_RESIZE:
|
||||
return "top_side";
|
||||
case META_CURSOR_SOUTH_RESIZE:
|
||||
return "bottom_side";
|
||||
case META_CURSOR_WEST_RESIZE:
|
||||
return "left_side";
|
||||
case META_CURSOR_EAST_RESIZE:
|
||||
return "right_side";
|
||||
case META_CURSOR_SE_RESIZE:
|
||||
return "bottom_right_corner";
|
||||
case META_CURSOR_SW_RESIZE:
|
||||
return "bottom_left_corner";
|
||||
case META_CURSOR_NE_RESIZE:
|
||||
return "top_right_corner";
|
||||
case META_CURSOR_NW_RESIZE:
|
||||
return "top_left_corner";
|
||||
case META_CURSOR_MOVE_OR_RESIZE_WINDOW:
|
||||
return "fleur";
|
||||
case META_CURSOR_BUSY:
|
||||
return "watch";
|
||||
case META_CURSOR_DND_IN_DRAG:
|
||||
return "dnd-none";
|
||||
case META_CURSOR_DND_MOVE:
|
||||
return "dnd-move";
|
||||
case META_CURSOR_DND_COPY:
|
||||
return "dnd-copy";
|
||||
case META_CURSOR_DND_UNSUPPORTED_TARGET:
|
||||
return "dnd-none";
|
||||
case META_CURSOR_POINTING_HAND:
|
||||
return "hand2";
|
||||
case META_CURSOR_CROSSHAIR:
|
||||
return "crosshair";
|
||||
case META_CURSOR_IBEAM:
|
||||
return "xterm";
|
||||
case META_CURSOR_NONE:
|
||||
case META_CURSOR_LAST:
|
||||
break;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
MetaCursor
|
||||
meta_cursor_sprite_xcursor_get_cursor (MetaCursorSpriteXcursor *sprite_xcursor)
|
||||
{
|
||||
return sprite_xcursor->cursor;
|
||||
}
|
||||
|
||||
Cursor
|
||||
meta_create_x_cursor (Display *xdisplay,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
return XcursorLibraryLoadCursor (xdisplay, translate_meta_cursor (cursor));
|
||||
}
|
||||
|
||||
static XcursorImages *
|
||||
load_cursor_on_client (MetaCursor cursor, int scale)
|
||||
{
|
||||
return XcursorLibraryLoadImages (translate_meta_cursor (cursor),
|
||||
meta_prefs_get_cursor_theme (),
|
||||
meta_prefs_get_cursor_size () * scale);
|
||||
}
|
||||
|
||||
static void
|
||||
load_from_current_xcursor_image (MetaCursorSpriteXcursor *sprite_xcursor)
|
||||
{
|
||||
MetaCursorSprite *sprite = META_CURSOR_SPRITE (sprite_xcursor);
|
||||
XcursorImage *xc_image;
|
||||
int width, height, rowstride;
|
||||
CoglPixelFormat cogl_format;
|
||||
ClutterBackend *clutter_backend;
|
||||
CoglContext *cogl_context;
|
||||
CoglTexture2D *texture;
|
||||
CoglError *error = NULL;
|
||||
|
||||
g_assert (!meta_cursor_sprite_get_cogl_texture (sprite));
|
||||
|
||||
xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor);
|
||||
width = (int) xc_image->width;
|
||||
height = (int) xc_image->height;
|
||||
rowstride = width * 4;
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
cogl_format = COGL_PIXEL_FORMAT_BGRA_8888;
|
||||
#else
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888;
|
||||
#endif
|
||||
|
||||
clutter_backend = clutter_get_default_backend ();
|
||||
cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||
texture = cogl_texture_2d_new_from_data (cogl_context,
|
||||
width, height,
|
||||
cogl_format,
|
||||
rowstride,
|
||||
(uint8_t *) xc_image->pixels,
|
||||
&error);
|
||||
if (!texture)
|
||||
{
|
||||
g_warning ("Failed to allocate cursor texture: %s\n", error->message);
|
||||
cogl_error_free (error);
|
||||
}
|
||||
|
||||
meta_cursor_sprite_set_texture (sprite,
|
||||
COGL_TEXTURE (texture),
|
||||
xc_image->xhot, xc_image->yhot);
|
||||
|
||||
g_clear_pointer (&texture, cogl_object_unref);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_xcursor_set_theme_scale (MetaCursorSpriteXcursor *sprite_xcursor,
|
||||
int theme_scale)
|
||||
{
|
||||
if (sprite_xcursor->theme_scale != theme_scale)
|
||||
sprite_xcursor->theme_dirty = TRUE;
|
||||
sprite_xcursor->theme_scale = theme_scale;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_cursor_sprite_xcursor_is_animated (MetaCursorSprite *sprite)
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
|
||||
|
||||
return (sprite_xcursor->xcursor_images &&
|
||||
sprite_xcursor->xcursor_images->nimage > 1);
|
||||
}
|
||||
|
||||
XcursorImage *
|
||||
meta_cursor_sprite_xcursor_get_current_image (MetaCursorSpriteXcursor *sprite_xcursor)
|
||||
{
|
||||
return sprite_xcursor->xcursor_images->images[sprite_xcursor->current_frame];
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xcursor_tick_frame (MetaCursorSprite *sprite)
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
|
||||
|
||||
if (!meta_cursor_sprite_is_animated (sprite))
|
||||
return;
|
||||
|
||||
sprite_xcursor->current_frame++;
|
||||
|
||||
if (sprite_xcursor->current_frame >= sprite_xcursor->xcursor_images->nimage)
|
||||
sprite_xcursor->current_frame = 0;
|
||||
|
||||
meta_cursor_sprite_clear_texture (sprite);
|
||||
load_from_current_xcursor_image (sprite_xcursor);
|
||||
}
|
||||
|
||||
static unsigned int
|
||||
meta_cursor_sprite_xcursor_get_current_frame_time (MetaCursorSprite *sprite)
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
|
||||
XcursorImages *xcursor_images;
|
||||
|
||||
g_return_val_if_fail (meta_cursor_sprite_is_animated (sprite), 0);
|
||||
|
||||
xcursor_images = sprite_xcursor->xcursor_images;
|
||||
return xcursor_images->images[sprite_xcursor->current_frame]->delay;
|
||||
}
|
||||
|
||||
static void
|
||||
load_cursor_from_theme (MetaCursorSprite *sprite)
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
|
||||
|
||||
g_assert (sprite_xcursor->cursor != META_CURSOR_NONE);
|
||||
|
||||
sprite_xcursor->theme_dirty = FALSE;
|
||||
|
||||
/* We might be reloading with a different scale. If so clear the old data. */
|
||||
if (sprite_xcursor->xcursor_images)
|
||||
{
|
||||
meta_cursor_sprite_clear_texture (sprite);
|
||||
XcursorImagesDestroy (sprite_xcursor->xcursor_images);
|
||||
}
|
||||
|
||||
sprite_xcursor->current_frame = 0;
|
||||
sprite_xcursor->xcursor_images =
|
||||
load_cursor_on_client (sprite_xcursor->cursor,
|
||||
sprite_xcursor->theme_scale);
|
||||
if (!sprite_xcursor->xcursor_images)
|
||||
g_error ("Could not find cursor. Perhaps set XCURSOR_PATH?");
|
||||
|
||||
load_from_current_xcursor_image (sprite_xcursor);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xcursor_realize_texture (MetaCursorSprite *sprite)
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (sprite);
|
||||
|
||||
if (sprite_xcursor->theme_dirty)
|
||||
load_cursor_from_theme (sprite);
|
||||
}
|
||||
|
||||
MetaCursorSpriteXcursor *
|
||||
meta_cursor_sprite_xcursor_new (MetaCursor cursor)
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor;
|
||||
|
||||
sprite_xcursor = g_object_new (META_TYPE_CURSOR_SPRITE_XCURSOR, NULL);
|
||||
sprite_xcursor->cursor = cursor;
|
||||
|
||||
return sprite_xcursor;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xcursor_finalize (GObject *object)
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor = META_CURSOR_SPRITE_XCURSOR (object);
|
||||
|
||||
g_clear_pointer (&sprite_xcursor->xcursor_images,
|
||||
XcursorImagesDestroy);
|
||||
|
||||
G_OBJECT_CLASS (meta_cursor_sprite_xcursor_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xcursor_init (MetaCursorSpriteXcursor *sprite_xcursor)
|
||||
{
|
||||
sprite_xcursor->theme_dirty = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xcursor_class_init (MetaCursorSpriteXcursorClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MetaCursorSpriteClass *cursor_sprite_class = META_CURSOR_SPRITE_CLASS (klass);
|
||||
|
||||
object_class->finalize = meta_cursor_sprite_xcursor_finalize;
|
||||
|
||||
cursor_sprite_class->realize_texture =
|
||||
meta_cursor_sprite_xcursor_realize_texture;
|
||||
cursor_sprite_class->is_animated = meta_cursor_sprite_xcursor_is_animated;
|
||||
cursor_sprite_class->tick_frame = meta_cursor_sprite_xcursor_tick_frame;
|
||||
cursor_sprite_class->get_current_frame_time =
|
||||
meta_cursor_sprite_xcursor_get_current_frame_time;
|
||||
}
|
43
src/backends/meta-cursor-sprite-xcursor.h
Normal file
43
src/backends/meta-cursor-sprite-xcursor.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2013, 2018 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef META_CURSOR_SPRITE_XCURSOR_H
|
||||
#define META_CURSOR_SPRITE_XCURSOR_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
|
||||
#include "backends/meta-cursor.h"
|
||||
|
||||
#define META_TYPE_CURSOR_SPRITE_XCURSOR meta_cursor_sprite_xcursor_get_type ()
|
||||
G_DECLARE_FINAL_TYPE (MetaCursorSpriteXcursor, meta_cursor_sprite_xcursor,
|
||||
META, CURSOR_SPRITE_XCURSOR, MetaCursorSprite)
|
||||
|
||||
MetaCursorSpriteXcursor * meta_cursor_sprite_xcursor_new (MetaCursor cursor);
|
||||
|
||||
void meta_cursor_sprite_xcursor_set_theme_scale (MetaCursorSpriteXcursor *sprite_xcursor,
|
||||
int scale);
|
||||
|
||||
MetaCursor meta_cursor_sprite_xcursor_get_cursor (MetaCursorSpriteXcursor *sprite_xcusror);
|
||||
|
||||
XcursorImage * meta_cursor_sprite_xcursor_get_current_image (MetaCursorSpriteXcursor *sprite_xcursor);
|
||||
|
||||
Cursor meta_create_x_cursor (Display *xdisplay,
|
||||
MetaCursor cursor);
|
||||
|
||||
#endif /* META_CURSOR_SPRITE_XCURSOR_H */
|
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "meta-cursor.h"
|
||||
#include "meta-cursor-renderer.h"
|
||||
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
|
||||
|
||||
struct _MetaCursorTracker {
|
||||
GObject parent_instance;
|
||||
@@ -46,7 +47,7 @@ struct _MetaCursorTracker {
|
||||
MetaCursorSprite *root_cursor;
|
||||
|
||||
/* The cursor from the X11 server. */
|
||||
MetaCursorSprite *xfixes_cursor;
|
||||
MetaCursorSpriteXfixes *xfixes_cursor;
|
||||
};
|
||||
|
||||
struct _MetaCursorTrackerClass {
|
||||
|
@@ -33,16 +33,17 @@
|
||||
#include <string.h>
|
||||
#include <meta/main.h>
|
||||
#include <meta/util.h>
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <gdk/gdkx.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#include "meta-backend-private.h"
|
||||
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
|
||||
G_DEFINE_TYPE (MetaCursorTracker, meta_cursor_tracker, G_TYPE_OBJECT);
|
||||
|
||||
@@ -161,15 +162,15 @@ meta_cursor_tracker_class_init (MetaCursorTrackerClass *klass)
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_cursor_tracker_get_for_screen:
|
||||
* @screen: the #MetaScreen
|
||||
* meta_cursor_tracker_get_for_display:
|
||||
* @display: the #MetaDisplay
|
||||
*
|
||||
* Retrieves the cursor tracker object for @screen.
|
||||
* Retrieves the cursor tracker object for @display.
|
||||
*
|
||||
* Returns: (transfer none):
|
||||
*/
|
||||
MetaCursorTracker *
|
||||
meta_cursor_tracker_get_for_screen (MetaScreen *screen)
|
||||
meta_cursor_tracker_get_for_display (MetaDisplay *display)
|
||||
{
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaCursorTracker *tracker = meta_backend_get_cursor_tracker (backend);
|
||||
@@ -195,13 +196,13 @@ gboolean
|
||||
meta_cursor_tracker_handle_xevent (MetaCursorTracker *tracker,
|
||||
XEvent *xevent)
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
MetaX11Display *x11_display = meta_get_display ()->x11_display;
|
||||
XFixesCursorNotifyEvent *notify_event;
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
return FALSE;
|
||||
|
||||
if (xevent->xany.type != display->xfixes_event_base + XFixesCursorNotify)
|
||||
if (xevent->xany.type != x11_display->xfixes_event_base + XFixesCursorNotify)
|
||||
return FALSE;
|
||||
|
||||
notify_event = (XFixesCursorNotifyEvent *)xevent;
|
||||
@@ -218,75 +219,14 @@ static void
|
||||
ensure_xfixes_cursor (MetaCursorTracker *tracker)
|
||||
{
|
||||
MetaDisplay *display = meta_get_display ();
|
||||
XFixesCursorImage *cursor_image;
|
||||
CoglTexture2D *sprite;
|
||||
guint8 *cursor_data;
|
||||
gboolean free_cursor_data;
|
||||
CoglContext *ctx;
|
||||
CoglError *error = NULL;
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
if (tracker->xfixes_cursor)
|
||||
return;
|
||||
|
||||
cursor_image = XFixesGetCursorImage (display->xdisplay);
|
||||
if (!cursor_image)
|
||||
return;
|
||||
|
||||
/* Like all X APIs, XFixesGetCursorImage() returns arrays of 32-bit
|
||||
* quantities as arrays of long; we need to convert on 64 bit */
|
||||
if (sizeof(long) == 4)
|
||||
{
|
||||
cursor_data = (guint8 *)cursor_image->pixels;
|
||||
free_cursor_data = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i, j;
|
||||
guint32 *cursor_words;
|
||||
gulong *p;
|
||||
guint32 *q;
|
||||
|
||||
cursor_words = g_new (guint32, cursor_image->width * cursor_image->height);
|
||||
cursor_data = (guint8 *)cursor_words;
|
||||
|
||||
p = cursor_image->pixels;
|
||||
q = cursor_words;
|
||||
for (j = 0; j < cursor_image->height; j++)
|
||||
for (i = 0; i < cursor_image->width; i++)
|
||||
*(q++) = *(p++);
|
||||
|
||||
free_cursor_data = TRUE;
|
||||
}
|
||||
|
||||
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
|
||||
sprite = cogl_texture_2d_new_from_data (ctx,
|
||||
cursor_image->width,
|
||||
cursor_image->height,
|
||||
CLUTTER_CAIRO_FORMAT_ARGB32,
|
||||
cursor_image->width * 4, /* stride */
|
||||
cursor_data,
|
||||
&error);
|
||||
|
||||
if (free_cursor_data)
|
||||
g_free (cursor_data);
|
||||
|
||||
if (error != NULL)
|
||||
{
|
||||
meta_warning ("Failed to allocate cursor sprite texture: %s\n", error->message);
|
||||
cogl_error_free (error);
|
||||
}
|
||||
|
||||
if (sprite != NULL)
|
||||
{
|
||||
MetaCursorSprite *cursor_sprite = meta_cursor_sprite_new ();
|
||||
meta_cursor_sprite_set_texture (cursor_sprite,
|
||||
COGL_TEXTURE (sprite),
|
||||
cursor_image->xhot,
|
||||
cursor_image->yhot);
|
||||
cogl_object_unref (sprite);
|
||||
tracker->xfixes_cursor = cursor_sprite;
|
||||
}
|
||||
XFree (cursor_image);
|
||||
tracker->xfixes_cursor = meta_cursor_sprite_xfixes_new (display, &error);
|
||||
if (!tracker->xfixes_cursor)
|
||||
g_warning ("Failed to create XFIXES cursor: %s", error->message);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -308,7 +248,7 @@ meta_cursor_tracker_get_sprite (MetaCursorTracker *tracker)
|
||||
else
|
||||
{
|
||||
ensure_xfixes_cursor (tracker);
|
||||
cursor_sprite = tracker->xfixes_cursor;
|
||||
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
|
||||
}
|
||||
|
||||
if (cursor_sprite)
|
||||
@@ -345,7 +285,7 @@ meta_cursor_tracker_get_hot (MetaCursorTracker *tracker,
|
||||
else
|
||||
{
|
||||
ensure_xfixes_cursor (tracker);
|
||||
cursor_sprite = tracker->xfixes_cursor;
|
||||
cursor_sprite = META_CURSOR_SPRITE (tracker->xfixes_cursor);
|
||||
}
|
||||
|
||||
if (cursor_sprite)
|
||||
|
@@ -23,19 +23,12 @@
|
||||
|
||||
#include "meta-cursor.h"
|
||||
|
||||
#include <meta/errors.h>
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "cogl/cogl.h"
|
||||
#include "meta/common.h"
|
||||
|
||||
#include "display-private.h"
|
||||
#include "screen-private.h"
|
||||
#include "meta-backend-private.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <X11/cursorfont.h>
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
|
||||
enum {
|
||||
enum
|
||||
{
|
||||
PREPARE_AT,
|
||||
TEXTURE_CHANGED,
|
||||
|
||||
@@ -44,316 +37,148 @@ enum {
|
||||
|
||||
static guint signals[LAST_SIGNAL];
|
||||
|
||||
struct _MetaCursorSprite
|
||||
typedef struct _MetaCursorSpritePrivate
|
||||
{
|
||||
GObject parent;
|
||||
|
||||
MetaCursor cursor;
|
||||
|
||||
CoglTexture2D *texture;
|
||||
float texture_scale;
|
||||
int hot_x, hot_y;
|
||||
} MetaCursorSpritePrivate;
|
||||
|
||||
int current_frame;
|
||||
XcursorImages *xcursor_images;
|
||||
|
||||
int theme_scale;
|
||||
gboolean theme_dirty;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (MetaCursorSprite, meta_cursor_sprite, G_TYPE_OBJECT)
|
||||
|
||||
static const char *
|
||||
translate_meta_cursor (MetaCursor cursor)
|
||||
{
|
||||
switch (cursor)
|
||||
{
|
||||
case META_CURSOR_DEFAULT:
|
||||
return "left_ptr";
|
||||
case META_CURSOR_NORTH_RESIZE:
|
||||
return "top_side";
|
||||
case META_CURSOR_SOUTH_RESIZE:
|
||||
return "bottom_side";
|
||||
case META_CURSOR_WEST_RESIZE:
|
||||
return "left_side";
|
||||
case META_CURSOR_EAST_RESIZE:
|
||||
return "right_side";
|
||||
case META_CURSOR_SE_RESIZE:
|
||||
return "bottom_right_corner";
|
||||
case META_CURSOR_SW_RESIZE:
|
||||
return "bottom_left_corner";
|
||||
case META_CURSOR_NE_RESIZE:
|
||||
return "top_right_corner";
|
||||
case META_CURSOR_NW_RESIZE:
|
||||
return "top_left_corner";
|
||||
case META_CURSOR_MOVE_OR_RESIZE_WINDOW:
|
||||
return "fleur";
|
||||
case META_CURSOR_BUSY:
|
||||
return "watch";
|
||||
case META_CURSOR_DND_IN_DRAG:
|
||||
return "dnd-none";
|
||||
case META_CURSOR_DND_MOVE:
|
||||
return "dnd-move";
|
||||
case META_CURSOR_DND_COPY:
|
||||
return "dnd-copy";
|
||||
case META_CURSOR_DND_UNSUPPORTED_TARGET:
|
||||
return "dnd-none";
|
||||
case META_CURSOR_POINTING_HAND:
|
||||
return "hand2";
|
||||
case META_CURSOR_CROSSHAIR:
|
||||
return "crosshair";
|
||||
case META_CURSOR_IBEAM:
|
||||
return "xterm";
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
Cursor
|
||||
meta_cursor_create_x_cursor (Display *xdisplay,
|
||||
MetaCursor cursor)
|
||||
{
|
||||
return XcursorLibraryLoadCursor (xdisplay, translate_meta_cursor (cursor));
|
||||
}
|
||||
|
||||
static XcursorImages *
|
||||
load_cursor_on_client (MetaCursor cursor, int scale)
|
||||
{
|
||||
return XcursorLibraryLoadImages (translate_meta_cursor (cursor),
|
||||
meta_prefs_get_cursor_theme (),
|
||||
meta_prefs_get_cursor_size () * scale);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_load_from_xcursor_image (MetaCursorSprite *self,
|
||||
XcursorImage *xc_image)
|
||||
{
|
||||
MetaBackend *meta_backend = meta_get_backend ();
|
||||
MetaCursorRenderer *renderer = meta_backend_get_cursor_renderer (meta_backend);
|
||||
uint width, height, rowstride;
|
||||
CoglPixelFormat cogl_format;
|
||||
ClutterBackend *clutter_backend;
|
||||
CoglContext *cogl_context;
|
||||
CoglTexture2D *texture;
|
||||
CoglError *error = NULL;
|
||||
|
||||
g_assert (self->texture == NULL);
|
||||
|
||||
width = xc_image->width;
|
||||
height = xc_image->height;
|
||||
rowstride = width * 4;
|
||||
|
||||
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
|
||||
cogl_format = COGL_PIXEL_FORMAT_BGRA_8888;
|
||||
#else
|
||||
cogl_format = COGL_PIXEL_FORMAT_ARGB_8888;
|
||||
#endif
|
||||
|
||||
clutter_backend = clutter_get_default_backend ();
|
||||
cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||
texture = cogl_texture_2d_new_from_data (cogl_context,
|
||||
width, height,
|
||||
cogl_format,
|
||||
rowstride,
|
||||
(uint8_t *) xc_image->pixels,
|
||||
&error);
|
||||
|
||||
if (error)
|
||||
{
|
||||
meta_warning ("Failed to allocate cursor texture: %s\n", error->message);
|
||||
cogl_error_free (error);
|
||||
}
|
||||
|
||||
meta_cursor_sprite_set_texture (self, COGL_TEXTURE (texture),
|
||||
xc_image->xhot, xc_image->yhot);
|
||||
|
||||
if (texture)
|
||||
cogl_object_unref (texture);
|
||||
|
||||
meta_cursor_renderer_realize_cursor_from_xcursor (renderer, self, xc_image);
|
||||
}
|
||||
|
||||
static XcursorImage *
|
||||
meta_cursor_sprite_get_current_frame_image (MetaCursorSprite *self)
|
||||
{
|
||||
return self->xcursor_images->images[self->current_frame];
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_tick_frame (MetaCursorSprite *self)
|
||||
{
|
||||
XcursorImage *image;
|
||||
|
||||
if (!meta_cursor_sprite_is_animated (self))
|
||||
return;
|
||||
|
||||
self->current_frame++;
|
||||
|
||||
if (self->current_frame >= self->xcursor_images->nimage)
|
||||
self->current_frame = 0;
|
||||
|
||||
image = meta_cursor_sprite_get_current_frame_image (self);
|
||||
|
||||
g_clear_pointer (&self->texture, cogl_object_unref);
|
||||
meta_cursor_sprite_load_from_xcursor_image (self, image);
|
||||
}
|
||||
|
||||
guint
|
||||
meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *self)
|
||||
{
|
||||
if (!meta_cursor_sprite_is_animated (self))
|
||||
return 0;
|
||||
|
||||
return self->xcursor_images->images[self->current_frame]->delay;
|
||||
}
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaCursorSprite,
|
||||
meta_cursor_sprite,
|
||||
G_TYPE_OBJECT)
|
||||
|
||||
gboolean
|
||||
meta_cursor_sprite_is_animated (MetaCursorSprite *self)
|
||||
meta_cursor_sprite_is_animated (MetaCursorSprite *sprite)
|
||||
{
|
||||
return (self->xcursor_images &&
|
||||
self->xcursor_images->nimage > 1);
|
||||
}
|
||||
MetaCursorSpriteClass *klass = META_CURSOR_SPRITE_GET_CLASS (sprite);
|
||||
|
||||
MetaCursorSprite *
|
||||
meta_cursor_sprite_new (void)
|
||||
{
|
||||
return g_object_new (META_TYPE_CURSOR_SPRITE, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_load_from_theme (MetaCursorSprite *self)
|
||||
{
|
||||
XcursorImage *image;
|
||||
|
||||
g_assert (self->cursor != META_CURSOR_NONE);
|
||||
|
||||
self->theme_dirty = FALSE;
|
||||
|
||||
/* We might be reloading with a different scale. If so clear the old data. */
|
||||
if (self->xcursor_images)
|
||||
{
|
||||
g_clear_pointer (&self->texture, cogl_object_unref);
|
||||
XcursorImagesDestroy (self->xcursor_images);
|
||||
}
|
||||
|
||||
self->current_frame = 0;
|
||||
self->xcursor_images = load_cursor_on_client (self->cursor,
|
||||
self->theme_scale);
|
||||
if (!self->xcursor_images)
|
||||
meta_fatal ("Could not find cursor. Perhaps set XCURSOR_PATH?");
|
||||
|
||||
image = meta_cursor_sprite_get_current_frame_image (self);
|
||||
meta_cursor_sprite_load_from_xcursor_image (self, image);
|
||||
}
|
||||
|
||||
MetaCursorSprite *
|
||||
meta_cursor_sprite_from_theme (MetaCursor cursor)
|
||||
{
|
||||
MetaCursorSprite *self;
|
||||
|
||||
self = meta_cursor_sprite_new ();
|
||||
|
||||
self->cursor = cursor;
|
||||
self->theme_dirty = TRUE;
|
||||
|
||||
return self;
|
||||
if (klass->is_animated)
|
||||
return klass->is_animated (sprite);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_set_texture (MetaCursorSprite *self,
|
||||
meta_cursor_sprite_tick_frame (MetaCursorSprite *sprite)
|
||||
{
|
||||
return META_CURSOR_SPRITE_GET_CLASS (sprite)->tick_frame (sprite);
|
||||
}
|
||||
|
||||
unsigned int
|
||||
meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *sprite)
|
||||
{
|
||||
return META_CURSOR_SPRITE_GET_CLASS (sprite)->get_current_frame_time (sprite);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_clear_texture (MetaCursorSprite *sprite)
|
||||
{
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_set_texture (MetaCursorSprite *sprite,
|
||||
CoglTexture *texture,
|
||||
int hot_x,
|
||||
int hot_y)
|
||||
{
|
||||
if (self->texture == COGL_TEXTURE_2D (texture) &&
|
||||
self->hot_x == hot_x &&
|
||||
self->hot_y == hot_y)
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
if (priv->texture == COGL_TEXTURE_2D (texture) &&
|
||||
priv->hot_x == hot_x &&
|
||||
priv->hot_y == hot_y)
|
||||
return;
|
||||
|
||||
g_clear_pointer (&self->texture, cogl_object_unref);
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
if (texture)
|
||||
self->texture = cogl_object_ref (texture);
|
||||
self->hot_x = hot_x;
|
||||
self->hot_y = hot_y;
|
||||
priv->texture = cogl_object_ref (texture);
|
||||
priv->hot_x = hot_x;
|
||||
priv->hot_y = hot_y;
|
||||
|
||||
g_signal_emit (self, signals[TEXTURE_CHANGED], 0);
|
||||
g_signal_emit (sprite, signals[TEXTURE_CHANGED], 0);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_set_texture_scale (MetaCursorSprite *self,
|
||||
meta_cursor_sprite_set_texture_scale (MetaCursorSprite *sprite,
|
||||
float scale)
|
||||
{
|
||||
self->texture_scale = scale;
|
||||
}
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
void
|
||||
meta_cursor_sprite_set_theme_scale (MetaCursorSprite *self,
|
||||
int theme_scale)
|
||||
{
|
||||
if (self->theme_scale != theme_scale)
|
||||
self->theme_dirty = TRUE;
|
||||
self->theme_scale = theme_scale;
|
||||
priv->texture_scale = scale;
|
||||
}
|
||||
|
||||
CoglTexture *
|
||||
meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *self)
|
||||
meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *sprite)
|
||||
{
|
||||
return COGL_TEXTURE (self->texture);
|
||||
}
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
MetaCursor
|
||||
meta_cursor_sprite_get_meta_cursor (MetaCursorSprite *self)
|
||||
{
|
||||
return self->cursor;
|
||||
return COGL_TEXTURE (priv->texture);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_get_hotspot (MetaCursorSprite *self,
|
||||
meta_cursor_sprite_get_hotspot (MetaCursorSprite *sprite,
|
||||
int *hot_x,
|
||||
int *hot_y)
|
||||
{
|
||||
*hot_x = self->hot_x;
|
||||
*hot_y = self->hot_y;
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
*hot_x = priv->hot_x;
|
||||
*hot_y = priv->hot_y;
|
||||
}
|
||||
|
||||
float
|
||||
meta_cursor_sprite_get_texture_scale (MetaCursorSprite *self)
|
||||
meta_cursor_sprite_get_texture_scale (MetaCursorSprite *sprite)
|
||||
{
|
||||
return self->texture_scale;
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
return priv->texture_scale;
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_prepare_at (MetaCursorSprite *self,
|
||||
meta_cursor_sprite_prepare_at (MetaCursorSprite *sprite,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
g_signal_emit (self, signals[PREPARE_AT], 0, x, y);
|
||||
g_signal_emit (sprite, signals[PREPARE_AT], 0, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_sprite_realize_texture (MetaCursorSprite *self)
|
||||
meta_cursor_sprite_realize_texture (MetaCursorSprite *sprite)
|
||||
{
|
||||
if (self->theme_dirty)
|
||||
meta_cursor_sprite_load_from_theme (self);
|
||||
MetaCursorSpriteClass *klass = META_CURSOR_SPRITE_GET_CLASS (sprite);
|
||||
|
||||
if (klass->realize_texture)
|
||||
klass->realize_texture (sprite);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_init (MetaCursorSprite *self)
|
||||
meta_cursor_sprite_init (MetaCursorSprite *sprite)
|
||||
{
|
||||
self->texture_scale = 1.0f;
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
priv->texture_scale = 1.0f;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_finalize (GObject *object)
|
||||
{
|
||||
MetaCursorSprite *self = META_CURSOR_SPRITE (object);
|
||||
MetaCursorSprite *sprite = META_CURSOR_SPRITE (object);
|
||||
MetaCursorSpritePrivate *priv =
|
||||
meta_cursor_sprite_get_instance_private (sprite);
|
||||
|
||||
if (self->xcursor_images)
|
||||
XcursorImagesDestroy (self->xcursor_images);
|
||||
|
||||
g_clear_pointer (&self->texture, cogl_object_unref);
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
|
||||
G_OBJECT_CLASS (meta_cursor_sprite_parent_class)->finalize (object);
|
||||
}
|
||||
|
@@ -25,51 +25,50 @@
|
||||
#include <meta/common.h>
|
||||
#include <meta/boxes.h>
|
||||
|
||||
typedef struct _MetaCursorSprite MetaCursorSprite;
|
||||
|
||||
#define META_TYPE_CURSOR_SPRITE (meta_cursor_sprite_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (MetaCursorSprite,
|
||||
meta_cursor_sprite,
|
||||
META, CURSOR_SPRITE,
|
||||
GObject);
|
||||
G_DECLARE_DERIVABLE_TYPE (MetaCursorSprite,
|
||||
meta_cursor_sprite,
|
||||
META, CURSOR_SPRITE,
|
||||
GObject)
|
||||
|
||||
MetaCursorSprite * meta_cursor_sprite_new (void);
|
||||
struct _MetaCursorSpriteClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
MetaCursorSprite * meta_cursor_sprite_from_theme (MetaCursor cursor);
|
||||
void (* realize_texture) (MetaCursorSprite *sprite);
|
||||
gboolean (* is_animated) (MetaCursorSprite *sprite);
|
||||
void (* tick_frame) (MetaCursorSprite *sprite);
|
||||
unsigned int (* get_current_frame_time) (MetaCursorSprite *sprite);
|
||||
};
|
||||
|
||||
|
||||
void meta_cursor_sprite_set_theme_scale (MetaCursorSprite *self,
|
||||
int scale);
|
||||
|
||||
MetaCursor meta_cursor_sprite_get_meta_cursor (MetaCursorSprite *self);
|
||||
|
||||
Cursor meta_cursor_create_x_cursor (Display *xdisplay,
|
||||
MetaCursor cursor);
|
||||
|
||||
void meta_cursor_sprite_prepare_at (MetaCursorSprite *self,
|
||||
void meta_cursor_sprite_prepare_at (MetaCursorSprite *sprite,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
void meta_cursor_sprite_realize_texture (MetaCursorSprite *self);
|
||||
void meta_cursor_sprite_realize_texture (MetaCursorSprite *sprite);
|
||||
|
||||
void meta_cursor_sprite_set_texture (MetaCursorSprite *self,
|
||||
void meta_cursor_sprite_clear_texture (MetaCursorSprite *sprite);
|
||||
|
||||
void meta_cursor_sprite_set_texture (MetaCursorSprite *sprite,
|
||||
CoglTexture *texture,
|
||||
int hot_x,
|
||||
int hot_y);
|
||||
|
||||
void meta_cursor_sprite_set_texture_scale (MetaCursorSprite *self,
|
||||
void meta_cursor_sprite_set_texture_scale (MetaCursorSprite *sprite,
|
||||
float scale);
|
||||
|
||||
CoglTexture *meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *self);
|
||||
CoglTexture *meta_cursor_sprite_get_cogl_texture (MetaCursorSprite *sprite);
|
||||
|
||||
void meta_cursor_sprite_get_hotspot (MetaCursorSprite *self,
|
||||
void meta_cursor_sprite_get_hotspot (MetaCursorSprite *sprite,
|
||||
int *hot_x,
|
||||
int *hot_y);
|
||||
|
||||
float meta_cursor_sprite_get_texture_scale (MetaCursorSprite *self);
|
||||
float meta_cursor_sprite_get_texture_scale (MetaCursorSprite *sprite);
|
||||
|
||||
gboolean meta_cursor_sprite_is_animated (MetaCursorSprite *self);
|
||||
void meta_cursor_sprite_tick_frame (MetaCursorSprite *self);
|
||||
guint meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *self);
|
||||
gboolean meta_cursor_sprite_is_animated (MetaCursorSprite *sprite);
|
||||
|
||||
void meta_cursor_sprite_tick_frame (MetaCursorSprite *sprite);
|
||||
|
||||
unsigned int meta_cursor_sprite_get_current_frame_time (MetaCursorSprite *sprite);
|
||||
|
||||
#endif /* META_CURSOR_H */
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
gboolean meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
MetaCompositor *compositor,
|
||||
MetaDisplay *display,
|
||||
Display *xdisplay,
|
||||
XEvent *xev);
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
|
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "meta-idle-monitor-dbus.h"
|
||||
#include <meta/meta-idle-monitor.h>
|
||||
#include <backends/meta-idle-monitor-private.h>
|
||||
#include "meta-dbus-idle-monitor.h"
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
@@ -43,6 +44,26 @@ handle_get_idletime (MetaDBusIdleMonitor *skeleton,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
handle_reset_idletime (MetaDBusIdleMonitor *skeleton,
|
||||
GDBusMethodInvocation *invocation,
|
||||
MetaIdleMonitor *monitor)
|
||||
{
|
||||
if (!g_getenv ("MUTTER_DEBUG_RESET_IDLETIME"))
|
||||
{
|
||||
g_dbus_method_invocation_return_error_literal (invocation,
|
||||
G_DBUS_ERROR,
|
||||
G_DBUS_ERROR_UNKNOWN_METHOD,
|
||||
"No such method");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
meta_idle_monitor_reset_idletime (meta_idle_monitor_get_core ());
|
||||
meta_dbus_idle_monitor_complete_reset_idletime (skeleton, invocation);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
MetaDBusIdleMonitor *dbus_monitor;
|
||||
MetaIdleMonitor *monitor;
|
||||
@@ -173,6 +194,8 @@ create_monitor_skeleton (GDBusObjectManagerServer *manager,
|
||||
G_CALLBACK (handle_add_user_active_watch), monitor, 0);
|
||||
g_signal_connect_object (skeleton, "handle-remove-watch",
|
||||
G_CALLBACK (handle_remove_watch), monitor, 0);
|
||||
g_signal_connect_object (skeleton, "handle-reset-idletime",
|
||||
G_CALLBACK (handle_reset_idletime), monitor, 0);
|
||||
g_signal_connect_object (skeleton, "handle-get-idletime",
|
||||
G_CALLBACK (handle_get_idletime), monitor, 0);
|
||||
|
||||
|
@@ -26,9 +26,6 @@
|
||||
#include <meta/meta-idle-monitor.h>
|
||||
#include "display-private.h"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/sync.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
MetaIdleMonitor *monitor;
|
||||
@@ -38,28 +35,26 @@ typedef struct
|
||||
GDestroyNotify notify;
|
||||
guint64 timeout_msec;
|
||||
int idle_source_id;
|
||||
GSource *timeout_source;
|
||||
} MetaIdleMonitorWatch;
|
||||
|
||||
struct _MetaIdleMonitor
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
GDBusProxy *session_proxy;
|
||||
gboolean inhibited;
|
||||
GHashTable *watches;
|
||||
int device_id;
|
||||
guint64 last_event_time;
|
||||
};
|
||||
|
||||
struct _MetaIdleMonitorClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
gint64 (*get_idletime) (MetaIdleMonitor *monitor);
|
||||
MetaIdleMonitorWatch * (*make_watch) (MetaIdleMonitor *monitor,
|
||||
guint64 timeout_msec,
|
||||
MetaIdleMonitorWatchFunc callback,
|
||||
gpointer user_data,
|
||||
GDestroyNotify notify);
|
||||
};
|
||||
|
||||
void _meta_idle_monitor_watch_fire (MetaIdleMonitorWatch *watch);
|
||||
void meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor);
|
||||
|
||||
#endif /* META_IDLE_MONITOR_PRIVATE_H */
|
||||
|
@@ -36,6 +36,7 @@
|
||||
#include <meta/util.h>
|
||||
#include <meta/main.h>
|
||||
#include <meta/meta-idle-monitor.h>
|
||||
#include "gsm-inhibitor-flag.h"
|
||||
#include "meta-idle-monitor-private.h"
|
||||
#include "meta-idle-monitor-dbus.h"
|
||||
#include "meta-backend-private.h"
|
||||
@@ -87,6 +88,7 @@ meta_idle_monitor_dispose (GObject *object)
|
||||
MetaIdleMonitor *monitor = META_IDLE_MONITOR (object);
|
||||
|
||||
g_clear_pointer (&monitor->watches, g_hash_table_destroy);
|
||||
g_clear_object (&monitor->session_proxy);
|
||||
|
||||
G_OBJECT_CLASS (meta_idle_monitor_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -151,9 +153,121 @@ meta_idle_monitor_class_init (MetaIdleMonitorClass *klass)
|
||||
g_object_class_install_property (object_class, PROP_DEVICE_ID, obj_props[PROP_DEVICE_ID]);
|
||||
}
|
||||
|
||||
static void
|
||||
free_watch (gpointer data)
|
||||
{
|
||||
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) data;
|
||||
MetaIdleMonitor *monitor = watch->monitor;
|
||||
|
||||
g_object_ref (monitor);
|
||||
|
||||
if (watch->idle_source_id)
|
||||
{
|
||||
g_source_remove (watch->idle_source_id);
|
||||
watch->idle_source_id = 0;
|
||||
}
|
||||
|
||||
if (watch->notify != NULL)
|
||||
watch->notify (watch->user_data);
|
||||
|
||||
if (watch->timeout_source != NULL)
|
||||
g_source_destroy (watch->timeout_source);
|
||||
|
||||
g_object_unref (monitor);
|
||||
g_slice_free (MetaIdleMonitorWatch, watch);
|
||||
}
|
||||
|
||||
static void
|
||||
update_inhibited_watch (gpointer key,
|
||||
gpointer value,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaIdleMonitor *monitor = user_data;
|
||||
MetaIdleMonitorWatch *watch = value;
|
||||
|
||||
if (!watch->timeout_source)
|
||||
return;
|
||||
|
||||
if (monitor->inhibited)
|
||||
{
|
||||
g_source_set_ready_time (watch->timeout_source, -1);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_source_set_ready_time (watch->timeout_source,
|
||||
monitor->last_event_time +
|
||||
watch->timeout_msec * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
update_inhibited (MetaIdleMonitor *monitor,
|
||||
gboolean inhibited)
|
||||
{
|
||||
if (inhibited == monitor->inhibited)
|
||||
return;
|
||||
|
||||
g_hash_table_foreach (monitor->watches,
|
||||
update_inhibited_watch,
|
||||
monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_inhibited_actions_changed (GDBusProxy *session,
|
||||
GVariant *changed,
|
||||
char **invalidated,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaIdleMonitor *monitor = user_data;
|
||||
GVariant *v;
|
||||
|
||||
v = g_variant_lookup_value (changed, "InhibitedActions", G_VARIANT_TYPE_UINT32);
|
||||
if (v)
|
||||
{
|
||||
gboolean inhibited;
|
||||
|
||||
inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
|
||||
g_variant_unref (v);
|
||||
|
||||
if (!inhibited)
|
||||
monitor->last_event_time = g_get_monotonic_time ();
|
||||
update_inhibited (monitor, inhibited);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_init (MetaIdleMonitor *monitor)
|
||||
{
|
||||
GVariant *v;
|
||||
|
||||
monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch);
|
||||
monitor->last_event_time = g_get_monotonic_time ();
|
||||
|
||||
/* Monitor inhibitors */
|
||||
monitor->session_proxy =
|
||||
g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS |
|
||||
G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
|
||||
NULL,
|
||||
"org.gnome.SessionManager",
|
||||
"/org/gnome/SessionManager",
|
||||
"org.gnome.SessionManager",
|
||||
NULL,
|
||||
NULL);
|
||||
if (!monitor->session_proxy)
|
||||
return;
|
||||
|
||||
g_signal_connect (monitor->session_proxy, "g-properties-changed",
|
||||
G_CALLBACK (meta_idle_monitor_inhibited_actions_changed),
|
||||
monitor);
|
||||
|
||||
v = g_dbus_proxy_get_cached_property (monitor->session_proxy,
|
||||
"InhibitedActions");
|
||||
if (v)
|
||||
{
|
||||
monitor->inhibited = g_variant_get_uint32 (v) & GSM_INHIBITOR_FLAG_IDLE;
|
||||
g_variant_unref (v);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -185,6 +299,36 @@ meta_idle_monitor_get_for_device (int device_id)
|
||||
return meta_backend_get_idle_monitor (backend, device_id);
|
||||
}
|
||||
|
||||
static guint32
|
||||
get_next_watch_serial (void)
|
||||
{
|
||||
static guint32 serial = 0;
|
||||
|
||||
g_atomic_int_inc (&serial);
|
||||
|
||||
return serial;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
idle_monitor_dispatch_timeout (GSource *source,
|
||||
GSourceFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) user_data;
|
||||
|
||||
_meta_idle_monitor_watch_fire (watch);
|
||||
g_source_set_ready_time (watch->timeout_source, -1);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GSourceFuncs idle_monitor_source_funcs = {
|
||||
.prepare = NULL,
|
||||
.check = NULL,
|
||||
.dispatch = idle_monitor_dispatch_timeout,
|
||||
.finalize = NULL,
|
||||
};
|
||||
|
||||
static MetaIdleMonitorWatch *
|
||||
make_watch (MetaIdleMonitor *monitor,
|
||||
guint64 timeout_msec,
|
||||
@@ -194,11 +338,32 @@ make_watch (MetaIdleMonitor *monitor,
|
||||
{
|
||||
MetaIdleMonitorWatch *watch;
|
||||
|
||||
watch = META_IDLE_MONITOR_GET_CLASS (monitor)->make_watch (monitor,
|
||||
timeout_msec,
|
||||
callback,
|
||||
user_data,
|
||||
notify);
|
||||
watch = g_slice_new0 (MetaIdleMonitorWatch);
|
||||
|
||||
watch->monitor = monitor;
|
||||
watch->id = get_next_watch_serial ();
|
||||
watch->callback = callback;
|
||||
watch->user_data = user_data;
|
||||
watch->notify = notify;
|
||||
watch->timeout_msec = timeout_msec;
|
||||
|
||||
if (timeout_msec != 0)
|
||||
{
|
||||
GSource *source = g_source_new (&idle_monitor_source_funcs,
|
||||
sizeof (GSource));
|
||||
|
||||
g_source_set_callback (source, NULL, watch, NULL);
|
||||
if (!monitor->inhibited)
|
||||
{
|
||||
g_source_set_ready_time (source,
|
||||
monitor->last_event_time +
|
||||
timeout_msec * 1000);
|
||||
}
|
||||
g_source_attach (source, NULL);
|
||||
g_source_unref (source);
|
||||
|
||||
watch->timeout_source = source;
|
||||
}
|
||||
|
||||
g_hash_table_insert (monitor->watches,
|
||||
GUINT_TO_POINTER (watch->id),
|
||||
@@ -314,5 +479,39 @@ meta_idle_monitor_remove_watch (MetaIdleMonitor *monitor,
|
||||
gint64
|
||||
meta_idle_monitor_get_idletime (MetaIdleMonitor *monitor)
|
||||
{
|
||||
return META_IDLE_MONITOR_GET_CLASS (monitor)->get_idletime (monitor);
|
||||
return (g_get_monotonic_time () - monitor->last_event_time) / 1000;
|
||||
}
|
||||
|
||||
void
|
||||
meta_idle_monitor_reset_idletime (MetaIdleMonitor *monitor)
|
||||
{
|
||||
GList *node, *watch_ids;
|
||||
|
||||
monitor->last_event_time = g_get_monotonic_time ();
|
||||
|
||||
watch_ids = g_hash_table_get_keys (monitor->watches);
|
||||
|
||||
for (node = watch_ids; node != NULL; node = node->next)
|
||||
{
|
||||
guint watch_id = GPOINTER_TO_UINT (node->data);
|
||||
MetaIdleMonitorWatch *watch;
|
||||
|
||||
watch = g_hash_table_lookup (monitor->watches,
|
||||
GUINT_TO_POINTER (watch_id));
|
||||
if (!watch)
|
||||
continue;
|
||||
|
||||
if (watch->timeout_msec == 0)
|
||||
{
|
||||
_meta_idle_monitor_watch_fire ((MetaIdleMonitorWatch *) watch);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_source_set_ready_time (watch->timeout_source,
|
||||
monitor->last_event_time +
|
||||
watch->timeout_msec * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free (watch_ids);
|
||||
}
|
||||
|
@@ -1088,7 +1088,7 @@ meta_input_settings_changed_cb (GSettings *settings,
|
||||
update_device_natural_scroll (input_settings, NULL);
|
||||
else if (strcmp (key, "tap-to-click") == 0)
|
||||
update_touchpad_tap_enabled (input_settings, NULL);
|
||||
else if (strcmp (key, "tap-and_drag") == 0)
|
||||
else if (strcmp (key, "tap-and-drag") == 0)
|
||||
update_touchpad_tap_and_drag_enabled (input_settings, NULL);
|
||||
else if (strcmp(key, "disable-while-typing") == 0)
|
||||
update_touchpad_disable_while_typing (input_settings, NULL);
|
||||
|
@@ -100,11 +100,12 @@ static MetaMonitorTransform
|
||||
derive_monitor_transform (MetaMonitor *monitor)
|
||||
{
|
||||
MetaOutput *main_output;
|
||||
MetaMonitorTransform transform;
|
||||
|
||||
main_output = meta_monitor_get_main_output (monitor);
|
||||
transform = meta_output_get_assigned_crtc (main_output)->transform;
|
||||
|
||||
return meta_monitor_crtc_to_logical_transform (monitor,
|
||||
main_output->crtc->transform);
|
||||
return meta_monitor_crtc_to_logical_transform (monitor, transform);
|
||||
}
|
||||
|
||||
MetaLogicalMonitor *
|
||||
@@ -145,7 +146,7 @@ meta_logical_monitor_add_monitor (MetaLogicalMonitor *logical_monitor,
|
||||
|
||||
is_presentation = logical_monitor->is_presentation;
|
||||
logical_monitor->monitors = g_list_append (logical_monitor->monitors,
|
||||
monitor);
|
||||
g_object_ref (monitor));
|
||||
|
||||
for (l = logical_monitor->monitors; l; l = l->next)
|
||||
{
|
||||
@@ -157,10 +158,12 @@ meta_logical_monitor_add_monitor (MetaLogicalMonitor *logical_monitor,
|
||||
for (l_output = outputs; l_output; l_output = l_output->next)
|
||||
{
|
||||
MetaOutput *output = l_output->data;
|
||||
MetaCrtc *crtc;
|
||||
|
||||
is_presentation = is_presentation && output->is_presentation;
|
||||
if (output->crtc)
|
||||
output->crtc->logical_monitor = logical_monitor;
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
if (crtc)
|
||||
crtc->logical_monitor = logical_monitor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,7 +223,7 @@ foreach_crtc (MetaMonitor *monitor,
|
||||
ForeachCrtcData *data = user_data;
|
||||
|
||||
data->func (data->logical_monitor,
|
||||
monitor_crtc_mode->output->crtc,
|
||||
meta_output_get_assigned_crtc (monitor_crtc_mode->output),
|
||||
data->user_data);
|
||||
|
||||
return TRUE;
|
||||
@@ -254,13 +257,17 @@ meta_logical_monitor_init (MetaLogicalMonitor *logical_monitor)
|
||||
}
|
||||
|
||||
static void
|
||||
meta_logical_monitor_finalize (GObject *object)
|
||||
meta_logical_monitor_dispose (GObject *object)
|
||||
{
|
||||
MetaLogicalMonitor *logical_monitor = META_LOGICAL_MONITOR (object);
|
||||
|
||||
g_list_free (logical_monitor->monitors);
|
||||
if (logical_monitor->monitors)
|
||||
{
|
||||
g_list_free_full (logical_monitor->monitors, g_object_unref);
|
||||
logical_monitor->monitors = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_logical_monitor_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (meta_logical_monitor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -268,38 +275,38 @@ meta_logical_monitor_class_init (MetaLogicalMonitorClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = meta_logical_monitor_finalize;
|
||||
object_class->dispose = meta_logical_monitor_dispose;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
||||
MetaLogicalMonitor *neighbor,
|
||||
MetaScreenDirection neighbor_direction)
|
||||
meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
||||
MetaLogicalMonitor *neighbor,
|
||||
MetaDisplayDirection neighbor_direction)
|
||||
{
|
||||
switch (neighbor_direction)
|
||||
{
|
||||
case META_SCREEN_RIGHT:
|
||||
case META_DISPLAY_RIGHT:
|
||||
if (neighbor->rect.x == (logical_monitor->rect.x +
|
||||
logical_monitor->rect.width) &&
|
||||
meta_rectangle_vert_overlap (&neighbor->rect,
|
||||
&logical_monitor->rect))
|
||||
return TRUE;
|
||||
break;
|
||||
case META_SCREEN_LEFT:
|
||||
case META_DISPLAY_LEFT:
|
||||
if (logical_monitor->rect.x == (neighbor->rect.x +
|
||||
neighbor->rect.width) &&
|
||||
meta_rectangle_vert_overlap (&neighbor->rect,
|
||||
&logical_monitor->rect))
|
||||
return TRUE;
|
||||
break;
|
||||
case META_SCREEN_UP:
|
||||
case META_DISPLAY_UP:
|
||||
if (logical_monitor->rect.y == (neighbor->rect.y +
|
||||
neighbor->rect.height) &&
|
||||
meta_rectangle_horiz_overlap (&neighbor->rect,
|
||||
&logical_monitor->rect))
|
||||
return TRUE;
|
||||
break;
|
||||
case META_SCREEN_DOWN:
|
||||
case META_DISPLAY_DOWN:
|
||||
if (neighbor->rect.y == (logical_monitor->rect.y +
|
||||
logical_monitor->rect.height) &&
|
||||
meta_rectangle_horiz_overlap (&neighbor->rect,
|
||||
|
@@ -90,9 +90,9 @@ MetaRectangle meta_logical_monitor_get_layout (MetaLogicalMonitor *logical_monit
|
||||
|
||||
GList * meta_logical_monitor_get_monitors (MetaLogicalMonitor *logical_monitor);
|
||||
|
||||
gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
||||
MetaLogicalMonitor *neighbor,
|
||||
MetaScreenDirection neighbor_dir);
|
||||
gboolean meta_logical_monitor_has_neighbor (MetaLogicalMonitor *logical_monitor,
|
||||
MetaLogicalMonitor *neighbor,
|
||||
MetaDisplayDirection neighbor_dir);
|
||||
|
||||
void meta_logical_monitor_foreach_crtc (MetaLogicalMonitor *logical_monitor,
|
||||
MetaLogicalMonitorCrtcFunc func,
|
||||
|
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "backends/meta-monitor-config-manager.h"
|
||||
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "backends/meta-monitor-config-migration.h"
|
||||
#include "backends/meta-monitor-config-store.h"
|
||||
#include "backends/meta-monitor-manager-private.h"
|
||||
@@ -326,6 +327,15 @@ meta_monitor_config_manager_assign (MetaMonitorManager *manager,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_lid_closed (MetaMonitorManager *monitor_manager)
|
||||
{
|
||||
MetaBackend *backend;
|
||||
|
||||
backend = meta_monitor_manager_get_backend (monitor_manager);
|
||||
return meta_backend_is_lid_closed (backend);
|
||||
}
|
||||
|
||||
MetaMonitorsConfigKey *
|
||||
meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_manager)
|
||||
{
|
||||
@@ -340,7 +350,7 @@ meta_create_monitors_config_key_for_current_state (MetaMonitorManager *monitor_m
|
||||
MetaMonitorSpec *monitor_spec;
|
||||
|
||||
if (meta_monitor_is_laptop_panel (monitor) &&
|
||||
meta_monitor_manager_is_lid_closed (monitor_manager))
|
||||
is_lid_closed (monitor_manager))
|
||||
continue;
|
||||
|
||||
monitor_spec = meta_monitor_spec_clone (meta_monitor_get_spec (monitor));
|
||||
@@ -455,7 +465,7 @@ find_primary_monitor (MetaMonitorManager *monitor_manager)
|
||||
{
|
||||
MetaMonitor *monitor;
|
||||
|
||||
if (meta_monitor_manager_is_lid_closed (monitor_manager))
|
||||
if (is_lid_closed (monitor_manager))
|
||||
{
|
||||
monitor = meta_monitor_manager_get_primary_monitor (monitor_manager);
|
||||
if (monitor && !meta_monitor_is_laptop_panel (monitor))
|
||||
@@ -598,7 +608,7 @@ meta_monitor_config_manager_create_linear (MetaMonitorConfigManager *config_mana
|
||||
continue;
|
||||
|
||||
if (meta_monitor_is_laptop_panel (monitor) &&
|
||||
meta_monitor_manager_is_lid_closed (monitor_manager))
|
||||
is_lid_closed (monitor_manager))
|
||||
continue;
|
||||
|
||||
logical_monitor_config =
|
||||
@@ -1252,7 +1262,7 @@ meta_monitors_config_new (MetaMonitorManager *monitor_manager,
|
||||
MetaMonitor *monitor = l->data;
|
||||
MetaMonitorSpec *monitor_spec;
|
||||
|
||||
if (meta_monitor_manager_is_lid_closed (monitor_manager) &&
|
||||
if (is_lid_closed (monitor_manager) &&
|
||||
meta_monitor_is_laptop_panel (monitor))
|
||||
continue;
|
||||
|
||||
|
@@ -486,7 +486,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
|
||||
|
||||
output->is_dirty = TRUE;
|
||||
output->crtc = crtc;
|
||||
meta_output_assign_crtc (output, crtc);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -531,7 +531,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
continue;
|
||||
}
|
||||
|
||||
output->crtc = NULL;
|
||||
meta_output_unassign_crtc (output);
|
||||
output->is_primary = FALSE;
|
||||
}
|
||||
}
|
||||
|
@@ -37,10 +37,8 @@
|
||||
|
||||
#include <cogl/cogl.h>
|
||||
#include <libgnome-desktop/gnome-pnp-ids.h>
|
||||
#include <libupower-glib/upower.h>
|
||||
|
||||
#include "display-private.h"
|
||||
#include <meta/screen.h>
|
||||
#include "stack-tracker.h"
|
||||
#include <meta/meta-monitor-manager.h>
|
||||
|
||||
@@ -180,7 +178,6 @@ struct _MetaMonitorManager
|
||||
MetaMonitorConfigManager *config_manager;
|
||||
|
||||
GnomePnpIds *pnp_ids;
|
||||
UpClient *up_client;
|
||||
|
||||
gulong experimental_features_changed_handler_id;
|
||||
|
||||
@@ -196,8 +193,6 @@ struct _MetaMonitorManagerClass
|
||||
GBytes* (*read_edid) (MetaMonitorManager *,
|
||||
MetaOutput *);
|
||||
|
||||
gboolean (*is_lid_closed) (MetaMonitorManager *);
|
||||
|
||||
void (*ensure_initial_config) (MetaMonitorManager *);
|
||||
|
||||
gboolean (*apply_monitors_config) (MetaMonitorManager *,
|
||||
@@ -279,9 +274,9 @@ MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_at (MetaMonitorMana
|
||||
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
||||
MetaRectangle *rect);
|
||||
|
||||
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
||||
MetaLogicalMonitor *logical_monitor,
|
||||
MetaScreenDirection direction);
|
||||
MetaLogicalMonitor *meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
||||
MetaLogicalMonitor *logical_monitor,
|
||||
MetaDisplayDirection direction);
|
||||
|
||||
MetaMonitor * meta_monitor_manager_get_primary_monitor (MetaMonitorManager *manager);
|
||||
|
||||
@@ -336,8 +331,6 @@ void meta_monitor_manager_update_logical_state (MetaMonitorManager
|
||||
void meta_monitor_manager_update_logical_state_derived (MetaMonitorManager *manager,
|
||||
MetaMonitorsConfig *config);
|
||||
|
||||
gboolean meta_monitor_manager_is_lid_closed (MetaMonitorManager *manager);
|
||||
|
||||
void meta_monitor_manager_lid_is_closed_changed (MetaMonitorManager *manager);
|
||||
|
||||
gboolean meta_monitor_manager_is_headless (MetaMonitorManager *manager);
|
||||
|
@@ -34,8 +34,9 @@
|
||||
|
||||
#include <meta/main.h>
|
||||
#include "util-private.h"
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include "edid.h"
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "backends/meta-crtc.h"
|
||||
#include "backends/meta-logical-monitor.h"
|
||||
#include "backends/meta-monitor.h"
|
||||
@@ -89,6 +90,9 @@ static gboolean
|
||||
meta_monitor_manager_is_config_complete (MetaMonitorManager *manager,
|
||||
MetaMonitorsConfig *config);
|
||||
|
||||
static MetaMonitor *
|
||||
meta_monitor_manager_get_active_monitor (MetaMonitorManager *manager);
|
||||
|
||||
MetaBackend *
|
||||
meta_monitor_manager_get_backend (MetaMonitorManager *manager)
|
||||
{
|
||||
@@ -198,13 +202,17 @@ calculate_monitor_scale (MetaMonitorManager *manager,
|
||||
static float
|
||||
derive_calculated_global_scale (MetaMonitorManager *manager)
|
||||
{
|
||||
MetaMonitor *primary_monitor;
|
||||
MetaMonitor *monitor = NULL;
|
||||
|
||||
primary_monitor = meta_monitor_manager_get_primary_monitor (manager);
|
||||
if (!primary_monitor)
|
||||
monitor = meta_monitor_manager_get_primary_monitor (manager);
|
||||
|
||||
if (!monitor || !meta_monitor_is_active (monitor))
|
||||
monitor = meta_monitor_manager_get_active_monitor (manager);
|
||||
|
||||
if (!monitor)
|
||||
return 1.0;
|
||||
|
||||
return calculate_monitor_scale (manager, primary_monitor);
|
||||
return calculate_monitor_scale (manager, monitor);
|
||||
}
|
||||
|
||||
static float
|
||||
@@ -339,30 +347,14 @@ meta_monitor_manager_lid_is_closed_changed (MetaMonitorManager *manager)
|
||||
}
|
||||
|
||||
static void
|
||||
lid_is_closed_changed (UpClient *client,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
lid_is_closed_changed (MetaBackend *backend,
|
||||
gboolean lid_is_closed,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaMonitorManager *manager = user_data;
|
||||
|
||||
meta_monitor_manager_lid_is_closed_changed (manager);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_monitor_manager_real_is_lid_closed (MetaMonitorManager *manager)
|
||||
{
|
||||
if (!manager->up_client)
|
||||
return FALSE;
|
||||
|
||||
return up_client_get_lid_is_closed (manager->up_client);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_monitor_manager_is_lid_closed (MetaMonitorManager *manager)
|
||||
{
|
||||
return META_MONITOR_MANAGER_GET_CLASS (manager)->is_lid_closed (manager);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_monitor_manager_is_headless (MetaMonitorManager *manager)
|
||||
{
|
||||
@@ -598,7 +590,7 @@ meta_monitor_manager_ensure_configured (MetaMonitorManager *manager)
|
||||
{
|
||||
g_clear_object (&config);
|
||||
g_warning ("Failed to use fallback monitor configuration: %s",
|
||||
error->message);
|
||||
error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
@@ -712,8 +704,6 @@ static void
|
||||
meta_monitor_manager_constructed (GObject *object)
|
||||
{
|
||||
MetaMonitorManager *manager = META_MONITOR_MANAGER (object);
|
||||
MetaMonitorManagerClass *manager_class =
|
||||
META_MONITOR_MANAGER_GET_CLASS (manager);
|
||||
MetaBackend *backend = manager->backend;
|
||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||
|
||||
@@ -723,13 +713,6 @@ meta_monitor_manager_constructed (GObject *object)
|
||||
G_CALLBACK (experimental_features_changed),
|
||||
manager);
|
||||
|
||||
if (manager_class->is_lid_closed == meta_monitor_manager_real_is_lid_closed)
|
||||
{
|
||||
manager->up_client = up_client_new ();
|
||||
g_signal_connect_object (manager->up_client, "notify::lid-is-closed",
|
||||
G_CALLBACK (lid_is_closed_changed), manager, 0);
|
||||
}
|
||||
|
||||
g_signal_connect_object (manager, "notify::power-save-mode",
|
||||
G_CALLBACK (power_save_mode_changed), manager, 0);
|
||||
|
||||
@@ -738,6 +721,11 @@ meta_monitor_manager_constructed (GObject *object)
|
||||
G_CALLBACK (orientation_changed),
|
||||
manager, 0);
|
||||
|
||||
g_signal_connect_object (backend,
|
||||
"lid-is-closed-changed",
|
||||
G_CALLBACK (lid_is_closed_changed),
|
||||
manager, 0);
|
||||
|
||||
manager->current_switch_config = META_MONITOR_SWITCH_CONFIG_UNKNOWN;
|
||||
|
||||
initialize_dbus_interface (manager);
|
||||
@@ -769,7 +757,6 @@ meta_monitor_manager_dispose (GObject *object)
|
||||
}
|
||||
|
||||
g_clear_object (&manager->config_manager);
|
||||
g_clear_object (&manager->up_client);
|
||||
|
||||
G_OBJECT_CLASS (meta_monitor_manager_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -837,7 +824,6 @@ meta_monitor_manager_class_init (MetaMonitorManagerClass *klass)
|
||||
|
||||
klass->get_edid_file = meta_monitor_manager_real_get_edid_file;
|
||||
klass->read_edid = meta_monitor_manager_real_read_edid;
|
||||
klass->is_lid_closed = meta_monitor_manager_real_is_lid_closed;
|
||||
|
||||
signals[MONITORS_CHANGED_INTERNAL] =
|
||||
g_signal_new ("monitors-changed-internal",
|
||||
@@ -1032,12 +1018,13 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
||||
NULL /* properties */);
|
||||
}
|
||||
|
||||
for (l = combined_outputs; l; l = l->next)
|
||||
for (l = combined_outputs, i = 0; l; l = l->next, i++)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
GVariantBuilder crtcs, modes, clones, properties;
|
||||
GBytes *edid;
|
||||
char *edid_file;
|
||||
MetaCrtc *crtc;
|
||||
int crtc_index;
|
||||
|
||||
g_variant_builder_init (&crtcs, G_VARIANT_TYPE ("au"));
|
||||
@@ -1131,8 +1118,8 @@ meta_monitor_manager_handle_get_resources (MetaDBusDisplayConfig *skeleton,
|
||||
output->tile_info.tile_h));
|
||||
}
|
||||
|
||||
crtc_index = output->crtc ? g_list_index (combined_crtcs, output->crtc)
|
||||
: -1;
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
crtc_index = crtc ? g_list_index (combined_crtcs, crtc) : -1;
|
||||
g_variant_builder_add (&output_builder, "(uxiausauaua{sv})",
|
||||
i, /* ID */
|
||||
(gint64)output->winsys_id,
|
||||
@@ -1574,7 +1561,7 @@ meta_monitor_manager_is_config_applicable (MetaMonitorManager *manager,
|
||||
}
|
||||
|
||||
if (meta_monitor_is_laptop_panel (monitor) &&
|
||||
meta_monitor_manager_is_lid_closed (manager))
|
||||
meta_backend_is_lid_closed (manager->backend))
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Refusing to activate a closed laptop panel");
|
||||
@@ -2382,6 +2369,12 @@ meta_monitor_manager_get_laptop_panel (MetaMonitorManager *manager)
|
||||
return find_monitor (manager, meta_monitor_is_laptop_panel);
|
||||
}
|
||||
|
||||
static MetaMonitor *
|
||||
meta_monitor_manager_get_active_monitor (MetaMonitorManager *manager)
|
||||
{
|
||||
return find_monitor (manager, meta_monitor_is_active);
|
||||
}
|
||||
|
||||
MetaMonitor *
|
||||
meta_monitor_manager_get_monitor_from_connector (MetaMonitorManager *manager,
|
||||
const char *connector)
|
||||
@@ -2478,9 +2471,9 @@ meta_monitor_manager_get_logical_monitor_from_rect (MetaMonitorManager *manager,
|
||||
}
|
||||
|
||||
MetaLogicalMonitor *
|
||||
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
||||
MetaLogicalMonitor *logical_monitor,
|
||||
MetaScreenDirection direction)
|
||||
meta_monitor_manager_get_logical_monitor_neighbor (MetaMonitorManager *manager,
|
||||
MetaLogicalMonitor *logical_monitor,
|
||||
MetaDisplayDirection direction)
|
||||
{
|
||||
GList *l;
|
||||
|
||||
@@ -2894,11 +2887,7 @@ meta_monitor_manager_get_monitor_for_connector (MetaMonitorManager *manager,
|
||||
|
||||
if (meta_monitor_is_active (monitor) &&
|
||||
g_str_equal (connector, meta_monitor_get_connector (monitor)))
|
||||
{
|
||||
MetaOutput *main_output = meta_monitor_get_main_output (monitor);
|
||||
|
||||
return main_output->crtc->logical_monitor->number;
|
||||
}
|
||||
return meta_monitor_get_logical_monitor (monitor)->number;
|
||||
}
|
||||
|
||||
return -1;
|
||||
@@ -2974,7 +2963,7 @@ meta_monitor_manager_switch_config (MetaMonitorManager *manager,
|
||||
gboolean
|
||||
meta_monitor_manager_can_switch_config (MetaMonitorManager *manager)
|
||||
{
|
||||
return (!meta_monitor_manager_is_lid_closed (manager) &&
|
||||
return (!meta_backend_is_lid_closed (manager->backend) &&
|
||||
g_list_length (manager->monitors) > 1);
|
||||
}
|
||||
|
||||
|
@@ -204,10 +204,12 @@ gboolean
|
||||
meta_monitor_is_active (MetaMonitor *monitor)
|
||||
{
|
||||
MetaOutput *output;
|
||||
MetaCrtc *crtc;
|
||||
|
||||
output = meta_monitor_get_main_output (monitor);
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
|
||||
return output->crtc && output->crtc->current_mode;
|
||||
return crtc && crtc->current_mode;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -385,6 +387,21 @@ meta_monitor_crtc_to_logical_transform (MetaMonitor *monitor,
|
||||
return new_transform;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_dispose (GObject *object)
|
||||
{
|
||||
MetaMonitor *monitor = META_MONITOR (object);
|
||||
MetaMonitorPrivate *priv = meta_monitor_get_instance_private (monitor);
|
||||
|
||||
if (priv->outputs)
|
||||
{
|
||||
g_list_free_full (priv->outputs, g_object_unref);
|
||||
priv->outputs = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_monitor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_monitor_finalize (GObject *object)
|
||||
{
|
||||
@@ -393,7 +410,6 @@ meta_monitor_finalize (GObject *object)
|
||||
|
||||
g_hash_table_destroy (priv->mode_ids);
|
||||
g_list_free_full (priv->modes, (GDestroyNotify) meta_monitor_mode_free);
|
||||
g_clear_pointer (&priv->outputs, g_list_free);
|
||||
meta_monitor_spec_free (priv->spec);
|
||||
|
||||
G_OBJECT_CLASS (meta_monitor_parent_class)->finalize (object);
|
||||
@@ -412,6 +428,7 @@ meta_monitor_class_init (MetaMonitorClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = meta_monitor_dispose;
|
||||
object_class->finalize = meta_monitor_finalize;
|
||||
}
|
||||
|
||||
@@ -493,6 +510,7 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
|
||||
for (i = 0; i < output->n_modes; i++)
|
||||
{
|
||||
MetaCrtcMode *crtc_mode = output->modes[i];
|
||||
MetaCrtc *crtc;
|
||||
MetaMonitorMode *mode;
|
||||
gboolean replace;
|
||||
|
||||
@@ -526,7 +544,9 @@ meta_monitor_normal_generate_modes (MetaMonitorNormal *monitor_normal)
|
||||
|
||||
if (crtc_mode == output->preferred_mode)
|
||||
monitor_priv->preferred_mode = mode;
|
||||
if (output->crtc && crtc_mode == output->crtc->current_mode)
|
||||
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
if (crtc && crtc_mode == crtc->current_mode)
|
||||
monitor_priv->current_mode = mode;
|
||||
}
|
||||
}
|
||||
@@ -545,7 +565,7 @@ meta_monitor_normal_new (MetaGpu *gpu,
|
||||
|
||||
monitor_priv->gpu = gpu;
|
||||
|
||||
monitor_priv->outputs = g_list_append (NULL, output);
|
||||
monitor_priv->outputs = g_list_append (NULL, g_object_ref (output));
|
||||
monitor_priv->winsys_id = output->winsys_id;
|
||||
meta_monitor_generate_spec (monitor);
|
||||
|
||||
@@ -568,13 +588,15 @@ meta_monitor_normal_derive_layout (MetaMonitor *monitor,
|
||||
MetaRectangle *layout)
|
||||
{
|
||||
MetaOutput *output;
|
||||
MetaCrtc *crtc;
|
||||
|
||||
output = meta_monitor_get_main_output (monitor);
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
*layout = (MetaRectangle) {
|
||||
.x = output->crtc->rect.x,
|
||||
.y = output->crtc->rect.y,
|
||||
.width = output->crtc->rect.width,
|
||||
.height = output->crtc->rect.height
|
||||
.x = crtc->rect.x,
|
||||
.y = crtc->rect.y,
|
||||
.width = crtc->rect.width,
|
||||
.height = crtc->rect.height
|
||||
};
|
||||
}
|
||||
|
||||
@@ -658,7 +680,8 @@ add_tiled_monitor_outputs (MetaGpu *gpu,
|
||||
g_warn_if_fail (output->subpixel_order ==
|
||||
monitor_tiled->origin_output->subpixel_order);
|
||||
|
||||
monitor_priv->outputs = g_list_append (monitor_priv->outputs, output);
|
||||
monitor_priv->outputs = g_list_append (monitor_priv->outputs,
|
||||
g_object_ref (output));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -764,12 +787,13 @@ is_monitor_mode_assigned (MetaMonitor *monitor,
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
MetaMonitorCrtcMode *monitor_crtc_mode = &mode->crtc_modes[i];
|
||||
MetaCrtc *crtc;
|
||||
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
if (monitor_crtc_mode->crtc_mode &&
|
||||
(!output->crtc ||
|
||||
output->crtc->current_mode != monitor_crtc_mode->crtc_mode))
|
||||
(!crtc || crtc->current_mode != monitor_crtc_mode->crtc_mode))
|
||||
return FALSE;
|
||||
else if (!monitor_crtc_mode->crtc_mode && output->crtc)
|
||||
else if (!monitor_crtc_mode->crtc_mode && crtc)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1217,14 +1241,16 @@ meta_monitor_tiled_derive_layout (MetaMonitor *monitor,
|
||||
for (l = monitor_priv->outputs; l; l = l->next)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
MetaCrtc *crtc;
|
||||
|
||||
if (!output->crtc)
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
if (!crtc)
|
||||
continue;
|
||||
|
||||
min_x = MIN (output->crtc->rect.x, min_x);
|
||||
min_y = MIN (output->crtc->rect.y, min_y);
|
||||
max_x = MAX (output->crtc->rect.x + output->crtc->rect.width, max_x);
|
||||
max_y = MAX (output->crtc->rect.y + output->crtc->rect.height, max_y);
|
||||
min_x = MIN (crtc->rect.x, min_x);
|
||||
min_y = MIN (crtc->rect.y, min_y);
|
||||
max_x = MAX (crtc->rect.x + crtc->rect.width, max_x);
|
||||
max_y = MAX (crtc->rect.y + crtc->rect.height, max_y);
|
||||
}
|
||||
|
||||
*layout = (MetaRectangle) {
|
||||
@@ -1318,10 +1344,14 @@ meta_monitor_get_spec (MetaMonitor *monitor)
|
||||
MetaLogicalMonitor *
|
||||
meta_monitor_get_logical_monitor (MetaMonitor *monitor)
|
||||
{
|
||||
MetaOutput *output = meta_monitor_get_main_output (monitor);
|
||||
MetaOutput *output;
|
||||
MetaCrtc *crtc;
|
||||
|
||||
if (output->crtc)
|
||||
return output->crtc->logical_monitor;
|
||||
output = meta_monitor_get_main_output (monitor);
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
|
||||
if (crtc)
|
||||
return crtc->logical_monitor;
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -21,7 +21,13 @@
|
||||
|
||||
#include "backends/meta-output.h"
|
||||
|
||||
G_DEFINE_TYPE (MetaOutput, meta_output, G_TYPE_OBJECT)
|
||||
typedef struct _MetaOutputPrivate
|
||||
{
|
||||
/* The CRTC driving this output, NULL if the output is not enabled */
|
||||
MetaCrtc *crtc;
|
||||
} MetaOutputPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaOutput, meta_output, G_TYPE_OBJECT)
|
||||
|
||||
MetaGpu *
|
||||
meta_output_get_gpu (MetaOutput *output)
|
||||
@@ -29,6 +35,44 @@ meta_output_get_gpu (MetaOutput *output)
|
||||
return output->gpu;
|
||||
}
|
||||
|
||||
void
|
||||
meta_output_assign_crtc (MetaOutput *output,
|
||||
MetaCrtc *crtc)
|
||||
{
|
||||
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
|
||||
|
||||
g_assert (crtc);
|
||||
|
||||
g_set_object (&priv->crtc, crtc);
|
||||
}
|
||||
|
||||
void
|
||||
meta_output_unassign_crtc (MetaOutput *output)
|
||||
{
|
||||
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
|
||||
|
||||
g_clear_object (&priv->crtc);
|
||||
}
|
||||
|
||||
MetaCrtc *
|
||||
meta_output_get_assigned_crtc (MetaOutput *output)
|
||||
{
|
||||
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
|
||||
|
||||
return priv->crtc;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_output_dispose (GObject *object)
|
||||
{
|
||||
MetaOutput *output = META_OUTPUT (object);
|
||||
MetaOutputPrivate *priv = meta_output_get_instance_private (output);
|
||||
|
||||
g_clear_object (&priv->crtc);
|
||||
|
||||
G_OBJECT_CLASS (meta_output_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_output_finalize (GObject *object)
|
||||
{
|
||||
@@ -58,5 +102,6 @@ meta_output_class_init (MetaOutputClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = meta_output_dispose;
|
||||
object_class->finalize = meta_output_finalize;
|
||||
}
|
||||
|
@@ -64,9 +64,6 @@ struct _MetaOutput
|
||||
|
||||
MetaGpu *gpu;
|
||||
|
||||
/* The CRTC driving this output, NULL if the output is not enabled */
|
||||
MetaCrtc *crtc;
|
||||
|
||||
/* The low-level ID of this output, used to apply back configuration */
|
||||
glong winsys_id;
|
||||
char *name;
|
||||
@@ -122,4 +119,11 @@ G_DECLARE_FINAL_TYPE (MetaOutput, meta_output, META, OUTPUT, GObject)
|
||||
|
||||
MetaGpu * meta_output_get_gpu (MetaOutput *output);
|
||||
|
||||
void meta_output_assign_crtc (MetaOutput *output,
|
||||
MetaCrtc *crtc);
|
||||
|
||||
void meta_output_unassign_crtc (MetaOutput *output);
|
||||
|
||||
MetaCrtc * meta_output_get_assigned_crtc (MetaOutput *output);
|
||||
|
||||
#endif /* META_OUTPUT_H */
|
||||
|
@@ -34,7 +34,6 @@
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
#include "cogl/cogl.h"
|
||||
#include "meta/meta-backend.h"
|
||||
#include "meta/errors.h"
|
||||
#include "meta-dbus-remote-desktop.h"
|
||||
|
||||
#define META_REMOTE_DESKTOP_SESSION_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop/Session"
|
||||
|
@@ -37,7 +37,6 @@
|
||||
#include "backends/meta-cursor-renderer.h"
|
||||
#include "backends/meta-remote-desktop-session.h"
|
||||
#include "backends/native/meta-cursor-renderer-native.h"
|
||||
#include "meta/errors.h"
|
||||
#include "meta/meta-backend.h"
|
||||
|
||||
#define META_REMOTE_DESKTOP_DBUS_SERVICE "org.gnome.Mutter.RemoteDesktop"
|
||||
|
@@ -132,8 +132,8 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
|
||||
{
|
||||
MetaScreenCastStreamSrcPrivate *priv =
|
||||
meta_screen_cast_stream_src_get_instance_private (src);
|
||||
uint32_t buffer_id;
|
||||
struct spa_buffer *buffer;
|
||||
struct pw_buffer *buffer;
|
||||
struct spa_buffer *spa_buffer;
|
||||
uint8_t *map = NULL;
|
||||
uint8_t *data;
|
||||
uint64_t now_us;
|
||||
@@ -148,17 +148,24 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
|
||||
if (!priv->pipewire_stream)
|
||||
return;
|
||||
|
||||
buffer_id = pw_stream_get_empty_buffer (priv->pipewire_stream);
|
||||
if (buffer_id == SPA_ID_INVALID)
|
||||
return;
|
||||
|
||||
buffer = pw_stream_peek_buffer (priv->pipewire_stream, buffer_id);
|
||||
|
||||
if (buffer->datas[0].type == priv->pipewire_type->data.MemFd)
|
||||
buffer = pw_stream_dequeue_buffer (priv->pipewire_stream);
|
||||
if (!buffer)
|
||||
{
|
||||
map = mmap (NULL, buffer->datas[0].maxsize + buffer->datas[0].mapoffset,
|
||||
g_warning ("Failed to dequeue at PipeWire buffer");
|
||||
return;
|
||||
}
|
||||
|
||||
spa_buffer = buffer->buffer;
|
||||
|
||||
if (spa_buffer->datas[0].data)
|
||||
{
|
||||
data = spa_buffer->datas[0].data;
|
||||
}
|
||||
else if (spa_buffer->datas[0].type == priv->pipewire_type->data.MemFd)
|
||||
{
|
||||
map = mmap (NULL, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset,
|
||||
PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
buffer->datas[0].fd, 0);
|
||||
spa_buffer->datas[0].fd, 0);
|
||||
if (map == MAP_FAILED)
|
||||
{
|
||||
g_warning ("Failed to mmap pipewire stream buffer: %s\n",
|
||||
@@ -166,14 +173,11 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
|
||||
return;
|
||||
}
|
||||
|
||||
data = SPA_MEMBER (map, buffer->datas[0].mapoffset, uint8_t);
|
||||
}
|
||||
else if (buffer->datas[0].type == priv->pipewire_type->data.MemPtr)
|
||||
{
|
||||
data = buffer->datas[0].data;
|
||||
data = SPA_MEMBER (map, spa_buffer->datas[0].mapoffset, uint8_t);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Unhandled spa buffer type: %d", spa_buffer->datas[0].type);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -181,11 +185,11 @@ meta_screen_cast_stream_src_maybe_record_frame (MetaScreenCastStreamSrc *src)
|
||||
priv->last_frame_timestamp_us = now_us;
|
||||
|
||||
if (map)
|
||||
munmap (map, buffer->datas[0].maxsize + buffer->datas[0].mapoffset);
|
||||
munmap (map, spa_buffer->datas[0].maxsize + spa_buffer->datas[0].mapoffset);
|
||||
|
||||
buffer->datas[0].chunk->size = buffer->datas[0].maxsize;
|
||||
spa_buffer->datas[0].chunk->size = spa_buffer->datas[0].maxsize;
|
||||
|
||||
pw_stream_send_buffer (priv->pipewire_stream, buffer_id);
|
||||
pw_stream_queue_buffer (priv->pipewire_stream, buffer);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -261,8 +265,8 @@ on_stream_state_changed (void *data,
|
||||
}
|
||||
|
||||
static void
|
||||
on_stream_format_changed (void *data,
|
||||
struct spa_pod *format)
|
||||
on_stream_format_changed (void *data,
|
||||
const struct spa_pod *format)
|
||||
{
|
||||
MetaScreenCastStreamSrc *src = data;
|
||||
MetaScreenCastStreamSrcPrivate *priv =
|
||||
@@ -271,7 +275,7 @@ on_stream_format_changed (void *data,
|
||||
uint8_t params_buffer[1024];
|
||||
int32_t width, height, stride, size;
|
||||
struct spa_pod_builder pod_builder;
|
||||
struct spa_pod *params[1];
|
||||
const struct spa_pod *params[1];
|
||||
const int bpp = 4;
|
||||
|
||||
if (!format)
|
||||
@@ -327,10 +331,18 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
|
||||
struct spa_fraction max_framerate;
|
||||
struct spa_fraction min_framerate;
|
||||
const struct spa_pod *params[1];
|
||||
int result;
|
||||
|
||||
pipewire_stream = pw_stream_new (priv->pipewire_remote,
|
||||
"meta-screen-cast-src",
|
||||
NULL);
|
||||
if (!pipewire_stream)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Failed to create PipeWire stream: %s",
|
||||
strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
meta_screen_cast_stream_src_get_specs (src, &width, &height, &frame_rate);
|
||||
frame_rate_fraction = meta_fraction_from_double (frame_rate);
|
||||
@@ -347,23 +359,25 @@ create_pipewire_stream (MetaScreenCastStreamSrc *src,
|
||||
":", spa_type->format_video.format, "I", spa_type->video_format.BGRx,
|
||||
":", spa_type->format_video.size, "R", &SPA_RECTANGLE (width, height),
|
||||
":", spa_type->format_video.framerate, "F", &SPA_FRACTION (0, 1),
|
||||
":", spa_type->format_video.max_framerate, "Fr", &max_framerate,
|
||||
PROP_RANGE (&min_framerate,
|
||||
&max_framerate));
|
||||
":", spa_type->format_video.max_framerate, "Fru", &max_framerate,
|
||||
PROP_RANGE (&min_framerate,
|
||||
&max_framerate));
|
||||
|
||||
pw_stream_add_listener (pipewire_stream,
|
||||
&priv->pipewire_stream_listener,
|
||||
&stream_events,
|
||||
src);
|
||||
|
||||
if (pw_stream_connect (pipewire_stream,
|
||||
PW_DIRECTION_OUTPUT,
|
||||
NULL,
|
||||
PW_STREAM_FLAG_NONE,
|
||||
params, G_N_ELEMENTS (¶ms)) != 0)
|
||||
result = pw_stream_connect (pipewire_stream,
|
||||
PW_DIRECTION_OUTPUT,
|
||||
NULL,
|
||||
(PW_STREAM_FLAG_DRIVER |
|
||||
PW_STREAM_FLAG_MAP_BUFFERS),
|
||||
params, G_N_ELEMENTS (params));
|
||||
if (result != 0)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Could not connect");
|
||||
"Could not connect: %s", spa_strerror (result));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -466,6 +480,12 @@ create_pipewire_source (void)
|
||||
(MetaPipeWireSource *) g_source_new (&pipewire_source_funcs,
|
||||
sizeof (MetaPipeWireSource));
|
||||
pipewire_source->pipewire_loop = pw_loop_new (NULL);
|
||||
if (!pipewire_source->pipewire_loop)
|
||||
{
|
||||
g_source_destroy ((GSource *) pipewire_source);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
g_source_add_unix_fd (&pipewire_source->base,
|
||||
pw_loop_get_fd (pipewire_source->pipewire_loop),
|
||||
G_IO_IN | G_IO_ERR);
|
||||
@@ -491,6 +511,13 @@ meta_screen_cast_stream_src_initable_init (GInitable *initable,
|
||||
meta_screen_cast_stream_src_get_instance_private (src);
|
||||
|
||||
priv->pipewire_source = create_pipewire_source ();
|
||||
if (!priv->pipewire_source)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Failed to create PipeWire source");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
priv->pipewire_core = pw_core_new (priv->pipewire_source->pipewire_loop,
|
||||
NULL);
|
||||
if (!priv->pipewire_core)
|
||||
|
@@ -31,8 +31,7 @@ typedef enum _MetaExperimentalFeature
|
||||
{
|
||||
META_EXPERIMENTAL_FEATURE_NONE = 0,
|
||||
META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER = (1 << 0),
|
||||
META_EXPERIMENTAL_FEATURE_SCREEN_CAST = (1 << 1),
|
||||
META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP = (1 << 2),
|
||||
META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS = (1 << 1),
|
||||
} MetaExperimentalFeature;
|
||||
|
||||
#define META_TYPE_SETTINGS (meta_settings_get_type ())
|
||||
|
@@ -260,13 +260,10 @@ experimental_features_handler (GVariant *features_variant,
|
||||
g_variant_iter_init (&features_iter, features_variant);
|
||||
while (g_variant_iter_loop (&features_iter, "s", &feature))
|
||||
{
|
||||
/* So far no experimental features defined. */
|
||||
if (g_str_equal (feature, "scale-monitor-framebuffer"))
|
||||
features |= META_EXPERIMENTAL_FEATURE_SCALE_MONITOR_FRAMEBUFFER;
|
||||
else if (g_str_equal (feature, "screen-cast"))
|
||||
features |= META_EXPERIMENTAL_FEATURE_SCREEN_CAST;
|
||||
else if (g_str_equal (feature, "remote-desktop"))
|
||||
features |= META_EXPERIMENTAL_FEATURE_REMOTE_DESKTOP;
|
||||
else if (g_str_equal (feature, "kms-modifiers"))
|
||||
features |= META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS;
|
||||
else
|
||||
g_info ("Unknown experimental feature '%s'\n", feature);
|
||||
}
|
||||
|
@@ -17,39 +17,23 @@
|
||||
* 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef META_STAGE_H
|
||||
#define META_STAGE_H
|
||||
#ifndef META_STAGE_PRIVATE_H
|
||||
#define META_STAGE_PRIVATE_H
|
||||
|
||||
#include <clutter/clutter.h>
|
||||
#include <meta/meta-stage.h>
|
||||
|
||||
#include "meta-cursor.h"
|
||||
#include <meta/boxes.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define META_TYPE_STAGE (meta_stage_get_type ())
|
||||
#define META_STAGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_STAGE, MetaStage))
|
||||
#define META_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_STAGE, MetaStageClass))
|
||||
#define META_IS_STAGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_STAGE))
|
||||
#define META_IS_STAGE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_STAGE))
|
||||
#define META_STAGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_STAGE, MetaStageClass))
|
||||
|
||||
typedef struct _MetaStage MetaStage;
|
||||
typedef struct _MetaStageClass MetaStageClass;
|
||||
typedef struct _MetaOverlay MetaOverlay;
|
||||
|
||||
struct _MetaStageClass
|
||||
{
|
||||
ClutterStageClass parent_class;
|
||||
};
|
||||
|
||||
struct _MetaStage
|
||||
{
|
||||
ClutterStage parent;
|
||||
};
|
||||
|
||||
GType meta_stage_get_type (void) G_GNUC_CONST;
|
||||
|
||||
ClutterActor *meta_stage_new (void);
|
||||
|
||||
MetaOverlay *meta_stage_create_cursor_overlay (MetaStage *stage);
|
||||
@@ -68,4 +52,4 @@ void meta_stage_update_view_layout (MetaStage *stage);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* META_STAGE_H */
|
||||
#endif /* META_STAGE_PRIVATE_H */
|
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "meta-stage.h"
|
||||
#include "meta-stage-private.h"
|
||||
|
||||
#include <meta/meta-backend.h>
|
||||
#include <meta/meta-monitor-manager.h>
|
||||
|
@@ -29,21 +29,20 @@
|
||||
|
||||
#include <meta/main.h>
|
||||
#include <clutter/evdev/clutter-evdev.h>
|
||||
#include <libupower-glib/upower.h>
|
||||
|
||||
#include "clutter/egl/clutter-egl.h"
|
||||
#include "clutter/evdev/clutter-evdev.h"
|
||||
#include "meta-barrier-native.h"
|
||||
#include "meta-border.h"
|
||||
#include "meta-idle-monitor-native.h"
|
||||
#include "meta-monitor-manager-kms.h"
|
||||
#include "meta-cursor-renderer-native.h"
|
||||
#include "meta-launcher.h"
|
||||
#include "backends/meta-cursor-tracker-private.h"
|
||||
#include "backends/meta-idle-monitor-private.h"
|
||||
#include "backends/meta-logical-monitor.h"
|
||||
#include "backends/meta-monitor-manager-private.h"
|
||||
#include "backends/meta-pointer-constraint.h"
|
||||
#include "backends/meta-stage.h"
|
||||
#include "backends/meta-stage-private.h"
|
||||
#include "backends/native/meta-clutter-backend-native.h"
|
||||
#include "backends/native/meta-input-settings-native.h"
|
||||
#include "backends/native/meta-renderer-native.h"
|
||||
@@ -60,10 +59,6 @@ struct _MetaBackendNativePrivate
|
||||
{
|
||||
MetaLauncher *launcher;
|
||||
MetaBarrierManagerNative *barrier_manager;
|
||||
UpClient *up_client;
|
||||
guint sleep_signal_id;
|
||||
GCancellable *cancellable;
|
||||
GDBusConnection *system_bus;
|
||||
};
|
||||
typedef struct _MetaBackendNativePrivate MetaBackendNativePrivate;
|
||||
|
||||
@@ -85,69 +80,9 @@ meta_backend_native_finalize (GObject *object)
|
||||
|
||||
meta_launcher_free (priv->launcher);
|
||||
|
||||
g_object_unref (priv->up_client);
|
||||
if (priv->sleep_signal_id)
|
||||
g_dbus_connection_signal_unsubscribe (priv->system_bus, priv->sleep_signal_id);
|
||||
g_cancellable_cancel (priv->cancellable);
|
||||
g_clear_object (&priv->cancellable);
|
||||
g_clear_object (&priv->system_bus);
|
||||
|
||||
G_OBJECT_CLASS (meta_backend_native_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
prepare_for_sleep_cb (GDBusConnection *connection,
|
||||
const gchar *sender_name,
|
||||
const gchar *object_path,
|
||||
const gchar *interface_name,
|
||||
const gchar *signal_name,
|
||||
GVariant *parameters,
|
||||
gpointer user_data)
|
||||
{
|
||||
gboolean suspending;
|
||||
g_variant_get (parameters, "(b)", &suspending);
|
||||
if (suspending)
|
||||
return;
|
||||
meta_idle_monitor_native_reset_idletime (meta_idle_monitor_get_core ());
|
||||
}
|
||||
|
||||
static void
|
||||
system_bus_gotten_cb (GObject *object,
|
||||
GAsyncResult *res,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaBackendNativePrivate *priv;
|
||||
GDBusConnection *bus;
|
||||
|
||||
bus = g_bus_get_finish (res, NULL);
|
||||
if (!bus)
|
||||
return;
|
||||
|
||||
priv = meta_backend_native_get_instance_private (META_BACKEND_NATIVE (user_data));
|
||||
priv->system_bus = bus;
|
||||
priv->sleep_signal_id = g_dbus_connection_signal_subscribe (priv->system_bus,
|
||||
"org.freedesktop.login1",
|
||||
"org.freedesktop.login1.Manager",
|
||||
"PrepareForSleep",
|
||||
"/org/freedesktop/login1",
|
||||
NULL,
|
||||
G_DBUS_SIGNAL_FLAGS_NONE,
|
||||
prepare_for_sleep_cb,
|
||||
NULL,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
lid_is_closed_changed_cb (UpClient *client,
|
||||
GParamSpec *pspec,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (up_client_get_lid_is_closed (client))
|
||||
return;
|
||||
|
||||
meta_idle_monitor_native_reset_idletime (meta_idle_monitor_get_core ());
|
||||
}
|
||||
|
||||
static void
|
||||
constrain_to_barriers (ClutterInputDevice *device,
|
||||
guint32 time,
|
||||
@@ -276,7 +211,7 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
|
||||
MetaLogicalMonitor *cur = current;
|
||||
float x = cur_x, y = cur_y;
|
||||
float dx = *dx_inout, dy = *dy_inout;
|
||||
MetaScreenDirection direction = -1;
|
||||
MetaDisplayDirection direction = -1;
|
||||
|
||||
while (cur)
|
||||
{
|
||||
@@ -304,18 +239,18 @@ relative_motion_across_outputs (MetaMonitorManager *monitor_manager,
|
||||
{ cur->rect.x + cur->rect.width, cur->rect.y + cur->rect.height }
|
||||
};
|
||||
|
||||
if (direction != META_SCREEN_RIGHT &&
|
||||
if (direction != META_DISPLAY_RIGHT &&
|
||||
meta_line2_intersects_with (&motion, &left, &intersection))
|
||||
direction = META_SCREEN_LEFT;
|
||||
else if (direction != META_SCREEN_LEFT &&
|
||||
direction = META_DISPLAY_LEFT;
|
||||
else if (direction != META_DISPLAY_LEFT &&
|
||||
meta_line2_intersects_with (&motion, &right, &intersection))
|
||||
direction = META_SCREEN_RIGHT;
|
||||
else if (direction != META_SCREEN_DOWN &&
|
||||
direction = META_DISPLAY_RIGHT;
|
||||
else if (direction != META_DISPLAY_DOWN &&
|
||||
meta_line2_intersects_with (&motion, &top, &intersection))
|
||||
direction = META_SCREEN_UP;
|
||||
else if (direction != META_SCREEN_UP &&
|
||||
direction = META_DISPLAY_UP;
|
||||
else if (direction != META_DISPLAY_UP &&
|
||||
meta_line2_intersects_with (&motion, &bottom, &intersection))
|
||||
direction = META_SCREEN_DOWN;
|
||||
direction = META_DISPLAY_DOWN;
|
||||
else
|
||||
{
|
||||
/* We reached the dest logical monitor */
|
||||
@@ -398,15 +333,6 @@ meta_backend_native_post_init (MetaBackend *backend)
|
||||
meta_backend_get_monitor_manager (backend));
|
||||
}
|
||||
|
||||
static MetaIdleMonitor *
|
||||
meta_backend_native_create_idle_monitor (MetaBackend *backend,
|
||||
int device_id)
|
||||
{
|
||||
return g_object_new (META_TYPE_IDLE_MONITOR_NATIVE,
|
||||
"device-id", device_id,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static MetaMonitorManager *
|
||||
meta_backend_native_create_monitor_manager (MetaBackend *backend,
|
||||
GError **error)
|
||||
@@ -604,7 +530,6 @@ meta_backend_native_class_init (MetaBackendNativeClass *klass)
|
||||
|
||||
backend_class->post_init = meta_backend_native_post_init;
|
||||
|
||||
backend_class->create_idle_monitor = meta_backend_native_create_idle_monitor;
|
||||
backend_class->create_monitor_manager = meta_backend_native_create_monitor_manager;
|
||||
backend_class->create_cursor_renderer = meta_backend_native_create_cursor_renderer;
|
||||
backend_class->create_renderer = meta_backend_native_create_renderer;
|
||||
@@ -637,16 +562,6 @@ meta_backend_native_init (MetaBackendNative *native)
|
||||
}
|
||||
|
||||
priv->barrier_manager = meta_barrier_manager_native_new ();
|
||||
|
||||
priv->up_client = up_client_new ();
|
||||
g_signal_connect (priv->up_client, "notify::lid-is-closed",
|
||||
G_CALLBACK (lid_is_closed_changed_cb), NULL);
|
||||
|
||||
priv->cancellable = g_cancellable_new ();
|
||||
g_bus_get (G_BUS_TYPE_SYSTEM,
|
||||
priv->cancellable,
|
||||
system_bus_gotten_cb,
|
||||
native);
|
||||
}
|
||||
|
||||
MetaLauncher *
|
||||
@@ -729,8 +644,6 @@ void meta_backend_native_resume (MetaBackendNative *native)
|
||||
meta_backend_get_monitor_manager (backend);
|
||||
MetaMonitorManagerKms *monitor_manager_kms =
|
||||
META_MONITOR_MANAGER_KMS (monitor_manager);
|
||||
MetaCursorRenderer *cursor_renderer;
|
||||
MetaCursorRendererNative *cursor_renderer_native;
|
||||
ClutterActor *stage;
|
||||
MetaIdleMonitor *idle_monitor;
|
||||
|
||||
@@ -742,10 +655,6 @@ void meta_backend_native_resume (MetaBackendNative *native)
|
||||
stage = meta_backend_get_stage (backend);
|
||||
clutter_actor_queue_redraw (stage);
|
||||
|
||||
cursor_renderer = meta_backend_get_cursor_renderer (backend);
|
||||
cursor_renderer_native = META_CURSOR_RENDERER_NATIVE (cursor_renderer);
|
||||
meta_cursor_renderer_native_force_update (cursor_renderer_native);
|
||||
|
||||
idle_monitor = meta_backend_get_idle_monitor (backend, 0);
|
||||
meta_idle_monitor_native_reset_idletime (idle_monitor);
|
||||
meta_idle_monitor_reset_idletime (idle_monitor);
|
||||
}
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include <meta/meta-backend.h>
|
||||
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "backends/meta-cursor-sprite-xcursor.h"
|
||||
#include "backends/meta-logical-monitor.h"
|
||||
#include "backends/meta-monitor.h"
|
||||
#include "backends/meta-monitor-manager-private.h"
|
||||
@@ -43,6 +44,11 @@
|
||||
#include "core/boxes-private.h"
|
||||
#include "meta/boxes.h"
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
#include "wayland/meta-cursor-sprite-wayland.h"
|
||||
#include "wayland/meta-wayland-buffer.h"
|
||||
#endif
|
||||
|
||||
#ifndef DRM_CAP_CURSOR_WIDTH
|
||||
#define DRM_CAP_CURSOR_WIDTH 0x8
|
||||
#endif
|
||||
@@ -113,6 +119,11 @@ static GQuark quark_cursor_renderer_native_gpu_data = 0;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (MetaCursorRendererNative, meta_cursor_renderer_native, META_TYPE_CURSOR_RENDERER);
|
||||
|
||||
static void
|
||||
realize_cursor_sprite (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
GList *gpus);
|
||||
|
||||
static MetaCursorNativeGpuState *
|
||||
get_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
|
||||
MetaGpuKms *gpu_kms);
|
||||
@@ -152,7 +163,8 @@ static void
|
||||
meta_cursor_renderer_native_finalize (GObject *object)
|
||||
{
|
||||
MetaCursorRendererNative *renderer = META_CURSOR_RENDERER_NATIVE (object);
|
||||
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (renderer);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (renderer);
|
||||
|
||||
if (priv->animation_timeout_id)
|
||||
g_source_remove (priv->animation_timeout_id);
|
||||
@@ -203,7 +215,8 @@ set_crtc_cursor (MetaCursorRendererNative *native,
|
||||
MetaCrtc *crtc,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
|
||||
MetaGpuKms *gpu_kms;
|
||||
int kms_fd;
|
||||
@@ -291,9 +304,12 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
|
||||
data->in_cursor_renderer_native;
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (cursor_renderer_native);
|
||||
MetaCrtc *crtc;
|
||||
MetaMonitorTransform transform;
|
||||
ClutterRect scaled_crtc_rect;
|
||||
float scale;
|
||||
int crtc_x, crtc_y;
|
||||
int crtc_width, crtc_height;
|
||||
|
||||
if (meta_is_stage_views_scaled ())
|
||||
scale = meta_logical_monitor_get_scale (data->in_logical_monitor);
|
||||
@@ -305,17 +321,31 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
|
||||
META_MONITOR_TRANSFORM_NORMAL,
|
||||
&crtc_x, &crtc_y);
|
||||
|
||||
transform = meta_logical_monitor_get_transform (data->in_logical_monitor);
|
||||
if (meta_monitor_transform_is_rotated (transform))
|
||||
{
|
||||
crtc_width = monitor_crtc_mode->crtc_mode->height;
|
||||
crtc_height = monitor_crtc_mode->crtc_mode->width;
|
||||
}
|
||||
else
|
||||
{
|
||||
crtc_width = monitor_crtc_mode->crtc_mode->width;
|
||||
crtc_height = monitor_crtc_mode->crtc_mode->height;
|
||||
}
|
||||
|
||||
scaled_crtc_rect = (ClutterRect) {
|
||||
.origin = {
|
||||
.x = crtc_x / scale,
|
||||
.y = crtc_y / scale
|
||||
},
|
||||
.size = {
|
||||
.width = monitor_crtc_mode->crtc_mode->width / scale,
|
||||
.height = monitor_crtc_mode->crtc_mode->height / scale
|
||||
.width = crtc_width / scale,
|
||||
.height = crtc_height / scale
|
||||
},
|
||||
};
|
||||
|
||||
crtc = meta_output_get_assigned_crtc (monitor_crtc_mode->output);
|
||||
|
||||
if (priv->has_hw_cursor &&
|
||||
clutter_rect_intersection (&scaled_crtc_rect,
|
||||
&data->in_local_cursor_rect,
|
||||
@@ -326,7 +356,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
|
||||
float crtc_cursor_x, crtc_cursor_y;
|
||||
|
||||
set_crtc_cursor (data->in_cursor_renderer_native,
|
||||
monitor_crtc_mode->output->crtc,
|
||||
crtc,
|
||||
data->in_cursor_sprite);
|
||||
|
||||
gpu_kms = META_GPU_KMS (meta_monitor_get_gpu (monitor));
|
||||
@@ -336,7 +366,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
|
||||
crtc_cursor_y = (data->in_local_cursor_rect.origin.y -
|
||||
scaled_crtc_rect.origin.y) * scale;
|
||||
drmModeMoveCursor (kms_fd,
|
||||
monitor_crtc_mode->output->crtc->crtc_id,
|
||||
crtc->crtc_id,
|
||||
roundf (crtc_cursor_x),
|
||||
roundf (crtc_cursor_y));
|
||||
|
||||
@@ -344,8 +374,7 @@ update_monitor_crtc_cursor (MetaMonitor *monitor,
|
||||
}
|
||||
else
|
||||
{
|
||||
set_crtc_cursor (data->in_cursor_renderer_native,
|
||||
monitor_crtc_mode->output->crtc, NULL);
|
||||
set_crtc_cursor (data->in_cursor_renderer_native, crtc, NULL);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -355,7 +384,8 @@ static void
|
||||
update_hw_cursor (MetaCursorRendererNative *native,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRenderer *renderer = META_CURSOR_RENDERER (native);
|
||||
MetaMonitorManager *monitor_manager = priv->monitor_manager;
|
||||
GList *logical_monitors;
|
||||
@@ -548,18 +578,15 @@ can_draw_cursor_unscaled (MetaCursorRenderer *renderer,
|
||||
|
||||
static gboolean
|
||||
should_have_hw_cursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
GList *gpus)
|
||||
{
|
||||
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
|
||||
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
|
||||
GList *gpus;
|
||||
GList *l;
|
||||
CoglTexture *texture;
|
||||
|
||||
if (!cursor_sprite)
|
||||
return FALSE;
|
||||
|
||||
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
|
||||
for (l = gpus; l; l = l->next)
|
||||
{
|
||||
MetaGpuKms *gpu_kms = l->data;
|
||||
@@ -593,7 +620,8 @@ should_have_hw_cursor (MetaCursorRenderer *renderer,
|
||||
static gboolean
|
||||
meta_cursor_renderer_native_update_animation (MetaCursorRendererNative *native)
|
||||
{
|
||||
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRenderer *renderer = META_CURSOR_RENDERER (native);
|
||||
MetaCursorSprite *cursor_sprite = meta_cursor_renderer_get_cursor (renderer);
|
||||
|
||||
@@ -605,10 +633,11 @@ meta_cursor_renderer_native_update_animation (MetaCursorRendererNative *native)
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_renderer_native_trigger_frame (MetaCursorRendererNative *native,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
maybe_schedule_cursor_sprite_animation_frame (MetaCursorRendererNative *native,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
gboolean cursor_change;
|
||||
guint delay;
|
||||
|
||||
@@ -640,21 +669,78 @@ meta_cursor_renderer_native_trigger_frame (MetaCursorRendererNative *native,
|
||||
}
|
||||
}
|
||||
|
||||
static GList *
|
||||
calculate_cursor_sprite_gpus (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaMonitorManager *monitor_manager = priv->monitor_manager;
|
||||
GList *gpus = NULL;
|
||||
GList *logical_monitors;
|
||||
GList *l;
|
||||
ClutterRect cursor_rect;
|
||||
|
||||
cursor_rect = meta_cursor_renderer_calculate_rect (renderer, cursor_sprite);
|
||||
|
||||
logical_monitors =
|
||||
meta_monitor_manager_get_logical_monitors (monitor_manager);
|
||||
for (l = logical_monitors; l; l = l->next)
|
||||
{
|
||||
MetaLogicalMonitor *logical_monitor = l->data;
|
||||
MetaRectangle logical_monitor_layout;
|
||||
ClutterRect logical_monitor_rect;
|
||||
GList *monitors, *l_mon;
|
||||
|
||||
logical_monitor_layout =
|
||||
meta_logical_monitor_get_layout (logical_monitor);
|
||||
logical_monitor_rect =
|
||||
meta_rectangle_to_clutter_rect (&logical_monitor_layout);
|
||||
|
||||
if (!clutter_rect_intersection (&cursor_rect, &logical_monitor_rect,
|
||||
NULL))
|
||||
continue;
|
||||
|
||||
monitors = meta_logical_monitor_get_monitors (logical_monitor);
|
||||
for (l_mon = monitors; l_mon; l_mon = l_mon->next)
|
||||
{
|
||||
MetaMonitor *monitor = l_mon->data;
|
||||
MetaGpu *gpu;
|
||||
|
||||
gpu = meta_monitor_get_gpu (monitor);
|
||||
if (!g_list_find (gpus, gpu))
|
||||
gpus = g_list_prepend (gpus, gpu);
|
||||
}
|
||||
}
|
||||
|
||||
return gpus;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_cursor_renderer_native_update_cursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
|
||||
MetaCursorRendererNativePrivate *priv = meta_cursor_renderer_native_get_instance_private (native);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
g_autoptr (GList) gpus = NULL;
|
||||
|
||||
if (cursor_sprite)
|
||||
meta_cursor_sprite_realize_texture (cursor_sprite);
|
||||
{
|
||||
meta_cursor_sprite_realize_texture (cursor_sprite);
|
||||
gpus = calculate_cursor_sprite_gpus (renderer, cursor_sprite);
|
||||
realize_cursor_sprite (renderer, cursor_sprite, gpus);
|
||||
}
|
||||
|
||||
meta_cursor_renderer_native_trigger_frame (native, cursor_sprite);
|
||||
maybe_schedule_cursor_sprite_animation_frame (native, cursor_sprite);
|
||||
|
||||
priv->has_hw_cursor = should_have_hw_cursor (renderer, cursor_sprite);
|
||||
priv->has_hw_cursor = should_have_hw_cursor (renderer, cursor_sprite, gpus);
|
||||
update_hw_cursor (native, cursor_sprite);
|
||||
return priv->has_hw_cursor;
|
||||
|
||||
return (priv->has_hw_cursor ||
|
||||
!cursor_sprite ||
|
||||
!meta_cursor_sprite_get_cogl_texture (cursor_sprite));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -690,6 +776,24 @@ ensure_cursor_gpu_state (MetaCursorNativePrivate *cursor_priv,
|
||||
return cursor_gpu_state;
|
||||
}
|
||||
|
||||
static void
|
||||
on_cursor_sprite_texture_changed (MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
MetaCursorNativePrivate *cursor_priv = get_cursor_priv (cursor_sprite);
|
||||
GHashTableIter iter;
|
||||
MetaCursorNativeGpuState *cursor_gpu_state;
|
||||
|
||||
g_hash_table_iter_init (&iter, cursor_priv->gpu_states);
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &cursor_gpu_state))
|
||||
{
|
||||
guint pending_bo;
|
||||
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_gpu_state);
|
||||
g_clear_pointer (&cursor_gpu_state->bos[pending_bo],
|
||||
(GDestroyNotify) gbm_bo_destroy);
|
||||
cursor_gpu_state->pending_bo_state = META_CURSOR_GBM_BO_STATE_INVALIDATED;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cursor_priv_free (MetaCursorNativePrivate *cursor_priv)
|
||||
{
|
||||
@@ -722,6 +826,9 @@ ensure_cursor_priv (MetaCursorSprite *cursor_sprite)
|
||||
cursor_priv,
|
||||
(GDestroyNotify) cursor_priv_free);
|
||||
|
||||
g_signal_connect (cursor_sprite, "texture-changed",
|
||||
G_CALLBACK (on_cursor_sprite_texture_changed), NULL);
|
||||
|
||||
return cursor_priv;
|
||||
}
|
||||
|
||||
@@ -789,57 +896,71 @@ load_cursor_sprite_gbm_buffer_for_gpu (MetaCursorRendererNative *native,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
invalidate_pending_cursor_sprite_gbm_bo (MetaCursorSprite *cursor_sprite,
|
||||
MetaGpuKms *gpu_kms)
|
||||
static gboolean
|
||||
is_cursor_hw_state_valid (MetaCursorSprite *cursor_sprite,
|
||||
MetaGpuKms *gpu_kms)
|
||||
{
|
||||
MetaCursorNativePrivate *cursor_priv;
|
||||
MetaCursorNativeGpuState *cursor_gpu_state;
|
||||
guint pending_bo;
|
||||
|
||||
cursor_priv = get_cursor_priv (cursor_sprite);
|
||||
if (!cursor_priv)
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
cursor_gpu_state = get_cursor_gpu_state (cursor_priv, gpu_kms);
|
||||
if (!cursor_gpu_state)
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
pending_bo = get_pending_cursor_sprite_gbm_bo_index (cursor_gpu_state);
|
||||
g_clear_pointer (&cursor_gpu_state->bos[pending_bo],
|
||||
(GDestroyNotify) gbm_bo_destroy);
|
||||
cursor_gpu_state->pending_bo_state = META_CURSOR_GBM_BO_STATE_INVALIDATED;
|
||||
switch (cursor_gpu_state->pending_bo_state)
|
||||
{
|
||||
case META_CURSOR_GBM_BO_STATE_SET:
|
||||
case META_CURSOR_GBM_BO_STATE_NONE:
|
||||
return TRUE;
|
||||
case META_CURSOR_GBM_BO_STATE_INVALIDATED:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
static void
|
||||
meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
|
||||
MetaGpuKms *gpu_kms,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
struct wl_resource *buffer)
|
||||
realize_cursor_sprite_from_wl_buffer_for_gpu (MetaCursorRenderer *renderer,
|
||||
MetaGpuKms *gpu_kms,
|
||||
MetaCursorSpriteWayland *sprite_wayland)
|
||||
{
|
||||
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
|
||||
MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_wayland);
|
||||
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
|
||||
uint32_t gbm_format;
|
||||
uint64_t cursor_width, cursor_height;
|
||||
CoglTexture *texture;
|
||||
uint width, height;
|
||||
MetaWaylandBuffer *buffer;
|
||||
struct wl_resource *buffer_resource;
|
||||
struct wl_shm_buffer *shm_buffer;
|
||||
|
||||
cursor_renderer_gpu_data =
|
||||
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
|
||||
if (!cursor_renderer_gpu_data || cursor_renderer_gpu_data->hw_cursor_broken)
|
||||
return;
|
||||
|
||||
/* Destroy any previous pending cursor buffer; we'll always either fail (which
|
||||
* should unset, or succeed, which will set new buffer.
|
||||
*/
|
||||
invalidate_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms);
|
||||
if (is_cursor_hw_state_valid (cursor_sprite, gpu_kms))
|
||||
return;
|
||||
|
||||
texture = meta_cursor_sprite_get_cogl_texture (cursor_sprite);
|
||||
width = cogl_texture_get_width (texture);
|
||||
height = cogl_texture_get_height (texture);
|
||||
|
||||
struct wl_shm_buffer *shm_buffer = wl_shm_buffer_get (buffer);
|
||||
buffer = meta_cursor_sprite_wayland_get_buffer (sprite_wayland);
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
buffer_resource = meta_wayland_buffer_get_resource (buffer);
|
||||
if (!buffer_resource)
|
||||
return;
|
||||
|
||||
shm_buffer = wl_shm_buffer_get (buffer_resource);
|
||||
if (shm_buffer)
|
||||
{
|
||||
int rowstride = wl_shm_buffer_get_stride (shm_buffer);
|
||||
@@ -913,47 +1034,27 @@ meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (MetaCursorRen
|
||||
set_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms, bo);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_renderer_native_realize_cursor_from_wl_buffer (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
struct wl_resource *buffer)
|
||||
{
|
||||
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
GList *gpus;
|
||||
GList *l;
|
||||
|
||||
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
|
||||
for (l = gpus; l; l = l->next)
|
||||
{
|
||||
MetaGpuKms *gpu_kms = l->data;
|
||||
|
||||
meta_cursor_renderer_native_realize_cursor_from_wl_buffer_for_gpu (
|
||||
renderer,
|
||||
gpu_kms,
|
||||
cursor_sprite,
|
||||
buffer);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
|
||||
MetaGpuKms *gpu_kms,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
XcursorImage *xc_image)
|
||||
realize_cursor_sprite_from_xcursor_for_gpu (MetaCursorRenderer *renderer,
|
||||
MetaGpuKms *gpu_kms,
|
||||
MetaCursorSpriteXcursor *sprite_xcursor)
|
||||
{
|
||||
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
|
||||
MetaCursorRendererNativeGpuData *cursor_renderer_gpu_data;
|
||||
MetaCursorSprite *cursor_sprite = META_CURSOR_SPRITE (sprite_xcursor);
|
||||
XcursorImage *xc_image;
|
||||
|
||||
cursor_renderer_gpu_data =
|
||||
meta_cursor_renderer_native_gpu_data_from_gpu (gpu_kms);
|
||||
if (!cursor_renderer_gpu_data || cursor_renderer_gpu_data->hw_cursor_broken)
|
||||
return;
|
||||
|
||||
invalidate_pending_cursor_sprite_gbm_bo (cursor_sprite, gpu_kms);
|
||||
if (is_cursor_hw_state_valid (cursor_sprite, gpu_kms))
|
||||
return;
|
||||
|
||||
xc_image = meta_cursor_sprite_xcursor_get_current_image (sprite_xcursor);
|
||||
|
||||
load_cursor_sprite_gbm_buffer_for_gpu (native,
|
||||
gpu_kms,
|
||||
@@ -966,26 +1067,44 @@ meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (MetaCursorRende
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_renderer_native_realize_cursor_from_xcursor (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
XcursorImage *xc_image)
|
||||
realize_cursor_sprite_for_gpu (MetaCursorRenderer *renderer,
|
||||
MetaGpuKms *gpu_kms,
|
||||
MetaCursorSprite *cursor_sprite)
|
||||
{
|
||||
if (META_IS_CURSOR_SPRITE_XCURSOR (cursor_sprite))
|
||||
{
|
||||
MetaCursorSpriteXcursor *sprite_xcursor =
|
||||
META_CURSOR_SPRITE_XCURSOR (cursor_sprite);
|
||||
|
||||
realize_cursor_sprite_from_xcursor_for_gpu (renderer,
|
||||
gpu_kms,
|
||||
sprite_xcursor);
|
||||
}
|
||||
#ifdef HAVE_WAYLAND
|
||||
else if (META_IS_CURSOR_SPRITE_WAYLAND (cursor_sprite))
|
||||
{
|
||||
MetaCursorSpriteWayland *sprite_wayland =
|
||||
META_CURSOR_SPRITE_WAYLAND (cursor_sprite);
|
||||
|
||||
realize_cursor_sprite_from_wl_buffer_for_gpu (renderer,
|
||||
gpu_kms,
|
||||
sprite_wayland);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
realize_cursor_sprite (MetaCursorRenderer *renderer,
|
||||
MetaCursorSprite *cursor_sprite,
|
||||
GList *gpus)
|
||||
{
|
||||
MetaCursorRendererNative *native = META_CURSOR_RENDERER_NATIVE (renderer);
|
||||
MetaCursorRendererNativePrivate *priv =
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
GList *gpus;
|
||||
GList *l;
|
||||
|
||||
gpus = meta_monitor_manager_get_gpus (priv->monitor_manager);
|
||||
for (l = gpus; l; l = l->next)
|
||||
{
|
||||
MetaGpuKms *gpu_kms = l->data;
|
||||
|
||||
meta_cursor_renderer_native_realize_cursor_from_xcursor_for_gpu (
|
||||
renderer,
|
||||
gpu_kms,
|
||||
cursor_sprite,
|
||||
xc_image);
|
||||
realize_cursor_sprite_for_gpu (renderer, gpu_kms, cursor_sprite);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -997,12 +1116,6 @@ meta_cursor_renderer_native_class_init (MetaCursorRendererNativeClass *klass)
|
||||
|
||||
object_class->finalize = meta_cursor_renderer_native_finalize;
|
||||
renderer_class->update_cursor = meta_cursor_renderer_native_update_cursor;
|
||||
#ifdef HAVE_WAYLAND
|
||||
renderer_class->realize_cursor_from_wl_buffer =
|
||||
meta_cursor_renderer_native_realize_cursor_from_wl_buffer;
|
||||
#endif
|
||||
renderer_class->realize_cursor_from_xcursor =
|
||||
meta_cursor_renderer_native_realize_cursor_from_xcursor;
|
||||
|
||||
quark_cursor_sprite = g_quark_from_static_string ("-meta-cursor-native");
|
||||
quark_cursor_renderer_native_gpu_data =
|
||||
@@ -1017,14 +1130,13 @@ force_update_hw_cursor (MetaCursorRendererNative *native)
|
||||
meta_cursor_renderer_native_get_instance_private (native);
|
||||
|
||||
priv->hw_state_invalidated = TRUE;
|
||||
update_hw_cursor (native, meta_cursor_renderer_get_cursor (renderer));
|
||||
meta_cursor_renderer_force_update (renderer);
|
||||
}
|
||||
|
||||
static void
|
||||
on_monitors_changed (MetaMonitorManager *monitors,
|
||||
MetaCursorRendererNative *native)
|
||||
{
|
||||
/* Our tracking is all messed up, so force an update. */
|
||||
force_update_hw_cursor (native);
|
||||
}
|
||||
|
||||
@@ -1096,9 +1208,3 @@ static void
|
||||
meta_cursor_renderer_native_init (MetaCursorRendererNative *native)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
meta_cursor_renderer_native_force_update (MetaCursorRendererNative *native)
|
||||
{
|
||||
force_update_hw_cursor (native);
|
||||
}
|
||||
|
@@ -26,14 +26,13 @@
|
||||
#define META_CURSOR_RENDERER_NATIVE_H
|
||||
|
||||
#include "meta-cursor-renderer.h"
|
||||
#include "meta/meta-backend.h"
|
||||
|
||||
#define META_TYPE_CURSOR_RENDERER_NATIVE (meta_cursor_renderer_native_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (MetaCursorRendererNative, meta_cursor_renderer_native,
|
||||
META, CURSOR_RENDERER_NATIVE,
|
||||
MetaCursorRenderer)
|
||||
|
||||
void meta_cursor_renderer_native_force_update (MetaCursorRendererNative *renderer);
|
||||
|
||||
MetaCursorRendererNative * meta_cursor_renderer_native_new (MetaBackend *backend);
|
||||
|
||||
#endif /* META_CURSOR_RENDERER_NATIVE_H */
|
||||
|
@@ -47,6 +47,12 @@ typedef struct _MetaKmsSource
|
||||
MetaGpuKms *gpu_kms;
|
||||
} MetaKmsSource;
|
||||
|
||||
typedef struct _MetaGpuKmsFlipClosureContainer
|
||||
{
|
||||
GClosure *flip_closure;
|
||||
MetaGpuKms *gpu_kms;
|
||||
} MetaGpuKmsFlipClosureContainer;
|
||||
|
||||
struct _MetaGpuKms
|
||||
{
|
||||
MetaGpu parent;
|
||||
@@ -104,8 +110,10 @@ get_crtc_drm_connectors (MetaGpu *gpu,
|
||||
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
MetaCrtc *assigned_crtc;
|
||||
|
||||
if (output->crtc == crtc)
|
||||
assigned_crtc = meta_output_get_assigned_crtc (output);
|
||||
if (assigned_crtc == crtc)
|
||||
g_array_append_val (connectors_array, output->winsys_id);
|
||||
}
|
||||
|
||||
@@ -185,8 +193,10 @@ meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
|
||||
for (l = meta_gpu_get_outputs (gpu); l; l = l->next)
|
||||
{
|
||||
MetaOutput *output = l->data;
|
||||
MetaCrtc *assigned_crtc;
|
||||
|
||||
if (output->crtc == crtc)
|
||||
assigned_crtc = meta_output_get_assigned_crtc (output);
|
||||
if (assigned_crtc == crtc)
|
||||
{
|
||||
connected_crtc_found = TRUE;
|
||||
break;
|
||||
@@ -199,11 +209,26 @@ meta_gpu_kms_is_crtc_active (MetaGpuKms *gpu_kms,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
typedef struct _GpuClosureContainer
|
||||
MetaGpuKmsFlipClosureContainer *
|
||||
meta_gpu_kms_wrap_flip_closure (MetaGpuKms *gpu_kms,
|
||||
GClosure *flip_closure)
|
||||
{
|
||||
GClosure *flip_closure;
|
||||
MetaGpuKms *gpu_kms;
|
||||
} GpuClosureContainer;
|
||||
MetaGpuKmsFlipClosureContainer *closure_container;
|
||||
|
||||
closure_container = g_new0 (MetaGpuKmsFlipClosureContainer, 1);
|
||||
*closure_container = (MetaGpuKmsFlipClosureContainer) {
|
||||
.flip_closure = flip_closure,
|
||||
.gpu_kms = gpu_kms
|
||||
};
|
||||
|
||||
return closure_container;
|
||||
}
|
||||
|
||||
void
|
||||
meta_gpu_kms_flip_closure_container_free (MetaGpuKmsFlipClosureContainer *closure_container)
|
||||
{
|
||||
g_free (closure_container);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
|
||||
@@ -229,14 +254,11 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
|
||||
|
||||
if (!gpu_kms->page_flips_not_supported)
|
||||
{
|
||||
GpuClosureContainer *closure_container;
|
||||
MetaGpuKmsFlipClosureContainer *closure_container;
|
||||
int kms_fd = meta_gpu_kms_get_fd (gpu_kms);
|
||||
|
||||
closure_container = g_new0 (GpuClosureContainer, 1);
|
||||
*closure_container = (GpuClosureContainer) {
|
||||
.flip_closure = flip_closure,
|
||||
.gpu_kms = gpu_kms
|
||||
};
|
||||
closure_container = meta_gpu_kms_wrap_flip_closure (gpu_kms,
|
||||
flip_closure);
|
||||
|
||||
ret = drmModePageFlip (kms_fd,
|
||||
crtc->crtc_id,
|
||||
@@ -245,7 +267,7 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
|
||||
closure_container);
|
||||
if (ret != 0 && ret != -EACCES)
|
||||
{
|
||||
g_free (closure_container);
|
||||
meta_gpu_kms_flip_closure_container_free (closure_container);
|
||||
g_warning ("Failed to flip: %s", strerror (-ret));
|
||||
gpu_kms->page_flips_not_supported = TRUE;
|
||||
}
|
||||
@@ -276,12 +298,12 @@ page_flip_handler (int fd,
|
||||
unsigned int usec,
|
||||
void *user_data)
|
||||
{
|
||||
GpuClosureContainer *closure_container = user_data;
|
||||
MetaGpuKmsFlipClosureContainer *closure_container = user_data;
|
||||
GClosure *flip_closure = closure_container->flip_closure;
|
||||
MetaGpuKms *gpu_kms = closure_container->gpu_kms;
|
||||
|
||||
invoke_flip_closure (flip_closure, gpu_kms);
|
||||
g_free (closure_container);
|
||||
meta_gpu_kms_flip_closure_container_free (closure_container);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -778,7 +800,7 @@ meta_gpu_kms_new (MetaMonitorManagerKms *monitor_manager_kms,
|
||||
|
||||
kms_fd = meta_launcher_open_restricted (launcher, kms_file_path, error);
|
||||
if (kms_fd == -1)
|
||||
return FALSE;
|
||||
return NULL;
|
||||
|
||||
gpu_kms = g_object_new (META_TYPE_GPU_KMS,
|
||||
"monitor-manager", monitor_manager_kms,
|
||||
|
@@ -32,6 +32,8 @@
|
||||
#define META_TYPE_GPU_KMS (meta_gpu_kms_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (MetaGpuKms, meta_gpu_kms, META, GPU_KMS, MetaGpu)
|
||||
|
||||
typedef struct _MetaGpuKmsFlipClosureContainer MetaGpuKmsFlipClosureContainer;
|
||||
|
||||
typedef struct _MetaKmsResources
|
||||
{
|
||||
drmModeRes *resources;
|
||||
@@ -84,4 +86,9 @@ gboolean meta_drm_mode_equal (const drmModeModeInfo *one,
|
||||
|
||||
float meta_calculate_drm_mode_refresh_rate (const drmModeModeInfo *mode);
|
||||
|
||||
MetaGpuKmsFlipClosureContainer * meta_gpu_kms_wrap_flip_closure (MetaGpuKms *gpu_kms,
|
||||
GClosure *flip_closure);
|
||||
|
||||
void meta_gpu_kms_flip_closure_container_free (MetaGpuKmsFlipClosureContainer *closure_container);
|
||||
|
||||
#endif /* META_GPU_KMS_H */
|
||||
|
@@ -1,200 +0,0 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright 2013 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
|
||||
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "meta-idle-monitor-native.h"
|
||||
#include "meta-idle-monitor-private.h"
|
||||
|
||||
#include <meta/util.h>
|
||||
#include "display-private.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
struct _MetaIdleMonitorNative
|
||||
{
|
||||
MetaIdleMonitor parent;
|
||||
|
||||
guint64 last_event_time;
|
||||
};
|
||||
|
||||
struct _MetaIdleMonitorNativeClass
|
||||
{
|
||||
MetaIdleMonitorClass parent_class;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
MetaIdleMonitorWatch base;
|
||||
|
||||
GSource *timeout_source;
|
||||
} MetaIdleMonitorWatchNative;
|
||||
|
||||
G_DEFINE_TYPE (MetaIdleMonitorNative, meta_idle_monitor_native, META_TYPE_IDLE_MONITOR)
|
||||
|
||||
static gint64
|
||||
meta_idle_monitor_native_get_idletime (MetaIdleMonitor *monitor)
|
||||
{
|
||||
MetaIdleMonitorNative *monitor_native = META_IDLE_MONITOR_NATIVE (monitor);
|
||||
|
||||
return (g_get_monotonic_time () - monitor_native->last_event_time) / 1000;
|
||||
}
|
||||
|
||||
static guint32
|
||||
get_next_watch_serial (void)
|
||||
{
|
||||
static guint32 serial = 0;
|
||||
g_atomic_int_inc (&serial);
|
||||
return serial;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
native_dispatch_timeout (GSource *source,
|
||||
GSourceFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
MetaIdleMonitorWatchNative *watch_native = user_data;
|
||||
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) watch_native;
|
||||
|
||||
_meta_idle_monitor_watch_fire (watch);
|
||||
g_source_set_ready_time (watch_native->timeout_source, -1);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GSourceFuncs native_source_funcs = {
|
||||
NULL, /* prepare */
|
||||
NULL, /* check */
|
||||
native_dispatch_timeout,
|
||||
NULL, /* finalize */
|
||||
};
|
||||
|
||||
static void
|
||||
free_watch (gpointer data)
|
||||
{
|
||||
MetaIdleMonitorWatchNative *watch_native = data;
|
||||
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) watch_native;
|
||||
MetaIdleMonitor *monitor = watch->monitor;
|
||||
|
||||
g_object_ref (monitor);
|
||||
|
||||
if (watch->idle_source_id)
|
||||
{
|
||||
g_source_remove (watch->idle_source_id);
|
||||
watch->idle_source_id = 0;
|
||||
}
|
||||
|
||||
if (watch->notify != NULL)
|
||||
watch->notify (watch->user_data);
|
||||
|
||||
if (watch_native->timeout_source != NULL)
|
||||
g_source_destroy (watch_native->timeout_source);
|
||||
|
||||
g_object_unref (monitor);
|
||||
g_slice_free (MetaIdleMonitorWatchNative, watch_native);
|
||||
}
|
||||
|
||||
static MetaIdleMonitorWatch *
|
||||
meta_idle_monitor_native_make_watch (MetaIdleMonitor *monitor,
|
||||
guint64 timeout_msec,
|
||||
MetaIdleMonitorWatchFunc callback,
|
||||
gpointer user_data,
|
||||
GDestroyNotify notify)
|
||||
{
|
||||
MetaIdleMonitorWatchNative *watch_native;
|
||||
MetaIdleMonitorWatch *watch;
|
||||
MetaIdleMonitorNative *monitor_native = META_IDLE_MONITOR_NATIVE (monitor);
|
||||
|
||||
watch_native = g_slice_new0 (MetaIdleMonitorWatchNative);
|
||||
watch = (MetaIdleMonitorWatch *) watch_native;
|
||||
|
||||
watch->monitor = monitor;
|
||||
watch->id = get_next_watch_serial ();
|
||||
watch->callback = callback;
|
||||
watch->user_data = user_data;
|
||||
watch->notify = notify;
|
||||
watch->timeout_msec = timeout_msec;
|
||||
|
||||
if (timeout_msec != 0)
|
||||
{
|
||||
GSource *source = g_source_new (&native_source_funcs, sizeof (GSource));
|
||||
|
||||
g_source_set_callback (source, NULL, watch, NULL);
|
||||
g_source_set_ready_time (source, monitor_native->last_event_time + timeout_msec * 1000);
|
||||
g_source_attach (source, NULL);
|
||||
g_source_unref (source);
|
||||
|
||||
watch_native->timeout_source = source;
|
||||
}
|
||||
|
||||
return watch;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_native_class_init (MetaIdleMonitorNativeClass *klass)
|
||||
{
|
||||
MetaIdleMonitorClass *idle_monitor_class = META_IDLE_MONITOR_CLASS (klass);
|
||||
|
||||
idle_monitor_class->get_idletime = meta_idle_monitor_native_get_idletime;
|
||||
idle_monitor_class->make_watch = meta_idle_monitor_native_make_watch;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_native_init (MetaIdleMonitorNative *monitor_native)
|
||||
{
|
||||
MetaIdleMonitor *monitor = META_IDLE_MONITOR (monitor_native);
|
||||
|
||||
monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch);
|
||||
monitor_native->last_event_time = g_get_monotonic_time ();
|
||||
}
|
||||
|
||||
void
|
||||
meta_idle_monitor_native_reset_idletime (MetaIdleMonitor *monitor)
|
||||
{
|
||||
MetaIdleMonitorNative *monitor_native = META_IDLE_MONITOR_NATIVE (monitor);
|
||||
GList *node, *watch_ids;
|
||||
|
||||
monitor_native->last_event_time = g_get_monotonic_time ();
|
||||
|
||||
watch_ids = g_hash_table_get_keys (monitor->watches);
|
||||
|
||||
for (node = watch_ids; node != NULL; node = node->next)
|
||||
{
|
||||
guint watch_id = GPOINTER_TO_UINT (node->data);
|
||||
MetaIdleMonitorWatchNative *watch;
|
||||
|
||||
watch = g_hash_table_lookup (monitor->watches, GUINT_TO_POINTER (watch_id));
|
||||
if (!watch)
|
||||
continue;
|
||||
|
||||
if (watch->base.timeout_msec == 0)
|
||||
{
|
||||
_meta_idle_monitor_watch_fire ((MetaIdleMonitorWatch *) watch);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_source_set_ready_time (watch->timeout_source,
|
||||
monitor_native->last_event_time +
|
||||
watch->base.timeout_msec * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
g_list_free (watch_ids);
|
||||
}
|
@@ -1,43 +0,0 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright 2013 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
|
||||
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
|
||||
*/
|
||||
|
||||
#ifndef META_IDLE_MONITOR_NATIVE_H
|
||||
#define META_IDLE_MONITOR_NATIVE_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <meta/meta-idle-monitor.h>
|
||||
|
||||
#define META_TYPE_IDLE_MONITOR_NATIVE (meta_idle_monitor_native_get_type ())
|
||||
#define META_IDLE_MONITOR_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_IDLE_MONITOR_NATIVE, MetaIdleMonitorNative))
|
||||
#define META_IDLE_MONITOR_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_IDLE_MONITOR_NATIVE, MetaIdleMonitorNativeClass))
|
||||
#define META_IS_IDLE_MONITOR_NATIVE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_IDLE_MONITOR_NATIVE))
|
||||
#define META_IS_IDLE_MONITOR_NATIVE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_IDLE_MONITOR_NATIVE))
|
||||
#define META_IDLE_MONITOR_NATIVE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_IDLE_MONITOR_NATIVE, MetaIdleMonitorNativeClass))
|
||||
|
||||
typedef struct _MetaIdleMonitorNative MetaIdleMonitorNative;
|
||||
typedef struct _MetaIdleMonitorNativeClass MetaIdleMonitorNativeClass;
|
||||
|
||||
GType meta_idle_monitor_native_get_type (void);
|
||||
|
||||
void meta_idle_monitor_native_reset_idletime (MetaIdleMonitor *monitor);
|
||||
|
||||
#endif /* META_IDLE_MONITOR_NATIVE_H */
|
@@ -44,7 +44,6 @@
|
||||
#include "backends/meta-backend-private.h"
|
||||
#include "backends/native/meta-backend-native.h"
|
||||
#include "meta-cursor-renderer-native.h"
|
||||
#include "meta-idle-monitor-native.h"
|
||||
#include "meta-renderer-native.h"
|
||||
|
||||
struct _MetaLauncher
|
||||
@@ -63,20 +62,179 @@ meta_launcher_get_seat_id (MetaLauncher *launcher)
|
||||
return launcher->seat_id;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
find_systemd_session (gchar **session_id,
|
||||
GError **error)
|
||||
{
|
||||
const gchar * const graphical_session_types[] = { "wayland", "x11", "mir", NULL };
|
||||
const gchar * const active_states[] = { "active", "online", NULL };
|
||||
g_autofree gchar *class = NULL;
|
||||
g_autofree gchar *local_session_id = NULL;
|
||||
g_autofree gchar *type = NULL;
|
||||
g_autofree gchar *state = NULL;
|
||||
g_auto (GStrv) sessions = NULL;
|
||||
int n_sessions;
|
||||
int saved_errno;
|
||||
|
||||
g_assert (session_id != NULL);
|
||||
g_assert (error == NULL || *error == NULL);
|
||||
|
||||
/* if we are in a logind session, we can trust that value, so use it. This
|
||||
* happens for example when you run mutter directly from a VT but when
|
||||
* systemd starts us we will not be in a logind session. */
|
||||
saved_errno = sd_pid_get_session (0, &local_session_id);
|
||||
if (saved_errno < 0)
|
||||
{
|
||||
if (saved_errno != -ENODATA)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Failed to get session by pid for user %d (%s)",
|
||||
getuid (),
|
||||
g_strerror (-saved_errno));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*session_id = g_steal_pointer (&local_session_id);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
saved_errno = sd_uid_get_display (getuid (), &local_session_id);
|
||||
if (saved_errno < 0)
|
||||
{
|
||||
/* no session, maybe there's a greeter session */
|
||||
if (saved_errno == -ENODATA)
|
||||
{
|
||||
n_sessions = sd_uid_get_sessions (getuid (), 1, &sessions);
|
||||
if (n_sessions < 0)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Failed to get all sessions for user %d (%m)",
|
||||
getuid ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (n_sessions == 0)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"User %d has no sessions",
|
||||
getuid ());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (int i = 0; i < n_sessions; ++i)
|
||||
{
|
||||
saved_errno = sd_session_get_class (sessions[i], &class);
|
||||
if (saved_errno < 0)
|
||||
{
|
||||
g_warning ("Couldn't get class for session '%d': %s",
|
||||
i,
|
||||
g_strerror (-saved_errno));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (g_strcmp0 (class, "greeter") == 0)
|
||||
{
|
||||
local_session_id = g_strdup (sessions[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!local_session_id)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Couldn't find a session or a greeter session for user %d",
|
||||
getuid ());
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Couldn't get display for user %d: %s",
|
||||
getuid (),
|
||||
g_strerror (-saved_errno));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
/* sd_uid_get_display will return any session if there is no graphical
|
||||
* one, so let's check it really is graphical. */
|
||||
saved_errno = sd_session_get_type (local_session_id, &type);
|
||||
if (saved_errno < 0)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Couldn't get type for session '%s': %s",
|
||||
local_session_id,
|
||||
g_strerror (-saved_errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!g_strv_contains (graphical_session_types, type))
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Session '%s' is not a graphical session (type: '%s')",
|
||||
local_session_id,
|
||||
type);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* and display sessions can be 'closing' if they are logged out but
|
||||
* some processes are lingering; we shouldn't consider these */
|
||||
saved_errno = sd_session_get_state (local_session_id, &state);
|
||||
if (saved_errno < 0)
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Couldn't get state for session '%s': %s",
|
||||
local_session_id,
|
||||
g_strerror (-saved_errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!g_strv_contains (active_states, state))
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Session '%s' is not active",
|
||||
local_session_id);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*session_id = g_steal_pointer (&local_session_id);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Login1Session *
|
||||
get_session_proxy (GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
g_autofree char *proxy_path = NULL;
|
||||
g_autofree char *session_id = NULL;
|
||||
g_autoptr (GError) local_error = NULL;
|
||||
Login1Session *session_proxy;
|
||||
|
||||
if (sd_pid_get_session (getpid (), &session_id) < 0)
|
||||
if (!find_systemd_session (&session_id, &local_error))
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Could not get session ID: %m");
|
||||
g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -303,17 +461,14 @@ on_active_changed (Login1Session *session,
|
||||
static gchar *
|
||||
get_seat_id (GError **error)
|
||||
{
|
||||
g_autoptr (GError) local_error = NULL;
|
||||
g_autofree char *session_id = NULL;
|
||||
char *seat_id = NULL;
|
||||
int r;
|
||||
|
||||
r = sd_pid_get_session (0, &session_id);
|
||||
if (r < 0)
|
||||
if (!find_systemd_session (&session_id, &local_error))
|
||||
{
|
||||
g_set_error (error,
|
||||
G_IO_ERROR,
|
||||
G_IO_ERROR_NOT_FOUND,
|
||||
"Could not get session for PID: %s", g_strerror (-r));
|
||||
g_propagate_prefixed_error (error, local_error, "Could not get session ID: ");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -46,7 +46,7 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <meta/main.h>
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
|
||||
#include <gudev/gudev.h>
|
||||
|
||||
@@ -188,7 +188,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
MetaOutput *output = g_ptr_array_index (crtc_info->outputs, j);
|
||||
|
||||
output->is_dirty = TRUE;
|
||||
output->crtc = crtc;
|
||||
meta_output_assign_crtc (output, crtc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
continue;
|
||||
}
|
||||
|
||||
output->crtc = NULL;
|
||||
meta_output_unassign_crtc (output);
|
||||
output->is_primary = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -674,7 +674,7 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
|
||||
gpu_paths = get_gpu_paths (manager_kms, GPU_TYPE_SECONDARY, primary_gpu_path);
|
||||
for (l = gpu_paths; l; l = l->next)
|
||||
{
|
||||
GError *secondary_error = NULL;
|
||||
g_autoptr (GError) secondary_error = NULL;
|
||||
char *gpu_path = l->data;
|
||||
MetaGpuKms *gpu_kms;
|
||||
|
||||
@@ -683,7 +683,7 @@ meta_monitor_manager_kms_initable_init (GInitable *initable,
|
||||
{
|
||||
g_warning ("Failed to open secondary gpu '%s': %s",
|
||||
gpu_path, secondary_error->message);
|
||||
g_error_free (secondary_error);
|
||||
continue;
|
||||
}
|
||||
|
||||
meta_monitor_manager_add_gpu (META_MONITOR_MANAGER (manager_kms),
|
||||
|
@@ -64,11 +64,13 @@ typedef struct _MetaOutputKms
|
||||
void
|
||||
meta_output_kms_set_underscan (MetaOutput *output)
|
||||
{
|
||||
if (!output->crtc)
|
||||
MetaCrtc *crtc;
|
||||
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
if (!crtc)
|
||||
return;
|
||||
|
||||
meta_crtc_kms_set_underscan (output->crtc,
|
||||
output->is_underscanning);
|
||||
meta_crtc_kms_set_underscan (crtc, output->is_underscanning);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -600,14 +602,14 @@ meta_create_kms_output (MetaGpuKms *gpu_kms,
|
||||
|
||||
if (crtc->crtc_id == output_kms->current_encoder->crtc_id)
|
||||
{
|
||||
output->crtc = crtc;
|
||||
meta_output_assign_crtc (output, crtc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
output->crtc = NULL;
|
||||
meta_output_unassign_crtc (output);
|
||||
}
|
||||
|
||||
if (old_output)
|
||||
|
@@ -103,8 +103,6 @@ typedef struct _MetaRendererNativeGpuData
|
||||
|
||||
MetaRendererNativeMode mode;
|
||||
|
||||
gboolean no_add_fb2;
|
||||
|
||||
EGLDisplay egl_display;
|
||||
|
||||
/*
|
||||
@@ -193,6 +191,8 @@ struct _MetaRendererNative
|
||||
MetaMonitorManagerKms *monitor_manager_kms;
|
||||
MetaGles3 *gles3;
|
||||
|
||||
gboolean use_modifiers;
|
||||
|
||||
GHashTable *gpu_datas;
|
||||
|
||||
CoglClosure *swap_notify_idle;
|
||||
@@ -991,14 +991,29 @@ meta_renderer_native_choose_egl_config (CoglDisplay *cogl_display,
|
||||
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
MetaEgl *egl = meta_backend_get_egl (backend);
|
||||
MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform;
|
||||
EGLDisplay egl_display = cogl_renderer_egl->edpy;
|
||||
|
||||
return choose_egl_config_from_gbm_format (egl,
|
||||
egl_display,
|
||||
attributes,
|
||||
GBM_FORMAT_XRGB8888,
|
||||
out_config,
|
||||
error);
|
||||
switch (renderer_gpu_data->mode)
|
||||
{
|
||||
case META_RENDERER_NATIVE_MODE_GBM:
|
||||
return choose_egl_config_from_gbm_format (egl,
|
||||
egl_display,
|
||||
attributes,
|
||||
GBM_FORMAT_XRGB8888,
|
||||
out_config,
|
||||
error);
|
||||
#ifdef HAVE_EGL_DEVICE
|
||||
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
|
||||
return meta_egl_choose_first_config (egl,
|
||||
egl_display,
|
||||
attributes,
|
||||
out_config,
|
||||
error);
|
||||
#endif
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1269,6 +1284,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
|
||||
MetaRendererNativeGpuData *renderer_gpu_data;
|
||||
EGLDisplay *egl_display;
|
||||
MetaEgl *egl = meta_onscreen_native_get_egl (onscreen_native);
|
||||
MetaGpuKmsFlipClosureContainer *closure_container;
|
||||
EGLAttrib *acquire_attribs;
|
||||
GError *error = NULL;
|
||||
|
||||
@@ -1278,9 +1294,12 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
|
||||
if (renderer_gpu_data->egl.no_egl_output_drm_flip_event)
|
||||
return FALSE;
|
||||
|
||||
closure_container =
|
||||
meta_gpu_kms_wrap_flip_closure (onscreen_native->render_gpu, flip_closure);
|
||||
|
||||
acquire_attribs = (EGLAttrib[]) {
|
||||
EGL_DRM_FLIP_EVENT_DATA_NV,
|
||||
(EGLAttrib) flip_closure,
|
||||
(EGLAttrib) closure_container,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
@@ -1299,6 +1318,7 @@ flip_egl_stream (MetaOnscreenNative *onscreen_native,
|
||||
renderer_gpu_data->egl.no_egl_output_drm_flip_event = TRUE;
|
||||
}
|
||||
g_error_free (error);
|
||||
meta_gpu_kms_flip_closure_container_free (closure_container);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1586,6 +1606,7 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
|
||||
struct gbm_bo **out_next_bo,
|
||||
uint32_t *out_next_fb_id)
|
||||
{
|
||||
MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
|
||||
struct gbm_bo *next_bo;
|
||||
uint32_t next_fb_id;
|
||||
int kms_fd;
|
||||
@@ -1598,6 +1619,12 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
|
||||
/* Now we need to set the CRTC to whatever is the front buffer */
|
||||
next_bo = gbm_surface_lock_front_buffer (gbm_surface);
|
||||
|
||||
if (!next_bo)
|
||||
{
|
||||
g_error ("Impossible to lock surface front buffer: %m");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; i < gbm_bo_get_plane_count (next_bo); i++)
|
||||
{
|
||||
strides[i] = gbm_bo_get_stride_for_plane (next_bo, i);
|
||||
@@ -1608,7 +1635,8 @@ gbm_get_next_fb_id (MetaGpuKms *gpu_kms,
|
||||
|
||||
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
|
||||
|
||||
if (modifiers[0] != DRM_FORMAT_MOD_INVALID)
|
||||
if (renderer_native->use_modifiers &&
|
||||
modifiers[0] != DRM_FORMAT_MOD_INVALID)
|
||||
{
|
||||
if (drmModeAddFB2WithModifiers (kms_fd,
|
||||
gbm_bo_get_width (next_bo),
|
||||
@@ -1854,18 +1882,18 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
||||
frame_info = g_queue_peek_tail (&onscreen->pending_frame_infos);
|
||||
frame_info->global_frame_counter = renderer_native->frame_counter;
|
||||
|
||||
/*
|
||||
* Wait for the flip callback before continuing, as we might have started the
|
||||
* animation earlier due to the animation being driven by some other monitor.
|
||||
*/
|
||||
wait_for_pending_flips (onscreen);
|
||||
|
||||
update_secondary_gpu_state_pre_swap_buffers (onscreen);
|
||||
|
||||
parent_vtable->onscreen_swap_buffers_with_damage (onscreen,
|
||||
rectangles,
|
||||
n_rectangles);
|
||||
|
||||
/*
|
||||
* Wait for the flip callback before continuing, as we might have started the
|
||||
* animation earlier due to the animation being driven by some other monitor.
|
||||
*/
|
||||
wait_for_pending_flips (onscreen);
|
||||
|
||||
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
||||
render_gpu);
|
||||
switch (renderer_gpu_data->mode)
|
||||
@@ -1907,12 +1935,7 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
|
||||
* context.
|
||||
*/
|
||||
if (egl_context_changed)
|
||||
{
|
||||
_cogl_winsys_egl_make_current (cogl_display,
|
||||
EGL_NO_SURFACE,
|
||||
EGL_NO_SURFACE,
|
||||
EGL_NO_CONTEXT);
|
||||
}
|
||||
_cogl_winsys_egl_ensure_current (cogl_display);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1996,7 +2019,7 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
|
||||
CoglRenderer *cogl_renderer = cogl_display->renderer;
|
||||
CoglRendererEGL *cogl_renderer_egl = cogl_renderer->winsys;
|
||||
MetaRendererNativeGpuData *renderer_gpu_data = cogl_renderer_egl->platform;
|
||||
struct gbm_surface *new_gbm_surface;
|
||||
struct gbm_surface *new_gbm_surface = NULL;
|
||||
EGLNativeWindowType egl_native_window;
|
||||
EGLSurface new_egl_surface;
|
||||
uint32_t format = GBM_FORMAT_XRGB8888;
|
||||
@@ -2006,7 +2029,10 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
|
||||
meta_renderer_native_get_gpu_data (renderer_native,
|
||||
onscreen_native->render_gpu);
|
||||
|
||||
modifiers = get_supported_modifiers (onscreen, format);
|
||||
if (renderer_native->use_modifiers)
|
||||
modifiers = get_supported_modifiers (onscreen, format);
|
||||
else
|
||||
modifiers = NULL;
|
||||
|
||||
if (modifiers)
|
||||
{
|
||||
@@ -2017,7 +2043,8 @@ meta_renderer_native_create_surface_gbm (CoglOnscreen *onscreen,
|
||||
modifiers->len);
|
||||
g_array_free (modifiers, TRUE);
|
||||
}
|
||||
else
|
||||
|
||||
if (!new_gbm_surface)
|
||||
{
|
||||
uint32_t flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING;
|
||||
|
||||
@@ -2080,6 +2107,7 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
|
||||
EGLDisplay egl_display = renderer_gpu_data->egl_display;
|
||||
MetaMonitor *monitor;
|
||||
MetaOutput *output;
|
||||
MetaCrtc *crtc;
|
||||
EGLConfig egl_config;
|
||||
EGLStreamKHR egl_stream;
|
||||
EGLSurface egl_surface;
|
||||
@@ -2103,6 +2131,7 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
|
||||
|
||||
monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
|
||||
output = meta_monitor_get_main_output (monitor);
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
|
||||
/*
|
||||
* An "logical_monitor" may have multiple outputs/crtcs in case its tiled,
|
||||
@@ -2110,7 +2139,7 @@ meta_renderer_native_create_surface_egl_device (CoglOnscreen *onscreen,
|
||||
* lets pass the first one.
|
||||
*/
|
||||
output_attribs[0] = EGL_DRM_CRTC_EXT;
|
||||
output_attribs[1] = output->crtc->crtc_id;
|
||||
output_attribs[1] = crtc->crtc_id;
|
||||
output_attribs[2] = EGL_NONE;
|
||||
|
||||
if (!meta_egl_get_output_layers (egl, egl_display,
|
||||
@@ -2167,14 +2196,15 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
|
||||
uint32_t format,
|
||||
GError **error)
|
||||
{
|
||||
MetaRendererNative *renderer_native = meta_renderer_native_from_gpu (gpu_kms);
|
||||
MetaRendererNativeGpuData *renderer_gpu_data;
|
||||
struct drm_mode_create_dumb create_arg;
|
||||
struct drm_mode_destroy_dumb destroy_arg;
|
||||
struct drm_mode_map_dumb map_arg;
|
||||
uint32_t fb_id = 0;
|
||||
void *map;
|
||||
int kms_fd;
|
||||
uint32_t handles[4] = { 0, };
|
||||
uint32_t pitches[4] = { 0, };
|
||||
uint32_t offsets[4] = { 0, };
|
||||
|
||||
kms_fd = meta_gpu_kms_get_fd (gpu_kms);
|
||||
|
||||
@@ -2192,25 +2222,18 @@ init_dumb_fb (MetaDumbBuffer *dumb_fb,
|
||||
goto err_ioctl;
|
||||
}
|
||||
|
||||
renderer_gpu_data = meta_renderer_native_get_gpu_data (renderer_native,
|
||||
gpu_kms);
|
||||
if (!renderer_gpu_data->no_add_fb2)
|
||||
{
|
||||
uint32_t handles[4] = { create_arg.handle, };
|
||||
uint32_t pitches[4] = { create_arg.pitch, };
|
||||
uint32_t offsets[4] = { 0 };
|
||||
handles[0] = create_arg.handle;
|
||||
pitches[0] = create_arg.pitch;
|
||||
|
||||
if (drmModeAddFB2 (kms_fd, width, height, format,
|
||||
handles, pitches, offsets,
|
||||
&fb_id, 0) != 0)
|
||||
{
|
||||
g_warning ("drmModeAddFB2 failed (%s), falling back to drmModeAddFB",
|
||||
g_strerror (errno));
|
||||
renderer_gpu_data->no_add_fb2 = TRUE;
|
||||
}
|
||||
if (drmModeAddFB2 (kms_fd, width, height, format,
|
||||
handles, pitches, offsets,
|
||||
&fb_id, 0) != 0)
|
||||
{
|
||||
g_debug ("drmModeAddFB2 failed (%s), falling back to drmModeAddFB",
|
||||
g_strerror (errno));
|
||||
}
|
||||
|
||||
if (renderer_gpu_data->no_add_fb2)
|
||||
if (fb_id == 0)
|
||||
{
|
||||
if (drmModeAddFB (kms_fd, width, height,
|
||||
24 /* depth of RGBX8888 */,
|
||||
@@ -2708,12 +2731,10 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
|
||||
{
|
||||
MetaMonitor *main_monitor;
|
||||
MetaOutput *main_output;
|
||||
MetaMonitorTransform crtc_transform;
|
||||
MetaCrtc *crtc;
|
||||
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
|
||||
main_output = meta_monitor_get_main_output (main_monitor);
|
||||
crtc_transform =
|
||||
meta_monitor_logical_to_crtc_transform (main_monitor,
|
||||
logical_monitor->transform);
|
||||
crtc = meta_output_get_assigned_crtc (main_output);
|
||||
|
||||
/*
|
||||
* Pick any monitor and output and check; all CRTCs of a logical monitor will
|
||||
@@ -2721,11 +2742,11 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
|
||||
*/
|
||||
|
||||
if (meta_monitor_manager_is_transform_handled (monitor_manager,
|
||||
main_output->crtc,
|
||||
crtc_transform))
|
||||
crtc,
|
||||
crtc->transform))
|
||||
return META_MONITOR_TRANSFORM_NORMAL;
|
||||
else
|
||||
return crtc_transform;
|
||||
return crtc->transform;
|
||||
}
|
||||
|
||||
static MetaRendererView *
|
||||
@@ -2898,10 +2919,11 @@ meta_renderer_native_set_property (GObject *object,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
create_secondary_egl_config (MetaEgl *egl,
|
||||
EGLDisplay egl_display,
|
||||
EGLConfig *egl_config,
|
||||
GError **error)
|
||||
create_secondary_egl_config (MetaEgl *egl,
|
||||
MetaRendererNativeMode mode,
|
||||
EGLDisplay egl_display,
|
||||
EGLConfig *egl_config,
|
||||
GError **error)
|
||||
{
|
||||
EGLint attributes[] = {
|
||||
EGL_RED_SIZE, 1,
|
||||
@@ -2914,12 +2936,26 @@ create_secondary_egl_config (MetaEgl *egl,
|
||||
EGL_NONE
|
||||
};
|
||||
|
||||
return choose_egl_config_from_gbm_format (egl,
|
||||
egl_display,
|
||||
attributes,
|
||||
GBM_FORMAT_XRGB8888,
|
||||
egl_config,
|
||||
error);
|
||||
switch (mode)
|
||||
{
|
||||
case META_RENDERER_NATIVE_MODE_GBM:
|
||||
return choose_egl_config_from_gbm_format (egl,
|
||||
egl_display,
|
||||
attributes,
|
||||
GBM_FORMAT_XRGB8888,
|
||||
egl_config,
|
||||
error);
|
||||
#ifdef HAVE_EGL_DEVICE
|
||||
case META_RENDERER_NATIVE_MODE_EGL_DEVICE:
|
||||
return meta_egl_choose_first_config (egl,
|
||||
egl_display,
|
||||
attributes,
|
||||
egl_config,
|
||||
error);
|
||||
#endif
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static EGLContext
|
||||
@@ -2963,7 +2999,8 @@ init_secondary_gpu_data_gpu (MetaRendererNativeGpuData *renderer_gpu_data,
|
||||
EGLContext egl_context;
|
||||
char **missing_gl_extensions;
|
||||
|
||||
if (!create_secondary_egl_config (egl,egl_display, &egl_config, error))
|
||||
if (!create_secondary_egl_config (egl, renderer_gpu_data->mode, egl_display,
|
||||
&egl_config, error))
|
||||
return FALSE;
|
||||
|
||||
egl_context = create_secondary_egl_context (egl, egl_display, egl_config, error);
|
||||
@@ -3389,6 +3426,22 @@ meta_renderer_native_finalize (GObject *object)
|
||||
G_OBJECT_CLASS (meta_renderer_native_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_renderer_native_constructed (GObject *object)
|
||||
{
|
||||
MetaRendererNative *renderer_native = META_RENDERER_NATIVE (object);
|
||||
MetaMonitorManager *monitor_manager =
|
||||
META_MONITOR_MANAGER (renderer_native->monitor_manager_kms);
|
||||
MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
|
||||
MetaSettings *settings = meta_backend_get_settings (backend);
|
||||
|
||||
if (meta_settings_is_experimental_feature_enabled (
|
||||
settings, META_EXPERIMENTAL_FEATURE_KMS_MODIFIERS))
|
||||
renderer_native->use_modifiers = TRUE;
|
||||
|
||||
G_OBJECT_CLASS (meta_renderer_native_parent_class)->constructed (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_renderer_native_init (MetaRendererNative *renderer_native)
|
||||
{
|
||||
@@ -3407,6 +3460,7 @@ meta_renderer_native_class_init (MetaRendererNativeClass *klass)
|
||||
object_class->get_property = meta_renderer_native_get_property;
|
||||
object_class->set_property = meta_renderer_native_set_property;
|
||||
object_class->finalize = meta_renderer_native_finalize;
|
||||
object_class->constructed = meta_renderer_native_constructed;
|
||||
|
||||
renderer_class->create_cogl_renderer = meta_renderer_native_create_cogl_renderer;
|
||||
renderer_class->create_view = meta_renderer_native_create_view;
|
||||
|
231
src/backends/x11/cm/meta-cursor-sprite-xfixes.c
Normal file
231
src/backends/x11/cm/meta-cursor-sprite-xfixes.c
Normal file
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* Copyright 2013, 2018 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "backends/x11/cm/meta-cursor-sprite-xfixes.h"
|
||||
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#include "core/display-private.h"
|
||||
#include "meta/meta-x11-display.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_DISPLAY,
|
||||
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
static GParamSpec *obj_props[N_PROPS];
|
||||
|
||||
struct _MetaCursorSpriteXfixes
|
||||
{
|
||||
MetaCursorSprite parent;
|
||||
|
||||
MetaDisplay *display;
|
||||
};
|
||||
|
||||
static void
|
||||
meta_screen_cast_xfixes_init_initable_iface (GInitableIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (MetaCursorSpriteXfixes,
|
||||
meta_cursor_sprite_xfixes,
|
||||
META_TYPE_CURSOR_SPRITE,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
|
||||
meta_screen_cast_xfixes_init_initable_iface))
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xfixes_realize_texture (MetaCursorSprite *sprite)
|
||||
{
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_cursor_sprite_xfixes_is_animated (MetaCursorSprite *sprite)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xfixes_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MetaCursorSpriteXfixes *sprite_xfixes = META_CURSOR_SPRITE_XFIXES (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
g_value_set_object (value, sprite_xfixes->display);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xfixes_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
MetaCursorSpriteXfixes *sprite_xfixes = META_CURSOR_SPRITE_XFIXES (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DISPLAY:
|
||||
sprite_xfixes->display = g_value_get_object (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MetaCursorSpriteXfixes *
|
||||
meta_cursor_sprite_xfixes_new (MetaDisplay *display,
|
||||
GError **error)
|
||||
{
|
||||
return g_initable_new (META_TYPE_CURSOR_SPRITE_XFIXES,
|
||||
NULL, error,
|
||||
"display", display,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_cursor_sprite_xfixes_initable_init (GInitable *initable,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
MetaCursorSpriteXfixes *sprite_xfixes =
|
||||
META_CURSOR_SPRITE_XFIXES (initable);
|
||||
MetaCursorSprite *sprite = META_CURSOR_SPRITE (sprite_xfixes);
|
||||
MetaX11Display *x11_display;
|
||||
Display *xdisplay;
|
||||
XFixesCursorImage *cursor_image;
|
||||
CoglTexture2D *texture;
|
||||
uint8_t *cursor_data;
|
||||
gboolean free_cursor_data;
|
||||
ClutterBackend *clutter_backend;
|
||||
CoglContext *cogl_context;
|
||||
|
||||
x11_display = meta_display_get_x11_display (sprite_xfixes->display);
|
||||
xdisplay = meta_x11_display_get_xdisplay (x11_display);
|
||||
cursor_image = XFixesGetCursorImage (xdisplay);
|
||||
if (!cursor_image)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
|
||||
"Failed to get cursor image");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Like all X APIs, XFixesGetCursorImage() returns arrays of 32-bit
|
||||
* quantities as arrays of long; we need to convert on 64 bit
|
||||
*/
|
||||
if (sizeof (long) == 4)
|
||||
{
|
||||
cursor_data = (uint8_t *) cursor_image->pixels;
|
||||
free_cursor_data = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int i, j;
|
||||
uint32_t *cursor_words;
|
||||
unsigned long *p;
|
||||
uint32_t *q;
|
||||
|
||||
cursor_words = g_new (uint32_t,
|
||||
cursor_image->width * cursor_image->height);
|
||||
cursor_data = (uint8_t *) cursor_words;
|
||||
|
||||
p = cursor_image->pixels;
|
||||
q = cursor_words;
|
||||
for (j = 0; j < cursor_image->height; j++)
|
||||
{
|
||||
for (i = 0; i < cursor_image->width; i++)
|
||||
*(q++) = *(p++);
|
||||
}
|
||||
|
||||
free_cursor_data = TRUE;
|
||||
}
|
||||
|
||||
clutter_backend = clutter_get_default_backend ();
|
||||
cogl_context = clutter_backend_get_cogl_context (clutter_backend);
|
||||
texture = cogl_texture_2d_new_from_data (cogl_context,
|
||||
cursor_image->width,
|
||||
cursor_image->height,
|
||||
CLUTTER_CAIRO_FORMAT_ARGB32,
|
||||
cursor_image->width * 4, /* stride */
|
||||
cursor_data,
|
||||
error);
|
||||
|
||||
if (free_cursor_data)
|
||||
g_free (cursor_data);
|
||||
|
||||
if (!sprite)
|
||||
return FALSE;
|
||||
|
||||
meta_cursor_sprite_set_texture (sprite,
|
||||
COGL_TEXTURE (texture),
|
||||
cursor_image->xhot,
|
||||
cursor_image->yhot);
|
||||
cogl_object_unref (texture);
|
||||
XFree (cursor_image);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_screen_cast_xfixes_init_initable_iface (GInitableIface *iface)
|
||||
{
|
||||
iface->init = meta_cursor_sprite_xfixes_initable_init;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xfixes_init (MetaCursorSpriteXfixes *sprite_xfixes)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
meta_cursor_sprite_xfixes_class_init (MetaCursorSpriteXfixesClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MetaCursorSpriteClass *cursor_sprite_class = META_CURSOR_SPRITE_CLASS (klass);
|
||||
|
||||
object_class->get_property = meta_cursor_sprite_xfixes_get_property;
|
||||
object_class->set_property = meta_cursor_sprite_xfixes_set_property;
|
||||
|
||||
cursor_sprite_class->realize_texture =
|
||||
meta_cursor_sprite_xfixes_realize_texture;
|
||||
cursor_sprite_class->is_animated = meta_cursor_sprite_xfixes_is_animated;
|
||||
|
||||
obj_props[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
"display",
|
||||
"MetaDisplay",
|
||||
META_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
g_object_class_install_properties (object_class, N_PROPS, obj_props);
|
||||
}
|
36
src/backends/x11/cm/meta-cursor-sprite-xfixes.h
Normal file
36
src/backends/x11/cm/meta-cursor-sprite-xfixes.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2013, 2018 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef META_CURSOR_SPRITE_XFIXES_H
|
||||
#define META_CURSOR_SPRITE_XFIXES_H
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "backends/meta-cursor.h"
|
||||
#include "meta/types.h"
|
||||
|
||||
#define META_TYPE_CURSOR_SPRITE_XFIXES (meta_cursor_sprite_xfixes_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (MetaCursorSpriteXfixes,
|
||||
meta_cursor_sprite_xfixes,
|
||||
META, CURSOR_SPRITE_XFIXES,
|
||||
MetaCursorSprite)
|
||||
|
||||
MetaCursorSpriteXfixes * meta_cursor_sprite_xfixes_new (MetaDisplay *display,
|
||||
GError **error);
|
||||
|
||||
#endif /* META_CURSOR_SPRITE_XFIXES_H */
|
@@ -37,8 +37,7 @@
|
||||
#include <X11/Xlib-xcb.h>
|
||||
#include <xkbcommon/xkbcommon-x11.h>
|
||||
|
||||
#include "meta-idle-monitor-xsync.h"
|
||||
#include "backends/meta-stage.h"
|
||||
#include "backends/meta-stage-private.h"
|
||||
#include "backends/x11/meta-clutter-backend-x11.h"
|
||||
#include "backends/x11/meta-renderer-x11.h"
|
||||
#include "meta/meta-cursor-tracker.h"
|
||||
@@ -47,6 +46,7 @@
|
||||
#include "display-private.h"
|
||||
#include "compositor/compositor-private.h"
|
||||
#include "backends/meta-dnd-private.h"
|
||||
#include "backends/meta-idle-monitor-private.h"
|
||||
|
||||
struct _MetaBackendX11Private
|
||||
{
|
||||
@@ -57,6 +57,8 @@ struct _MetaBackendX11Private
|
||||
|
||||
int xsync_event_base;
|
||||
int xsync_error_base;
|
||||
XSyncAlarm user_active_alarm;
|
||||
XSyncCounter counter;
|
||||
|
||||
int xinput_opcode;
|
||||
int xinput_event_base;
|
||||
@@ -83,13 +85,77 @@ G_DEFINE_TYPE_WITH_CODE (MetaBackendX11, meta_backend_x11, META_TYPE_BACKEND,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
|
||||
initable_iface_init));
|
||||
|
||||
|
||||
static void
|
||||
handle_alarm_notify (MetaBackend *backend,
|
||||
XEvent *event)
|
||||
uint64_to_xsync_value (uint64_t value,
|
||||
XSyncValue *xsync_value)
|
||||
{
|
||||
meta_backend_foreach_device_monitor (backend,
|
||||
(GFunc) meta_idle_monitor_xsync_handle_xevent,
|
||||
event);
|
||||
XSyncIntsToValue (xsync_value, value & 0xffffffff, value >> 32);
|
||||
}
|
||||
|
||||
static XSyncAlarm
|
||||
xsync_user_active_alarm_set (MetaBackendX11Private *priv)
|
||||
{
|
||||
XSyncAlarmAttributes attr;
|
||||
XSyncValue delta;
|
||||
unsigned long flags;
|
||||
|
||||
flags = (XSyncCACounter | XSyncCAValueType | XSyncCATestType |
|
||||
XSyncCAValue | XSyncCADelta | XSyncCAEvents);
|
||||
|
||||
XSyncIntToValue (&delta, 0);
|
||||
attr.trigger.counter = priv->counter;
|
||||
attr.trigger.value_type = XSyncAbsolute;
|
||||
attr.delta = delta;
|
||||
attr.events = TRUE;
|
||||
|
||||
uint64_to_xsync_value (1, &attr.trigger.wait_value);
|
||||
|
||||
attr.trigger.test_type = XSyncNegativeTransition;
|
||||
return XSyncCreateAlarm (priv->xdisplay, flags, &attr);
|
||||
}
|
||||
|
||||
static XSyncCounter
|
||||
find_idletime_counter (MetaBackendX11Private *priv)
|
||||
{
|
||||
int i;
|
||||
int n_counters;
|
||||
XSyncSystemCounter *counters;
|
||||
XSyncCounter counter = None;
|
||||
|
||||
counters = XSyncListSystemCounters (priv->xdisplay, &n_counters);
|
||||
for (i = 0; i < n_counters; i++)
|
||||
{
|
||||
if (g_strcmp0 (counters[i].name, "IDLETIME") == 0)
|
||||
{
|
||||
counter = counters[i].counter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
XSyncFreeSystemCounterList (counters);
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
static void
|
||||
handle_alarm_notify (MetaBackend *backend,
|
||||
XSyncAlarmNotifyEvent *alarm_event)
|
||||
{
|
||||
MetaBackendX11 *x11 = META_BACKEND_X11 (backend);
|
||||
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
|
||||
MetaIdleMonitor *idle_monitor;
|
||||
XSyncAlarmAttributes attr;
|
||||
|
||||
if (alarm_event->state != XSyncAlarmActive ||
|
||||
alarm_event->alarm != priv->user_active_alarm)
|
||||
return;
|
||||
|
||||
attr.events = TRUE;
|
||||
XSyncChangeAlarm (priv->xdisplay, priv->user_active_alarm,
|
||||
XSyncCAEvents, &attr);
|
||||
|
||||
idle_monitor = meta_backend_get_idle_monitor (backend, 0);
|
||||
meta_idle_monitor_reset_idletime (idle_monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -110,7 +176,7 @@ translate_device_event (MetaBackendX11 *x11,
|
||||
|
||||
meta_backend_x11_translate_device_event (x11, device_event);
|
||||
|
||||
if (!device_event->send_event && device_event->time != CurrentTime)
|
||||
if (!device_event->send_event && device_event->time != META_CURRENT_TIME)
|
||||
{
|
||||
if (XSERVER_TIME_IS_BEFORE (device_event->time, priv->latest_evtime))
|
||||
{
|
||||
@@ -266,7 +332,7 @@ handle_host_xevent (MetaBackend *backend,
|
||||
if (meta_plugin_manager_xevent_filter (compositor->plugin_mgr, event))
|
||||
bypass_clutter = TRUE;
|
||||
|
||||
if (meta_dnd_handle_xdnd_event (backend, compositor, display, event))
|
||||
if (meta_dnd_handle_xdnd_event (backend, compositor, priv->xdisplay, event))
|
||||
bypass_clutter = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -275,7 +341,7 @@ handle_host_xevent (MetaBackend *backend,
|
||||
bypass_clutter);
|
||||
|
||||
if (event->type == (priv->xsync_event_base + XSyncAlarmNotify))
|
||||
handle_alarm_notify (backend, event);
|
||||
handle_alarm_notify (backend, (XSyncAlarmNotifyEvent *) event);
|
||||
|
||||
if (event->type == priv->xkb_event_base)
|
||||
{
|
||||
@@ -423,6 +489,12 @@ meta_backend_x11_post_init (MetaBackend *backend)
|
||||
!XSyncInitialize (priv->xdisplay, &major, &minor))
|
||||
meta_fatal ("Could not initialize XSync");
|
||||
|
||||
priv->counter = find_idletime_counter (priv);
|
||||
if (priv->counter == None)
|
||||
meta_fatal ("Could not initialize XSync counter");
|
||||
|
||||
priv->user_active_alarm = xsync_user_active_alarm_set (priv);
|
||||
|
||||
if (XQueryExtension (priv->xdisplay,
|
||||
"XInputExtension",
|
||||
&priv->xinput_opcode,
|
||||
@@ -464,15 +536,6 @@ meta_backend_x11_create_clutter_backend (MetaBackend *backend)
|
||||
return g_object_new (META_TYPE_CLUTTER_BACKEND_X11, NULL);
|
||||
}
|
||||
|
||||
static MetaIdleMonitor *
|
||||
meta_backend_x11_create_idle_monitor (MetaBackend *backend,
|
||||
int device_id)
|
||||
{
|
||||
return g_object_new (META_TYPE_IDLE_MONITOR_XSYNC,
|
||||
"device-id", device_id,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_backend_x11_grab_device (MetaBackend *backend,
|
||||
int device_id,
|
||||
@@ -484,7 +547,7 @@ meta_backend_x11_grab_device (MetaBackend *backend,
|
||||
XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
|
||||
int ret;
|
||||
|
||||
if (timestamp != CurrentTime)
|
||||
if (timestamp != META_CURRENT_TIME)
|
||||
timestamp = MAX (timestamp, priv->latest_evtime);
|
||||
|
||||
XISetMask (mask.mask, XI_ButtonPress);
|
||||
@@ -679,14 +742,30 @@ initable_iface_init (GInitableIface *initable_iface)
|
||||
initable_iface->init = meta_backend_x11_initable_init;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_backend_x11_finalize (GObject *object)
|
||||
{
|
||||
MetaBackendX11 *x11 = META_BACKEND_X11 (object);
|
||||
MetaBackendX11Private *priv = meta_backend_x11_get_instance_private (x11);
|
||||
|
||||
if (priv->user_active_alarm != None)
|
||||
{
|
||||
XSyncDestroyAlarm (priv->xdisplay, priv->user_active_alarm);
|
||||
priv->user_active_alarm = None;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (meta_backend_x11_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_backend_x11_class_init (MetaBackendX11Class *klass)
|
||||
{
|
||||
MetaBackendClass *backend_class = META_BACKEND_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = meta_backend_x11_finalize;
|
||||
backend_class->create_clutter_backend = meta_backend_x11_create_clutter_backend;
|
||||
backend_class->post_init = meta_backend_x11_post_init;
|
||||
backend_class->create_idle_monitor = meta_backend_x11_create_idle_monitor;
|
||||
backend_class->grab_device = meta_backend_x11_grab_device;
|
||||
backend_class->ungrab_device = meta_backend_x11_ungrab_device;
|
||||
backend_class->warp_pointer = meta_backend_x11_warp_pointer;
|
||||
@@ -723,3 +802,13 @@ meta_backend_x11_get_xwindow (MetaBackendX11 *x11)
|
||||
ClutterActor *stage = meta_backend_get_stage (META_BACKEND (x11));
|
||||
return clutter_x11_get_stage_window (CLUTTER_STAGE (stage));
|
||||
}
|
||||
|
||||
void
|
||||
meta_backend_x11_reload_cursor (MetaBackendX11 *x11)
|
||||
{
|
||||
MetaBackend *backend = META_BACKEND (x11);
|
||||
MetaCursorRenderer *cursor_renderer =
|
||||
meta_backend_get_cursor_renderer (backend);
|
||||
|
||||
meta_cursor_renderer_force_update (cursor_renderer);
|
||||
}
|
||||
|
@@ -57,4 +57,6 @@ void meta_backend_x11_handle_event (MetaBackendX11 *x11,
|
||||
|
||||
uint8_t meta_backend_x11_get_xkb_event_base (MetaBackendX11 *x11);
|
||||
|
||||
void meta_backend_x11_reload_cursor (MetaBackendX11 *x11);
|
||||
|
||||
#endif /* META_BACKEND_X11_H */
|
||||
|
@@ -40,6 +40,7 @@
|
||||
#include <meta/barrier.h>
|
||||
#include "backends/x11/meta-barrier-x11.h"
|
||||
#include "display-private.h"
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
|
||||
struct _MetaBarrierImplX11Private
|
||||
{
|
||||
@@ -68,10 +69,11 @@ _meta_barrier_impl_x11_release (MetaBarrierImpl *impl,
|
||||
MetaBarrierImplX11Private *priv =
|
||||
meta_barrier_impl_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->barrier->priv->display;
|
||||
Display *dpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
if (META_DISPLAY_HAS_XINPUT_23 (display))
|
||||
if (META_X11_DISPLAY_HAS_XINPUT_23 (display->x11_display))
|
||||
{
|
||||
XIBarrierReleasePointer (display->xdisplay,
|
||||
XIBarrierReleasePointer (dpy,
|
||||
META_VIRTUAL_CORE_POINTER_ID,
|
||||
priv->xbarrier, event->event_id);
|
||||
}
|
||||
@@ -89,13 +91,13 @@ _meta_barrier_impl_x11_destroy (MetaBarrierImpl *impl)
|
||||
if (display == NULL)
|
||||
return;
|
||||
|
||||
dpy = display->xdisplay;
|
||||
dpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
if (!meta_barrier_is_active (priv->barrier))
|
||||
return;
|
||||
|
||||
XFixesDestroyPointerBarrier (dpy, priv->xbarrier);
|
||||
g_hash_table_remove (display->xids, &priv->xbarrier);
|
||||
g_hash_table_remove (display->x11_display->xids, &priv->xbarrier);
|
||||
priv->xbarrier = 0;
|
||||
}
|
||||
|
||||
@@ -119,7 +121,7 @@ meta_barrier_impl_x11_new (MetaBarrier *barrier)
|
||||
priv = meta_barrier_impl_x11_get_instance_private (self);
|
||||
priv->barrier = barrier;
|
||||
|
||||
dpy = display->xdisplay;
|
||||
dpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
root = DefaultRootWindow (dpy);
|
||||
|
||||
allowed_motion_dirs =
|
||||
@@ -132,7 +134,7 @@ meta_barrier_impl_x11_new (MetaBarrier *barrier)
|
||||
allowed_motion_dirs,
|
||||
0, NULL);
|
||||
|
||||
g_hash_table_insert (display->xids, &priv->xbarrier, barrier);
|
||||
g_hash_table_insert (display->x11_display->xids, &priv->xbarrier, barrier);
|
||||
|
||||
return META_BARRIER_IMPL (self);
|
||||
}
|
||||
@@ -172,8 +174,8 @@ meta_barrier_fire_xevent (MetaBarrier *barrier,
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_display_process_barrier_xevent (MetaDisplay *display,
|
||||
XIEvent *event)
|
||||
meta_x11_display_process_barrier_xevent (MetaX11Display *x11_display,
|
||||
XIEvent *event)
|
||||
{
|
||||
MetaBarrier *barrier;
|
||||
XIBarrierEvent *xev;
|
||||
@@ -191,7 +193,7 @@ meta_display_process_barrier_xevent (MetaDisplay *display,
|
||||
}
|
||||
|
||||
xev = (XIBarrierEvent *) event;
|
||||
barrier = g_hash_table_lookup (display->xids, &xev->barrier);
|
||||
barrier = g_hash_table_lookup (x11_display->xids, &xev->barrier);
|
||||
if (barrier != NULL)
|
||||
{
|
||||
meta_barrier_fire_xevent (barrier, xev);
|
||||
|
@@ -29,7 +29,8 @@
|
||||
#include <X11/extensions/Xfixes.h>
|
||||
|
||||
#include "meta-backend-x11.h"
|
||||
#include "meta-stage.h"
|
||||
#include "meta-stage-private.h"
|
||||
#include "backends/meta-cursor-sprite-xcursor.h"
|
||||
|
||||
struct _MetaCursorRendererX11Private
|
||||
{
|
||||
@@ -59,13 +60,18 @@ meta_cursor_renderer_x11_update_cursor (MetaCursorRenderer *renderer,
|
||||
|
||||
gboolean has_server_cursor = FALSE;
|
||||
|
||||
if (cursor_sprite)
|
||||
if (cursor_sprite && META_IS_CURSOR_SPRITE_XCURSOR (cursor_sprite))
|
||||
{
|
||||
MetaCursor cursor = meta_cursor_sprite_get_meta_cursor (cursor_sprite);
|
||||
MetaCursorSpriteXcursor *sprite_xcursor =
|
||||
META_CURSOR_SPRITE_XCURSOR (cursor_sprite);
|
||||
MetaCursor cursor;
|
||||
|
||||
cursor = meta_cursor_sprite_xcursor_get_cursor (sprite_xcursor);
|
||||
if (cursor != META_CURSOR_NONE)
|
||||
{
|
||||
Cursor xcursor = meta_cursor_create_x_cursor (xdisplay, cursor);
|
||||
Cursor xcursor;
|
||||
|
||||
xcursor = meta_create_x_cursor (xdisplay, cursor);
|
||||
XDefineCursor (xdisplay, xwindow, xcursor);
|
||||
XFlush (xdisplay);
|
||||
XFreeCursor (xdisplay, xcursor);
|
||||
|
@@ -1,373 +0,0 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright 2013 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
|
||||
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "meta-idle-monitor-xsync.h"
|
||||
#include "meta-idle-monitor-private.h"
|
||||
|
||||
#include "meta-backend-x11.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
struct _MetaIdleMonitorXSync
|
||||
{
|
||||
MetaIdleMonitor parent;
|
||||
|
||||
GHashTable *alarms;
|
||||
Display *display;
|
||||
XSyncCounter counter;
|
||||
XSyncAlarm user_active_alarm;
|
||||
};
|
||||
|
||||
struct _MetaIdleMonitorXSyncClass
|
||||
{
|
||||
MetaIdleMonitorClass parent_class;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
MetaIdleMonitorWatch base;
|
||||
|
||||
XSyncAlarm xalarm;
|
||||
} MetaIdleMonitorWatchXSync;
|
||||
|
||||
G_DEFINE_TYPE (MetaIdleMonitorXSync, meta_idle_monitor_xsync, META_TYPE_IDLE_MONITOR)
|
||||
|
||||
static gint64
|
||||
_xsyncvalue_to_int64 (XSyncValue value)
|
||||
{
|
||||
return ((guint64) XSyncValueHigh32 (value)) << 32
|
||||
| (guint64) XSyncValueLow32 (value);
|
||||
}
|
||||
|
||||
#define GUINT64_TO_XSYNCVALUE(value, ret) XSyncIntsToValue (ret, (value) & 0xFFFFFFFF, ((guint64)(value)) >> 32)
|
||||
|
||||
static XSyncAlarm
|
||||
_xsync_alarm_set (MetaIdleMonitorXSync *monitor_xsync,
|
||||
XSyncTestType test_type,
|
||||
guint64 interval,
|
||||
gboolean want_events)
|
||||
{
|
||||
XSyncAlarmAttributes attr;
|
||||
XSyncValue delta;
|
||||
guint flags;
|
||||
|
||||
flags = XSyncCACounter | XSyncCAValueType | XSyncCATestType |
|
||||
XSyncCAValue | XSyncCADelta | XSyncCAEvents;
|
||||
|
||||
XSyncIntToValue (&delta, 0);
|
||||
attr.trigger.counter = monitor_xsync->counter;
|
||||
attr.trigger.value_type = XSyncAbsolute;
|
||||
attr.delta = delta;
|
||||
attr.events = want_events;
|
||||
|
||||
GUINT64_TO_XSYNCVALUE (interval, &attr.trigger.wait_value);
|
||||
attr.trigger.test_type = test_type;
|
||||
return XSyncCreateAlarm (monitor_xsync->display, flags, &attr);
|
||||
}
|
||||
|
||||
static void
|
||||
ensure_alarm_rescheduled (Display *dpy,
|
||||
XSyncAlarm alarm)
|
||||
{
|
||||
XSyncAlarmAttributes attr;
|
||||
|
||||
/* Some versions of Xorg have an issue where alarms aren't
|
||||
* always rescheduled. Calling XSyncChangeAlarm, even
|
||||
* without any attributes, will reschedule the alarm. */
|
||||
XSyncChangeAlarm (dpy, alarm, 0, &attr);
|
||||
}
|
||||
|
||||
static void
|
||||
set_alarm_enabled (Display *dpy,
|
||||
XSyncAlarm alarm,
|
||||
gboolean enabled)
|
||||
{
|
||||
XSyncAlarmAttributes attr;
|
||||
attr.events = enabled;
|
||||
XSyncChangeAlarm (dpy, alarm, XSyncCAEvents, &attr);
|
||||
}
|
||||
|
||||
static char *
|
||||
counter_name_for_device (int device_id)
|
||||
{
|
||||
if (device_id > 0)
|
||||
return g_strdup_printf ("DEVICEIDLETIME %d", device_id);
|
||||
|
||||
return g_strdup ("IDLETIME");
|
||||
}
|
||||
|
||||
static XSyncCounter
|
||||
find_idletime_counter (MetaIdleMonitorXSync *monitor_xsync)
|
||||
{
|
||||
MetaIdleMonitor *monitor = META_IDLE_MONITOR (monitor_xsync);
|
||||
int i;
|
||||
int ncounters;
|
||||
XSyncSystemCounter *counters;
|
||||
XSyncCounter counter = None;
|
||||
char *counter_name;
|
||||
|
||||
counter_name = counter_name_for_device (monitor->device_id);
|
||||
counters = XSyncListSystemCounters (monitor_xsync->display, &ncounters);
|
||||
for (i = 0; i < ncounters; i++)
|
||||
{
|
||||
if (counters[i].name != NULL && strcmp (counters[i].name, counter_name) == 0)
|
||||
{
|
||||
counter = counters[i].counter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
XSyncFreeSystemCounterList (counters);
|
||||
g_free (counter_name);
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
static void
|
||||
init_xsync (MetaIdleMonitorXSync *monitor_xsync)
|
||||
{
|
||||
monitor_xsync->counter = find_idletime_counter (monitor_xsync);
|
||||
/* IDLETIME counter not found? */
|
||||
if (monitor_xsync->counter == None)
|
||||
{
|
||||
g_warning ("IDLETIME counter not found\n");
|
||||
return;
|
||||
}
|
||||
|
||||
monitor_xsync->user_active_alarm = _xsync_alarm_set (monitor_xsync, XSyncNegativeTransition, 1, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_xsync_dispose (GObject *object)
|
||||
{
|
||||
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (object);
|
||||
|
||||
if (monitor_xsync->user_active_alarm != None)
|
||||
{
|
||||
XSyncDestroyAlarm (monitor_xsync->display, monitor_xsync->user_active_alarm);
|
||||
monitor_xsync->user_active_alarm = None;
|
||||
}
|
||||
|
||||
g_clear_pointer (&monitor_xsync->alarms, g_hash_table_destroy);
|
||||
|
||||
G_OBJECT_CLASS (meta_idle_monitor_xsync_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_xsync_constructed (GObject *object)
|
||||
{
|
||||
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (object);
|
||||
MetaBackendX11 *backend = META_BACKEND_X11 (meta_get_backend ());
|
||||
|
||||
monitor_xsync->display = meta_backend_x11_get_xdisplay (backend);
|
||||
init_xsync (monitor_xsync);
|
||||
|
||||
G_OBJECT_CLASS (meta_idle_monitor_xsync_parent_class)->constructed (object);
|
||||
}
|
||||
|
||||
static gint64
|
||||
meta_idle_monitor_xsync_get_idletime (MetaIdleMonitor *monitor)
|
||||
{
|
||||
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
|
||||
XSyncValue value;
|
||||
|
||||
if (!XSyncQueryCounter (monitor_xsync->display, monitor_xsync->counter, &value))
|
||||
return -1;
|
||||
|
||||
return _xsyncvalue_to_int64 (value);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
fire_watch_idle (gpointer data)
|
||||
{
|
||||
MetaIdleMonitorWatch *watch = data;
|
||||
|
||||
watch->idle_source_id = 0;
|
||||
_meta_idle_monitor_watch_fire (watch);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static guint32
|
||||
get_next_watch_serial (void)
|
||||
{
|
||||
static guint32 serial = 0;
|
||||
g_atomic_int_inc (&serial);
|
||||
return serial;
|
||||
}
|
||||
|
||||
static void
|
||||
free_watch (gpointer data)
|
||||
{
|
||||
MetaIdleMonitorWatchXSync *watch_xsync = data;
|
||||
MetaIdleMonitorWatch *watch = (MetaIdleMonitorWatch *) watch_xsync;
|
||||
MetaIdleMonitor *monitor = watch->monitor;
|
||||
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
|
||||
|
||||
g_object_ref (monitor);
|
||||
|
||||
if (watch->idle_source_id)
|
||||
{
|
||||
g_source_remove (watch->idle_source_id);
|
||||
watch->idle_source_id = 0;
|
||||
}
|
||||
|
||||
if (watch->notify != NULL)
|
||||
watch->notify (watch->user_data);
|
||||
|
||||
if (watch_xsync->xalarm != monitor_xsync->user_active_alarm &&
|
||||
watch_xsync->xalarm != None)
|
||||
{
|
||||
XSyncDestroyAlarm (monitor_xsync->display, watch_xsync->xalarm);
|
||||
g_hash_table_remove (monitor_xsync->alarms, (gpointer) watch_xsync->xalarm);
|
||||
}
|
||||
|
||||
g_object_unref (monitor);
|
||||
g_slice_free (MetaIdleMonitorWatchXSync, watch_xsync);
|
||||
}
|
||||
|
||||
static MetaIdleMonitorWatch *
|
||||
meta_idle_monitor_xsync_make_watch (MetaIdleMonitor *monitor,
|
||||
guint64 timeout_msec,
|
||||
MetaIdleMonitorWatchFunc callback,
|
||||
gpointer user_data,
|
||||
GDestroyNotify notify)
|
||||
{
|
||||
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
|
||||
MetaIdleMonitorWatchXSync *watch_xsync;
|
||||
MetaIdleMonitorWatch *watch;
|
||||
|
||||
watch_xsync = g_slice_new0 (MetaIdleMonitorWatchXSync);
|
||||
watch = (MetaIdleMonitorWatch *) watch_xsync;
|
||||
|
||||
watch->monitor = monitor;
|
||||
watch->id = get_next_watch_serial ();
|
||||
watch->callback = callback;
|
||||
watch->user_data = user_data;
|
||||
watch->notify = notify;
|
||||
watch->timeout_msec = timeout_msec;
|
||||
|
||||
if (monitor_xsync->user_active_alarm != None)
|
||||
{
|
||||
if (timeout_msec != 0)
|
||||
{
|
||||
watch_xsync->xalarm = _xsync_alarm_set (monitor_xsync, XSyncPositiveTransition, timeout_msec, TRUE);
|
||||
|
||||
g_hash_table_add (monitor_xsync->alarms, (gpointer) watch_xsync->xalarm);
|
||||
|
||||
if (meta_idle_monitor_get_idletime (monitor) > (gint64)timeout_msec)
|
||||
{
|
||||
watch->idle_source_id = g_idle_add (fire_watch_idle, watch);
|
||||
g_source_set_name_by_id (watch->idle_source_id, "[mutter] fire_watch_idle");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
watch_xsync->xalarm = monitor_xsync->user_active_alarm;
|
||||
|
||||
set_alarm_enabled (monitor_xsync->display, monitor_xsync->user_active_alarm, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
return watch;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_xsync_class_init (MetaIdleMonitorXSyncClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
MetaIdleMonitorClass *idle_monitor_class = META_IDLE_MONITOR_CLASS (klass);
|
||||
|
||||
object_class->dispose = meta_idle_monitor_xsync_dispose;
|
||||
object_class->constructed = meta_idle_monitor_xsync_constructed;
|
||||
|
||||
idle_monitor_class->get_idletime = meta_idle_monitor_xsync_get_idletime;
|
||||
idle_monitor_class->make_watch = meta_idle_monitor_xsync_make_watch;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_idle_monitor_xsync_init (MetaIdleMonitorXSync *monitor_xsync)
|
||||
{
|
||||
MetaIdleMonitor *monitor = META_IDLE_MONITOR (monitor_xsync);
|
||||
|
||||
monitor->watches = g_hash_table_new_full (NULL, NULL, NULL, free_watch);
|
||||
monitor_xsync->alarms = g_hash_table_new (NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
check_x11_watches (MetaIdleMonitor *monitor,
|
||||
XSyncAlarm alarm)
|
||||
{
|
||||
GList *node, *watch_ids;
|
||||
|
||||
/* we get the keys and do explicit look ups in case
|
||||
* an early iteration of the loop ends up leading
|
||||
* to watches from later iterations getting invalidated
|
||||
*/
|
||||
watch_ids = g_hash_table_get_keys (monitor->watches);
|
||||
|
||||
for (node = watch_ids; node != NULL; node = node->next)
|
||||
{
|
||||
guint watch_id = GPOINTER_TO_UINT (node->data);
|
||||
MetaIdleMonitorWatchXSync *watch;
|
||||
|
||||
watch = g_hash_table_lookup (monitor->watches, GUINT_TO_POINTER (watch_id));
|
||||
|
||||
if (watch && watch->xalarm == alarm)
|
||||
_meta_idle_monitor_watch_fire ((MetaIdleMonitorWatch *) watch);
|
||||
}
|
||||
|
||||
g_list_free (watch_ids);
|
||||
}
|
||||
|
||||
void
|
||||
meta_idle_monitor_xsync_handle_xevent (MetaIdleMonitor *monitor,
|
||||
XSyncAlarmNotifyEvent *alarm_event)
|
||||
{
|
||||
MetaIdleMonitorXSync *monitor_xsync = META_IDLE_MONITOR_XSYNC (monitor);
|
||||
XSyncAlarm alarm;
|
||||
gboolean has_alarm;
|
||||
|
||||
if (alarm_event->state != XSyncAlarmActive)
|
||||
return;
|
||||
|
||||
alarm = alarm_event->alarm;
|
||||
|
||||
has_alarm = FALSE;
|
||||
|
||||
if (alarm == monitor_xsync->user_active_alarm)
|
||||
{
|
||||
set_alarm_enabled (monitor_xsync->display,
|
||||
alarm,
|
||||
FALSE);
|
||||
has_alarm = TRUE;
|
||||
}
|
||||
else if (g_hash_table_contains (monitor_xsync->alarms, (gpointer) alarm))
|
||||
{
|
||||
ensure_alarm_rescheduled (monitor_xsync->display,
|
||||
alarm);
|
||||
has_alarm = TRUE;
|
||||
}
|
||||
|
||||
if (has_alarm)
|
||||
check_x11_watches (monitor, alarm);
|
||||
}
|
@@ -1,47 +0,0 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/*
|
||||
* Copyright 2013 Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Adapted from gnome-session/gnome-session/gs-idle-monitor.c and
|
||||
* from gnome-desktop/libgnome-desktop/gnome-idle-monitor.c
|
||||
*/
|
||||
|
||||
#ifndef META_IDLE_MONITOR_XSYNC_H
|
||||
#define META_IDLE_MONITOR_XSYNC_H
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <meta/meta-idle-monitor.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/extensions/sync.h>
|
||||
|
||||
#define META_TYPE_IDLE_MONITOR_XSYNC (meta_idle_monitor_xsync_get_type ())
|
||||
#define META_IDLE_MONITOR_XSYNC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), META_TYPE_IDLE_MONITOR_XSYNC, MetaIdleMonitorXSync))
|
||||
#define META_IDLE_MONITOR_XSYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), META_TYPE_IDLE_MONITOR_XSYNC, MetaIdleMonitorXSyncClass))
|
||||
#define META_IS_IDLE_MONITOR_XSYNC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), META_TYPE_IDLE_MONITOR_XSYNC))
|
||||
#define META_IS_IDLE_MONITOR_XSYNC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_IDLE_MONITOR_XSYNC))
|
||||
#define META_IDLE_MONITOR_XSYNC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_IDLE_MONITOR_XSYNC, MetaIdleMonitorXSyncClass))
|
||||
|
||||
typedef struct _MetaIdleMonitorXSync MetaIdleMonitorXSync;
|
||||
typedef struct _MetaIdleMonitorXSyncClass MetaIdleMonitorXSyncClass;
|
||||
|
||||
GType meta_idle_monitor_xsync_get_type (void);
|
||||
|
||||
void meta_idle_monitor_xsync_handle_xevent (MetaIdleMonitor *monitor,
|
||||
XSyncAlarmNotifyEvent *xevent);
|
||||
|
||||
#endif /* META_IDLE_MONITOR_XSYNC_H */
|
@@ -35,7 +35,7 @@
|
||||
#include <gudev/gudev.h>
|
||||
#endif
|
||||
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include "backends/meta-logical-monitor.h"
|
||||
|
||||
typedef struct _MetaInputSettingsX11Private
|
||||
@@ -63,9 +63,9 @@ device_free_xdevice (gpointer user_data)
|
||||
Display *xdisplay = meta_backend_x11_get_xdisplay (META_BACKEND_X11 (backend));
|
||||
XDevice *xdev = user_data;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
XCloseDevice (xdisplay, xdev);
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
}
|
||||
|
||||
static XDevice *
|
||||
@@ -81,9 +81,9 @@ device_ensure_xdevice (ClutterInputDevice *device)
|
||||
if (xdev)
|
||||
return xdev;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
xdev = XOpenDevice (xdisplay, device_id);
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
|
||||
if (xdev)
|
||||
{
|
||||
@@ -586,7 +586,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
|
||||
return;
|
||||
|
||||
/* Grab the puke bucket! */
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
xdev = device_ensure_xdevice (device);
|
||||
if (xdev)
|
||||
{
|
||||
@@ -595,7 +595,7 @@ meta_input_settings_x11_set_tablet_mapping (MetaInputSettings *settings,
|
||||
Absolute : Relative);
|
||||
}
|
||||
|
||||
if (meta_error_trap_pop_with_return (display))
|
||||
if (meta_x11_error_trap_pop_with_return (display->x11_display))
|
||||
{
|
||||
g_warning ("Could not set tablet mapping for %s",
|
||||
clutter_input_device_get_device_name (device));
|
||||
@@ -782,7 +782,6 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
|
||||
return;
|
||||
|
||||
/* Grab the puke bucket! */
|
||||
meta_error_trap_push (display);
|
||||
xdev = device_ensure_xdevice (device);
|
||||
if (xdev)
|
||||
{
|
||||
@@ -800,7 +799,7 @@ meta_input_settings_x11_set_stylus_button_map (MetaInputSettings *setti
|
||||
XSetDeviceButtonMapping (xdisplay, xdev, map, G_N_ELEMENTS (map));
|
||||
}
|
||||
|
||||
if (meta_error_trap_pop_with_return (display))
|
||||
if (meta_x11_error_trap_pop_with_return (display->x11_display))
|
||||
{
|
||||
g_warning ("Could not set stylus button map for %s",
|
||||
clutter_input_device_get_device_name (device));
|
||||
|
@@ -39,7 +39,7 @@
|
||||
|
||||
#include "meta-backend-x11.h"
|
||||
#include <meta/main.h>
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include "backends/meta-crtc.h"
|
||||
#include "backends/meta-monitor-config-manager.h"
|
||||
#include "backends/meta-logical-monitor.h"
|
||||
@@ -225,8 +225,10 @@ is_crtc_assignment_changed (MetaCrtc *crtc,
|
||||
for (j = 0; j < crtc_info->outputs->len; j++)
|
||||
{
|
||||
MetaOutput *output = ((MetaOutput**) crtc_info->outputs->pdata)[j];
|
||||
MetaCrtc *assigned_crtc;
|
||||
|
||||
if (output->crtc != crtc)
|
||||
assigned_crtc = meta_output_get_assigned_crtc (output);
|
||||
if (assigned_crtc != crtc)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -243,6 +245,7 @@ is_output_assignment_changed (MetaOutput *output,
|
||||
MetaOutputInfo **output_infos,
|
||||
unsigned int n_output_infos)
|
||||
{
|
||||
MetaCrtc *assigned_crtc;
|
||||
gboolean output_is_found = FALSE;
|
||||
unsigned int i;
|
||||
|
||||
@@ -265,8 +268,10 @@ is_output_assignment_changed (MetaOutput *output,
|
||||
output_is_found = TRUE;
|
||||
}
|
||||
|
||||
assigned_crtc = meta_output_get_assigned_crtc (output);
|
||||
|
||||
if (!output_is_found)
|
||||
return output->crtc != NULL;
|
||||
return assigned_crtc != NULL;
|
||||
|
||||
for (i = 0; i < n_crtc_infos; i++)
|
||||
{
|
||||
@@ -279,7 +284,7 @@ is_output_assignment_changed (MetaOutput *output,
|
||||
((MetaOutput**) crtc_info->outputs->pdata)[j];
|
||||
|
||||
if (crtc_info_output == output &&
|
||||
crtc_info->crtc == output->crtc)
|
||||
crtc_info->crtc == assigned_crtc)
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
@@ -455,7 +460,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
output = ((MetaOutput**)crtc_info->outputs->pdata)[j];
|
||||
|
||||
output->is_dirty = TRUE;
|
||||
output->crtc = crtc;
|
||||
meta_output_assign_crtc (output, crtc);
|
||||
|
||||
output_ids[j] = output->winsys_id;
|
||||
}
|
||||
@@ -521,7 +526,7 @@ apply_crtc_assignments (MetaMonitorManager *manager,
|
||||
continue;
|
||||
}
|
||||
|
||||
output->crtc = NULL;
|
||||
meta_output_unassign_crtc (output);
|
||||
output->is_primary = FALSE;
|
||||
}
|
||||
|
||||
|
@@ -97,10 +97,13 @@ output_set_underscanning_xrandr (MetaOutput *output,
|
||||
* make the border configurable. */
|
||||
if (underscanning)
|
||||
{
|
||||
MetaCrtc *crtc;
|
||||
uint32_t border_value;
|
||||
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
|
||||
prop = XInternAtom (xdisplay, "underscan hborder", False);
|
||||
border_value = output->crtc->current_mode->width * 0.05;
|
||||
border_value = crtc->current_mode->width * 0.05;
|
||||
|
||||
xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
|
||||
(XID) output->winsys_id,
|
||||
@@ -109,7 +112,7 @@ output_set_underscanning_xrandr (MetaOutput *output,
|
||||
1, &border_value);
|
||||
|
||||
prop = XInternAtom (xdisplay, "underscan vborder", False);
|
||||
border_value = output->crtc->current_mode->height * 0.05;
|
||||
border_value = crtc->current_mode->height * 0.05;
|
||||
|
||||
xcb_randr_change_output_property (XGetXCBConnection (xdisplay),
|
||||
(XID) output->winsys_id,
|
||||
@@ -737,14 +740,14 @@ output_get_crtcs (MetaOutput *output,
|
||||
}
|
||||
output->n_possible_crtcs = n_actual_crtcs;
|
||||
|
||||
output->crtc = NULL;
|
||||
meta_output_unassign_crtc (output);
|
||||
for (l = meta_gpu_get_crtcs (gpu); l; l = l->next)
|
||||
{
|
||||
MetaCrtc *crtc = l->data;
|
||||
|
||||
if ((XID) crtc->crtc_id == xrandr_output->crtc)
|
||||
{
|
||||
output->crtc = crtc;
|
||||
meta_output_assign_crtc (output, crtc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -113,7 +113,7 @@ draw_crtc (MetaMonitor *monitor,
|
||||
CoglTexture *texture = data->texture;
|
||||
MetaLogicalMonitor *logical_monitor = data->logical_monitor;
|
||||
MetaOutput *output = monitor_crtc_mode->output;
|
||||
MetaCrtc *crtc = output->crtc;
|
||||
MetaCrtc *crtc;
|
||||
MetaRendererView *renderer_view = META_RENDERER_VIEW (data->view);
|
||||
MetaMonitorTransform view_transform;
|
||||
MetaMonitorTransform layout_transform = META_MONITOR_TRANSFORM_NORMAL;
|
||||
@@ -129,6 +129,8 @@ draw_crtc (MetaMonitor *monitor,
|
||||
texture_width = cogl_texture_get_width (texture);
|
||||
texture_height = cogl_texture_get_height (texture);
|
||||
|
||||
crtc = meta_output_get_assigned_crtc (output);
|
||||
|
||||
clutter_stage_view_get_layout (data->view, &view_layout);
|
||||
sample_x = crtc->rect.x - view_layout.x;
|
||||
sample_y = crtc->rect.y - view_layout.y;
|
||||
|
@@ -26,6 +26,8 @@
|
||||
|
||||
#include "backends/x11/nested/meta-cursor-renderer-x11-nested.h"
|
||||
|
||||
#include <X11/Xcursor/Xcursor.h>
|
||||
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
|
||||
struct _MetaCursorRendererX11Nested
|
||||
|
@@ -50,24 +50,22 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
|
||||
{
|
||||
MetaMonitor *main_monitor;
|
||||
MetaOutput *main_output;
|
||||
MetaMonitorTransform crtc_transform;
|
||||
MetaCrtc *crtc;
|
||||
|
||||
main_monitor = meta_logical_monitor_get_monitors (logical_monitor)->data;
|
||||
main_output = meta_monitor_get_main_output (main_monitor);
|
||||
crtc_transform =
|
||||
meta_monitor_logical_to_crtc_transform (main_monitor,
|
||||
logical_monitor->transform);
|
||||
|
||||
crtc = meta_output_get_assigned_crtc (main_output);
|
||||
/*
|
||||
* Pick any monitor and output and check; all CRTCs of a logical monitor will
|
||||
* always have the same transform assigned to them.
|
||||
*/
|
||||
|
||||
if (meta_monitor_manager_is_transform_handled (monitor_manager,
|
||||
main_output->crtc,
|
||||
crtc_transform))
|
||||
crtc,
|
||||
crtc->transform))
|
||||
return META_MONITOR_TRANSFORM_NORMAL;
|
||||
else
|
||||
return crtc_transform;
|
||||
return crtc->transform;
|
||||
}
|
||||
|
||||
static MetaRendererView *
|
||||
|
@@ -22,7 +22,6 @@ struct _MetaCompositor
|
||||
gint64 server_time_offset;
|
||||
|
||||
guint server_time_is_monotonic_time : 1;
|
||||
guint no_mipmaps : 1;
|
||||
|
||||
ClutterActor *stage, *window_group, *top_window_group, *feedback_group;
|
||||
ClutterActor *background_actor;
|
||||
|
@@ -42,8 +42,8 @@
|
||||
* There's two containers in the stage that are used to place window actors, here
|
||||
* are listed in the order in which they are painted:
|
||||
*
|
||||
* - window group, accessible with meta_get_window_group_for_screen()
|
||||
* - top window group, accessible with meta_get_top_window_group_for_screen()
|
||||
* - window group, accessible with meta_get_window_group_for_display()
|
||||
* - top window group, accessible with meta_get_top_window_group_for_display()
|
||||
*
|
||||
* Mutter will place actors representing windows in the window group, except for
|
||||
* override-redirect windows (ie. popups and menus) which will be placed in the
|
||||
@@ -55,8 +55,7 @@
|
||||
#include <clutter/x11/clutter-x11.h>
|
||||
|
||||
#include "core.h"
|
||||
#include <meta/screen.h>
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include <meta/window.h>
|
||||
#include "compositor-private.h"
|
||||
#include <meta/compositor-mutter.h>
|
||||
@@ -67,7 +66,7 @@
|
||||
#include <meta/meta-background-group.h>
|
||||
#include <meta/meta-shadow-factory.h>
|
||||
#include "meta-window-actor-private.h"
|
||||
#include "meta-window-group.h"
|
||||
#include "meta-window-group-private.h"
|
||||
#include "window-private.h" /* to check window->hidden */
|
||||
#include "display-private.h" /* for meta_display_lookup_x_window() and meta_display_cancel_touch() */
|
||||
#include "util-private.h"
|
||||
@@ -80,6 +79,8 @@
|
||||
#include "backends/x11/meta-backend-x11.h"
|
||||
#include "clutter/clutter-mutter.h"
|
||||
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
#include "wayland/meta-wayland-private.h"
|
||||
#endif
|
||||
@@ -149,78 +150,78 @@ process_damage (MetaCompositor *compositor,
|
||||
|
||||
/* compat helper */
|
||||
static MetaCompositor *
|
||||
get_compositor_for_screen (MetaScreen *screen)
|
||||
get_compositor_for_display (MetaDisplay *display)
|
||||
{
|
||||
return screen->display->compositor;
|
||||
return display->compositor;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_get_stage_for_screen:
|
||||
* @screen: a #MetaScreen
|
||||
* meta_get_stage_for_display:
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
* Returns: (transfer none): The #ClutterStage for the screen
|
||||
* Returns: (transfer none): The #ClutterStage for the display
|
||||
*/
|
||||
ClutterActor *
|
||||
meta_get_stage_for_screen (MetaScreen *screen)
|
||||
meta_get_stage_for_display (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
return compositor->stage;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_get_window_group_for_screen:
|
||||
* @screen: a #MetaScreen
|
||||
* meta_get_window_group_for_display:
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
* Returns: (transfer none): The window group corresponding to @screen
|
||||
* Returns: (transfer none): The window group corresponding to @display
|
||||
*/
|
||||
ClutterActor *
|
||||
meta_get_window_group_for_screen (MetaScreen *screen)
|
||||
meta_get_window_group_for_display (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
return compositor->window_group;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_get_top_window_group_for_screen:
|
||||
* @screen: a #MetaScreen
|
||||
* meta_get_top_window_group_for_display:
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
* Returns: (transfer none): The top window group corresponding to @screen
|
||||
* Returns: (transfer none): The top window group corresponding to @display
|
||||
*/
|
||||
ClutterActor *
|
||||
meta_get_top_window_group_for_screen (MetaScreen *screen)
|
||||
meta_get_top_window_group_for_display (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
return compositor->top_window_group;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_get_feedback_group_for_screen:
|
||||
* @screen: a #MetaScreen
|
||||
* meta_get_feedback_group_for_display:
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
* Returns: (transfer none): The feedback group corresponding to @screen
|
||||
* Returns: (transfer none): The feedback group corresponding to @display
|
||||
*/
|
||||
ClutterActor *
|
||||
meta_get_feedback_group_for_screen (MetaScreen *screen)
|
||||
meta_get_feedback_group_for_display (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
return compositor->feedback_group;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_get_window_actors:
|
||||
* @screen: a #MetaScreen
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
* Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @screen
|
||||
* Returns: (transfer none) (element-type Clutter.Actor): The set of #MetaWindowActor on @display
|
||||
*/
|
||||
GList *
|
||||
meta_get_window_actors (MetaScreen *screen)
|
||||
meta_get_window_actors (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
return compositor->windows;
|
||||
}
|
||||
|
||||
void
|
||||
meta_set_stage_input_region (MetaScreen *screen,
|
||||
meta_set_stage_input_region (MetaDisplay *display,
|
||||
XserverRegion region)
|
||||
{
|
||||
/* As a wayland compositor we can simply ignore all this trickery
|
||||
@@ -230,9 +231,8 @@ meta_set_stage_input_region (MetaScreen *screen,
|
||||
*/
|
||||
if (!meta_is_wayland_compositor ())
|
||||
{
|
||||
MetaDisplay *display = screen->display;
|
||||
MetaCompositor *compositor = display->compositor;
|
||||
Display *xdpy = meta_display_get_xdisplay (display);
|
||||
Display *xdpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
Window xstage = clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage));
|
||||
|
||||
XFixesSetWindowShapeRegion (xdpy, xstage, ShapeInput, 0, 0, region);
|
||||
@@ -247,7 +247,7 @@ meta_set_stage_input_region (MetaScreen *screen,
|
||||
}
|
||||
|
||||
void
|
||||
meta_empty_stage_input_region (MetaScreen *screen)
|
||||
meta_empty_stage_input_region (MetaDisplay *display)
|
||||
{
|
||||
/* Using a static region here is a bit hacky, but Metacity never opens more than
|
||||
* one XDisplay, so it works fine. */
|
||||
@@ -255,22 +255,21 @@ meta_empty_stage_input_region (MetaScreen *screen)
|
||||
|
||||
if (region == None)
|
||||
{
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
Display *xdpy = meta_display_get_xdisplay (display);
|
||||
Display *xdpy = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
region = XFixesCreateRegion (xdpy, NULL, 0);
|
||||
}
|
||||
|
||||
meta_set_stage_input_region (screen, region);
|
||||
meta_set_stage_input_region (display, region);
|
||||
}
|
||||
|
||||
void
|
||||
meta_focus_stage_window (MetaScreen *screen,
|
||||
guint32 timestamp)
|
||||
meta_focus_stage_window (MetaDisplay *display,
|
||||
guint32 timestamp)
|
||||
{
|
||||
ClutterStage *stage;
|
||||
Window window;
|
||||
|
||||
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
|
||||
stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
|
||||
if (!stage)
|
||||
return;
|
||||
|
||||
@@ -279,14 +278,13 @@ meta_focus_stage_window (MetaScreen *screen,
|
||||
if (window == None)
|
||||
return;
|
||||
|
||||
meta_display_set_input_focus_xwindow (screen->display,
|
||||
screen,
|
||||
window,
|
||||
timestamp);
|
||||
meta_x11_display_set_input_focus_xwindow (display->x11_display,
|
||||
window,
|
||||
timestamp);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_stage_is_focused (MetaScreen *screen)
|
||||
meta_stage_is_focused (MetaDisplay *display)
|
||||
{
|
||||
ClutterStage *stage;
|
||||
Window window;
|
||||
@@ -294,7 +292,7 @@ meta_stage_is_focused (MetaScreen *screen)
|
||||
if (meta_is_wayland_compositor ())
|
||||
return TRUE;
|
||||
|
||||
stage = CLUTTER_STAGE (meta_get_stage_for_screen (screen));
|
||||
stage = CLUTTER_STAGE (meta_get_stage_for_display (display));
|
||||
if (!stage)
|
||||
return FALSE;
|
||||
|
||||
@@ -303,7 +301,7 @@ meta_stage_is_focused (MetaScreen *screen)
|
||||
if (window == None)
|
||||
return FALSE;
|
||||
|
||||
return (screen->display->focus_xwindow == window);
|
||||
return (display->x11_display->focus_xwindow == window);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -364,11 +362,14 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor,
|
||||
if (is_modal (display) || display->grab_op != META_GRAB_OP_NONE)
|
||||
return FALSE;
|
||||
|
||||
/* XXX: why is this needed? */
|
||||
XIUngrabDevice (display->xdisplay,
|
||||
META_VIRTUAL_CORE_POINTER_ID,
|
||||
timestamp);
|
||||
XSync (display->xdisplay, False);
|
||||
if (display->x11_display)
|
||||
{
|
||||
/* XXX: why is this needed? */
|
||||
XIUngrabDevice (display->x11_display->xdisplay,
|
||||
META_VIRTUAL_CORE_POINTER_ID,
|
||||
timestamp);
|
||||
XSync (display->x11_display->xdisplay, False);
|
||||
}
|
||||
|
||||
if (!grab_devices (options, timestamp))
|
||||
return FALSE;
|
||||
@@ -380,7 +381,7 @@ meta_begin_modal_for_plugin (MetaCompositor *compositor,
|
||||
display->grab_have_keyboard = TRUE;
|
||||
|
||||
g_signal_emit_by_name (display, "grab-op-begin",
|
||||
meta_plugin_get_screen (plugin),
|
||||
meta_plugin_get_display (plugin),
|
||||
display->grab_window, display->grab_op);
|
||||
|
||||
if (meta_is_wayland_compositor ())
|
||||
@@ -407,7 +408,7 @@ meta_end_modal_for_plugin (MetaCompositor *compositor,
|
||||
g_return_if_fail (is_modal (display));
|
||||
|
||||
g_signal_emit_by_name (display, "grab-op-end",
|
||||
meta_plugin_get_screen (plugin),
|
||||
meta_plugin_get_display (plugin),
|
||||
display->grab_window, display->grab_op);
|
||||
|
||||
display->grab_op = META_GRAB_OP_NONE;
|
||||
@@ -445,14 +446,13 @@ after_stage_paint (ClutterStage *stage,
|
||||
}
|
||||
|
||||
static void
|
||||
redirect_windows (MetaScreen *screen)
|
||||
redirect_windows (MetaX11Display *x11_display)
|
||||
{
|
||||
MetaDisplay *display = meta_screen_get_display (screen);
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Window xroot = meta_screen_get_xroot (screen);
|
||||
int screen_number = meta_screen_get_screen_number (screen);
|
||||
guint n_retries;
|
||||
guint max_retries;
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (x11_display);
|
||||
Window xroot = meta_x11_display_get_xroot (x11_display);
|
||||
int screen_number = meta_x11_display_get_screen_number (x11_display);
|
||||
guint n_retries;
|
||||
guint max_retries;
|
||||
|
||||
if (meta_get_replace_current_wm ())
|
||||
max_retries = 5;
|
||||
@@ -467,11 +467,11 @@ redirect_windows (MetaScreen *screen)
|
||||
*/
|
||||
while (TRUE)
|
||||
{
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (x11_display);
|
||||
XCompositeRedirectSubwindows (xdisplay, xroot, CompositeRedirectManual);
|
||||
XSync (xdisplay, FALSE);
|
||||
|
||||
if (!meta_error_trap_pop_with_return (display))
|
||||
if (!meta_x11_error_trap_pop_with_return (x11_display))
|
||||
break;
|
||||
|
||||
if (n_retries == max_retries)
|
||||
@@ -479,7 +479,7 @@ redirect_windows (MetaScreen *screen)
|
||||
/* This probably means that a non-WM compositor like xcompmgr is running;
|
||||
* we have no way to get it to exit */
|
||||
meta_fatal (_("Another compositing manager is already running on screen %i on display “%s”."),
|
||||
screen_number, display->name);
|
||||
screen_number, x11_display->name);
|
||||
}
|
||||
|
||||
n_retries++;
|
||||
@@ -491,11 +491,14 @@ void
|
||||
meta_compositor_manage (MetaCompositor *compositor)
|
||||
{
|
||||
MetaDisplay *display = compositor->display;
|
||||
Display *xdisplay = display->xdisplay;
|
||||
MetaScreen *screen = display->screen;
|
||||
Display *xdisplay = NULL;
|
||||
MetaBackend *backend = meta_get_backend ();
|
||||
|
||||
meta_screen_set_cm_selection (display->screen);
|
||||
if (display->x11_display)
|
||||
{
|
||||
xdisplay = display->x11_display->xdisplay;
|
||||
meta_x11_display_set_cm_selection (display->x11_display);
|
||||
}
|
||||
|
||||
compositor->stage = meta_backend_get_stage (backend);
|
||||
|
||||
@@ -516,9 +519,9 @@ meta_compositor_manage (MetaCompositor *compositor)
|
||||
|
||||
clutter_stage_set_sync_delay (CLUTTER_STAGE (compositor->stage), META_SYNC_DELAY);
|
||||
|
||||
compositor->window_group = meta_window_group_new (screen);
|
||||
compositor->top_window_group = meta_window_group_new (screen);
|
||||
compositor->feedback_group = meta_window_group_new (screen);
|
||||
compositor->window_group = meta_window_group_new (display);
|
||||
compositor->top_window_group = meta_window_group_new (display);
|
||||
compositor->feedback_group = meta_window_group_new (display);
|
||||
|
||||
clutter_actor_add_child (compositor->stage, compositor->window_group);
|
||||
clutter_actor_add_child (compositor->stage, compositor->top_window_group);
|
||||
@@ -535,13 +538,13 @@ meta_compositor_manage (MetaCompositor *compositor)
|
||||
{
|
||||
Window xwin;
|
||||
|
||||
compositor->output = screen->composite_overlay_window;
|
||||
compositor->output = display->x11_display->composite_overlay_window;
|
||||
|
||||
xwin = meta_backend_x11_get_xwindow (META_BACKEND_X11 (backend));
|
||||
|
||||
XReparentWindow (xdisplay, xwin, compositor->output, 0, 0);
|
||||
|
||||
meta_empty_stage_input_region (screen);
|
||||
meta_empty_stage_input_region (display);
|
||||
|
||||
/* Make sure there isn't any left-over output shape on the
|
||||
* overlay window by setting the whole screen to be an
|
||||
@@ -561,7 +564,8 @@ meta_compositor_manage (MetaCompositor *compositor)
|
||||
compositor->have_x11_sync_object = meta_sync_ring_init (xdisplay);
|
||||
}
|
||||
|
||||
redirect_windows (display->screen);
|
||||
if (display->x11_display)
|
||||
redirect_windows (display->x11_display);
|
||||
|
||||
compositor->plugin_mgr = meta_plugin_manager_new (compositor);
|
||||
}
|
||||
@@ -571,9 +575,9 @@ meta_compositor_unmanage (MetaCompositor *compositor)
|
||||
{
|
||||
if (!meta_is_wayland_compositor ())
|
||||
{
|
||||
MetaDisplay *display = compositor->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Window xroot = display->screen->xroot;
|
||||
MetaX11Display *display = compositor->display->x11_display;
|
||||
Display *xdisplay = display->xdisplay;
|
||||
Window xroot = display->xroot;
|
||||
|
||||
/* This is the most important part of cleanup - we have to do this
|
||||
* before giving up the window manager selection or the next
|
||||
@@ -598,7 +602,7 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
|
||||
MetaWindow *window)
|
||||
{
|
||||
MetaDisplay *display = compositor->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
if (window == NULL)
|
||||
XFixesSetWindowShapeRegion (xdisplay, compositor->output, ShapeBounding, 0, 0, None);
|
||||
@@ -616,7 +620,7 @@ meta_shape_cow_for_window (MetaCompositor *compositor,
|
||||
window_bounds.width = rect.width;
|
||||
window_bounds.height = rect.height;
|
||||
|
||||
meta_screen_get_size (display->screen, &width, &height);
|
||||
meta_display_get_size (display, &width, &height);
|
||||
screen_rect.x = 0;
|
||||
screen_rect.y = 0;
|
||||
screen_rect.width = width;
|
||||
@@ -659,12 +663,12 @@ meta_compositor_add_window (MetaCompositor *compositor,
|
||||
{
|
||||
MetaDisplay *display = compositor->display;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
|
||||
meta_window_actor_new (window);
|
||||
sync_actor_stacking (compositor);
|
||||
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -744,8 +748,10 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
||||
XEvent *event,
|
||||
MetaWindow *window)
|
||||
{
|
||||
MetaX11Display *x11_display = compositor->display->x11_display;
|
||||
|
||||
if (!meta_is_wayland_compositor () &&
|
||||
event->type == meta_display_get_damage_event_base (compositor->display) + XDamageNotify)
|
||||
event->type == meta_x11_display_get_damage_event_base (x11_display) + XDamageNotify)
|
||||
{
|
||||
/* Core code doesn't handle damage events, so we need to extract the MetaWindow
|
||||
* ourselves
|
||||
@@ -753,7 +759,7 @@ meta_compositor_process_event (MetaCompositor *compositor,
|
||||
if (window == NULL)
|
||||
{
|
||||
Window xwin = ((XDamageNotifyEvent *) event)->drawable;
|
||||
window = meta_display_lookup_x_window (compositor->display, xwin);
|
||||
window = meta_x11_display_lookup_x_window (x11_display, xwin);
|
||||
}
|
||||
|
||||
if (window)
|
||||
@@ -943,11 +949,13 @@ get_top_visible_window_actor (MetaCompositor *compositor)
|
||||
MetaWindowActor *window_actor = l->data;
|
||||
MetaWindow *window = meta_window_actor_get_meta_window (window_actor);
|
||||
MetaRectangle buffer_rect;
|
||||
MetaRectangle display_rect = { 0 };
|
||||
|
||||
meta_window_get_buffer_rect (window, &buffer_rect);
|
||||
meta_display_get_size (compositor->display,
|
||||
&display_rect.width, &display_rect.height);
|
||||
|
||||
if (meta_rectangle_overlap (&compositor->display->screen->rect,
|
||||
&buffer_rect))
|
||||
if (meta_rectangle_overlap (&display_rect, &buffer_rect))
|
||||
return window_actor;
|
||||
}
|
||||
|
||||
@@ -961,7 +969,7 @@ on_top_window_actor_destroyed (MetaWindowActor *window_actor,
|
||||
compositor->top_window_actor = NULL;
|
||||
compositor->windows = g_list_remove (compositor->windows, window_actor);
|
||||
|
||||
meta_stack_tracker_queue_sync_stack (compositor->display->screen->stack_tracker);
|
||||
meta_stack_tracker_queue_sync_stack (compositor->display->stack_tracker);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1169,7 +1177,7 @@ meta_pre_paint_func (gpointer data)
|
||||
if (compositor->have_x11_sync_object)
|
||||
compositor->have_x11_sync_object = meta_sync_ring_insert_wait ();
|
||||
else
|
||||
XSync (compositor->display->xdisplay, False);
|
||||
XSync (compositor->display->x11_display->xdisplay, False);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -1241,9 +1249,6 @@ meta_compositor_new (MetaDisplay *display)
|
||||
compositor->display = display;
|
||||
compositor->context = clutter_backend->cogl_context;
|
||||
|
||||
if (g_getenv("META_DISABLE_MIPMAPS"))
|
||||
compositor->no_mipmaps = TRUE;
|
||||
|
||||
g_signal_connect (meta_shadow_factory_get_default (),
|
||||
"changed",
|
||||
G_CALLBACK (on_shadow_factory_changed),
|
||||
@@ -1264,44 +1269,44 @@ meta_compositor_new (MetaDisplay *display)
|
||||
|
||||
/**
|
||||
* meta_get_overlay_window: (skip)
|
||||
* @screen: a #MetaScreen
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
*/
|
||||
Window
|
||||
meta_get_overlay_window (MetaScreen *screen)
|
||||
meta_get_overlay_window (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
return compositor->output;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_disable_unredirect_for_screen:
|
||||
* @screen: a #MetaScreen
|
||||
* meta_disable_unredirect_for_display:
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
* Disables unredirection, can be usefull in situations where having
|
||||
* unredirected windows is undesireable like when recording a video.
|
||||
*
|
||||
*/
|
||||
void
|
||||
meta_disable_unredirect_for_screen (MetaScreen *screen)
|
||||
meta_disable_unredirect_for_display (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
compositor->disable_unredirect_count++;
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_enable_unredirect_for_screen:
|
||||
* @screen: a #MetaScreen
|
||||
* meta_enable_unredirect_for_display:
|
||||
* @display: a #MetaDisplay
|
||||
*
|
||||
* Enables unredirection which reduces the overhead for apps like games.
|
||||
*
|
||||
*/
|
||||
void
|
||||
meta_enable_unredirect_for_screen (MetaScreen *screen)
|
||||
meta_enable_unredirect_for_display (MetaDisplay *display)
|
||||
{
|
||||
MetaCompositor *compositor = get_compositor_for_screen (screen);
|
||||
MetaCompositor *compositor = get_compositor_for_display (display);
|
||||
if (compositor->disable_unredirect_count == 0)
|
||||
g_warning ("Called enable_unredirect_for_screen while unredirection is enabled.");
|
||||
g_warning ("Called enable_unredirect_for_display while unredirection is enabled.");
|
||||
if (compositor->disable_unredirect_count > 0)
|
||||
compositor->disable_unredirect_count--;
|
||||
}
|
||||
@@ -1318,15 +1323,15 @@ flash_out_completed (ClutterTimeline *timeline,
|
||||
}
|
||||
|
||||
void
|
||||
meta_compositor_flash_screen (MetaCompositor *compositor,
|
||||
MetaScreen *screen)
|
||||
meta_compositor_flash_display (MetaCompositor *compositor,
|
||||
MetaDisplay *display)
|
||||
{
|
||||
ClutterActor *stage;
|
||||
ClutterActor *flash;
|
||||
ClutterTransition *transition;
|
||||
gfloat width, height;
|
||||
|
||||
stage = meta_get_stage_for_screen (screen);
|
||||
stage = meta_get_stage_for_display (display);
|
||||
clutter_actor_get_size (stage, &width, &height);
|
||||
|
||||
flash = clutter_actor_new ();
|
||||
|
@@ -3,7 +3,6 @@
|
||||
#ifndef META_BACKGROUND_ACTOR_PRIVATE_H
|
||||
#define META_BACKGROUND_ACTOR_PRIVATE_H
|
||||
|
||||
#include <meta/screen.h>
|
||||
#include <meta/meta-background-actor.h>
|
||||
|
||||
cairo_region_t *meta_background_actor_get_clip_region (MetaBackgroundActor *self);
|
||||
|
@@ -78,14 +78,15 @@
|
||||
|
||||
#include "cogl-utils.h"
|
||||
#include "clutter-utils.h"
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include "meta-background-actor-private.h"
|
||||
#include "meta-background-private.h"
|
||||
#include "meta-cullable.h"
|
||||
#include "meta/display.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_META_SCREEN = 1,
|
||||
PROP_META_DISPLAY = 1,
|
||||
PROP_MONITOR,
|
||||
PROP_BACKGROUND,
|
||||
PROP_GRADIENT,
|
||||
@@ -150,7 +151,7 @@ typedef enum {
|
||||
|
||||
struct _MetaBackgroundActorPrivate
|
||||
{
|
||||
MetaScreen *screen;
|
||||
MetaDisplay *display;
|
||||
int monitor;
|
||||
|
||||
MetaBackground *background;
|
||||
@@ -213,7 +214,9 @@ get_preferred_size (MetaBackgroundActor *self,
|
||||
MetaBackgroundActorPrivate *priv = META_BACKGROUND_ACTOR (self)->priv;
|
||||
MetaRectangle monitor_geometry;
|
||||
|
||||
meta_screen_get_monitor_geometry (priv->screen, priv->monitor, &monitor_geometry);
|
||||
meta_display_get_monitor_geometry (priv->display,
|
||||
priv->monitor,
|
||||
&monitor_geometry);
|
||||
|
||||
if (width != NULL)
|
||||
*width = monitor_geometry.width;
|
||||
@@ -381,7 +384,8 @@ setup_pipeline (MetaBackgroundActor *self,
|
||||
MetaRectangle monitor_geometry;
|
||||
float gradient_height_perc;
|
||||
|
||||
meta_screen_get_monitor_geometry (priv->screen, priv->monitor, &monitor_geometry);
|
||||
meta_display_get_monitor_geometry (priv->display,
|
||||
priv->monitor, &monitor_geometry);
|
||||
gradient_height_perc = MAX (0.0001, priv->gradient_height / (float)monitor_geometry.height);
|
||||
cogl_pipeline_set_uniform_1f (priv->pipeline,
|
||||
cogl_pipeline_get_uniform_location (priv->pipeline,
|
||||
@@ -548,8 +552,8 @@ meta_background_actor_set_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_META_SCREEN:
|
||||
priv->screen = g_value_get_object (value);
|
||||
case PROP_META_DISPLAY:
|
||||
priv->display = g_value_get_object (value);
|
||||
break;
|
||||
case PROP_MONITOR:
|
||||
meta_background_actor_set_monitor (self, g_value_get_int (value));
|
||||
@@ -609,8 +613,8 @@ meta_background_actor_get_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_META_SCREEN:
|
||||
g_value_set_object (value, priv->screen);
|
||||
case PROP_META_DISPLAY:
|
||||
g_value_set_object (value, priv->display);
|
||||
break;
|
||||
case PROP_MONITOR:
|
||||
g_value_set_int (value, priv->monitor);
|
||||
@@ -660,14 +664,14 @@ meta_background_actor_class_init (MetaBackgroundActorClass *klass)
|
||||
actor_class->get_paint_volume = meta_background_actor_get_paint_volume;
|
||||
actor_class->paint = meta_background_actor_paint;
|
||||
|
||||
param_spec = g_param_spec_object ("meta-screen",
|
||||
"MetaScreen",
|
||||
"MetaScreen",
|
||||
META_TYPE_SCREEN,
|
||||
param_spec = g_param_spec_object ("meta-display",
|
||||
"MetaDisplay",
|
||||
"MetaDisplay",
|
||||
META_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_META_SCREEN,
|
||||
PROP_META_DISPLAY,
|
||||
param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("monitor",
|
||||
@@ -778,13 +782,13 @@ meta_background_actor_init (MetaBackgroundActor *self)
|
||||
* Return value: the newly created background actor
|
||||
*/
|
||||
ClutterActor *
|
||||
meta_background_actor_new (MetaScreen *screen,
|
||||
int monitor)
|
||||
meta_background_actor_new (MetaDisplay *display,
|
||||
int monitor)
|
||||
{
|
||||
MetaBackgroundActor *self;
|
||||
|
||||
self = g_object_new (META_TYPE_BACKGROUND_ACTOR,
|
||||
"meta-screen", screen,
|
||||
"meta-display", display,
|
||||
"monitor", monitor,
|
||||
NULL);
|
||||
|
||||
@@ -923,12 +927,13 @@ meta_background_actor_set_monitor (MetaBackgroundActor *self,
|
||||
MetaBackgroundActorPrivate *priv = self->priv;
|
||||
MetaRectangle old_monitor_geometry;
|
||||
MetaRectangle new_monitor_geometry;
|
||||
MetaDisplay *display = priv->display;
|
||||
|
||||
if(priv->monitor == monitor)
|
||||
return;
|
||||
|
||||
meta_screen_get_monitor_geometry (priv->screen, priv->monitor, &old_monitor_geometry);
|
||||
meta_screen_get_monitor_geometry (priv->screen, monitor, &new_monitor_geometry);
|
||||
meta_display_get_monitor_geometry (display, priv->monitor, &old_monitor_geometry);
|
||||
meta_display_get_monitor_geometry (display, monitor, &new_monitor_geometry);
|
||||
if(old_monitor_geometry.height != new_monitor_geometry.height)
|
||||
invalidate_pipeline (self, CHANGED_GRADIENT_PARAMETERS);
|
||||
|
||||
|
@@ -17,9 +17,11 @@
|
||||
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include <meta/display.h>
|
||||
#include <meta/util.h>
|
||||
#include <meta/meta-background.h>
|
||||
#include <meta/meta-background-image.h>
|
||||
#include <meta/meta-monitor-manager.h>
|
||||
#include "meta-background-private.h"
|
||||
#include "cogl-utils.h"
|
||||
|
||||
@@ -44,7 +46,7 @@ struct _MetaBackgroundMonitor
|
||||
|
||||
struct _MetaBackgroundPrivate
|
||||
{
|
||||
MetaScreen *screen;
|
||||
MetaDisplay *display;
|
||||
MetaBackgroundMonitor *monitors;
|
||||
int n_monitors;
|
||||
|
||||
@@ -68,7 +70,7 @@ struct _MetaBackgroundPrivate
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_META_SCREEN = 1,
|
||||
PROP_META_DISPLAY = 1,
|
||||
PROP_MONITOR,
|
||||
};
|
||||
|
||||
@@ -128,8 +130,7 @@ free_wallpaper_texture (MetaBackground *self)
|
||||
}
|
||||
|
||||
static void
|
||||
on_monitors_changed (MetaScreen *screen,
|
||||
MetaBackground *self)
|
||||
invalidate_monitor_backgrounds (MetaBackground *self)
|
||||
{
|
||||
MetaBackgroundPrivate *priv = self->priv;
|
||||
|
||||
@@ -138,11 +139,11 @@ on_monitors_changed (MetaScreen *screen,
|
||||
priv->monitors = NULL;
|
||||
priv->n_monitors = 0;
|
||||
|
||||
if (priv->screen)
|
||||
if (priv->display)
|
||||
{
|
||||
int i;
|
||||
|
||||
priv->n_monitors = meta_screen_get_n_monitors (screen);
|
||||
priv->n_monitors = meta_display_get_n_monitors (priv->display);
|
||||
priv->monitors = g_new0 (MetaBackgroundMonitor, priv->n_monitors);
|
||||
|
||||
for (i = 0; i < priv->n_monitors; i++)
|
||||
@@ -151,27 +152,20 @@ on_monitors_changed (MetaScreen *screen,
|
||||
}
|
||||
|
||||
static void
|
||||
set_screen (MetaBackground *self,
|
||||
MetaScreen *screen)
|
||||
on_monitors_changed (MetaBackground *self)
|
||||
{
|
||||
invalidate_monitor_backgrounds (self);
|
||||
}
|
||||
|
||||
static void
|
||||
set_display (MetaBackground *self,
|
||||
MetaDisplay *display)
|
||||
{
|
||||
MetaBackgroundPrivate *priv = self->priv;
|
||||
|
||||
if (priv->screen != NULL)
|
||||
{
|
||||
g_signal_handlers_disconnect_by_func (priv->screen,
|
||||
(gpointer)on_monitors_changed,
|
||||
self);
|
||||
}
|
||||
g_set_object (&priv->display, display);
|
||||
|
||||
g_set_object (&priv->screen, screen);
|
||||
|
||||
if (priv->screen != NULL)
|
||||
{
|
||||
g_signal_connect (priv->screen, "monitors-changed",
|
||||
G_CALLBACK (on_monitors_changed), self);
|
||||
}
|
||||
|
||||
on_monitors_changed (priv->screen, self);
|
||||
invalidate_monitor_backgrounds (self);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -182,8 +176,8 @@ meta_background_set_property (GObject *object,
|
||||
{
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_META_SCREEN:
|
||||
set_screen (META_BACKGROUND (object), g_value_get_object (value));
|
||||
case PROP_META_DISPLAY:
|
||||
set_display (META_BACKGROUND (object), g_value_get_object (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
@@ -201,8 +195,8 @@ meta_background_get_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_META_SCREEN:
|
||||
g_value_set_object (value, priv->screen);
|
||||
case PROP_META_DISPLAY:
|
||||
g_value_set_object (value, priv->display);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
@@ -304,7 +298,7 @@ meta_background_dispose (GObject *object)
|
||||
set_file (self, &priv->file1, &priv->background_image1, NULL);
|
||||
set_file (self, &priv->file2, &priv->background_image2, NULL);
|
||||
|
||||
set_screen (self, NULL);
|
||||
set_display (self, NULL);
|
||||
|
||||
G_OBJECT_CLASS (meta_background_parent_class)->dispose (object);
|
||||
}
|
||||
@@ -322,11 +316,16 @@ meta_background_constructed (GObject *object)
|
||||
{
|
||||
MetaBackground *self = META_BACKGROUND (object);
|
||||
MetaBackgroundPrivate *priv = self->priv;
|
||||
MetaMonitorManager *monitor_manager = meta_monitor_manager_get ();
|
||||
|
||||
G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
|
||||
|
||||
g_signal_connect_object (meta_screen_get_display (priv->screen), "gl-video-memory-purged",
|
||||
g_signal_connect_object (priv->display, "gl-video-memory-purged",
|
||||
G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
|
||||
|
||||
g_signal_connect_object (monitor_manager, "monitors-changed",
|
||||
G_CALLBACK (on_monitors_changed), self,
|
||||
G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -351,14 +350,14 @@ meta_background_class_init (MetaBackgroundClass *klass)
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
param_spec = g_param_spec_object ("meta-screen",
|
||||
"MetaScreen",
|
||||
"MetaScreen",
|
||||
META_TYPE_SCREEN,
|
||||
param_spec = g_param_spec_object ("meta-display",
|
||||
"MetaDisplay",
|
||||
"MetaDisplay",
|
||||
META_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_META_SCREEN,
|
||||
PROP_META_DISPLAY,
|
||||
param_spec);
|
||||
|
||||
}
|
||||
@@ -407,7 +406,7 @@ get_texture_area (MetaBackground *self,
|
||||
set_texture_area_from_monitor_area (monitor_rect, texture_area);
|
||||
break;
|
||||
case G_DESKTOP_BACKGROUND_STYLE_WALLPAPER:
|
||||
meta_screen_get_size (priv->screen, &screen_width, &screen_height);
|
||||
meta_display_get_size (priv->display, &screen_width, &screen_height);
|
||||
|
||||
/* Start off by centering a tile in the middle of the
|
||||
* total screen area.
|
||||
@@ -476,7 +475,7 @@ get_texture_area (MetaBackground *self,
|
||||
/* paint region is the union of all monitors, with the origin
|
||||
* of the region set to align with monitor associated with the background.
|
||||
*/
|
||||
meta_screen_get_size (priv->screen, &screen_width, &screen_height);
|
||||
meta_display_get_size (priv->display, &screen_width, &screen_height);
|
||||
|
||||
/* unclipped texture area is whole screen */
|
||||
image_area.width = screen_width;
|
||||
@@ -750,7 +749,7 @@ meta_background_get_texture (MetaBackground *self,
|
||||
|
||||
monitor = &priv->monitors[monitor_index];
|
||||
|
||||
meta_screen_get_monitor_geometry (priv->screen, monitor_index, &geometry);
|
||||
meta_display_get_monitor_geometry (priv->display, monitor_index, &geometry);
|
||||
monitor_area.x = geometry.x;
|
||||
monitor_area.y = geometry.y;
|
||||
monitor_area.width = geometry.width;
|
||||
@@ -879,10 +878,10 @@ meta_background_get_texture (MetaBackground *self,
|
||||
}
|
||||
|
||||
MetaBackground *
|
||||
meta_background_new (MetaScreen *screen)
|
||||
meta_background_new (MetaDisplay *display)
|
||||
{
|
||||
return g_object_new (META_TYPE_BACKGROUND,
|
||||
"meta-screen", screen,
|
||||
"meta-display", display,
|
||||
NULL);
|
||||
}
|
||||
|
||||
|
@@ -27,6 +27,7 @@
|
||||
#include "core/display-private.h"
|
||||
#include "backends/meta-dnd-private.h"
|
||||
#include "meta/meta-dnd.h"
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
|
||||
struct _MetaDndClass
|
||||
{
|
||||
@@ -139,7 +140,7 @@ meta_dnd_notify_dnd_leave (MetaDnd *dnd)
|
||||
gboolean
|
||||
meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
MetaCompositor *compositor,
|
||||
MetaDisplay *display,
|
||||
Display *xdisplay,
|
||||
XEvent *xev)
|
||||
{
|
||||
MetaDnd *dnd = meta_backend_get_dnd (backend);
|
||||
@@ -152,23 +153,23 @@ meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
xev->xany.window != clutter_x11_get_stage_window (CLUTTER_STAGE (compositor->stage)))
|
||||
return FALSE;
|
||||
|
||||
if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndPosition"))
|
||||
if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndPosition", TRUE))
|
||||
{
|
||||
XEvent xevent;
|
||||
Window src = xev->xclient.data.l[0];
|
||||
|
||||
memset (&xevent, 0, sizeof(xevent));
|
||||
xevent.xany.type = ClientMessage;
|
||||
xevent.xany.display = display->xdisplay;
|
||||
xevent.xany.display = xdisplay;
|
||||
xevent.xclient.window = src;
|
||||
xevent.xclient.message_type = gdk_x11_get_xatom_by_name ("XdndStatus");
|
||||
xevent.xclient.message_type = XInternAtom (xdisplay, "XdndStatus", TRUE);
|
||||
xevent.xclient.format = 32;
|
||||
xevent.xclient.data.l[0] = output_window;
|
||||
/* flags: bit 0: will we accept the drop? bit 1: do we want more position messages */
|
||||
xevent.xclient.data.l[1] = 2;
|
||||
xevent.xclient.data.l[4] = None;
|
||||
|
||||
XSendEvent (display->xdisplay, src, False, 0, &xevent);
|
||||
XSendEvent (xdisplay, src, False, 0, &xevent);
|
||||
|
||||
meta_dnd_notify_dnd_position_change (dnd,
|
||||
(int)(xev->xclient.data.l[2] >> 16),
|
||||
@@ -176,13 +177,13 @@ meta_dnd_handle_xdnd_event (MetaBackend *backend,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndLeave"))
|
||||
else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndLeave", TRUE))
|
||||
{
|
||||
meta_dnd_notify_dnd_leave (dnd);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (xev->xclient.message_type == gdk_x11_get_xatom_by_name ("XdndEnter"))
|
||||
else if (xev->xclient.message_type == XInternAtom (xdisplay, "XdndEnter", TRUE))
|
||||
{
|
||||
meta_dnd_notify_dnd_enter (dnd);
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
#include "compositor-private.h"
|
||||
#include "meta-plugin-manager.h"
|
||||
#include <meta/prefs.h>
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include <meta/workspace.h>
|
||||
#include "meta-module.h"
|
||||
#include "window-private.h"
|
||||
|
@@ -23,7 +23,6 @@
|
||||
#define META_PLUGIN_MANAGER_H_
|
||||
|
||||
#include <meta/types.h>
|
||||
#include <meta/screen.h>
|
||||
#include <meta/meta-plugin.h>
|
||||
|
||||
typedef enum {
|
||||
|
@@ -28,7 +28,6 @@
|
||||
|
||||
#include <meta/meta-plugin.h>
|
||||
#include "meta-plugin-manager.h"
|
||||
#include <meta/screen.h>
|
||||
#include <meta/display.h>
|
||||
#include <meta/util.h>
|
||||
|
||||
@@ -191,19 +190,19 @@ meta_plugin_end_modal (MetaPlugin *plugin,
|
||||
}
|
||||
|
||||
/**
|
||||
* meta_plugin_get_screen:
|
||||
* meta_plugin_get_display:
|
||||
* @plugin: a #MetaPlugin
|
||||
*
|
||||
* Gets the #MetaScreen corresponding to a plugin.
|
||||
* Gets the #MetaDisplay corresponding to a plugin.
|
||||
*
|
||||
* Return value: (transfer none): the #MetaScreen for the plugin
|
||||
* Return value: (transfer none): the #MetaDisplay for the plugin
|
||||
*/
|
||||
MetaScreen *
|
||||
meta_plugin_get_screen (MetaPlugin *plugin)
|
||||
MetaDisplay *
|
||||
meta_plugin_get_display (MetaPlugin *plugin)
|
||||
{
|
||||
MetaPluginPrivate *priv = META_PLUGIN (plugin)->priv;
|
||||
|
||||
return priv->compositor->display->screen;
|
||||
return priv->compositor->display;
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -38,6 +38,20 @@
|
||||
|
||||
#include "meta-cullable.h"
|
||||
|
||||
/* MAX_MIPMAPPING_FPS needs to be as small as possible for the best GPU
|
||||
* performance, but higher than the refresh rate of commonly slow updating
|
||||
* windows like top or a blinking cursor, so that such windows do get
|
||||
* mipmapped.
|
||||
*/
|
||||
#define MAX_MIPMAPPING_FPS 5
|
||||
#define MIN_MIPMAP_AGE_USEC (G_USEC_PER_SEC / MAX_MIPMAPPING_FPS)
|
||||
|
||||
/* MIN_FAST_UPDATES_BEFORE_UNMIPMAP allows windows to update themselves
|
||||
* occasionally without causing mipmapping to be disabled, so long as such
|
||||
* an update takes fewer update_area calls than:
|
||||
*/
|
||||
#define MIN_FAST_UPDATES_BEFORE_UNMIPMAP 20
|
||||
|
||||
static void meta_shaped_texture_dispose (GObject *object);
|
||||
|
||||
static void meta_shaped_texture_paint (ClutterActor *actor);
|
||||
@@ -95,6 +109,11 @@ struct _MetaShapedTexturePrivate
|
||||
guint tex_width, tex_height;
|
||||
guint fallback_width, fallback_height;
|
||||
|
||||
gint64 prev_invalidation, last_invalidation;
|
||||
guint fast_updates;
|
||||
guint remipmap_timeout_id;
|
||||
gint64 earliest_remipmap;
|
||||
|
||||
guint create_mipmaps : 1;
|
||||
};
|
||||
|
||||
@@ -191,6 +210,12 @@ meta_shaped_texture_dispose (GObject *object)
|
||||
MetaShapedTexture *self = (MetaShapedTexture *) object;
|
||||
MetaShapedTexturePrivate *priv = self->priv;
|
||||
|
||||
if (priv->remipmap_timeout_id)
|
||||
{
|
||||
g_source_remove (priv->remipmap_timeout_id);
|
||||
priv->remipmap_timeout_id = 0;
|
||||
}
|
||||
|
||||
if (priv->paint_tower)
|
||||
meta_texture_tower_free (priv->paint_tower);
|
||||
priv->paint_tower = NULL;
|
||||
@@ -372,6 +397,21 @@ set_cogl_texture (MetaShapedTexture *stex,
|
||||
meta_texture_tower_set_base_texture (priv->paint_tower, cogl_tex);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
texture_is_idle_and_not_mipmapped (gpointer user_data)
|
||||
{
|
||||
MetaShapedTexture *stex = META_SHAPED_TEXTURE (user_data);
|
||||
MetaShapedTexturePrivate *priv = stex->priv;
|
||||
|
||||
if ((g_get_monotonic_time () - priv->earliest_remipmap) < 0)
|
||||
return G_SOURCE_CONTINUE;
|
||||
|
||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stex));
|
||||
priv->remipmap_timeout_id = 0;
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
static void
|
||||
meta_shaped_texture_paint (ClutterActor *actor)
|
||||
{
|
||||
@@ -381,9 +421,10 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
||||
guchar opacity;
|
||||
CoglContext *ctx;
|
||||
CoglFramebuffer *fb;
|
||||
CoglTexture *paint_tex;
|
||||
CoglTexture *paint_tex = NULL;
|
||||
ClutterActorBox alloc;
|
||||
CoglPipelineFilter filter;
|
||||
gint64 now = g_get_monotonic_time ();
|
||||
|
||||
if (priv->clip_region && cairo_region_is_empty (priv->clip_region))
|
||||
return;
|
||||
@@ -406,13 +447,34 @@ meta_shaped_texture_paint (ClutterActor *actor)
|
||||
* Setting the texture quality to high without SGIS_generate_mipmap
|
||||
* support for TFP textures will result in fallbacks to XGetImage.
|
||||
*/
|
||||
if (priv->create_mipmaps)
|
||||
paint_tex = meta_texture_tower_get_paint_texture (priv->paint_tower);
|
||||
else
|
||||
paint_tex = COGL_TEXTURE (priv->texture);
|
||||
if (priv->create_mipmaps && priv->last_invalidation)
|
||||
{
|
||||
gint64 age = now - priv->last_invalidation;
|
||||
|
||||
if (age >= MIN_MIPMAP_AGE_USEC ||
|
||||
priv->fast_updates < MIN_FAST_UPDATES_BEFORE_UNMIPMAP)
|
||||
paint_tex = meta_texture_tower_get_paint_texture (priv->paint_tower);
|
||||
}
|
||||
|
||||
if (paint_tex == NULL)
|
||||
return;
|
||||
{
|
||||
paint_tex = COGL_TEXTURE (priv->texture);
|
||||
|
||||
if (paint_tex == NULL)
|
||||
return;
|
||||
|
||||
if (priv->create_mipmaps)
|
||||
{
|
||||
/* Minus 1000 to ensure we don't fail the age test in timeout */
|
||||
priv->earliest_remipmap = now + MIN_MIPMAP_AGE_USEC - 1000;
|
||||
|
||||
if (!priv->remipmap_timeout_id)
|
||||
priv->remipmap_timeout_id =
|
||||
g_timeout_add (MIN_MIPMAP_AGE_USEC / 1000,
|
||||
texture_is_idle_and_not_mipmapped,
|
||||
stex);
|
||||
}
|
||||
}
|
||||
|
||||
tex_width = priv->tex_width;
|
||||
tex_height = priv->tex_height;
|
||||
@@ -632,46 +694,11 @@ effective_unobscured_region (MetaShapedTexture *self)
|
||||
return priv->unobscured_region;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_unobscured_bounds (MetaShapedTexture *self,
|
||||
cairo_rectangle_int_t *unobscured_bounds)
|
||||
{
|
||||
cairo_region_t *unobscured_region = effective_unobscured_region (self);
|
||||
|
||||
if (unobscured_region)
|
||||
{
|
||||
cairo_region_get_extents (unobscured_region, unobscured_bounds);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_shaped_texture_get_paint_volume (ClutterActor *actor,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
MetaShapedTexture *self = META_SHAPED_TEXTURE (actor);
|
||||
ClutterActorBox box;
|
||||
cairo_rectangle_int_t unobscured_bounds;
|
||||
|
||||
if (!clutter_actor_has_allocation (actor))
|
||||
return FALSE;
|
||||
|
||||
clutter_actor_get_allocation_box (actor, &box);
|
||||
|
||||
if (get_unobscured_bounds (self, &unobscured_bounds))
|
||||
{
|
||||
box.x1 = MAX (unobscured_bounds.x, box.x1);
|
||||
box.x2 = MIN (unobscured_bounds.x + unobscured_bounds.width, box.x2);
|
||||
box.y1 = MAX (unobscured_bounds.y, box.y1);
|
||||
box.y2 = MIN (unobscured_bounds.y + unobscured_bounds.height, box.y2);
|
||||
}
|
||||
box.x2 = MAX (box.x2, box.x1);
|
||||
box.y2 = MAX (box.y2, box.y1);
|
||||
|
||||
clutter_paint_volume_union_box (volume, &box);
|
||||
return TRUE;
|
||||
return clutter_paint_volume_set_from_allocation (volume, actor);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -758,6 +785,20 @@ meta_shaped_texture_update_area (MetaShapedTexture *stex,
|
||||
|
||||
meta_texture_tower_update_area (priv->paint_tower, x, y, width, height);
|
||||
|
||||
priv->prev_invalidation = priv->last_invalidation;
|
||||
priv->last_invalidation = g_get_monotonic_time ();
|
||||
|
||||
if (priv->prev_invalidation)
|
||||
{
|
||||
gint64 interval = priv->last_invalidation - priv->prev_invalidation;
|
||||
gboolean fast_update = interval < MIN_MIPMAP_AGE_USEC;
|
||||
|
||||
if (!fast_update)
|
||||
priv->fast_updates = 0;
|
||||
else if (priv->fast_updates < MIN_FAST_UPDATES_BEFORE_UNMIPMAP)
|
||||
priv->fast_updates++;
|
||||
}
|
||||
|
||||
unobscured_region = effective_unobscured_region (stex);
|
||||
if (unobscured_region)
|
||||
{
|
||||
|
@@ -30,11 +30,12 @@
|
||||
#include <X11/extensions/Xcomposite.h>
|
||||
#include <cogl/winsys/cogl-texture-pixmap-x11.h>
|
||||
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include "window-private.h"
|
||||
#include "meta-shaped-texture-private.h"
|
||||
#include "meta-cullable.h"
|
||||
#include "x11/window-x11.h"
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
|
||||
struct _MetaSurfaceActorX11Private
|
||||
{
|
||||
@@ -68,15 +69,15 @@ free_damage (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
if (priv->damage == None)
|
||||
return;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
XDamageDestroy (xdisplay, priv->damage);
|
||||
priv->damage = None;
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -84,7 +85,7 @@ detach_pixmap (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
MetaShapedTexture *stex = meta_surface_actor_get_texture (META_SURFACE_ACTOR (self));
|
||||
|
||||
if (priv->pixmap == None)
|
||||
@@ -97,10 +98,10 @@ detach_pixmap (MetaSurfaceActorX11 *self)
|
||||
meta_shaped_texture_set_texture (stex, NULL);
|
||||
cogl_flush ();
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
XFreePixmap (xdisplay, priv->pixmap);
|
||||
priv->pixmap = None;
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
|
||||
g_clear_pointer (&priv->texture, cogl_object_unref);
|
||||
}
|
||||
@@ -138,7 +139,7 @@ update_pixmap (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
if (priv->size_changed)
|
||||
{
|
||||
@@ -151,10 +152,10 @@ update_pixmap (MetaSurfaceActorX11 *self)
|
||||
Pixmap new_pixmap;
|
||||
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
new_pixmap = XCompositeNameWindowPixmap (xdisplay, xwindow);
|
||||
|
||||
if (meta_error_trap_pop_with_return (display) != Success)
|
||||
if (meta_x11_error_trap_pop_with_return (display->x11_display) != Success)
|
||||
{
|
||||
/* Probably a BadMatch if the window isn't viewable; we could
|
||||
* GrabServer/GetWindowAttributes/NameWindowPixmap/UngrabServer/Sync
|
||||
@@ -223,13 +224,13 @@ meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor)
|
||||
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
if (priv->received_damage)
|
||||
{
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
XDamageSubtract (xdisplay, priv->damage, None, None);
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
|
||||
priv->received_damage = FALSE;
|
||||
}
|
||||
@@ -311,10 +312,10 @@ sync_unredirected (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
MetaDisplay *display = priv->display;
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
|
||||
if (priv->unredirected)
|
||||
{
|
||||
@@ -326,7 +327,7 @@ sync_unredirected (MetaSurfaceActorX11 *self)
|
||||
XCompositeRedirectWindow (xdisplay, xwindow, CompositeRedirectManual);
|
||||
}
|
||||
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -403,7 +404,7 @@ static void
|
||||
create_damage (MetaSurfaceActorX11 *self)
|
||||
{
|
||||
MetaSurfaceActorX11Private *priv = meta_surface_actor_x11_get_instance_private (self);
|
||||
Display *xdisplay = meta_display_get_xdisplay (priv->display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (priv->display->x11_display);
|
||||
Window xwindow = meta_window_x11_get_toplevel_xwindow (priv->window);
|
||||
|
||||
priv->damage = XDamageCreate (xdisplay, xwindow, XDamageReportBoundingBox);
|
||||
|
@@ -101,6 +101,13 @@ meta_surface_actor_pick (ClutterActor *actor,
|
||||
clutter_actor_paint (child);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
meta_surface_actor_get_paint_volume (ClutterActor *actor,
|
||||
ClutterPaintVolume *volume)
|
||||
{
|
||||
return clutter_paint_volume_set_from_allocation (volume, actor);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_surface_actor_dispose (GObject *object)
|
||||
{
|
||||
@@ -120,6 +127,7 @@ meta_surface_actor_class_init (MetaSurfaceActorClass *klass)
|
||||
|
||||
object_class->dispose = meta_surface_actor_dispose;
|
||||
actor_class->pick = meta_surface_actor_pick;
|
||||
actor_class->get_paint_volume = meta_surface_actor_get_paint_volume;
|
||||
|
||||
signals[REPAINT_SCHEDULED] = g_signal_new ("repaint-scheduled",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
|
@@ -58,5 +58,6 @@ void meta_window_actor_effect_completed (MetaWindowActor *actor,
|
||||
|
||||
MetaSurfaceActor *meta_window_actor_get_surface (MetaWindowActor *self);
|
||||
void meta_window_actor_update_surface (MetaWindowActor *self);
|
||||
MetaWindowActor *meta_window_actor_from_window (MetaWindow *window);
|
||||
|
||||
#endif /* META_WINDOW_ACTOR_PRIVATE_H */
|
||||
|
@@ -16,7 +16,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <meta/display.h>
|
||||
#include <meta/errors.h>
|
||||
#include <meta/meta-x11-errors.h>
|
||||
#include "frame.h"
|
||||
#include <meta/window.h>
|
||||
#include <meta/meta-shaped-texture.h>
|
||||
@@ -37,6 +37,8 @@
|
||||
#include "meta-surface-actor.h"
|
||||
#include "meta-surface-actor-x11.h"
|
||||
|
||||
#include "x11/meta-x11-display-private.h"
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
#include "meta-surface-actor-wayland.h"
|
||||
#include "wayland/meta-wayland-surface.h"
|
||||
@@ -142,6 +144,8 @@ struct _FrameData
|
||||
enum
|
||||
{
|
||||
FIRST_FRAME,
|
||||
EFFECTS_COMPLETED,
|
||||
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@@ -238,6 +242,21 @@ meta_window_actor_class_init (MetaWindowActorClass *klass)
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
/**
|
||||
* MetaWindowActor::effects-completed:
|
||||
* @actor: the #MetaWindowActor instance
|
||||
*
|
||||
* The ::effects-completed signal will be emitted once all pending compositor
|
||||
* effects are completed.
|
||||
*/
|
||||
signals[EFFECTS_COMPLETED] =
|
||||
g_signal_new ("effects-completed",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
pspec = g_param_spec_object ("meta-window",
|
||||
"MetaWindow",
|
||||
"The displayed MetaWindow",
|
||||
@@ -433,7 +452,7 @@ meta_window_actor_update_surface (MetaWindowActor *self)
|
||||
|
||||
#ifdef HAVE_WAYLAND
|
||||
if (window->surface)
|
||||
surface_actor = window->surface->surface_actor;
|
||||
surface_actor = meta_wayland_surface_get_actor (window->surface);
|
||||
else
|
||||
#endif
|
||||
if (!meta_is_wayland_compositor ())
|
||||
@@ -1131,6 +1150,7 @@ meta_window_actor_after_effects (MetaWindowActor *self)
|
||||
return;
|
||||
}
|
||||
|
||||
g_signal_emit (self, signals[EFFECTS_COMPLETED], 0);
|
||||
meta_window_actor_sync_visibility (self);
|
||||
meta_window_actor_sync_actor_geometry (self, FALSE);
|
||||
}
|
||||
@@ -1953,7 +1973,7 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
|
||||
{
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
MetaDisplay *display = meta_window_get_display (priv->window);
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
XClientMessageEvent ev = { 0, };
|
||||
|
||||
@@ -1963,17 +1983,17 @@ do_send_frame_drawn (MetaWindowActor *self, FrameData *frame)
|
||||
|
||||
ev.type = ClientMessage;
|
||||
ev.window = meta_window_get_xwindow (priv->window);
|
||||
ev.message_type = display->atom__NET_WM_FRAME_DRAWN;
|
||||
ev.message_type = display->x11_display->atom__NET_WM_FRAME_DRAWN;
|
||||
ev.format = 32;
|
||||
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
|
||||
ev.data.l[1] = frame->sync_request_serial >> 32;
|
||||
ev.data.l[2] = frame->frame_drawn_time & G_GUINT64_CONSTANT(0xffffffff);
|
||||
ev.data.l[3] = frame->frame_drawn_time >> 32;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
|
||||
XFlush (xdisplay);
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -2021,13 +2041,13 @@ do_send_frame_timings (MetaWindowActor *self,
|
||||
{
|
||||
MetaWindowActorPrivate *priv = self->priv;
|
||||
MetaDisplay *display = meta_window_get_display (priv->window);
|
||||
Display *xdisplay = meta_display_get_xdisplay (display);
|
||||
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
|
||||
|
||||
XClientMessageEvent ev = { 0, };
|
||||
|
||||
ev.type = ClientMessage;
|
||||
ev.window = meta_window_get_xwindow (priv->window);
|
||||
ev.message_type = display->atom__NET_WM_FRAME_TIMINGS;
|
||||
ev.message_type = display->x11_display->atom__NET_WM_FRAME_TIMINGS;
|
||||
ev.format = 32;
|
||||
ev.data.l[0] = frame->sync_request_serial & G_GUINT64_CONSTANT(0xffffffff);
|
||||
ev.data.l[1] = frame->sync_request_serial >> 32;
|
||||
@@ -2047,10 +2067,10 @@ do_send_frame_timings (MetaWindowActor *self,
|
||||
ev.data.l[3] = refresh_interval;
|
||||
ev.data.l[4] = 1000 * META_SYNC_DELAY;
|
||||
|
||||
meta_error_trap_push (display);
|
||||
meta_x11_error_trap_push (display->x11_display);
|
||||
XSendEvent (xdisplay, ev.window, False, 0, (XEvent*) &ev);
|
||||
XFlush (xdisplay);
|
||||
meta_error_trap_pop (display);
|
||||
meta_x11_error_trap_pop (display->x11_display);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2157,3 +2177,9 @@ meta_window_actor_sync_updates_frozen (MetaWindowActor *self)
|
||||
|
||||
meta_window_actor_set_updates_frozen (self, meta_window_updates_are_frozen (window));
|
||||
}
|
||||
|
||||
MetaWindowActor *
|
||||
meta_window_actor_from_window (MetaWindow *window)
|
||||
{
|
||||
return META_WINDOW_ACTOR (meta_window_get_compositor_private (window));
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user