From 7a043317070afa55e53cd4784f2f6e5f26bb9b82 Mon Sep 17 00:00:00 2001 From: Wolfgang Ulbrich Date: Nov 22 2015 11:52:01 +0000 Subject: disable anmations on un-minimze --- diff --git a/marco.spec b/marco.spec index a00c461..d3724f1 100644 --- a/marco.spec +++ b/marco.spec @@ -15,7 +15,7 @@ Name: marco Version: %{branch}.0 %if 0%{?rel_build} -Release: 1%{?dist} +Release: 2%{?dist} %else Release: 0.2%{?git_rel}%{?dist} %endif @@ -39,6 +39,9 @@ Source5: window.png # needed for fixing initial-setup issue, rhbz (#962009) Patch0: marco_add-pixbuf-inline-icons_1.9.x.patch +# http://git.mate-desktop.org/marco/commit/?id=3ed3bab +Patch1: marco_revert-animation-changes.patch + Requires: mate-desktop-libs BuildRequires: desktop-file-utils @@ -88,6 +91,7 @@ Development files for marco #cp %{SOURCE5} src/window.png #%patch0 -p1 -b .inline-icons +%patch1 -p1 -b .revert-animation-changes # needed for the patch and for git snapshot builds #autoreconf -if @@ -167,6 +171,9 @@ fi %changelog +* Sun Nov 22 2015 Wolfgang Ulbrich - 1.12.0-2 +- disable anmations on un-minimze + * Fri Nov 06 2015 Wolfgang Ulbrich - 1.12.0-1 - update to 1.12.0 release diff --git a/marco_effects-remove-hack.patch b/marco_effects-remove-hack.patch deleted file mode 100644 index 0769780..0000000 --- a/marco_effects-remove-hack.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/src/core/effects.c b/src/core/effects.c -index 469184e..163ec05 100644 ---- a/src/core/effects.c -+++ b/src/core/effects.c -@@ -316,23 +316,6 @@ update_wireframe_window (MetaDisplay *display, - } - #endif - --/** -- * A hack to force the X server to synchronize with the -- * graphics hardware. -- */ --static void --graphics_sync (BoxAnimationContext *context) --{ -- XImage *image; -- -- image = XGetImage (context->screen->display->xdisplay, -- context->screen->xroot, -- 0, 0, 1, 1, -- AllPlanes, ZPixmap); -- -- XDestroyImage (image); --} -- - static gboolean - effects_draw_box_animation_timeout (BoxAnimationContext *context) - { -@@ -383,8 +366,6 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context) - context->gc); - #endif /* !HAVE_SHAPE */ - -- graphics_sync (context); -- - context->finished(context->finished_data); - - g_free (context); -@@ -425,7 +406,7 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context) - #endif /* !HAVE_SHAPE */ - - /* kick changes onto the server */ -- graphics_sync (context); -+ XFlush (context->screen->display->xdisplay); - - return TRUE; - } - diff --git a/marco_fix-wine.patch b/marco_fix-wine.patch deleted file mode 100644 index 552fa83..0000000 --- a/marco_fix-wine.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 2847fefe1ae96a795b08115e3e9d8fc45ec939ca Mon Sep 17 00:00:00 2001 -From: Stefan Dösinger -Date: Thu, 20 Nov 2014 13:56:35 +0000 -Subject: Allow programmatic minimization without MWM_FUNC_MINIMIZE - -This fixes switching out of fullscreen Direct3D applications running in -Wine. See issue 166 for more details. ---- -diff --git a/src/core/window.c b/src/core/window.c -index 9b2ad92..44755b0 100644 ---- a/src/core/window.c -+++ b/src/core/window.c -@@ -5181,8 +5181,7 @@ meta_window_client_message (MetaWindow *window, - { - meta_verbose ("WM_CHANGE_STATE client message, state: %ld\n", - event->xclient.data.l[0]); -- if (event->xclient.data.l[0] == IconicState && -- window->has_minimize_func) -+ if (event->xclient.data.l[0] == IconicState) - meta_window_minimize (window); - - return TRUE; --- -cgit - diff --git a/marco_remove-outdated-assertion.patch b/marco_remove-outdated-assertion.patch deleted file mode 100644 index 1d4696c..0000000 --- a/marco_remove-outdated-assertion.patch +++ /dev/null @@ -1,26 +0,0 @@ -diff --git a/src/ui/theme.c b/src/ui/theme.c -index a7dc8d0..173c58f 100644 ---- a/src/ui/theme.c -+++ b/src/ui/theme.c -@@ -1312,7 +1312,6 @@ meta_color_spec_new_from_string (const char *str, - spec = meta_color_spec_new (META_COLOR_SPEC_GTK); - spec->data.gtk.state = state; - spec->data.gtk.component = component; -- g_assert (spec->data.gtk.state < N_GTK_STATES); - g_assert (spec->data.gtk.component < META_GTK_COLOR_LAST); - } - else if (str[0] == 'b' && str[1] == 'l' && str[2] == 'e' && str[3] == 'n' && -diff --git a/src/ui/theme.h b/src/ui/theme.h -index 66996d8..742d01f 100644 ---- a/src/ui/theme.h -+++ b/src/ui/theme.h -@@ -694,8 +694,6 @@ typedef enum - META_FRAME_PIECE_LAST - } MetaFramePiece; - --#define N_GTK_STATES 5 -- - /** - * How to draw a frame in a particular state (say, a focussed, non-maximised, - * resizable frame). This corresponds closely to the tag - diff --git a/marco_revert-GTK_FRAME_EXTENTS-commits.patch b/marco_revert-GTK_FRAME_EXTENTS-commits.patch deleted file mode 100644 index 325b4ce..0000000 --- a/marco_revert-GTK_FRAME_EXTENTS-commits.patch +++ /dev/null @@ -1,168 +0,0 @@ -diff -upr marco/src/core/atomnames.h marco-test-master/src/core/atomnames.h ---- marco/src/core/atomnames.h 2015-10-06 17:15:54.909757371 +0200 -+++ marco-test-master/src/core/atomnames.h 2015-10-23 17:19:23.373005831 +0200 -@@ -58,7 +58,6 @@ item(_MARCO_RESTART_MESSAGE) - item(_MARCO_RELOAD_THEME_MESSAGE) - item(_MARCO_SET_KEYBINDINGS_MESSAGE) - item(_MARCO_TOGGLE_VERBOSE) --item(_GTK_FRAME_EXTENTS) - item(_MATE_PANEL_ACTION) - item(_MATE_PANEL_ACTION_MAIN_MENU) - item(_MATE_PANEL_ACTION_RUN_DIALOG) -@@ -71,6 +70,7 @@ item(MULTIPLE) - item(TIMESTAMP) - item(VERSION) - item(ATOM_PAIR) -+item(_GTK_FRAME_EXTENTS) - - /* Oddities: These are used, and we need atoms for them, - * but when we need all _NET_WM hints (i.e. when we're making -diff -upr marco/src/core/constraints.c marco-test-master/src/core/constraints.c ---- marco/src/core/constraints.c 2015-10-06 17:15:54.910757381 +0200 -+++ marco-test-master/src/core/constraints.c 2015-10-23 17:20:37.214737879 +0200 -@@ -437,7 +437,7 @@ setup_constraint_info (ConstraintInfo - */ - - if (meta_prefs_get_force_fullscreen() && -- (window->decorated || !meta_window_is_client_decorated (window)) && -+ window->decorated && - meta_rectangle_equal (new, &xinerama_info->rect) && - window->has_fullscreen_func && - !window->fullscreen) -diff -upr marco/src/core/window.c marco-test-master/src/core/window.c ---- marco/src/core/window.c 2015-10-23 17:18:23.157406594 +0200 -+++ marco-test-master/src/core/window.c 2015-10-23 17:20:41.317778555 +0200 -@@ -4058,18 +4058,7 @@ meta_window_get_outer_rect (const MetaWi - if (window->frame) - *rect = window->frame->rect; - else -- { -- *rect = window->rect; -- -- if (window->has_custom_frame_extents) -- { -- const GtkBorder *extents = &window->custom_frame_extents; -- rect->x += extents->left; -- rect->y += extents->top; -- rect->width -= extents->left + extents->right; -- rect->height -= extents->top + extents->bottom; -- } -- } -+ *rect = window->rect; - } - - void -@@ -8468,20 +8457,3 @@ meta_window_is_maximized (MetaWindow *wi - return META_WINDOW_MAXIMIZED (window); - } - --/** -- * meta_window_is_client_decorated: -- * -- * Check if if the window has decorations drawn by the client. -- * (window->decorated refers only to whether we should add decorations) -- */ --gboolean --meta_window_is_client_decorated (MetaWindow *window) --{ -- /* Currently the implementation here is hackish - -- * has_custom_frame_extents() is set if _GTK_FRAME_EXTENTS is set -- * to any value even 0. GTK+ always sets _GTK_FRAME_EXTENTS for -- * client-side-decorated window, even if the value is 0 because -- * the window is maxized and has no invisible borders or shadows. -- */ -- return window->has_custom_frame_extents; --} -diff -upr marco/src/core/window-private.h marco-test-master/src/core/window-private.h ---- marco/src/core/window-private.h 2015-10-23 17:18:23.155406574 +0200 -+++ marco-test-master/src/core/window-private.h 2015-10-23 17:20:41.320778585 +0200 -@@ -356,9 +356,6 @@ struct _MetaWindow - */ - MetaRectangle rect; - -- gboolean has_custom_frame_extents; -- GtkBorder custom_frame_extents; -- - /* The geometry to restore when we unmaximize. The position is in - * root window coords, even if there's a frame, which contrasts with - * window->rect above. Note that this gives the position and size -@@ -664,8 +661,6 @@ void meta_window_unset_demands_attention - - void meta_window_update_icon_now (MetaWindow *window); - --gboolean meta_window_is_client_decorated (MetaWindow *window); -- - void meta_window_update_role (MetaWindow *window); - void meta_window_update_net_wm_type (MetaWindow *window); - -diff -upr marco/src/core/window-props.c marco-test-master/src/core/window-props.c ---- marco/src/core/window-props.c 2015-10-06 17:15:54.919757469 +0200 -+++ marco-test-master/src/core/window-props.c 2015-10-23 17:20:35.921725060 +0200 -@@ -215,66 +215,12 @@ reload_kwm_win_icon (MetaWindow *wind - reload_icon (window, window->display->atom__KWM_WIN_ICON); - } - --static gboolean --gtk_border_equal (GtkBorder *a, -- GtkBorder *b) --{ -- return (a->left == b->left && -- a->right == b->right && -- a->top == b->top && -- a->bottom == b->bottom); --} -- --static void --meta_window_set_custom_frame_extents (MetaWindow *window, -- GtkBorder *extents) --{ -- if (extents) -- { -- if (window->has_custom_frame_extents && gtk_border_equal (&window->custom_frame_extents, extents)) -- return; -- -- window->has_custom_frame_extents = TRUE; -- window->custom_frame_extents = *extents; -- } -- else -- { -- if (!window->has_custom_frame_extents) -- return; -- -- window->has_custom_frame_extents = FALSE; -- memset (&window->custom_frame_extents, 0, sizeof (window->custom_frame_extents)); -- } -- -- meta_window_queue (window, META_QUEUE_MOVE_RESIZE); --} -- - static void - reload_gtk_frame_extents (MetaWindow *window, - MetaPropValue *value, - gboolean initial) - { -- if (value->type != META_PROP_VALUE_INVALID) -- { -- if (value->v.cardinal_list.n_cardinals != 4) -- { -- meta_verbose ("_GTK_FRAME_EXTENTS on %s has %d values instead of 4\n", -- window->desc, value->v.cardinal_list.n_cardinals); -- } -- else -- { -- GtkBorder extents; -- extents.left = (int)value->v.cardinal_list.cardinals[0]; -- extents.right = (int)value->v.cardinal_list.cardinals[1]; -- extents.top = (int)value->v.cardinal_list.cardinals[2]; -- extents.bottom = (int)value->v.cardinal_list.cardinals[3]; -- meta_window_set_custom_frame_extents (window, &extents); -- } -- } -- else -- { -- meta_window_set_custom_frame_extents (window, NULL); -- } -+ return; - } - - static void diff --git a/marco_revert-animation-changes.patch b/marco_revert-animation-changes.patch new file mode 100644 index 0000000..b686ea8 --- /dev/null +++ b/marco_revert-animation-changes.patch @@ -0,0 +1,412 @@ +diff --git a/src/core/effects.c b/src/core/effects.c +index 163ec05..2866246 100644 +--- a/src/core/effects.c ++++ b/src/core/effects.c +@@ -67,7 +67,6 @@ + #endif + + #define META_MINIMIZE_ANIMATION_LENGTH 0.25 +-#define META_UNMINIMIZE_ANIMATION_LENGTH 0.25 + #define META_SHADE_ANIMATION_LENGTH 0.2 + + #include +@@ -99,9 +98,6 @@ typedef struct + MetaRectangle start_rect; + MetaRectangle end_rect; + +- MetaEffectFinished finished; +- gpointer finished_data; +- + } BoxAnimationContext; + + /** +@@ -153,9 +149,7 @@ static void + draw_box_animation (MetaScreen *screen, + MetaRectangle *initial_rect, + MetaRectangle *destination_rect, +- double seconds_duration, +- MetaEffectFinished finished, +- gpointer finished_data); ++ double seconds_duration); + + /** + * Creates an effect. +@@ -179,13 +173,17 @@ create_effect (MetaEffectType type, + } + + /** +- * Destroys an effect. ++ * Destroys an effect. If the effect has a "finished" hook, it will be ++ * called before cleanup. + * + * \param effect The effect. + */ + static void + effect_free (MetaEffect *effect) + { ++ if (effect->priv->finished) ++ effect->priv->finished (effect->priv->finished_data); ++ + g_free (effect->priv); + g_free (effect); + } +@@ -366,8 +364,6 @@ effects_draw_box_animation_timeout (BoxAnimationContext *context) + context->gc); + #endif /* !HAVE_SHAPE */ + +- context->finished(context->finished_data); +- + g_free (context); + return FALSE; + } +@@ -415,9 +411,7 @@ void + draw_box_animation (MetaScreen *screen, + MetaRectangle *initial_rect, + MetaRectangle *destination_rect, +- double seconds_duration, +- MetaEffectFinished finished, +- gpointer finished_data) ++ double seconds_duration) + { + BoxAnimationContext *context; + +@@ -442,9 +436,6 @@ draw_box_animation (MetaScreen *screen, + context->start_rect = *initial_rect; + context->end_rect = *destination_rect; + +- context->finished = finished; +- context->finished_data = finished_data; +- + #ifdef HAVE_SHAPE + + attrs.override_redirect = True; +@@ -707,17 +698,7 @@ run_default_effect_handler (MetaEffect *effect) + draw_box_animation (effect->window->screen, + &(effect->u.minimize.window_rect), + &(effect->u.minimize.icon_rect), +- META_MINIMIZE_ANIMATION_LENGTH, +- effect->priv->finished, +- effect->priv->finished_data); +- break; +- case META_EFFECT_UNMINIMIZE: +- draw_box_animation (effect->window->screen, +- &(effect->u.minimize.icon_rect), +- &(effect->u.minimize.window_rect), +- META_UNMINIMIZE_ANIMATION_LENGTH, +- effect->priv->finished, +- effect->priv->finished_data); ++ META_MINIMIZE_ANIMATION_LENGTH); + break; + + default: +@@ -728,16 +709,8 @@ run_default_effect_handler (MetaEffect *effect) + static void + run_handler (MetaEffect *effect) + { +- /* If effects are disabled just run the finished function */ + if (meta_prefs_get_mate_animations ()) +- { + run_default_effect_handler (effect); +- } +- else +- { +- if (effect->priv->finished) +- effect->priv->finished(effect->priv->finished_data); +- } + + effect_free (effect); + } +diff --git a/src/core/effects.h b/src/core/effects.h +index e0025ff..ca25aa8 100644 +--- a/src/core/effects.h ++++ b/src/core/effects.h +@@ -50,7 +50,6 @@ + + typedef enum + { +- META_EFFECT_NONE = 0, + META_EFFECT_MINIMIZE, + META_EFFECT_UNMINIMIZE, + META_EFFECT_FOCUS, +diff --git a/src/core/window-private.h b/src/core/window-private.h +index 0b3cf59..8871310 100644 +--- a/src/core/window-private.h ++++ b/src/core/window-private.h +@@ -36,7 +36,6 @@ + + #include + #include "window.h" +-#include "effects.h" + #include "screen-private.h" + #include "util.h" + #include "stack.h" +@@ -187,9 +186,6 @@ struct _MetaWindow + guint was_minimized : 1; + guint tab_unminimized : 1; + +- /* Whether there is a pending effect */ +- MetaEffectType effect_pending; +- + /* Whether the window is mapped; actual server-side state + * see also unmaps_pending + */ +diff --git a/src/core/window.c b/src/core/window.c +index 08bf58a..461d38f 100644 +--- a/src/core/window.c ++++ b/src/core/window.c +@@ -483,7 +483,6 @@ meta_window_new_with_attrs (MetaDisplay *display, + window->minimized = FALSE; + window->was_minimized = FALSE; + window->tab_unminimized = FALSE; +- window->effect_pending = META_EFFECT_NONE; + window->iconic = FALSE; + window->mapped = attrs->map_state != IsUnmapped; + /* if already mapped, no need to worry about focus-on-first-time-showing */ +@@ -1460,119 +1459,80 @@ static void + finish_minimize (gpointer data) + { + MetaWindow *window = data; ++ /* FIXME: It really sucks to put timestamp pinging here; it'd ++ * probably make more sense in implement_showing() so that it's at ++ * least not duplicated in meta_window_show; but since ++ * finish_minimize is a callback making things just slightly icky, I ++ * haven't done that yet. ++ */ ++ guint32 timestamp = meta_display_get_current_time_roundtrip (window->display); + +- window->effect_pending = META_EFFECT_NONE; +-} +- +-static void +-finish_unminimize (gpointer data) +-{ +- MetaWindow *window = data; +- +- meta_window_show (window); +- window->was_minimized = FALSE; +- window->effect_pending = META_EFFECT_NONE; +-} +- +-static void +-meta_window_animate_minimize (MetaWindow *window) +-{ +- MetaRectangle icon_rect, window_rect; +- gboolean result; +- +- /* Check if the window has an icon geometry */ +- result = meta_window_get_icon_geometry (window, &icon_rect); +- +- if (!result) ++ meta_window_hide (window); ++ if (window->has_focus) + { +- /* just animate into the corner somehow - maybe +- * not a good idea... +- */ +- icon_rect.x = window->screen->rect.width; +- icon_rect.y = window->screen->rect.height; +- icon_rect.width = 1; +- icon_rect.height = 1; ++ meta_workspace_focus_default_window (window->screen->active_workspace, ++ window, ++ timestamp); + } +- +- meta_window_get_outer_rect (window, &window_rect); +- +- meta_effect_run_minimize (window, +- &window_rect, +- &icon_rect, +- finish_minimize, +- window); + } + + static void +-meta_window_animate_unminimize (MetaWindow *window) ++implement_showing (MetaWindow *window, ++ gboolean showing) + { +- MetaRectangle icon_rect, window_rect; +- gboolean result; +- +- /* Check if the window has an icon geometry */ +- result = meta_window_get_icon_geometry (window, &icon_rect); ++ /* Actually show/hide the window */ ++ meta_verbose ("Implement showing = %d for window %s\n", ++ showing, window->desc); + +- if (!result) ++ if (!showing) + { +- /* just animate into the corner somehow - maybe +- * not a good idea... ++ gboolean on_workspace; ++ ++ on_workspace = meta_window_located_on_workspace (window, ++ window->screen->active_workspace); ++ ++ /* Really this effects code should probably ++ * be in meta_window_hide so the window->mapped ++ * test isn't duplicated here. Anyhow, we animate ++ * if we are mapped now, we are supposed to ++ * be minimized, and we are on the current workspace. + */ +- icon_rect.x = window->screen->rect.width; +- icon_rect.y = window->screen->rect.height; +- icon_rect.width = 1; +- icon_rect.height = 1; +- } ++ if (on_workspace && window->minimized && window->mapped && ++ !meta_prefs_get_reduced_resources ()) ++ { ++ MetaRectangle icon_rect, window_rect; ++ gboolean result; + +- meta_window_get_outer_rect (window, &window_rect); ++ /* Check if the window has an icon geometry */ ++ result = meta_window_get_icon_geometry (window, &icon_rect); + +- meta_effect_run_unminimize (window, +- &window_rect, +- &icon_rect, +- finish_unminimize, +- window); +-} ++ if (!result) ++ { ++ /* just animate into the corner somehow - maybe ++ * not a good idea... ++ */ ++ icon_rect.x = window->screen->rect.width; ++ icon_rect.y = window->screen->rect.height; ++ icon_rect.width = 1; ++ icon_rect.height = 1; ++ } + +-static void +-implement_showing (MetaWindow *window, +- gboolean showing) +-{ +- /* Actually show/hide the window */ +- meta_verbose ("Implement showing = %d for window %s with effect pending %i\n", +- showing, window->desc, window->effect_pending); ++ meta_window_get_outer_rect (window, &window_rect); + +- if (!showing) +- { +- /* Handle pending effects */ +- switch(window->effect_pending) +- { +- case META_EFFECT_MINIMIZE: +- /* First hide the window and then animate */ +- meta_window_hide(window); +- meta_window_animate_minimize (window); +- break; +- case META_EFFECT_UNMINIMIZE: +- case META_EFFECT_NONE: +- default: +- meta_window_hide(window); +- break; +- } ++ meta_effect_run_minimize (window, ++ &window_rect, ++ &icon_rect, ++ finish_minimize, ++ window); ++ } ++ else ++ { ++ finish_minimize (window); ++ } + } + else + { +- /* Handle pending effects */ +- switch(window->effect_pending) +- { +- case META_EFFECT_MINIMIZE: +- break; +- case META_EFFECT_UNMINIMIZE: +- /* First animate then show the window */ +- meta_window_animate_unminimize (window); +- break; +- case META_EFFECT_NONE: +- default: +- meta_window_show (window); +- break; +- } ++ meta_window_show (window); + } + } + +@@ -2335,6 +2295,24 @@ meta_window_show (MetaWindow *window) + XMapWindow (window->display->xdisplay, window->xwindow); + meta_error_trap_pop (window->display, FALSE); + did_show = TRUE; ++ ++ if (window->was_minimized) ++ { ++ MetaRectangle window_rect; ++ MetaRectangle icon_rect; ++ ++ window->was_minimized = FALSE; ++ ++ if (meta_window_get_icon_geometry (window, &icon_rect)) ++ { ++ meta_window_get_outer_rect (window, &window_rect); ++ ++ meta_effect_run_unminimize (window, ++ &window_rect, ++ &icon_rect, ++ NULL, NULL); ++ } ++ } + } + + if (window->iconic) +@@ -2373,10 +2351,6 @@ meta_window_show (MetaWindow *window) + meta_display_increment_focus_sentinel (window->display); + } + } +- else if (window->was_minimized) +- { +- meta_window_focus(window, timestamp); +- } + + set_net_wm_state (window); + +@@ -2463,8 +2437,6 @@ meta_window_minimize (MetaWindow *window) + if (!window->minimized) + { + window->minimized = TRUE; +- /* Flag minimize effect pending */ +- window->effect_pending = META_EFFECT_MINIMIZE; + meta_window_queue(window, META_QUEUE_CALC_SHOWING); + + meta_window_foreach_transient (window, +@@ -2484,8 +2456,6 @@ meta_window_minimize (MetaWindow *window) + window->desc); + } + } +- +- /* Should insert minimize effect here? */ + } + + void +@@ -2495,15 +2465,12 @@ meta_window_unminimize (MetaWindow *window) + { + window->minimized = FALSE; + window->was_minimized = TRUE; +- window->effect_pending = META_EFFECT_UNMINIMIZE; + meta_window_queue(window, META_QUEUE_CALC_SHOWING); + + meta_window_foreach_transient (window, + queue_calc_showing_func, + NULL); + } +- +- /* Should insert unminimize effect here? */ + } + + static void +