diff --git a/mutter-black-screen-during-login.patch b/mutter-black-screen-during-login.patch new file mode 100644 index 0000000..388b57d --- /dev/null +++ b/mutter-black-screen-during-login.patch @@ -0,0 +1,43 @@ +From 6d3e64226d43a55f4554e1dcacaf56d81d3dae86 Mon Sep 17 00:00:00 2001 +From: Ray Strode +Date: Thu, 20 Nov 2014 14:40:19 -0500 +Subject: Revert "screen: Set a black background for testing purposes" + +This reverts commit ec8ed1dbb04ce8169c0a38ddf066d5565117c587. + +1) It turns out to add a momentary flicker from the transition +between the login screen and user session +2) It actually isn't needed anymore since bug 733026 + +https://bugzilla.gnome.org/show_bug.cgi?id=740377 + +diff --git a/src/core/screen.c b/src/core/screen.c +index dbf3f60..b26137e 100644 +--- a/src/core/screen.c ++++ b/src/core/screen.c +@@ -496,15 +496,6 @@ create_guard_window (Display *xdisplay, MetaScreen *screen) + return guard_window; + } + +-/* Set a black background on the root window so that we don't +- * see confusing old copies of old windows when debugging +- * and testing. */ +-static void +-meta_screen_set_background (MetaScreen *screen) +-{ +- XSetWindowBackground (screen->display->xdisplay, screen->xroot, 0x00000000); +-} +- + MetaScreen* + meta_screen_new (MetaDisplay *display, + int number, +@@ -709,7 +700,6 @@ meta_screen_new (MetaDisplay *display, + reload_monitor_infos (screen); + + meta_screen_set_cursor (screen, META_CURSOR_DEFAULT); +- meta_screen_set_background (screen); + + /* Handle creating a no_focus_window for this screen */ + screen->no_focus_window = +-- +cgit v0.10.1 diff --git a/mutter-dont-overwrite-send_frame_messages_timer.patch b/mutter-dont-overwrite-send_frame_messages_timer.patch new file mode 100644 index 0000000..58584f3 --- /dev/null +++ b/mutter-dont-overwrite-send_frame_messages_timer.patch @@ -0,0 +1,29 @@ +From 56e74b1ea8ae37b88ba4b48388cd582d77c9dd91 Mon Sep 17 00:00:00 2001 +From: "Owen W. Taylor" +Date: Fri, 17 Oct 2014 08:58:28 -0400 +Subject: MetaWindowActor: don't overwrite send_frame_messages_timer + +If the app finished multiple frames before we sent _NET_WM_FRAME_DRAWN, +we could add the send_frame_messages_timer multiple times. In the rare +case that the app immediately closed the window, the older timeout +could potentially then run on the freed actor. + +https://bugzilla.gnome.org/show_bug.cgi?id=738686 + +diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c +index 254a1a9..3d6fab1 100644 +--- a/src/compositor/meta-window-actor.c ++++ b/src/compositor/meta-window-actor.c +@@ -939,6 +939,10 @@ static void + queue_send_frame_messages_timeout (MetaWindowActor *self) + { + MetaWindowActorPrivate *priv = self->priv; ++ ++ if (priv->send_frame_messages_timer != 0) ++ return; ++ + MetaDisplay *display = meta_window_get_display (priv->window); + gint64 current_time = meta_compositor_monotonic_time_to_server_time (display, g_get_monotonic_time ()); + MetaMonitorManager *monitor_manager = meta_monitor_manager_get (); +-- +cgit v0.10.1 diff --git a/mutter-empty-input-shapes-windows.patch b/mutter-empty-input-shapes-windows.patch new file mode 100644 index 0000000..b515a2e --- /dev/null +++ b/mutter-empty-input-shapes-windows.patch @@ -0,0 +1,94 @@ +From d7ff632c67ebddf6932d052e08ce9671ae8982d2 Mon Sep 17 00:00:00 2001 +From: "Jasper St. Pierre" +Date: Wed, 26 Nov 2014 12:45:26 -0800 +Subject: window-x11: Fix windows that set empty input shapes + +Windows that set empty input shapes get n_rects of 0 when querying them +later, which makes sense, but the code that interpreted the result +translated it into a NULL input shape, which meant it was the same as +the bounding region. As such, an empty input shape would actually get +interpreted as a full input shape! + +We, ourselves, set an empty input shape on tray icon windows in +gnome-shell since we would handle the picking ourselves. This meant that +we'd actually get the MetaSurfaceActorX11 when hovering over the tray +icon, instead of the ShellGTKEmbed that we capture events on and react +to. + +This fixes weird tray icon behavior in gnome-shell. + +diff --git a/src/x11/window-x11.c b/src/x11/window-x11.c +index 1dca3e3..0d6d142 100644 +--- a/src/x11/window-x11.c ++++ b/src/x11/window-x11.c +@@ -1684,7 +1684,7 @@ meta_window_x11_update_input_region (MetaWindow *window) + /* Translate the set of XShape rectangles that we + * get from the X server to a cairo_region. */ + XRectangle *rects = NULL; +- int n_rects, ordering; ++ int n_rects = -1, ordering; + + meta_error_trap_push (window->display); + rects = XShapeGetRectangles (window->display->xdisplay, +@@ -1694,21 +1694,46 @@ meta_window_x11_update_input_region (MetaWindow *window) + &ordering); + meta_error_trap_pop (window->display); + +- /* XXX: The x shape extension doesn't provide a way to only test if an +- * input shape has been specified, so we have to query and throw away the +- * rectangles. */ +- if (rects) +- { +- if (n_rects > 1 || +- (n_rects == 1 && +- (rects[0].x != 0 || +- rects[0].y != 0 || +- rects[0].width != priv->client_rect.width || +- rects[0].height != priv->client_rect.height))) +- region = region_create_from_x_rectangles (rects, n_rects); ++ /* XXX: The X Shape specification is quite unfortunately specified. ++ * ++ * By default, the window has a shape the same as its bounding region, ++ * which we consider "NULL". ++ * ++ * If the window sets an empty region, then we'll get n_rects as 0 ++ * and rects as NULL, which we need to transform back into an empty ++ * region. ++ * ++ * It would be great to have a less-broken extension for this, but ++ * hey, it's X11! ++ */ + +- XFree (rects); ++ if (n_rects == -1) ++ { ++ /* We had an error. */ ++ region = NULL; ++ } ++ else if (n_rects == 0) ++ { ++ /* Client set an empty region. */ ++ region = cairo_region_create (); + } ++ else if (n_rects == 1 && ++ (rects[0].x == 0 || ++ rects[0].y == 0 || ++ rects[0].width == priv->client_rect.width || ++ rects[0].height == priv->client_rect.height)) ++ { ++ /* This is the bounding region case. Keep the ++ * region as NULL. */ ++ region = NULL; ++ } ++ else ++ { ++ /* Window has a custom shape. */ ++ region = region_create_from_x_rectangles (rects, n_rects); ++ } ++ ++ meta_XFree (rects); + } + + if (region != NULL) +-- +cgit v0.10.1 diff --git a/mutter-left-over-queued-frames.patch b/mutter-left-over-queued-frames.patch new file mode 100644 index 0000000..9d500b2 --- /dev/null +++ b/mutter-left-over-queued-frames.patch @@ -0,0 +1,226 @@ +From 7d3204b1965fd54f28f73013f4700caf37dd8216 Mon Sep 17 00:00:00 2001 +From: "Owen W. Taylor" +Date: Fri, 17 Oct 2014 08:49:54 -0400 +Subject: Fix problems resulting in left-over queued frames + +* Use -1 rather than 0 as a flag for pending queue entries; 0 is + a valid frame_counter value from Cogl. +* Consistently handle the fact we can have more than one pending + entry. It's app misbehavior to submit a new frame before + _NET_WM_FRAME_DRAWN is received; but we accept such frame messages, + so we can't just leak them. +* If we remove send_frame_message_timer, assign the current frame counter + to pending entries. +* To try to avoid regressing on this, when sending _NET_WM_FRAME_TIMINGS + messages, if we have stale messages, or messages with no frame drawn + time, warn and remove them from the queue rather than just accumulating. +* Improve commenting. + +https://bugzilla.gnome.org/show_bug.cgi?id=738686 + +diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c +index eb21c46..254a1a9 100644 +--- a/src/compositor/meta-window-actor.c ++++ b/src/compositor/meta-window-actor.c +@@ -100,7 +100,7 @@ struct _MetaWindowActorPrivate + guint disposed : 1; + + /* If set, the client needs to be sent a _NET_WM_FRAME_DRAWN +- * client message using the most recent frame in ->frames */ ++ * client message for one or more messages in ->frames */ + guint needs_frame_drawn : 1; + guint repaint_scheduled : 1; + +@@ -118,10 +118,21 @@ struct _MetaWindowActorPrivate + + typedef struct _FrameData FrameData; + ++/* Each time the application updates the sync request counter to a new even value ++ * value, we queue a frame into the windows list of frames. Once we're painting ++ * an update "in response" to the window, we fill in frame_counter with the ++ * Cogl counter for that frame, and send _NET_WM_FRAME_DRAWN at the end of the ++ * frame. _NET_WM_FRAME_TIMINGS is sent when we get a frame_complete callback. ++ * ++ * As an exception, if a window is completely obscured, we try to throttle drawning ++ * to a slower frame rate. In this case, frame_counter stays -1 until ++ * send_frame_message_timeout() runs, at which point we send both the ++ * _NET_WM_FRAME_DRAWN and _NET_WM_FRAME_TIMINGS messages. ++ */ + struct _FrameData + { +- int64_t frame_counter; + guint64 sync_request_serial; ++ int64_t frame_counter; + gint64 frame_drawn_time; + }; + +@@ -656,6 +667,30 @@ clip_shadow_under_window (MetaWindowActor *self) + } + + static void ++assign_frame_counter_to_frames (MetaWindowActor *self) ++{ ++ MetaWindowActorPrivate *priv = self->priv; ++ GList *l; ++ ++ /* If the window is obscured, then we're expecting to deal with sending ++ * frame messages in a timeout, rather than in this paint cycle. ++ */ ++ if (priv->send_frame_messages_timer != 0) ++ return; ++ ++ for (l = priv->frames; l; l = l->next) ++ { ++ FrameData *frame = l->data; ++ ++ if (frame->frame_counter == -1) ++ { ++ CoglOnscreen *onscreen = COGL_ONSCREEN (cogl_get_draw_framebuffer()); ++ frame->frame_counter = cogl_onscreen_get_frame_counter (onscreen); ++ } ++ } ++} ++ ++static void + meta_window_actor_paint (ClutterActor *actor) + { + MetaWindowActor *self = META_WINDOW_ACTOR (actor); +@@ -671,6 +706,8 @@ meta_window_actor_paint (ClutterActor *actor) + { + g_source_remove (priv->send_frame_messages_timer); + priv->send_frame_messages_timer = 0; ++ ++ assign_frame_counter_to_frames (self); + } + + if (shadow != NULL) +@@ -873,16 +910,27 @@ send_frame_messages_timeout (gpointer data) + { + MetaWindowActor *self = (MetaWindowActor *) data; + MetaWindowActorPrivate *priv = self->priv; +- FrameData *frame = g_slice_new0 (FrameData); ++ GList *l; + +- frame->sync_request_serial = priv->window->sync_request_serial; ++ for (l = priv->frames; l;) ++ { ++ GList *l_next = l->next; ++ FrameData *frame = l->data; + +- do_send_frame_drawn (self, frame); +- do_send_frame_timings (self, frame, 0, 0); ++ if (frame->frame_counter == -1) ++ { ++ do_send_frame_drawn (self, frame); ++ do_send_frame_timings (self, frame, 0, 0); ++ ++ priv->frames = g_list_delete_link (priv->frames, l); ++ frame_data_free (frame); ++ } ++ ++ l = l_next; ++ } + + priv->needs_frame_drawn = FALSE; + priv->send_frame_messages_timer = 0; +- frame_data_free (frame); + + return FALSE; + } +@@ -933,6 +981,7 @@ meta_window_actor_queue_frame_drawn (MetaWindowActor *self, + return; + + frame = g_slice_new0 (FrameData); ++ frame->frame_counter = -1; + + priv->needs_frame_drawn = TRUE; + +@@ -1905,24 +1954,12 @@ meta_window_actor_handle_updates (MetaWindowActor *self) + void + meta_window_actor_pre_paint (MetaWindowActor *self) + { +- MetaWindowActorPrivate *priv = self->priv; +- GList *l; +- + if (meta_window_actor_is_destroyed (self)) + return; + + meta_window_actor_handle_updates (self); + +- for (l = priv->frames; l != NULL; l = l->next) +- { +- FrameData *frame = l->data; +- +- if (frame->frame_counter == 0) +- { +- CoglOnscreen *onscreen = COGL_ONSCREEN (cogl_get_draw_framebuffer()); +- frame->frame_counter = cogl_onscreen_get_frame_counter (onscreen); +- } +- } ++ assign_frame_counter_to_frames (self); + } + + static void +@@ -1963,16 +2000,23 @@ meta_window_actor_post_paint (MetaWindowActor *self) + if (meta_window_actor_is_destroyed (self)) + return; + +- /* This window had damage, but wasn't actually redrawn because +- * it is obscured. So we should wait until timer expiration +- * before sending _NET_WM_FRAME_* messages. +- */ +- if (priv->send_frame_messages_timer != 0) +- return; +- +- if (priv->needs_frame_drawn) ++ /* If the window had damage, but wasn't actually redrawn because ++ * it is obscured, we should wait until timer expiration before ++ * sending _NET_WM_FRAME_* messages. ++ */ ++ if (priv->send_frame_messages_timer == 0 && ++ priv->needs_frame_drawn) + { +- do_send_frame_drawn (self, priv->frames->data); ++ GList *l; ++ ++ for (l = priv->frames; l; l = l->next) ++ { ++ FrameData *frame = l->data; ++ ++ if (frame->frame_drawn_time == 0) ++ do_send_frame_drawn (self, frame); ++ } ++ + priv->needs_frame_drawn = FALSE; + } + +@@ -2057,15 +2101,20 @@ meta_window_actor_frame_complete (MetaWindowActor *self, + { + GList *l_next = l->next; + FrameData *frame = l->data; ++ gint64 frame_counter = cogl_frame_info_get_frame_counter (frame_info); + +- if (frame->frame_counter == cogl_frame_info_get_frame_counter (frame_info)) ++ if (frame->frame_counter != -1 && frame->frame_counter <= frame_counter) + { +- if (frame->frame_drawn_time != 0) +- { +- priv->frames = g_list_delete_link (priv->frames, l); +- send_frame_timings (self, frame, frame_info, presentation_time); +- frame_data_free (frame); +- } ++ if (G_UNLIKELY (frame->frame_drawn_time == 0)) ++ g_warning ("%s: Frame has assigned frame counter but no frame drawn time", ++ priv->window->desc); ++ if (G_UNLIKELY (frame->frame_counter < frame_counter)) ++ g_warning ("%s: frame_complete callback never occurred for frame %" G_GINT64_FORMAT, ++ priv->window->desc, frame->frame_counter); ++ ++ priv->frames = g_list_delete_link (priv->frames, l); ++ send_frame_timings (self, frame, frame_info, presentation_time); ++ frame_data_free (frame); + } + + l = l_next; +-- +cgit v0.10.1 diff --git a/mutter-window-actor-unredirection-when-destroyed.patch b/mutter-window-actor-unredirection-when-destroyed.patch new file mode 100644 index 0000000..ec24ad5 --- /dev/null +++ b/mutter-window-actor-unredirection-when-destroyed.patch @@ -0,0 +1,26 @@ +From 2e7b9e0dfed8ca637cf70bc160489610b93234fd Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Florian=20M=C3=BCllner?= +Date: Fri, 14 Nov 2014 13:23:15 +0100 +Subject: window-actor: Do not request unredirection when destroyed + +WindowActors can outlive their corresponding window to animate unmap. +Unredirecting the actor does not make sense in that case, so make +sure to not request it. + +https://bugzilla.gnome.org/show_bug.cgi?id=740133 + +diff --git a/src/compositor/meta-window-actor.c b/src/compositor/meta-window-actor.c +index 39864d6..eb21c46 100644 +--- a/src/compositor/meta-window-actor.c ++++ b/src/compositor/meta-window-actor.c +@@ -1155,7 +1155,7 @@ gboolean + meta_window_actor_should_unredirect (MetaWindowActor *self) + { + MetaWindowActorPrivate *priv = self->priv; +- if (priv->surface) ++ if (!meta_window_actor_is_destroyed (self) && priv->surface) + return meta_surface_actor_should_unredirect (priv->surface); + else + return FALSE; +-- +cgit v0.10.1 diff --git a/mutter.changes b/mutter.changes index 6c855dc..8a2ac91 100644 --- a/mutter.changes +++ b/mutter.changes @@ -1,3 +1,20 @@ +------------------------------------------------------------------- +Wed Dec 3 23:35:43 UTC 2014 - badshah400@gmail.com + +- Add post-release fixes from upstream: + + mutter-black-screen-during-login.patch: Disable ugly black + screen during login (bgo#740377). + + mutter-window-actor-unredirection-when-destroyed.patch: + window-actor: Do not request unredirection when destroyed + (bgo#740133). + + mutter-empty-input-shapes-windows.patch: window-x11: Fix + windows that set empty input shapes. + + mutter-left-over-queued-frames.patch: Fix problems resulting + in left-over queued frames (bgo#738686). + + mutter-dont-overwrite-send_frame_messages_timer.patch: + MetaWindowActor: don't overwrite send_frame_messages_timer + (bgo#738686). + ------------------------------------------------------------------- Wed Nov 12 20:53:02 UTC 2014 - zaitor@opensuse.org diff --git a/mutter.spec b/mutter.spec index 4eccccd..f0a407c 100644 --- a/mutter.spec +++ b/mutter.spec @@ -24,6 +24,16 @@ License: GPL-2.0+ Group: System/GUI/GNOME Url: http://www.gnome.org Source: http://download.gnome.org/sources/mutter/3.14/%{name}-%{version}.tar.xz +# PATCH-FIX-UPSTREAM mutter-black-screen-during-login.patch bgo#740377 badshah400@gmail.com --Disable ugly black screen during login; patch taken from upstream git +Patch0: mutter-black-screen-during-login.patch +# PATCH-FIX-UPSTREAM mutter-window-actor-unredirection-when-destroyed.patch bgo#740133 badshah400@gmail.com -- window-actor: Do not request unredirection when destroyed; patch taken from upstream +Patch1: mutter-window-actor-unredirection-when-destroyed.patch +# PATCH-FIX-UPSTREAM mutter-empty-input-shapes-windows.patch badshah400@gmail.com -- window-x11: Fix windows that set empty input shapes; patch taken from upstream git +Patch2: mutter-empty-input-shapes-windows.patch +# PATCH-FIX-UPSTREAM mutter-left-over-queued-frames.patch bgo#738686 badshah400@gmail.com -- Fix problems resulting in left-over queued frames; patch taken from upstream git +Patch3: mutter-left-over-queued-frames.patch +# PATCH-FIX-UPSTREAM mutter-dont-overwrite-send_frame_messages_timer.patch bgo#738686 badshah400@gmail.com -- MetaWindowActor: don't overwrite send_frame_messages_timer; patch taken from upstream git +Patch4: mutter-dont-overwrite-send_frame_messages_timer.patch BuildRequires: fdupes BuildRequires: gobject-introspection-devel >= 0.9.5 BuildRequires: intltool @@ -132,6 +142,11 @@ to develop applications that require these. %lang_package %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 translation-update-upstream %build