Compare commits

...

10 Commits

Author SHA1 Message Date
2f74ecd469 Bump version to 3.21.3
Update NEWS.
2016-06-21 21:04:52 +02:00
53a9411255 surface-actor: Keep track of ignored damage
We ignore all damage while a surface is frozen and queue a full
update instead once it's thawed. While not super efficient, this
isn't overly bad for the intended case of catching up with any
updates that happened during a compositor effect. However when
extended frame sync is used, surfaces are also frozen while the
client is drawing a frame, in which case the current behavior is
pretty damaging (pun intended), as we end up redrawing the entire
window each frame. To address this, keep track of the actual damage
we ignore and apply it when the surface is thawed.

https://bugzilla.gnome.org/show_bug.cgi?id=767798
2016-06-17 21:39:06 +02:00
989ec7fc60 wayland: Mark pending moved as moved
The result flag needs to be marked as moved even for pending moves,
otherwise the window's unconstrained_rect doesn't get updated in
meta_window_move_resize_internal() and the anchor grab is wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=764180
2016-06-13 17:31:35 +02:00
c72efc90cb wayland: Implement force-quit using kill()
The X11 backend uses EWMH's _NET_WM_PID to get the PID of an offending
client and kill its PID to force the client to terminate.

The Wayland backend is using a Wayland protocol error, but if the client
is hung, that will not be sufficient to kill the client.

Retrieve the client PID under Wayland using the Wayland client API
wl_client_get_credentials() and kill() the client the same way the X11
backend does.

https://bugzilla.gnome.org/show_bug.cgi?id=767464
2016-06-10 09:55:19 +02:00
e7430a4535 wayland: add extended state for tiled
xdg-shell allows desktop environments to extend the list of states
within a given range.

Use this possibility to add a new state for tiled so that gtk+ can
benefit from this.

https://bugzilla.gnome.org/show_bug.cgi?id=766860
2016-06-08 14:54:41 +02:00
2292458f5e wayland/*-shell: UTF-8 validate title, class and app ID strings
The protocol says these must be UTF-8 so let's ensure they are.

https://bugzilla.gnome.org/show_bug.cgi?id=752788
2016-06-07 20:17:39 +02:00
d62491f46e x11/window-props: Convert WM_NAME and WM_CLASS to UTF-8
gjs throws exceptions on non UTF-8 strings which, in some cases, crash
gnome-shell. ICCCM string properties are defined to be Latin-1 encoded
so we can try to convert them to avoid it.

Note that _NET_WM_NAME is defined to be UTF-8 and we already validate
it in utf8_string_from_results() .

https://bugzilla.gnome.org/show_bug.cgi?id=752788
2016-06-07 20:17:38 +02:00
8f7a36c53f window: Don't create invalid UTF-8 window description strings
printf string precision counts bytes so we may end up creating invalid
UTF-8 strings here. Instead, use glib's unicode aware methods to clip
the title.

https://bugzilla.gnome.org/show_bug.cgi?id=765535
2016-06-07 20:17:37 +02:00
8d7ae52565 stage: Fix function definition 2016-06-02 16:10:42 +02:00
cffd2a658b Updated Occitan translation 2016-05-30 19:00:16 +00:00
10 changed files with 112 additions and 26 deletions

15
NEWS
View File

@ -1,3 +1,18 @@
3.21.3
======
* Don't create invalid UTF-8 window description strings [Rui; #765535]
* Convert window titles and wm_class to UTF-8 [Rui; #752788]
* Communicate tiled state to GTK+ on wayland [Olivier; #766860]
* Use kill() to force-quit unresponsive wayland clients [Olivier; #767464]
* Fix window position when unmaximizing via DND on wayland [Olivier; #764180]
* Avoid full window redraws when using extended frame sync [Florian; #767798]
Contributors:
Olivier Fourdan, Rui Matos, Florian Müllner
Translations:
Cédric Valmary [oc]
3.21.2
======
* Clean up surface <-> shell interaction [Jonas; #763431]

View File

@ -2,7 +2,7 @@ AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [21])
m4_define([mutter_micro_version], [2])
m4_define([mutter_micro_version], [3])
m4_define([mutter_version],
[mutter_major_version.mutter_minor_version.mutter_micro_version])

View File

@ -6,9 +6,9 @@
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: 2016-04-29 13:18+0000\n"
"Report-Msgid-Bugs-To: http://bugzilla.gnome.org/enter_bug.cgi?"
"product=mutter&keywords=I18N+L10N&component=general\n"
"POT-Creation-Date: 2016-05-20 13:48+0000\n"
"PO-Revision-Date: 2016-05-08 18:48+0200\n"
"Last-Translator: Cédric Valmary (totenoc.eu) <cvalmary@yahoo.fr>\n"
"Language-Team: Tot En Òc\n"

View File

@ -47,7 +47,7 @@ typedef struct _MetaStagePrivate MetaStagePrivate;
G_DEFINE_TYPE_WITH_PRIVATE (MetaStage, meta_stage, CLUTTER_TYPE_STAGE);
static MetaOverlay *
meta_overlay_new ()
meta_overlay_new (void)
{
MetaOverlay *overlay;
CoglContext *ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());

View File

@ -25,7 +25,7 @@ struct _MetaSurfaceActorPrivate
cairo_region_t *input_region;
/* Freeze/thaw accounting */
guint needs_damage_all : 1;
cairo_region_t *pending_damage;
guint frozen : 1;
};
@ -261,9 +261,8 @@ meta_surface_actor_process_damage (MetaSurfaceActor *self,
* here on the off chance that this will stop the corresponding
* texture_from_pixmap from being update.
*
* needs_damage_all tracks that some unknown damage happened while the
* window was frozen so that when the window becomes unfrozen we can
* issue a full window update to cover any lost damage.
* pending_damage tracks any damage that happened while the window was
* frozen so that when can apply it when the window becomes unfrozen.
*
* It should be noted that this is an unreliable mechanism since it's
* quite likely that drivers will aim to provide a zero-copy
@ -271,7 +270,12 @@ meta_surface_actor_process_damage (MetaSurfaceActor *self,
* any drawing done to the window is always immediately reflected in the
* texture regardless of damage event handling.
*/
priv->needs_damage_all = TRUE;
cairo_rectangle_int_t rect = { .x = x, .y = y, .width = width, .height = height };
if (!priv->pending_damage)
priv->pending_damage = cairo_region_create_rectangle (&rect);
else
cairo_region_union_rectangle (priv->pending_damage, &rect);
return;
}
@ -332,16 +336,21 @@ meta_surface_actor_set_frozen (MetaSurfaceActor *self,
priv->frozen = frozen;
if (!frozen && priv->needs_damage_all)
if (!frozen && priv->pending_damage)
{
/* Since we ignore damage events while a window is frozen for certain effects
* we may need to issue an update_area() covering the whole pixmap if we
* don't know what real damage has happened. */
int i, n_rects = cairo_region_num_rectangles (priv->pending_damage);
cairo_rectangle_int_t rect;
meta_surface_actor_process_damage (self, 0, 0,
clutter_actor_get_width (CLUTTER_ACTOR (priv->texture)),
clutter_actor_get_height (CLUTTER_ACTOR (priv->texture)));
priv->needs_damage_all = FALSE;
/* Since we ignore damage events while a window is frozen for certain effects
* we need to apply the tracked damage now. */
for (i = 0; i < n_rects; i++)
{
cairo_region_get_rectangle (priv->pending_damage, i, &rect);
meta_surface_actor_process_damage (self, rect.x, rect.y,
rect.width, rect.height);
}
g_clear_pointer (&priv->pending_damage, cairo_region_destroy);
}
}

View File

@ -761,12 +761,18 @@ sync_client_window_mapped (MetaWindow *window)
static void
meta_window_update_desc (MetaWindow *window)
{
g_autofree gchar *title = NULL;
g_clear_pointer (&window->desc, g_free);
if (window->title)
title = g_utf8_substring (window->title, 0,
MIN (10, g_utf8_strlen (window->title, -1)));
if (window->client_type == META_WINDOW_CLIENT_TYPE_X11)
{
if (window->title)
window->desc = g_strdup_printf ("0x%lx (%.10s)", window->xwindow, window->title);
if (title)
window->desc = g_strdup_printf ("0x%lx (%s)", window->xwindow, title);
else
window->desc = g_strdup_printf ("0x%lx", window->xwindow);
}
@ -774,8 +780,8 @@ meta_window_update_desc (MetaWindow *window)
{
guint64 small_stamp = window->stamp - G_GUINT64_CONSTANT(0x100000000);
if (window->title)
window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT " (%.10s)", small_stamp, window->title);
if (title)
window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT " (%s)", small_stamp, title);
else
window->desc = g_strdup_printf ("W%" G_GUINT64_FORMAT , small_stamp);
}

View File

@ -400,6 +400,10 @@ wl_shell_surface_set_title (struct wl_client *client,
surface_from_wl_shell_surface_resource (resource);
g_clear_pointer (&wl_shell_surface->title, g_free);
if (!g_utf8_validate (title, -1, NULL))
title = "";
wl_shell_surface->title = g_strdup (title);
if (surface->window)
@ -417,6 +421,10 @@ wl_shell_surface_set_class (struct wl_client *client,
surface_from_wl_shell_surface_resource (resource);
g_clear_pointer (&wl_shell_surface->wm_class, g_free);
if (!g_utf8_validate (class_, -1, NULL))
class_ = "";
wl_shell_surface->wm_class = g_strdup (class_);
if (surface->window)

View File

@ -35,6 +35,13 @@
#include "wayland/meta-window-wayland.h"
#include "xdg-shell-unstable-v5-server-protocol.h"
/*
* Define GNOME additional states to xdg-shell
* The current reserved range for GNOME is 0x1000 - 0x1FFF
*/
#define XDG_SURFACE_STATE_GNOME_TILED 0x1000
struct _MetaWaylandXdgSurface
{
MetaWaylandSurfaceRoleShellSurface parent;
@ -136,6 +143,9 @@ xdg_surface_set_title (struct wl_client *client,
{
MetaWaylandSurface *surface = surface_from_xdg_surface_resource (resource);
if (!g_utf8_validate (title, -1, NULL))
title = "";
meta_window_set_title (surface->window, title);
}
@ -146,6 +156,9 @@ xdg_surface_set_app_id (struct wl_client *client,
{
MetaWaylandSurface *surface = surface_from_xdg_surface_resource (resource);
if (!g_utf8_validate (app_id, -1, NULL))
app_id = "";
meta_window_set_wm_class (surface->window, app_id, app_id);
}
@ -393,6 +406,13 @@ fill_states (struct wl_array *states, MetaWindow *window)
s = wl_array_add (states, sizeof *s);
*s = XDG_SURFACE_STATE_ACTIVATED;
}
/* GNOME extension to xdg-shell states */
if (window->tile_mode == META_TILE_LEFT ||
window->tile_mode == META_TILE_RIGHT)
{
s = wl_array_add (states, sizeof *s);
*s = XDG_SURFACE_STATE_GNOME_TILED;
}
}
static void

View File

@ -27,6 +27,8 @@
#include "meta-window-wayland.h"
#include <meta/errors.h>
#include <errno.h>
#include <string.h> /* for strerror () */
#include "window-private.h"
#include "boxes-private.h"
#include "stack-tracker.h"
@ -102,6 +104,24 @@ meta_window_wayland_kill (MetaWindow *window)
{
MetaWaylandSurface *surface = window->surface;
struct wl_resource *resource = surface->resource;
pid_t pid;
uid_t uid;
gid_t gid;
wl_client_get_credentials (wl_resource_get_client (resource), &pid, &uid, &gid);
if (pid > 0)
{
meta_topic (META_DEBUG_WINDOW_OPS,
"Killing %s with kill()\n",
window->desc);
if (kill (pid, 9) == 0)
return;
meta_topic (META_DEBUG_WINDOW_OPS,
"Failed to signal %s: %s\n",
window->desc, strerror (errno));
}
/* Send the client an unrecoverable error to kill the client. */
wl_resource_post_error (resource,
@ -283,6 +303,7 @@ meta_window_wayland_move_resize_internal (MetaWindow *window,
if (new_x != window->rect.x || new_y != window->rect.y)
{
*result |= META_MOVE_RESIZE_RESULT_MOVED;
wl_window->has_pending_move = TRUE;
wl_window->pending_move_x = new_x;
wl_window->pending_move_y = new_y;

View File

@ -635,7 +635,10 @@ reload_wm_name (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID)
{
set_window_title (window, value->v.str);
g_autofree gchar *title = g_convert (value->v.str, -1,
"UTF-8", "LATIN1",
NULL, NULL, NULL);
set_window_title (window, title);
meta_verbose ("Using WM_NAME for new title of %s: \"%s\"\n",
window->desc, window->title);
@ -969,9 +972,13 @@ reload_wm_class (MetaWindow *window,
{
if (value->type != META_PROP_VALUE_INVALID)
{
meta_window_set_wm_class (window,
value->v.class_hint.res_class,
value->v.class_hint.res_name);
g_autofree gchar *res_class = g_convert (value->v.class_hint.res_class, -1,
"UTF-8", "LATIN1",
NULL, NULL, NULL);
g_autofree gchar *res_name = g_convert (value->v.class_hint.res_name, -1,
"UTF-8", "LATIN1",
NULL, NULL, NULL);
meta_window_set_wm_class (window, res_class, res_name);
}
else
{