Skip to content

Commit

Permalink
window: update frame in recalc_window_features
Browse files Browse the repository at this point in the history
  • Loading branch information
muktupavels committed Feb 28, 2020
1 parent fd696d4 commit 829ce2e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 32 deletions.
19 changes: 0 additions & 19 deletions src/core/window-props.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,6 @@ reload_mwm_hints (MetaWindow *window,
gboolean initial)
{
MotifWmHints *hints;
gboolean decorated;

window->mwm_decorated = TRUE;
window->mwm_border_only = FALSE;
Expand All @@ -900,7 +899,6 @@ reload_mwm_hints (MetaWindow *window,
}

hints = value->v.motif_hints;
decorated = window->decorated;

/* We support those MWM hints deemed non-stupid */

Expand Down Expand Up @@ -987,23 +985,6 @@ reload_mwm_hints (MetaWindow *window,
meta_verbose ("Functions flag unset\n");

meta_window_recalc_features (window);

/* We do all this anyhow at the end of meta_window_new() */
if (!window->constructing)
{
if (window->decorated)
meta_window_ensure_frame (window);
else
meta_window_destroy_frame (window);

meta_window_queue (window,
META_QUEUE_MOVE_RESIZE |
/* because ensure/destroy frame may unmap: */
META_QUEUE_CALC_SHOWING);

if (decorated != window->decorated)
g_object_notify (G_OBJECT (window), "decorated");
}
}

static void
Expand Down
32 changes: 19 additions & 13 deletions src/core/window.c
Original file line number Diff line number Diff line change
Expand Up @@ -6756,30 +6756,17 @@ recalc_window_type (MetaWindow *window)

if (old_type != window->type)
{
gboolean decorated;

decorated = window->decorated;

window->attached = meta_window_should_attach_to_parent (window);
recalc_window_features (window);

if (!window->override_redirect)
set_net_wm_state (window);

/* Update frame */
if (window->decorated)
meta_window_ensure_frame (window);
else
meta_window_destroy_frame (window);

/* update stacking constraints */
meta_window_update_layer (window);

meta_window_grab_keys (window);

if (decorated != window->decorated)
g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_DECORATED]);

g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_WINDOW_TYPE]);
}
}
Expand Down Expand Up @@ -6877,13 +6864,15 @@ recalc_window_features (MetaWindow *window)
gboolean old_has_resize_func;
gboolean old_has_shade_func;
gboolean old_always_sticky;
gboolean old_decorated;

old_has_close_func = window->has_close_func;
old_has_minimize_func = window->has_minimize_func;
old_has_move_func = window->has_move_func;
old_has_resize_func = window->has_resize_func;
old_has_shade_func = window->has_shade_func;
old_always_sticky = window->always_sticky;
old_decorated = window->decorated;

/* Use MWM hints initially */
window->decorated = window->mwm_decorated;
Expand Down Expand Up @@ -7081,6 +7070,23 @@ recalc_window_features (MetaWindow *window)
old_always_sticky != window->always_sticky)
set_allowed_actions_hint (window);

if (!window->constructing &&
old_decorated != window->decorated)
{
/* Update frame */
if (window->decorated)
meta_window_ensure_frame (window);
else
meta_window_destroy_frame (window);

meta_window_queue (window,
META_QUEUE_MOVE_RESIZE |
/* because ensure/destroy frame may unmap: */
META_QUEUE_CALC_SHOWING);

g_object_notify_by_pspec (G_OBJECT (window), properties[PROP_DECORATED]);
}

meta_window_frame_size_changed (window);

/* FIXME perhaps should ensure if we don't have a shade func,
Expand Down

0 comments on commit 829ce2e

Please sign in to comment.