Compare commits

...

7 Commits

Author SHA1 Message Date
Florian Müllner
46b8624833 Bump version to 3.23.3
Update NEWS.
2016-12-15 16:41:00 +01:00
Olivier Fourdan
76012506ff wayland: Preserve the event mask on the root window
A window manager must select the SubstructureRedirect mask on the root
window to receive the MapRequest from the X11 clients and manage the
windows. Without this event mask set, a window manager won't be able to
map any new window.

The Wayland selection code in mutter can change/clear the event mask on
the requestor window from a XSelectionRequest event when the window is
not managed by mutter/gnome-shell.

A rogue or simply buggy X11 client may send a XConvertSelection() on the
root window and mutter will happily change/clear its own event mask on
the root window, effectively turning itself into a regular X11 client
unable to map any new X11 window from the other X11 clients.

To avoid this, simply check that the requestor window is not the root
window prior to change/clear the event mask on that window.

https://bugzilla.gnome.org/show_bug.cgi?id=776128
2016-12-15 13:01:57 +01:00
Olivier Fourdan
1ab6ac2996 wayland: disconnect mapped signal handler on destroy
Commit 5eb5f72 - wayland: Check surface outputs after mapped state
changes connected the ::mapped signal handler, we need to disconnect it
on destroy to avoid a possible assertion failure in
update_surface_output_state()

https://bugzilla.gnome.org/show_bug.cgi?id=776036
2016-12-13 15:34:03 +01:00
Rui Matos
c98d5448ec wayland: Ensure we don't focus xdg_popups iff they're non-grabbing
Commit 4295fdb892 made us skip focusing
all xdg_popups instead of just non-grabbing ones as intended. This
means that when unmanaging a window we might select a xdg_popup window
to focus (in meta_stack_get_default_focus_window() ) but then since we
don't actually focus it we go on unmanaging the focused window which
triggers an assertion, as it should.

To avoid this and still fixing bug 771694 we can make use of the
MetaWindow->input property for non-grabbing xdg_popup windows since
their semantics, in this regard, are the same as no input X11 windows.

This way, when unmanaging a focused window while a xdg_popup is up,
we'll either give focus to the xdg_popup or not select the popup at
all to be focused if it's non-grabbing.

https://bugzilla.gnome.org/show_bug.cgi?id=775986
2016-12-13 15:03:39 +01:00
Rui Matos
cfafb0bfca MetaRendererNative: Flush all pending swap notifies on idle
We need to do swap notifications asynchronously from flip events since
these might be processed during swap buffers if we are waiting for the
previous frame's flip to continue with the current.

This means that we might have more than one swap notification queued
to be delivered when the idle handler runs. In that case we must
deliver all notifications for which we've already seen a flip event.

Failing to do so means that if a new frame, that only swaps buffers on
such a swap notification backlogged Onscreen, is started, when later
we get its flip event, we'd notify only an old frame which would hit
this MetaStageNative's frame_cb() early exit:

  if (global_frame_counter <= presented_frame_counter)
    return;

and we'd never finish the new frame and thus clutter's master clock
would be waiting forever stuck.

https://bugzilla.gnome.org/show_bug.cgi?id=774557
2016-12-07 16:48:22 +01:00
Florian Müllner
71077d582b cogl: Do not include both GLES2 and GL headers
EGLDevice requires a define from GLES2, even when GL is used instead.
As type definitions may conflict between the two, we shouldn't include
both at the same time. Instead, provide the missing define explicitly
when not using GLES2.

https://bugzilla.gnome.org/show_bug.cgi?id=774891
2016-12-02 18:15:39 +01:00
Carlos Garnacho
5eb5f72434 wayland: Check surface outputs after mapped state changes
So they consistently receive wl_surface.leave after the surface
is not visible anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=775478
2016-12-02 12:04:40 +01:00
8 changed files with 80 additions and 31 deletions

10
NEWS
View File

@@ -1,3 +1,13 @@
3.23.3
======
* Fix frequent freezes in multihead setups on wayland [Rui; #774557]
* Preserve root window mask on XSelectionRequest [Olivier; #776128]
* Misc. bug fixes [Carlos, Florian, Rui, Olivier; #775478, #774891, #775986,
#776036]
Contributors:
Olivier Fourdan, Carlos Garnacho, Rui Matos, Florian Müllner
3.23.2
======
* Stack docks below other windows on fullscreen monitors [Rui; #772937]

View File

@@ -47,8 +47,13 @@
#include "cogl-util-gl-private.h"
#if defined (COGL_HAS_EGL_SUPPORT)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include "cogl-egl-defines.h"
# ifndef COGL_HAS_GLES2
/* We need this define from GLES2, but can't include the header
as its type definitions may conflict with the GL ones
*/
# define GL_TEXTURE_EXTERNAL_OES 0x8D65
# endif
#endif
void

View File

@@ -2,7 +2,7 @@ AC_PREREQ(2.62)
m4_define([mutter_major_version], [3])
m4_define([mutter_minor_version], [23])
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

@@ -98,6 +98,9 @@ typedef struct _MetaOnscreenNative
gboolean pending_set_crtc;
int64_t pending_queue_swap_notify_frame_count;
int64_t pending_swap_notify_frame_count;
MetaRendererView *view;
int pending_flips;
} MetaOnscreenNative;
@@ -166,16 +169,19 @@ flush_pending_swap_notify (CoglFramebuffer *framebuffer)
if (onscreen_native->pending_swap_notify)
{
CoglFrameInfo *info =
g_queue_pop_head (&onscreen->pending_frame_infos);
CoglFrameInfo *info;
_cogl_onscreen_notify_frame_sync (onscreen, info);
_cogl_onscreen_notify_complete (onscreen, info);
while ((info = g_queue_peek_head (&onscreen->pending_frame_infos)) &&
info->global_frame_counter <= onscreen_native->pending_swap_notify_frame_count)
{
_cogl_onscreen_notify_frame_sync (onscreen, info);
_cogl_onscreen_notify_complete (onscreen, info);
cogl_object_unref (info);
g_queue_pop_head (&onscreen->pending_frame_infos);
}
onscreen_native->pending_swap_notify = FALSE;
cogl_object_unref (onscreen);
cogl_object_unref (info);
}
}
}
@@ -242,6 +248,9 @@ meta_onscreen_native_queue_swap_notify (CoglOnscreen *onscreen)
CoglRendererEGL *egl_renderer = cogl_renderer->winsys;
MetaRendererNative *renderer_native = egl_renderer->platform;
onscreen_native->pending_swap_notify_frame_count =
onscreen_native->pending_queue_swap_notify_frame_count;
if (onscreen_native->pending_swap_notify)
return;
@@ -850,6 +859,7 @@ meta_onscreen_native_swap_buffers_with_damage (CoglOnscreen *onscreen,
onscreen_native->pending_set_crtc = FALSE;
}
onscreen_native->pending_queue_swap_notify_frame_count = renderer_native->frame_counter;
meta_onscreen_native_flip_crtcs (onscreen);
}

View File

@@ -172,6 +172,11 @@ static void
meta_wayland_surface_role_shell_surface_managed (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
MetaWindow *window);
static void
surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
GParamSpec *pspec,
MetaWaylandSurface *surface);
static void
unset_param_value (GParameter *param)
{
@@ -406,6 +411,10 @@ meta_wayland_surface_destroy_window (MetaWaylandSurface *surface)
MetaDisplay *display = meta_get_display ();
guint32 timestamp = meta_display_get_current_time_roundtrip (display);
g_signal_handlers_disconnect_by_func (surface->surface_actor,
surface_actor_mapped_notify,
surface);
meta_window_unmanage (surface->window, timestamp);
}
@@ -1286,6 +1295,14 @@ surface_actor_painting (MetaSurfaceActorWayland *surface_actor,
meta_wayland_surface_update_outputs (surface);
}
static void
surface_actor_mapped_notify (MetaSurfaceActorWayland *surface_actor,
GParamSpec *pspec,
MetaWaylandSurface *surface)
{
meta_wayland_surface_update_outputs (surface);
}
MetaWaylandSurface *
meta_wayland_surface_create (MetaWaylandCompositor *compositor,
struct wl_client *client,
@@ -1309,6 +1326,10 @@ meta_wayland_surface_create (MetaWaylandCompositor *compositor,
G_CALLBACK (surface_actor_painting),
surface,
0);
g_signal_connect_object (surface->surface_actor,
"notify::mapped",
G_CALLBACK (surface_actor_mapped_notify),
surface, 0);
sync_drag_dest_funcs (surface);

View File

@@ -839,6 +839,17 @@ finish_popup_setup (MetaWaylandXdgPopup *xdg_popup)
xdg_popup->popup = popup;
}
else
{
/* The keyboard focus semantics for non-grabbing zxdg_shell_v6 popups
* is pretty undefined. Same applies for subsurfaces, but in practice,
* subsurfaces never receive keyboard focus, so it makes sense to
* do the same for non-grabbing popups.
*
* See https://bugzilla.gnome.org/show_bug.cgi?id=771694#c24
*/
window->input = FALSE;
}
}
static void

View File

@@ -117,24 +117,11 @@ static void
meta_window_wayland_focus (MetaWindow *window,
guint32 timestamp)
{
MetaWaylandSurface *surface = window->surface;
MetaWaylandSurfaceRoleShellSurface *shell_surface_role =
META_WAYLAND_SURFACE_ROLE_SHELL_SURFACE (surface->role);
/* The keyboard focus semantics for non-grabbing zxdg_shell_v6 popups
* is pretty undefined. Same applies for subsurfaces, but in practice,
* subsurfaces never receive keyboard focus, so it makes sense to
* do the same for non-grabbing popups.
*
* See https://bugzilla.gnome.org/show_bug.cgi?id=771694#c24
*/
if (META_IS_WAYLAND_XDG_POPUP (shell_surface_role))
return;
meta_display_set_input_focus_window (window->display,
window,
FALSE,
timestamp);
if (window->input)
meta_display_set_input_focus_window (window->display,
window,
FALSE,
timestamp);
}
static void

View File

@@ -546,6 +546,8 @@ static WaylandSelectionData *
wayland_selection_data_new (XSelectionRequestEvent *request_event,
MetaWaylandCompositor *compositor)
{
MetaDisplay *display = meta_get_display ();
MetaScreen *screen = display->screen;
MetaWaylandDataDevice *data_device;
MetaWaylandDataSource *wayland_source;
MetaSelectionBridge *selection;
@@ -595,7 +597,8 @@ wayland_selection_data_new (XSelectionRequestEvent *request_event,
data->window = meta_display_lookup_x_window (meta_get_display (),
data->request_event.requestor);
if (!data->window)
/* Do *not* change the event mask on the root window, bugger! */
if (!data->window && data->request_event.requestor != screen->xroot)
{
/* Not a managed window, set the PropertyChangeMask
* for INCR deletion notifications.
@@ -629,10 +632,12 @@ reply_selection_request (XSelectionRequestEvent *request_event,
static void
wayland_selection_data_free (WaylandSelectionData *data)
{
if (!data->window)
{
MetaDisplay *display = meta_get_display ();
MetaDisplay *display = meta_get_display ();
MetaScreen *screen = display->screen;
/* Do *not* change the event mask on the root window, bugger! */
if (!data->window && data->request_event.requestor != screen->xroot)
{
meta_error_trap_push (display);
XSelectInput (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
data->request_event.requestor, NoEventMask);