Compare commits

...

29 Commits

Author SHA1 Message Date
Carlos Garnacho
d7f799bfaf core: Only trigger MetaWorkspace::window-* on toplevel window types
Popups and other override-redirect windows are irrelevant to all listeners
of MetaWorkspace::window-*. Ignoring those windows will namely result in
less activity on ShellWindowTracker, less ShellApp::windows-changed
signal emissions and less AppMenuButton updates.

Reduces gnome-shell CPU activity while typing on the Epiphany addressbar,
as the pop up animation there results in a number of xdg_popup being
created and destroyed.

https://gitlab.gnome.org/GNOME/mutter/issues/556
2019-07-24 23:40:21 +02:00
Carlos Garnacho
09bab98b1e core: Avoid consecutive workspace changes in window construction
We first set the workspace to the transient-for parent's, and then
try to set on the current workspace. If both happen, we double the
work on adding/removing it from the workspace, and everything that
happens in result.

Should reduce some activity while typing on the Epiphany address
bar, as the animation results in a number of xdg_popup being created
and destroyed to handle the animation.

https://gitlab.gnome.org/GNOME/mutter/issues/556
2019-07-24 21:06:50 +02:00
Carlos Garnacho
aee8bfce3f core: Only notify on MetaWindow::user-time on actual changes
If the timestamp is the same, it doesn't make sense to update and we
don't do so. So it doesn't make sense to notify on the property either.

https://gitlab.gnome.org/GNOME/mutter/issues/556
2019-07-24 13:55:53 +02:00
Florian Müllner
92868182c9 build: Bump API version automatically each development cycle
Since the API version was added, we've bumped it at some point late-ish in
the cycle when enough changes had accumulated (but way after the first ABI
break). Automate that process by computing the API version automatically
from the project version:
With this commit, the new API version will be 5 for the remaining 3.33.x
releases and all 3.34.x stable versions; 3.35.1 will then bump it to 6 and
so forth.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/696
2019-07-23 22:37:54 +02:00
Florian Müllner
08a3cbfc6c clutter: Force an allocation on clone source if necessary
Since commit 0eab73dc, actors are only allocated when they are actually
visible. While this generally works well, it breaks - because of *course*
it does - ClutterClones when the clone source (or any of its ancestors)
is hidden.

Force an allocation in that case to allow the clone's paint to work as
intended.

https://gitlab.gnome.org/GNOME/mutter/issues/683
2019-07-23 01:38:38 +00:00
Iain Lane
59fb26cb00 cogl/tests: Only install run-tests.sh when building installed tests
This is a script for installed tests; leave it out otherwise.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/694
2019-07-22 22:07:39 +01:00
Florian Müllner
87c734cef9 cleanup: Really stop using G_TYPE_INSTANCE_GET_PRIVATE()
Commit 4259cfd4c6 missed some occurences, move those to the generated
get_instance_private() functions as well.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/691
2019-07-22 09:48:29 +00:00
Florian Müllner
c755fb6995 clutter-tests: Fix macro definitions
FOO_OBJECT() macros should cast to the corresponding instance type,
not the class.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/691
2019-07-22 09:48:29 +00:00
Mark Blakeney
e9cc220c8e x11: Remove benign warning for older X clients
The default configuration of libinput-gestures utility invokes wmctrl to
switch between desktops. It uses wmctrl because this works on both Xorg
and Wayland (via XWayland). Unfortunately, this generates the following
warning message every time, in both Xorg and Wayland desktops:

"Received a NET_CURRENT_DESKTOP message from a broken (outdated) client
who sent a 0 timestamp"

The desktop switch still works fine. The tiny code change here removes
this specific warning because, as the prefacing code comment originally
said and still says, older clients can validly pass a 0 time value so
why complain about that?

I also refactored the "if (workspace)" code slightly to avoid the double
test of the workspace value.

This is submitted for MR
https://gitlab.gnome.org/GNOME/mutter/merge_requests/671.
2019-07-22 07:31:41 +00:00
Rafael Fontenelle
92f210039e Update Brazilian Portuguese translation 2019-07-22 04:44:31 +00:00
Asier Sarasua Garmendia
aef393efd0 Update Basque translation 2019-07-21 18:41:30 +00:00
Florian Müllner
6836317e41 Bump version to 3.33.4
Update NEWS.
2019-07-20 14:27:14 +02:00
Jonas Ådahl
61e51cdef6 dma-buf: Mark DMA-BUF textures as paint-only
Reading pixels directly from a texture imported from a DMA-BUF EGLImage
may result compressed textures to be transferred into non-compressed
texture. This may have side effects causing it to be rendered
incorrectly in subsequent paints.

Avoid this by passing the no-get-data flag to the texture creator
function, eventually causing mutter to use an intermediate offscreen
framebuffer when reading pixels from such textures.

https://bugs.freedesktop.org/show_bug.cgi?id=111140
https://gitlab.freedesktop.org/xorg/xserver/issues/545

https://gitlab.gnome.org/GNOME/mutter/merge_requests/687
2019-07-18 14:09:22 +00:00
Jonas Ådahl
7868ab761f cogl/texture: Add EGLImage texture import flags
The flags are 'none', and 'no-get-data' meaning get_data() is not
supported.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/687
2019-07-18 14:09:22 +00:00
Jonas Ådahl
e6c8939c30 cogl/texture: Make is_get_data_supported() a bool on the texture
Comparing the gl target is not enough. More on that later.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/687
2019-07-18 14:09:22 +00:00
Olivier Fourdan
ac5d9ec558 keybindings: Do not grab the locate-pointer key if unnecessary
On X11, mutter needs to keep a grab on the locate-pointer key to be able
to trigger the functionality time the corresponding key combo is
pressed.

However, doing so may have side effects on other X11 clients that would
want to have a grab on the same key.

Make sure we only actually grab the key combo for "locate-pointer" only
when the feature is actually enabled, so that having the locate pointer
feature turned off (the default) would not cause side effects on other
X11 clients that might want to use the same key for their own use.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/647
2019-07-18 13:10:32 +00:00
Olivier Fourdan
9c8ff5dbe8 keybindings: Mark "locate-pointer" key as "no-auto-grab"
Mark the keybinding for locate-pointer as "no-auto-grab" so we don't
automatically redo the grab.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/685
2019-07-18 13:10:32 +00:00
Olivier Fourdan
7738316dff keybindings: Mark the "overlay" key as "no-auto-grab"
Mark the keybinding for overlay as "no-auto-grab" to skip it in
`change_binding_keygrabs()` so we don't automatically redo the grab.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/685
2019-07-18 13:10:32 +00:00
Olivier Fourdan
1c3d8defb5 keybindings: Add "no-auto-grab" type
Some special modifiers (typically "Control_L" used for locate-pointer in
mutter/gnome-shell or "Super_L" for overlay) must be handled separately
from the rest of the key bindings.

Add a new flag `META_KEY_BINDING_NO_AUTO_GRAB` so we can tell when
dealing with that special keybinding which should not be grabbed
automatically like the rest of the keybindings, and skip those when
changing the grabs of all keybindings.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/685
2019-07-18 13:10:32 +00:00
Olivier Fourdan
b2ae03c428 keybindings: Fix indentation
Small cleanup of indentation.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/685
2019-07-18 13:10:32 +00:00
Olivier Fourdan
456698c814 keybindings: Remove unneeded forward declaration
The functions `grab_key_bindings()` and `ungrab_key_bindings()` are not
used before their actual definition, there is no need to have a forward
declaration for those.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/685
2019-07-18 13:10:32 +00:00
Florian Müllner
9189b7b512 clutter: Stop using GParameter
The type has been deprecated, so stop using it. The easiest replacement
would be to add our own struct, but considering that separate name/value
arrays are easier to free (g_auto!) and we already do the split in one
place, go that route.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/689
2019-07-18 11:01:09 +02:00
Florian Müllner
4259cfd4c6 cleanup: Don't use G_TYPE_INSTANCE_GET_PRIVATE()
It has been deprecated in favor of the get_instance_private() function
generated by the G_ADD_PRIVATE() macro.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/689
2019-07-18 11:01:09 +02:00
Florian Müllner
4fdefb5b2e cleanup: Don't use g_memmove()
Glib stopped providing any fallback implementations on systems without
memmove() all the way back in 2013. Since then, the symbol is a simple
macro around memmove(); use that function directly now that glib added
a deprecation warning.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/689
2019-07-18 11:01:09 +02:00
Marco Trevisan (Treviño)
5ca0ef078d window-x11: Focus a window in the active workspace as take-focus fallback
Starting with commit 2db94e2e we try to focus a fallback default focus window
if no take-focus window candidate gets the input focus when we request it and
we limit the focus candidates to the current window's workspace.

However, if the window is unmanaging, the workspace might be unset, and we could
end up in deferencing a NULL pointer causing a crash.

So, in case the window's workspace is unset, just use the currently active
workspace for the display.

Closes https://gitlab.gnome.org/GNOME/mutter/issues/687

https://gitlab.gnome.org/GNOME/mutter/merge_requests/688
2019-07-18 10:09:45 +02:00
Daniel van Vugt
a5265365dd background: Reload when GPU memory is invalidated
Fixes corrupt background wallpaper when resuming from suspend on the
Nvidia driver.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/issues/1084

https://gitlab.gnome.org/GNOME/mutter/merge_requests/600
2019-07-16 16:24:41 +08:00
Robert Mader
62f576e15b events: Use new API to get MetaWindow from ClutterActor
The new API supports Wayland subsurfaces and is probably better placed.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/604
2019-07-13 15:32:19 +02:00
Robert Mader
73bc3c4426 window-actor: Add API to get a MetaWindowActor from a ClutterActor
Make it so it returns the closest ancestry MetaWindowActor if it
is a MetaSurfaceActor.
We need this for Wayland subsurfaces, so we can support actions like
Meta+Drag on them.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/604
2019-07-13 15:32:01 +02:00
Robert Mader
57772e5850 workspace-manager: Fix a documentation warning
Pure comment should not start with two stars. Fixes a GIR creation warning
introduced in 8038eaa99f.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/683
2019-07-12 22:01:27 +02:00
39 changed files with 584 additions and 1514 deletions

31
NEWS
View File

@@ -1,3 +1,34 @@
3.33.4
======
* Discard page flip retries on hotplug [Jonas; !630]
* Add xdg-output v2 support [Olivier; #645]
* Restore DRM format fallbacks [Jonas; !662]
* Don't emit ::size-changed when only position changed [Daniel; !568]
* Expose workspace layout properties [Florian; !618]
* Don't use grab modifiers when shortcuts are inhibited [Olivier; #642]
* Fix stuttering due to unchanged power save mode notifications [Georges; !674]
* Add API to reorder workspaces [Adam; !670]
* Make picking a new focus window more reliable [Marco; !669]
* Defer actor allocation till shown [Carlos; !677]
* Try to use primary GPU for copy instead of glReadPixels [Pekka; !615]
* Unset pointer focus when the cursor is hidden [Jonas D.; !448]
* Fix modifier-drag on wayland subsurfaces [Robert; !604]
* Fix background corruption on Nvidia after resuming from suspend [Daniel; !600]
* Only grab the locate-pointer key when necessary [Olivier; !685, #647]
* Misc. bug fixes and cleanups [Florian, Jonas, Daniel, Robert, Olivier,
Georges, Marco, Carlos, Emmanuele; !648, !650, !647, !656, !658, !637,
!663, !660, !659, !665, !666, !668, !667, #667, !676, !678, #672, !680,
!683, !688, !689, !687]
Contributors:
Jonas Ådahl, Emmanuele Bassi, Adam Bieńkowski, Piotr Drąg, Jonas Dreßler,
Olivier Fourdan, Carlos Garnacho, Robert Mader, Florian Müllner,
Georges Basile Stavracas Neto, Pekka Paalanen, Marco Trevisan (Treviño),
Daniel van Vugt
Translators:
Fabio Tomat [fur], Kukuh Syafaat [id]
3.33.3
======
* Prepare for running Xwayland on demand [Carlos; !420]

View File

@@ -252,6 +252,13 @@ clutter_clone_allocate (ClutterActor *self,
if (priv->clone_source == NULL)
return;
/* ClutterActor delays allocating until the actor is shown; however
* we cannot paint it correctly in that case, so force an allocation.
*/
if (clutter_actor_get_parent (priv->clone_source) != NULL &&
!clutter_actor_has_allocation (priv->clone_source))
clutter_actor_allocate_preferred_size (priv->clone_source, flags);
#if 0
/* XXX - this is wrong: ClutterClone cannot clone unparented
* actors, as it will break all invariants

View File

@@ -1636,14 +1636,17 @@ clutter_script_translate_parameters (ClutterScript *script,
GObject *object,
const gchar *name,
GList *properties,
GArray **params)
GPtrArray **param_names,
GArray **param_values)
{
ClutterScriptable *scriptable = NULL;
ClutterScriptableIface *iface = NULL;
GList *l, *unparsed;
gboolean parse_custom = FALSE;
*params = g_array_new (FALSE, FALSE, sizeof (GParameter));
*param_names = g_ptr_array_new_with_free_func (g_free);
*param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
g_array_set_clear_func (*param_values, (GDestroyNotify) g_value_unset);
if (CLUTTER_IS_SCRIPTABLE (object))
{
@@ -1659,7 +1662,7 @@ clutter_script_translate_parameters (ClutterScript *script,
for (l = properties; l != NULL; l = l->next)
{
PropertyInfo *pinfo = l->data;
GParameter param = { NULL };
GValue value = G_VALUE_INIT;
gboolean res = FALSE;
if (pinfo->is_child || pinfo->is_layout)
@@ -1676,12 +1679,12 @@ clutter_script_translate_parameters (ClutterScript *script,
pinfo->name);
if (parse_custom)
res = iface->parse_custom_node (scriptable, script, &param.value,
res = iface->parse_custom_node (scriptable, script, &value,
pinfo->name,
pinfo->node);
if (!res)
res = _clutter_script_parse_node (script, &param.value,
res = _clutter_script_parse_node (script, &value,
pinfo->name,
pinfo->node,
pinfo->pspec);
@@ -1693,9 +1696,8 @@ clutter_script_translate_parameters (ClutterScript *script,
continue;
}
param.name = g_strdup (pinfo->name);
g_array_append_val (*params, param);
g_ptr_array_add (*param_names, g_strdup (pinfo->name));
g_array_append_val (*param_values, value);
property_info_free (pinfo);
}
@@ -1710,7 +1712,8 @@ clutter_script_construct_parameters (ClutterScript *script,
GType gtype,
const gchar *name,
GList *properties,
GArray **construct_params)
GPtrArray **construct_param_names,
GArray **construct_param_values)
{
GObjectClass *klass;
GList *l, *unparsed;
@@ -1718,14 +1721,17 @@ clutter_script_construct_parameters (ClutterScript *script,
klass = g_type_class_ref (gtype);
g_assert (klass != NULL);
*construct_params = g_array_new (FALSE, FALSE, sizeof (GParameter));
*construct_param_names = g_ptr_array_new_with_free_func (g_free);
*construct_param_values = g_array_new (FALSE, FALSE, sizeof (GValue));
g_array_set_clear_func (*construct_param_values,
(GDestroyNotify) g_value_unset);
unparsed = NULL;
for (l = properties; l != NULL; l = l->next)
{
PropertyInfo *pinfo = l->data;
GParameter param = { NULL };
GValue value = G_VALUE_INIT;
GParamSpec *pspec = NULL;
/* we allow custom property names for classes, so if we
@@ -1749,9 +1755,7 @@ clutter_script_construct_parameters (ClutterScript *script,
continue;
}
param.name = g_strdup (pinfo->name);
if (!_clutter_script_parse_node (script, &param.value,
if (!_clutter_script_parse_node (script, &value,
pinfo->name,
pinfo->node,
pinfo->pspec))
@@ -1760,7 +1764,8 @@ clutter_script_construct_parameters (ClutterScript *script,
continue;
}
g_array_append_val (*construct_params, param);
g_ptr_array_add (*construct_param_names, g_strdup (pinfo->name));
g_array_append_val (*construct_param_values, value);
property_info_free (pinfo);
}
@@ -2087,7 +2092,8 @@ _clutter_script_apply_properties (ClutterScript *script,
gboolean set_custom_property = FALSE;
GObject *object = oinfo->object;
GList *properties;
GArray *params;
g_autoptr (GPtrArray) param_names = NULL;
g_autoptr (GArray) param_values = NULL;
guint i;
if (!oinfo->has_unresolved)
@@ -2111,34 +2117,31 @@ _clutter_script_apply_properties (ClutterScript *script,
object,
oinfo->id,
properties,
&params);
&param_names,
&param_values);
/* consume all the properties we could translate in this pass */
for (i = 0; i < params->len; i++)
for (i = 0; i < param_names->len; i++)
{
GParameter *param = &g_array_index (params, GParameter, i);
char *name = g_ptr_array_index (param_names, i);
GValue *value = &g_array_index (param_values, GValue, i);
CLUTTER_NOTE (SCRIPT,
"Setting %s property '%s' (type:%s) to object '%s' (id:%s)",
set_custom_property ? "custom" : "regular",
param->name,
g_type_name (G_VALUE_TYPE (&param->value)),
name,
g_type_name (G_VALUE_TYPE (value)),
g_type_name (oinfo->gtype),
oinfo->id);
if (set_custom_property)
iface->set_custom_property (scriptable, script,
param->name,
&param->value);
name,
value);
else
g_object_set_property (object, param->name, &param->value);
g_free ((gchar *) param->name);
g_value_unset (&param->value);
g_object_set_property (object, name, value);
}
g_array_free (params, TRUE);
_clutter_script_check_unresolved (script, oinfo);
}
@@ -2146,8 +2149,8 @@ void
_clutter_script_construct_object (ClutterScript *script,
ObjectInfo *oinfo)
{
GArray *params = NULL;
guint i;
g_autoptr (GPtrArray) param_names = NULL;
g_autoptr (GArray) param_values = NULL;
/* we have completely updated the object */
if (oinfo->object != NULL)
@@ -2190,25 +2193,14 @@ _clutter_script_construct_object (ClutterScript *script,
oinfo->gtype,
oinfo->id,
properties,
&params);
&param_names,
&param_values);
default_stage = clutter_stage_manager_get_default_stage (manager);
oinfo->object = G_OBJECT (default_stage);
for (i = 0; i < params->len; i++)
{
GParameter *param = &g_array_index (params, GParameter, i);
g_free ((gchar *) param->name);
g_value_unset (&param->value);
}
g_array_free (params, TRUE);
}
else
{
g_autoptr (GPtrArray) param_names = NULL;
GArray *param_values;
GList *properties = oinfo->properties;
/* every other object: first, we get the construction parameters */
@@ -2217,22 +2209,11 @@ _clutter_script_construct_object (ClutterScript *script,
oinfo->gtype,
oinfo->id,
properties,
&params);
/* Convert GParameter → (GStrv, GValue[]) */
param_names = g_ptr_array_sized_new (params->len);
param_values = g_array_sized_new (TRUE, FALSE, sizeof (GValue), params->len);
for (i = 0; i < params->len; i++)
{
GParameter *param = &g_array_index (params, GParameter, i);
g_ptr_array_add (param_names, (gchar *) param->name);
g_array_append_val (param_values, param->value);
}
g_ptr_array_add (param_names, NULL);
&param_names,
&param_values);
oinfo->object = g_object_new_with_properties (oinfo->gtype,
params->len,
param_names->len,
(const gchar **) param_names->pdata,
(const GValue *) param_values->data);
@@ -2241,17 +2222,6 @@ _clutter_script_construct_object (ClutterScript *script,
* else too or only by this ClutterScript object.
*/
g_object_ref_sink (oinfo->object);
for (i = 0; i < params->len; i++)
{
GParameter *param = &g_array_index (params, GParameter, i);
g_free ((gchar *) param->name);
g_value_unset (&param->value);
}
g_array_free (param_values, FALSE);
g_array_free (params, TRUE);
}
g_assert (oinfo->object != NULL);

View File

@@ -263,8 +263,6 @@ enum
static GParamSpec *obj_props[PROP_LAST];
#define CLUTTER_SCRIPT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), CLUTTER_TYPE_SCRIPT, ClutterScriptPrivate))
struct _ClutterScriptPrivate
{
GHashTable *objects;
@@ -377,7 +375,7 @@ object_info_free (gpointer data)
static void
clutter_script_finalize (GObject *gobject)
{
ClutterScriptPrivate *priv = CLUTTER_SCRIPT_GET_PRIVATE (gobject);
ClutterScriptPrivate *priv = CLUTTER_SCRIPT (gobject)->priv;
g_object_unref (priv->parser);
g_hash_table_destroy (priv->objects);

View File

@@ -171,7 +171,7 @@ clutter_text_buffer_normal_insert_text (ClutterTextBuffer *buffer,
/* Actual text insertion */
at = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
g_memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
memmove (pv->normal_text + at + n_bytes, pv->normal_text + at, pv->normal_text_bytes - at);
memcpy (pv->normal_text + at, chars, n_bytes);
/* Book keeping */
@@ -201,7 +201,7 @@ clutter_text_buffer_normal_delete_text (ClutterTextBuffer *buffer,
start = g_utf8_offset_to_pointer (pv->normal_text, position) - pv->normal_text;
end = g_utf8_offset_to_pointer (pv->normal_text, position + n_chars) - pv->normal_text;
g_memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
memmove (pv->normal_text + start, pv->normal_text + end, pv->normal_text_bytes + 1 - end);
pv->normal_text_chars -= n_chars;
pv->normal_text_bytes -= (end - start);

View File

@@ -13,7 +13,7 @@ G_BEGIN_DECLS
#define TEST_COGLBOX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
TEST_TYPE_COGLBOX, TestCoglboxClass))
TEST_TYPE_COGLBOX, TestCoglbox))
#define TEST_COGLBOX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
@@ -77,7 +77,7 @@ struct _TestCoglboxPrivate
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
(test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
/* Coglbox implementation
*--------------------------------------------------*/

View File

@@ -13,7 +13,7 @@ G_BEGIN_DECLS
#define TEST_COGLBOX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
TEST_TYPE_COGLBOX, TestCoglboxClass))
TEST_TYPE_COGLBOX, TestCoglbox))
#define TEST_COGLBOX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
@@ -76,7 +76,7 @@ struct _TestCoglboxPrivate
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
(test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
/* Coglbox implementation
*--------------------------------------------------*/

View File

@@ -13,7 +13,7 @@ G_BEGIN_DECLS
#define TEST_COGLBOX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
TEST_TYPE_COGLBOX, TestCoglboxClass))
TEST_TYPE_COGLBOX, TestCoglbox))
#define TEST_COGLBOX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
@@ -78,7 +78,7 @@ struct _TestCoglboxPrivate
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
((TestCoglboxPrivate *)test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
/* Coglbox implementation
*--------------------------------------------------*/

View File

@@ -14,7 +14,7 @@ G_BEGIN_DECLS
#define TEST_COGLBOX(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), \
TEST_TYPE_COGLBOX, TestCoglboxClass))
TEST_TYPE_COGLBOX, TestCoglbox))
#define TEST_COGLBOX_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), \
@@ -77,7 +77,7 @@ struct _TestCoglboxPrivate
G_DEFINE_TYPE_WITH_PRIVATE (TestCoglbox, test_coglbox, CLUTTER_TYPE_ACTOR);
#define TEST_COGLBOX_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), TEST_TYPE_COGLBOX, TestCoglboxPrivate))
(test_coglbox_get_instance_private (TEST_COGLBOX ((obj))))
/* Coglbox implementation
*--------------------------------------------------*/

View File

@@ -47,6 +47,7 @@ struct _CoglTexture2D
gboolean auto_mipmap;
gboolean mipmaps_dirty;
gboolean is_foreign;
gboolean is_get_data_supported;
/* TODO: factor out these OpenGL specific members into some form
* of driver private state. */

View File

@@ -106,6 +106,7 @@ _cogl_texture_2d_create_base (CoglContext *ctx,
tex_2d->mipmaps_dirty = TRUE;
tex_2d->auto_mipmap = TRUE;
tex_2d->is_get_data_supported = TRUE;
tex_2d->gl_target = GL_TEXTURE_2D;
@@ -240,6 +241,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int height,
CoglPixelFormat format,
EGLImageKHR image,
CoglEglImageFlags flags,
GError **error)
{
CoglTextureLoader *loader;
@@ -260,6 +262,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
loader->src.egl_image.width = width;
loader->src.egl_image.height = height;
loader->src.egl_image.format = format;
loader->src.egl_image.flags = flags;
tex = _cogl_texture_2d_create_base (ctx, width, height, format, loader);

View File

@@ -60,6 +60,12 @@ G_BEGIN_DECLS
typedef struct _CoglTexture2D CoglTexture2D;
#define COGL_TEXTURE_2D(X) ((CoglTexture2D *)X)
typedef enum _CoglEglImageFlags
{
COGL_EGL_IMAGE_FLAG_NONE = 0,
COGL_EGL_IMAGE_FLAG_NO_GET_DATA = 1 << 0,
} CoglEglImageFlags;
/**
* cogl_texture_2d_get_gtype:
*
@@ -219,6 +225,7 @@ cogl_egl_texture_2d_new_from_image (CoglContext *ctx,
int height,
CoglPixelFormat format,
EGLImageKHR image,
CoglEglImageFlags flags,
GError **error);
typedef gboolean (*CoglTexture2DEGLImageExternalAlloc) (CoglTexture2D *tex_2d,

View File

@@ -182,6 +182,7 @@ typedef struct _CoglTextureLoader
int width;
int height;
CoglPixelFormat format;
CoglEglImageFlags flags;
} egl_image;
#endif
#if defined (COGL_HAS_EGL_SUPPORT)

View File

@@ -320,6 +320,8 @@ allocate_from_egl_image (CoglTexture2D *tex_2d,
}
tex_2d->internal_format = internal_format;
tex_2d->is_get_data_supported =
!(loader->src.egl_image.flags & COGL_EGL_IMAGE_FLAG_NO_GET_DATA);
_cogl_texture_set_allocated (tex,
internal_format,
@@ -508,6 +510,7 @@ allocate_custom_egl_image_external (CoglTexture2D *tex_2d,
tex_2d->internal_format = internal_format;
tex_2d->gl_target = GL_TEXTURE_EXTERNAL_OES;
tex_2d->is_get_data_supported = FALSE;
return TRUE;
}
@@ -834,10 +837,7 @@ _cogl_texture_2d_gl_copy_from_bitmap (CoglTexture2D *tex_2d,
gboolean
_cogl_texture_2d_gl_is_get_data_supported (CoglTexture2D *tex_2d)
{
if (tex_2d->gl_target == GL_TEXTURE_EXTERNAL_OES)
return FALSE;
else
return TRUE;
return tex_2d->is_get_data_supported;
}
void

View File

@@ -801,6 +801,7 @@ _cogl_winsys_texture_pixmap_x11_create (CoglTexturePixmapX11 *tex_pixmap)
tex->height,
texture_format,
egl_tex_pixmap->image,
COGL_EGL_IMAGE_FLAG_NONE,
NULL));
tex_pixmap->winsys = egl_tex_pixmap;

View File

@@ -6,7 +6,9 @@ cdata.set('HAVE_GLES2', have_gles2.to_int())
cogl_installed_tests_libexecdir = join_paths(
mutter_installed_tests_libexecdir, 'cogl', 'conform')
install_data('run-tests.sh', install_dir: cogl_installed_tests_libexecdir)
if have_installed_tests
install_data('run-tests.sh', install_dir: cogl_installed_tests_libexecdir)
endif
cogl_config_env = configure_file(
input: 'config.env.in',

View File

@@ -1,12 +1,17 @@
project('mutter', 'c',
version: '3.33.3',
version: '3.33.4',
meson_version: '>= 0.50.0',
license: 'GPLv2+'
)
mutter_plugin_api_version = '3'
libmutter_api_version = '4'
split_version = meson.project_version().split('.')
# Automatically increase API version each development cycle,
# starting with 0 in 3.23.x
api_version = (split_version[1].to_int() - 23) / 2
libmutter_api_version = '@0@'.format(api_version)
# generic version requirements
fribidi_req = '>= 1.0.0'

1514
po/eu.po

File diff suppressed because it is too large Load Diff

View File

@@ -21,16 +21,16 @@ msgid ""
msgstr ""
"Project-Id-Version: mutter\n"
"Report-Msgid-Bugs-To: https://gitlab.gnome.org/GNOME/mutter/issues\n"
"POT-Creation-Date: 2019-02-04 17:52+0000\n"
"PO-Revision-Date: 2019-02-20 22:11-0300\n"
"POT-Creation-Date: 2019-07-18 13:55+0000\n"
"PO-Revision-Date: 2019-07-22 01:40-0300\n"
"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
"Language-Team: Portuguese - Brazil <gnome-pt_br-list@gnome.org>\n"
"Language-Team: Brazilian Portuguese <gnome-pt_br-list@gnome.org>\n"
"Language: pt_BR\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: Gtranslator 3.31.90\n"
"X-Generator: Gtranslator 3.32.0\n"
"X-Project-Style: gnome\n"
#: data/50-mutter-navigation.xml:6
@@ -406,6 +406,16 @@ msgid "Enable experimental features"
msgstr "Habilitar recursos experimentais"
#: data/org.gnome.mutter.gschema.xml.in:108
#| msgid ""
#| "To enable experimental features, add the feature keyword to the list. "
#| "Whether the feature requires restarting the compositor depends on the "
#| "given feature. Any experimental feature is not required to still be "
#| "available, or configurable. Dont expect adding anything in this setting "
#| "to be future proof. Currently possible keywords: • “scale-monitor-"
#| "framebuffer” — makes mutter default to layout logical monitors in a "
#| "logical pixel coordinate space, while scaling monitor framebuffers "
#| "instead of window content, to manage HiDPI monitors. Does not require a "
#| "restart."
msgid ""
"To enable experimental features, add the feature keyword to the list. "
"Whether the feature requires restarting the compositor depends on the given "
@@ -414,7 +424,9 @@ 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."
"manage HiDPI monitors. Does not require a restart. • “rt-scheduler” — makes "
"mutter request a low priority real-time scheduling. The executable or user "
"must have CAP_SYS_NICE. Requires a restart."
msgstr ""
"Para habilitar recursos experimentais, adicione a palavra-chave do recurso à "
"lista. Se o recurso exige ou não reiniciar o compositor, depende do recurso "
@@ -424,21 +436,31 @@ msgstr ""
"framebuffer” — torna o mutter padrão para a disposição de monitores lógicos "
"em um espaço lógico coordenado por pixels, ao dimensionar buffers de quadros "
"de monitor em vez de conteúdo de janela, para gerenciar monitores HiDPI. Não "
"exige uma reinicialização."
"exige uma reinicialização. • “rt-scheduler” — faz o mutter solicitar um "
"agendamento de tempo real de baixa prioridade. O executável ou usuário deve "
"ter CAP_SYS_NICE. Exige uma reinicialização."
#: data/org.gnome.mutter.gschema.xml.in:141
#: data/org.gnome.mutter.gschema.xml.in:132
msgid "Modifier to use to locate the pointer"
msgstr "Modificador para usar ao localizar o ponteiro"
#: data/org.gnome.mutter.gschema.xml.in:133
msgid "This key will initiate the “locate pointer” action."
msgstr "Essa chave vai iniciar a ação de “localizar ponteiro”."
#: data/org.gnome.mutter.gschema.xml.in:153
msgid "Select window from tab popup"
msgstr "Selecione a janela a partir da aba instantânea"
#: data/org.gnome.mutter.gschema.xml.in:146
#: data/org.gnome.mutter.gschema.xml.in:158
msgid "Cancel tab popup"
msgstr "Cancelar aba instantânea"
#: data/org.gnome.mutter.gschema.xml.in:151
#: data/org.gnome.mutter.gschema.xml.in:163
msgid "Switch monitor configurations"
msgstr "Trocar configurações de monitor"
#: data/org.gnome.mutter.gschema.xml.in:156
#: data/org.gnome.mutter.gschema.xml.in:168
msgid "Rotates the built-in monitor configuration"
msgstr "Gira a configuração de monitor embutido"
@@ -495,28 +517,44 @@ msgid "Re-enable shortcuts"
msgstr "Reabilita atalhos"
#: data/org.gnome.mutter.wayland.gschema.xml.in:64
msgid "Allow grabs with Xwayland"
msgstr "Permitir capturas com Xwayland"
#| msgid "Allow grabs with Xwayland"
msgid "Allow X11 grabs to lock keyboard focus with Xwayland"
msgstr "Permitir as capturas do X11 travar o foco do teclado com 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”."
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”."
"Allow all keyboard events to be routed to X11 “override redirect” windows "
"with a grab when running in Xwayland. This option is to support X11 clients "
"which map an “override redirect” window (which do not receive keyboard "
"focus) and issue a keyboard grab to force all keyboard events to that "
"window. This option is seldom used and has no effect on regular X11 windows "
"which can receive keyboard focus under normal circumstances. 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 capturas de teclado emitidas por aplicativos X11 em execução no "
"Xwayland para serem levadas em consideração. Para que uma captura de X11 "
"seja levada em consideração no Wayland, o cliente também deve enviar um X11 "
"ClientMessage específica para a janela raiz ou estar entre os aplicativos "
"listados em branco na chave “xwayland-grab-access-rules”."
"Permita que todos os eventos do teclado sejam roteados para as janelas "
"“override redirect” do X11 com uma captura ao executar no Xwayland. Esta "
"opção é para ter suporte a clientes X11 que mapeiam uma janela “override "
"redirect” (que não recebe o foco do teclado) e emitem uma captura de teclado "
"para forçar todos os eventos do teclado para aquela janela. Esta opção é "
"raramente usada e não tem efeito nas janelas comuns do X11, que podem "
"receber o foco do teclado em circunstâncias normais. Para que uma captura de "
"X11 seja levada em conta no Wayland, o cliente também deve enviar uma "
"ClientMessage específica do X11 para a janela raiz ou estar entre os "
"aplicativos na lista branca na chave “xwayland-grab-access-rules”."
#: data/org.gnome.mutter.wayland.gschema.xml.in:77
#: data/org.gnome.mutter.wayland.gschema.xml.in:84
msgid "Xwayland applications allowed to issue keyboard grabs"
msgstr "Aplicativos Xwayland com permissão para emitir capturas de teclado"
#: data/org.gnome.mutter.wayland.gschema.xml.in:78
#: data/org.gnome.mutter.wayland.gschema.xml.in:85
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 "
@@ -543,7 +581,7 @@ msgstr ""
#. TRANSLATORS: This string refers to a button that switches between
#. * different modes.
#.
#: src/backends/meta-input-settings.c:2423
#: src/backends/meta-input-settings.c:2531
#, c-format
msgid "Mode Switch (Group %d)"
msgstr "Alternador de modo (Grupo %d)"
@@ -551,52 +589,56 @@ msgstr "Alternador de modo (Grupo %d)"
#. TRANSLATORS: This string refers to an action, cycles drawing tablets'
#. * mapping through the available outputs.
#.
#: src/backends/meta-input-settings.c:2446
#: src/backends/meta-input-settings.c:2554
msgid "Switch monitor"
msgstr "Trocar monitor"
#: src/backends/meta-input-settings.c:2448
#: src/backends/meta-input-settings.c:2556
msgid "Show on-screen help"
msgstr "Mostrar ajuda na tela"
#: src/backends/meta-monitor-manager.c:954
#: src/backends/meta-monitor.c:223
msgid "Built-in display"
msgstr "Tela embutida"
#: src/backends/meta-monitor-manager.c:986
#: src/backends/meta-monitor.c:252
msgid "Unknown"
msgstr "Desconhecido"
#: src/backends/meta-monitor-manager.c:988
#: src/backends/meta-monitor.c:254
msgid "Unknown Display"
msgstr "Monitor desconhecido"
#: src/backends/meta-monitor-manager.c:996
#: src/backends/meta-monitor.c:262
#, c-format
#| msgid "%s %s"
msgctxt ""
"This is a monitor vendor name, followed by a size in inches, like 'Dell 15\"'"
msgid "%s %s"
msgstr "%s %s"
#: src/backends/meta-monitor-manager.c:1004
#: src/backends/meta-monitor.c:270
#, c-format
#| msgid "%s %s"
msgctxt ""
"This is a monitor vendor name followed by product/model name where size in "
"inches could not be calculated, e.g. Dell U2414H"
msgid "%s %s"
msgstr "%s %s"
#. Translators: this string will appear in Sysprof
#: src/backends/meta-profiler.c:82
#| msgid "Compositing Manager"
msgid "Compositor"
msgstr "Compositor"
#. 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:482
#: src/compositor/compositor.c:510
#, c-format
msgid ""
"Another compositing manager is already running on screen %i on display “%s”."
msgstr "Outro compositor de janelas está em execução na tela %i na área “%s”."
msgstr "Outro gerenciador de composição de janelas está em execução na tela %i na área “%s”."
#: src/core/bell.c:252
#: src/core/bell.c:192
msgid "Bell event"
msgstr "Evento de som"
@@ -645,16 +687,16 @@ msgid "Run with X11 backend"
msgstr "Executa com backend X11"
#. Translators: %s is a window title
#: src/core/meta-close-dialog-default.c:150
#: src/core/meta-close-dialog-default.c:151
#, c-format
msgid "“%s” is not responding."
msgstr "“%s” não está respondendo."
#: src/core/meta-close-dialog-default.c:152
#: src/core/meta-close-dialog-default.c:153
msgid "Application is not responding."
msgstr "O aplicativo não está respondendo."
#: src/core/meta-close-dialog-default.c:157
#: src/core/meta-close-dialog-default.c:158
msgid ""
"You may choose to wait a short while for it to continue or force the "
"application to quit entirely."
@@ -662,11 +704,11 @@ msgstr ""
"Você pode escolher aguardar um pouco e continuar ou forçar o aplicativo a "
"sair completamente."
#: src/core/meta-close-dialog-default.c:164
#: src/core/meta-close-dialog-default.c:165
msgid "_Force Quit"
msgstr "_Forçar sair"
#: src/core/meta-close-dialog-default.c:164
#: src/core/meta-close-dialog-default.c:165
msgid "_Wait"
msgstr "_Esperar"
@@ -694,7 +736,7 @@ msgstr "Versão impressa"
msgid "Mutter plugin to use"
msgstr "Plug-in do Mutter para usar"
#: src/core/prefs.c:1786
#: src/core/prefs.c:1849
#, c-format
msgid "Workspace %d"
msgstr "Espaço de trabalho %d"
@@ -708,7 +750,7 @@ msgstr "O Mutter foi compilado sem suporte para modo detalhado\n"
msgid "Mode Switch: Mode %d"
msgstr "Alternador de modo: Modo %d"
#: src/x11/meta-x11-display.c:666
#: src/x11/meta-x11-display.c:682
#, c-format
msgid ""
"Display “%s” already has a window manager; try using the --replace option to "
@@ -717,20 +759,25 @@ msgstr ""
"A exibição “%s” já possui um gerenciador de janelas; tente usar a opção --"
"replace para substituir o gerenciador de janelas atual."
#: src/x11/meta-x11-display.c:1008
#: src/x11/meta-x11-display.c:1024
msgid "Failed to initialize GDK\n"
msgstr "Falha ao inicializar GDK\n"
#: src/x11/meta-x11-display.c:1032
#: src/x11/meta-x11-display.c:1048
#, c-format
msgid "Failed to open X Window System display “%s”\n"
msgstr "Falha ao abrir a exibição “%s” do sistema de janelas X\n"
#: src/x11/meta-x11-display.c:1115
#: src/x11/meta-x11-display.c:1132
#, c-format
msgid "Screen %d on display “%s” is invalid\n"
msgstr "A tela %d na exibição “%s” é inválida\n"
#: src/x11/meta-x11-selection-input-stream.c:445
#, c-format
msgid "Format %s not supported"
msgstr "Sem suporte ao formato %s"
#: src/x11/session.c:1821
msgid ""
"These windows do not support “save current setup” and will have to be "
@@ -739,7 +786,7 @@ msgstr ""
"Estas janelas não oferecem suporte para a opção “salvar configuração atual” "
"e precisarão ser reiniciadas manualmente quando você reiniciar a sessão."
#: src/x11/window-props.c:568
#: src/x11/window-props.c:569
#, c-format
msgid "%s (on %s)"
msgstr "%s (em %s)"
@@ -2072,9 +2119,6 @@ msgstr "%s (em %s)"
#~ msgid "Commands to run in response to keybindings"
#~ msgstr "Comandos executados em resposta a teclas de atalho"
#~ msgid "Compositing Manager"
#~ msgstr "Gerenciador de composição"
#~ msgid "Control how new windows get focus"
#~ msgstr "Controla como novas janelas obtêm foco"

View File

@@ -302,7 +302,7 @@ meta_barrier_destroy (MetaBarrier *barrier)
static void
meta_barrier_init (MetaBarrier *barrier)
{
barrier->priv = G_TYPE_INSTANCE_GET_PRIVATE (barrier, META_TYPE_BARRIER, MetaBarrierPrivate);
barrier->priv = meta_barrier_get_instance_private (barrier);
}
void

View File

@@ -1870,6 +1870,7 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscre
uint32_t offsets[1];
uint64_t modifiers[1];
CoglPixelFormat cogl_format;
CoglEglImageFlags flags;
CoglTexture2D *cogl_tex;
CoglOffscreen *cogl_fbo;
int ret;
@@ -1919,11 +1920,13 @@ copy_shared_framebuffer_primary_gpu (CoglOnscreen *onscre
return FALSE;
}
flags = COGL_EGL_IMAGE_FLAG_NO_GET_DATA;
cogl_tex = cogl_egl_texture_2d_new_from_image (cogl_context,
dumb_fb->width,
dumb_fb->height,
cogl_format,
egl_image,
flags,
&error);
meta_egl_destroy_image (egl, egl_display, egl_image, NULL);

View File

@@ -252,12 +252,11 @@ static void
set_file (MetaBackground *self,
GFile **filep,
MetaBackgroundImage **imagep,
GFile *file)
GFile *file,
gboolean force_reload)
{
if (!file_equal0 (*filep, file))
if (force_reload || !file_equal0 (*filep, file))
{
g_clear_object (filep);
if (*imagep)
{
g_signal_handlers_disconnect_by_func (*imagep,
@@ -267,11 +266,12 @@ set_file (MetaBackground *self,
*imagep = NULL;
}
g_set_object (filep, file);
if (file)
{
MetaBackgroundImageCache *cache = meta_background_image_cache_get_default ();
*filep = g_object_ref (file);
*imagep = meta_background_image_cache_load (cache, file);
g_signal_connect (*imagep, "loaded",
G_CALLBACK (on_background_loaded), self);
@@ -279,6 +279,32 @@ set_file (MetaBackground *self,
}
}
static void
on_gl_video_memory_purged (MetaBackground *self)
{
MetaBackgroundImageCache *cache = meta_background_image_cache_get_default ();
/* The GPU memory that just got invalidated is the texture inside
* self->background_image1,2 and/or its mipmaps. However, to save memory the
* original pixbuf isn't kept in RAM so we can't do a simple re-upload. The
* only copy of the image was the one in texture memory that got invalidated.
* So we need to do a full reload from disk.
*/
if (self->file1)
{
meta_background_image_cache_purge (cache, self->file1);
set_file (self, &self->file1, &self->background_image1, self->file1, TRUE);
}
if (self->file2)
{
meta_background_image_cache_purge (cache, self->file2);
set_file (self, &self->file2, &self->background_image2, self->file2, TRUE);
}
mark_changed (self);
}
static void
meta_background_dispose (GObject *object)
{
@@ -287,8 +313,8 @@ meta_background_dispose (GObject *object)
free_color_texture (self);
free_wallpaper_texture (self);
set_file (self, &self->file1, &self->background_image1, NULL);
set_file (self, &self->file2, &self->background_image2, NULL);
set_file (self, &self->file1, &self->background_image1, NULL, FALSE);
set_file (self, &self->file2, &self->background_image2, NULL, FALSE);
set_display (self, NULL);
@@ -312,7 +338,7 @@ meta_background_constructed (GObject *object)
G_OBJECT_CLASS (meta_background_parent_class)->constructed (object);
g_signal_connect_object (self->display, "gl-video-memory-purged",
G_CALLBACK (mark_changed), object, G_CONNECT_SWAPPED);
G_CALLBACK (on_gl_video_memory_purged), object, G_CONNECT_SWAPPED);
g_signal_connect_object (monitor_manager, "monitors-changed",
G_CALLBACK (on_monitors_changed), self,
@@ -937,8 +963,8 @@ meta_background_set_blend (MetaBackground *self,
g_return_if_fail (META_IS_BACKGROUND (self));
g_return_if_fail (blend_factor >= 0.0 && blend_factor <= 1.0);
set_file (self, &self->file1, &self->background_image1, file1);
set_file (self, &self->file2, &self->background_image2, file2);
set_file (self, &self->file1, &self->background_image1, file1, FALSE);
set_file (self, &self->file2, &self->background_image2, file2, FALSE);
self->blend_factor = blend_factor;
self->style = style;

View File

@@ -41,9 +41,6 @@ struct _MetaModulePrivate
GType plugin_type;
};
#define META_MODULE_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_MODULE, MetaModulePrivate))
G_DEFINE_TYPE_WITH_PRIVATE (MetaModule, meta_module, G_TYPE_TYPE_MODULE);
static gboolean
@@ -192,7 +189,7 @@ meta_module_class_init (MetaModuleClass *klass)
static void
meta_module_init (MetaModule *self)
{
self->priv = META_MODULE_GET_PRIVATE (self);
self->priv = meta_module_get_instance_private (self);
}
GType

View File

@@ -86,5 +86,6 @@ void meta_window_actor_assign_surface_actor (MetaWindowActor *self,
MetaSurfaceActor *surface_actor);
MetaWindowActor *meta_window_actor_from_window (MetaWindow *window);
MetaWindowActor *meta_window_actor_from_actor (ClutterActor *actor);
#endif /* META_WINDOW_ACTOR_PRIVATE_H */

View File

@@ -2035,3 +2035,21 @@ screen_cast_window_iface_init (MetaScreenCastWindowInterface *iface)
iface->capture_into = meta_window_actor_capture_into;
iface->has_damage = meta_window_actor_has_damage;
}
MetaWindowActor *
meta_window_actor_from_actor (ClutterActor *actor)
{
if (!META_IS_SURFACE_ACTOR (actor))
return NULL;
do
{
actor = clutter_actor_get_parent (actor);
if (META_IS_WINDOW_ACTOR (actor))
return META_WINDOW_ACTOR (actor);
}
while (actor != NULL);
return NULL;
}

View File

@@ -50,9 +50,6 @@
#define META_IS_DEFAULT_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), META_TYPE_DEFAULT_PLUGIN))
#define META_DEFAULT_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginClass))
#define META_DEFAULT_PLUGIN_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), META_TYPE_DEFAULT_PLUGIN, MetaDefaultPluginPrivate))
typedef struct _MetaDefaultPlugin MetaDefaultPlugin;
typedef struct _MetaDefaultPluginClass MetaDefaultPluginClass;
typedef struct _MetaDefaultPluginPrivate MetaDefaultPluginPrivate;
@@ -218,7 +215,7 @@ meta_default_plugin_init (MetaDefaultPlugin *self)
{
MetaDefaultPluginPrivate *priv;
self->priv = priv = META_DEFAULT_PLUGIN_GET_PRIVATE (self);
self->priv = priv = meta_default_plugin_get_instance_private (self);
priv->info.name = "Default Effects";
priv->info.version = "0.1";

View File

@@ -27,7 +27,7 @@
#include "backends/meta-cursor-tracker-private.h"
#include "backends/meta-idle-monitor-private.h"
#include "backends/x11/meta-backend-x11.h"
#include "compositor/meta-surface-actor.h"
#include "compositor/meta-window-actor-private.h"
#include "core/display-private.h"
#include "core/window-private.h"
#include "meta/meta-backend.h"
@@ -68,14 +68,16 @@ get_window_for_event (MetaDisplay *display,
case META_EVENT_ROUTE_NORMAL:
{
ClutterActor *source;
MetaWindowActor *window_actor;
/* Always use the key focused window for key events. */
if (IS_KEY_EVENT (event))
return stage_has_key_focus () ? display->focus_window : NULL;
source = clutter_event_get_source (event);
if (META_IS_SURFACE_ACTOR (source))
return meta_surface_actor_get_window (META_SURFACE_ACTOR (source));
window_actor = meta_window_actor_from_actor (source);
if (window_actor)
return meta_window_actor_get_meta_window (window_actor);
else
return NULL;
}

View File

@@ -154,6 +154,7 @@ GList *meta_prefs_get_keybindings (void);
void meta_prefs_get_overlay_binding (MetaKeyCombo *combo);
void meta_prefs_get_locate_pointer_binding (MetaKeyCombo *combo);
const char *meta_prefs_get_iso_next_group_option (void);
gboolean meta_prefs_is_locate_pointer_enabled (void);
void meta_x11_display_grab_keys (MetaX11Display *x11_display);
void meta_x11_display_ungrab_keys (MetaX11Display *x11_display);

View File

@@ -182,8 +182,8 @@ static gboolean process_keyboard_resize_grab (MetaDisplay *display,
MetaWindow *window,
ClutterKeyEvent *event);
static void grab_key_bindings (MetaDisplay *display);
static void ungrab_key_bindings (MetaDisplay *display);
static void maybe_update_locate_pointer_keygrab (MetaDisplay *display,
gboolean grab);
static GHashTable *key_handlers;
static GHashTable *external_grabs;
@@ -529,8 +529,8 @@ reload_iso_next_group_combos (MetaKeyBindingManager *keys)
static void
devirtualize_modifiers (MetaKeyBindingManager *keys,
MetaVirtualModifier modifiers,
unsigned int *mask)
MetaVirtualModifier modifiers,
unsigned int *mask)
{
*mask = 0;
@@ -1345,6 +1345,10 @@ prefs_changed_callback (MetaPreference pref,
switch (pref)
{
case META_PREF_LOCATE_POINTER:
maybe_update_locate_pointer_keygrab (display,
meta_prefs_is_locate_pointer_enabled());
break;
case META_PREF_KEYBINDINGS:
ungrab_key_bindings (display);
rebuild_key_binding_table (keys);
@@ -1466,6 +1470,12 @@ change_keygrab_foreach (gpointer key,
if (data->only_per_window != binding_is_per_window)
return;
/* Ignore the key bindings marked as META_KEY_BINDING_NO_AUTO_GRAB,
* those are handled separately
*/
if (binding->flags & META_KEY_BINDING_NO_AUTO_GRAB)
return;
if (binding->resolved_combo.len == 0)
return;
@@ -1474,9 +1484,9 @@ change_keygrab_foreach (gpointer key,
static void
change_binding_keygrabs (MetaKeyBindingManager *keys,
Window xwindow,
gboolean only_per_window,
gboolean grab)
Window xwindow,
gboolean only_per_window,
gboolean grab)
{
ChangeKeygrabData data;
@@ -1488,6 +1498,21 @@ change_binding_keygrabs (MetaKeyBindingManager *keys,
g_hash_table_foreach (keys->key_bindings, change_keygrab_foreach, &data);
}
static void
maybe_update_locate_pointer_keygrab (MetaDisplay *display,
gboolean grab)
{
MetaKeyBindingManager *keys = &display->key_binding_manager;
if (!display->x11_display)
return;
if (keys->locate_pointer_resolved_key_combo.len != 0)
meta_change_keygrab (keys, display->x11_display->xroot,
(!!grab & !!meta_prefs_is_locate_pointer_enabled()),
&keys->locate_pointer_resolved_key_combo);
}
static void
meta_x11_display_change_keygrabs (MetaX11Display *x11_display,
gboolean grab)
@@ -1499,9 +1524,7 @@ meta_x11_display_change_keygrabs (MetaX11Display *x11_display,
meta_change_keygrab (keys, x11_display->xroot,
grab, &keys->overlay_resolved_key_combo);
if (keys->locate_pointer_resolved_key_combo.len != 0)
meta_change_keygrab (keys, x11_display->xroot,
grab, &keys->locate_pointer_resolved_key_combo);
maybe_update_locate_pointer_keygrab (x11_display->display, grab);
for (i = 0; i < keys->n_iso_next_group_combos; i++)
meta_change_keygrab (keys, x11_display->xroot,
@@ -4453,13 +4476,13 @@ meta_display_init_keys (MetaDisplay *display)
handler = g_new0 (MetaKeyHandler, 1);
handler->name = g_strdup ("overlay-key");
handler->flags = META_KEY_BINDING_BUILTIN;
handler->flags = META_KEY_BINDING_BUILTIN | META_KEY_BINDING_NO_AUTO_GRAB;
g_hash_table_insert (key_handlers, g_strdup (handler->name), handler);
handler = g_new0 (MetaKeyHandler, 1);
handler->name = g_strdup ("locate-pointer-key");
handler->flags = META_KEY_BINDING_BUILTIN;
handler->flags = META_KEY_BINDING_BUILTIN | META_KEY_BINDING_NO_AUTO_GRAB;
g_hash_table_insert (key_handlers, g_strdup (handler->name), handler);

View File

@@ -150,9 +150,8 @@ meta_workspace_manager_class_init (MetaWorkspaceManagerClass *klass)
G_TYPE_INT,
META_TYPE_MOTION_DIRECTION);
/**
* Emitted when calling meta_workspace_manager_reorder_workspace.
*
/* Emitted when calling meta_workspace_manager_reorder_workspace.
*
* This signal is emitted when a workspace has been reordered to
* a different index. Note that other workspaces can change
* their index too when reordering happens.

View File

@@ -60,6 +60,7 @@
#define KEY_OVERLAY_KEY "overlay-key"
#define KEY_WORKSPACES_ONLY_ON_PRIMARY "workspaces-only-on-primary"
#define KEY_LOCATE_POINTER "locate-pointer"
/* These are the different schemas we are keeping
* a GSettings instance for */
@@ -100,6 +101,7 @@ static gboolean bell_is_visible = FALSE;
static gboolean bell_is_audible = TRUE;
static gboolean gnome_accessibility = FALSE;
static gboolean gnome_animations = TRUE;
static gboolean locate_pointer_is_enabled = FALSE;
static char *cursor_theme = NULL;
/* cursor_size will, when running as an X11 compositing window manager, be the
* actual cursor size, multiplied with the global window scaling factor. On
@@ -147,6 +149,7 @@ static gboolean mouse_button_mods_handler (GVariant*, gpointer*, gpointer);
static gboolean button_layout_handler (GVariant*, gpointer*, gpointer);
static gboolean overlay_key_handler (GVariant*, gpointer*, gpointer);
static gboolean locate_pointer_key_handler (GVariant*, gpointer*, gpointer);
static gboolean iso_next_group_handler (GVariant*, gpointer*, gpointer);
static void init_bindings (void);
@@ -384,6 +387,13 @@ static MetaBoolPreference preferences_bool[] =
},
&auto_maximize,
},
{
{ KEY_LOCATE_POINTER,
SCHEMA_INTERFACE,
META_PREF_LOCATE_POINTER,
},
&locate_pointer_is_enabled,
},
{ { NULL, 0, 0 }, NULL },
};
@@ -960,6 +970,8 @@ meta_prefs_init (void)
G_CALLBACK (settings_changed), NULL);
g_signal_connect (settings, "changed::" KEY_GNOME_CURSOR_SIZE,
G_CALLBACK (settings_changed), NULL);
g_signal_connect (settings, "changed::" KEY_LOCATE_POINTER,
G_CALLBACK (settings_changed), NULL);
g_hash_table_insert (settings_schemas, g_strdup (SCHEMA_INTERFACE), settings);
settings = g_settings_new (SCHEMA_INPUT_SOURCES);
@@ -1680,6 +1692,9 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_AUTO_MAXIMIZE:
return "AUTO_MAXIMIZE";
case META_PREF_LOCATE_POINTER:
return "LOCATE_POINTER";
}
return "(unknown)";
@@ -2020,6 +2035,12 @@ meta_prefs_get_locate_pointer_binding (MetaKeyCombo *combo)
*combo = locate_pointer_key_combo;
}
gboolean
meta_prefs_is_locate_pointer_enabled (void)
{
return locate_pointer_is_enabled;
}
const char *
meta_prefs_get_iso_next_group_option (void)
{

View File

@@ -1296,8 +1296,7 @@ _meta_window_shared_new (MetaDisplay *display,
window->transient_for->on_all_workspaces_requested,
window->transient_for->workspace);
}
if (window->on_all_workspaces)
else if (window->on_all_workspaces)
{
meta_topic (META_DEBUG_PLACEMENT,
"Putting window %s on all workspaces\n",
@@ -7101,9 +7100,9 @@ meta_window_set_user_time (MetaWindow *window,
if (meta_prefs_get_focus_new_windows () == G_DESKTOP_FOCUS_NEW_WINDOWS_STRICT &&
window_is_terminal (window))
window->display->allow_terminal_deactivation = FALSE;
}
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_USER_TIME]);
g_object_notify_by_pspec (G_OBJECT (window), obj_props[PROP_USER_TIME]);
}
}
/**

View File

@@ -372,7 +372,12 @@ meta_workspace_add_window (MetaWorkspace *workspace,
meta_workspace_invalidate_work_area (workspace);
}
g_signal_emit (workspace, signals[WINDOW_ADDED], 0, window);
if (window->type == META_WINDOW_NORMAL ||
window->type == META_WINDOW_DIALOG ||
window->type == META_WINDOW_MODAL_DIALOG ||
window->type == META_WINDOW_UTILITY)
g_signal_emit (workspace, signals[WINDOW_ADDED], 0, window);
g_object_notify_by_pspec (G_OBJECT (workspace), obj_props[PROP_N_WINDOWS]);
}
@@ -393,7 +398,12 @@ meta_workspace_remove_window (MetaWorkspace *workspace,
meta_workspace_invalidate_work_area (workspace);
}
g_signal_emit (workspace, signals[WINDOW_REMOVED], 0, window);
if (window->type == META_WINDOW_NORMAL ||
window->type == META_WINDOW_DIALOG ||
window->type == META_WINDOW_MODAL_DIALOG ||
window->type == META_WINDOW_UTILITY)
g_signal_emit (workspace, signals[WINDOW_REMOVED], 0, window);
g_object_notify (G_OBJECT (workspace), "n-windows");
}

View File

@@ -65,6 +65,7 @@
* @META_PREF_AUTO_MAXIMIZE: auto-maximize
* @META_PREF_CENTER_NEW_WINDOWS: center new windows
* @META_PREF_DRAG_THRESHOLD: drag threshold
* @META_PREF_LOCATE_POINTER: show pointer location
*/
/* Keep in sync with GSettings schemas! */
@@ -103,6 +104,7 @@ typedef enum
META_PREF_AUTO_MAXIMIZE,
META_PREF_CENTER_NEW_WINDOWS,
META_PREF_DRAG_THRESHOLD,
META_PREF_LOCATE_POINTER,
} MetaPreference;
typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -436,6 +438,7 @@ typedef enum _MetaKeyBindingAction
* @META_KEY_BINDING_BUILTIN: built-in
* @META_KEY_BINDING_IS_REVERSED: is reversed
* @META_KEY_BINDING_NON_MASKABLE: always active
* @META_KEY_BINDING_NO_AUTO_GRAB: not grabbed automatically
*/
typedef enum
{
@@ -445,6 +448,7 @@ typedef enum
META_KEY_BINDING_IS_REVERSED = 1 << 2,
META_KEY_BINDING_NON_MASKABLE = 1 << 3,
META_KEY_BINDING_IGNORE_AUTOREPEAT = 1 << 4,
META_KEY_BINDING_NO_AUTO_GRAB = 1 << 5,
} MetaKeyBindingFlags;
/**

View File

@@ -566,7 +566,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
}
else
g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable));
memmove (&(rect->clickable), &(rect->visible), sizeof (rect->clickable));
x = rect->visible.x - layout->button_margin.left * scale;
@@ -613,7 +613,7 @@ meta_frame_layout_calc_geometry (MetaFrameLayout *layout,
rect->clickable.height = button_height + button_y;
}
else
g_memmove (&(rect->clickable), &(rect->visible), sizeof(rect->clickable));
memmove (&(rect->clickable), &(rect->visible), sizeof (rect->clickable));
x = rect->visible.x + rect->visible.width + layout->button_margin.right * scale;
if (i < n_left - 1)

View File

@@ -289,6 +289,7 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
int format, width, height, y_inverted;
CoglPixelFormat cogl_format;
EGLImageKHR egl_image;
CoglEglImageFlags flags;
CoglTexture2D *texture_2d;
if (buffer->egl_image.texture)
@@ -343,10 +344,12 @@ egl_image_buffer_attach (MetaWaylandBuffer *buffer,
if (egl_image == EGL_NO_IMAGE_KHR)
return FALSE;
flags = COGL_EGL_IMAGE_FLAG_NONE;
texture_2d = cogl_egl_texture_2d_new_from_image (cogl_context,
width, height,
cogl_format,
egl_image,
flags,
error);
meta_egl_destroy_image (egl, egl_display, egl_image, NULL);

View File

@@ -79,6 +79,7 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
uint64_t modifiers[META_WAYLAND_DMA_BUF_MAX_FDS];
CoglPixelFormat cogl_format;
EGLImageKHR egl_image;
CoglEglImageFlags flags;
CoglTexture2D *texture;
if (buffer->dma_buf.texture)
@@ -134,11 +135,13 @@ meta_wayland_dma_buf_realize_texture (MetaWaylandBuffer *buffer,
if (egl_image == EGL_NO_IMAGE_KHR)
return FALSE;
flags = COGL_EGL_IMAGE_FLAG_NO_GET_DATA;
texture = cogl_egl_texture_2d_new_from_image (cogl_context,
dma_buf->width,
dma_buf->height,
cogl_format,
egl_image,
flags,
error);
meta_egl_destroy_image (egl, egl_display, egl_image, NULL);

View File

@@ -1580,19 +1580,18 @@ handle_other_xevent (MetaX11Display *x11_display,
workspace = meta_workspace_manager_get_workspace_by_index (workspace_manager, space);
/* Handle clients using the older version of the spec... */
if (time == 0 && workspace)
{
meta_warning ("Received a NET_CURRENT_DESKTOP message "
"from a broken (outdated) client who sent "
"a 0 timestamp\n");
time = meta_x11_display_get_current_time_roundtrip (x11_display);
}
if (workspace)
meta_workspace_activate (workspace, time);
{
/* Handle clients using the older version of the spec... */
if (time == 0)
time = meta_x11_display_get_current_time_roundtrip (x11_display);
meta_workspace_activate (workspace, time);
}
else
meta_verbose ("Don't know about workspace %d\n", space);
{
meta_verbose ("Don't know about workspace %d\n", space);
}
}
else if (event->xclient.message_type ==
x11_display->atom__NET_NUMBER_OF_DESKTOPS)

View File

@@ -886,15 +886,21 @@ meta_window_x11_maybe_focus_delayed (MetaWindow *window,
}
static void
maybe_focus_default_window (MetaWorkspace *workspace,
MetaWindow *not_this_one,
guint32 timestamp)
maybe_focus_default_window (MetaDisplay *display,
MetaWindow *not_this_one,
guint32 timestamp)
{
MetaStack *stack = workspace->display->stack;
MetaWorkspace *workspace;
MetaStack *stack = display->stack;
g_autoptr (GList) focusable_windows = NULL;
g_autoptr (GQueue) focus_candidates = NULL;
GList *l;
if (not_this_one && not_this_one->workspace)
workspace = not_this_one->workspace;
else
workspace = display->workspace_manager->active_workspace;
/* Go through all the focusable windows and try to focus them
* in order, waiting for a delay. The first one that replies to
* the request (in case of take focus windows) changing the display
@@ -988,7 +994,7 @@ meta_window_x11_focus (MetaWindow *window,
window->display->focus_window->unmanaging)
{
meta_display_unset_input_focus (window->display, timestamp);
maybe_focus_default_window (window->workspace, window,
maybe_focus_default_window (window->display, window,
timestamp);
}
}