mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
frames: Simplify our frame title management
This fixes a number of crashers when they try to change their dialog layout at runtime because we're too tricksy with the frame title.
This commit is contained in:
parent
5c60ea6635
commit
87eb5f8632
@ -295,16 +295,9 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data)
|
|||||||
invalidate_whole_window (frame);
|
invalidate_whole_window (frame);
|
||||||
meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
|
||||||
frame->xwindow);
|
frame->xwindow);
|
||||||
if (frame->text_layout)
|
|
||||||
{
|
|
||||||
/* save title to recreate layout */
|
|
||||||
g_free (frame->title);
|
|
||||||
|
|
||||||
frame->title = g_strdup (pango_layout_get_text (frame->text_layout));
|
|
||||||
|
|
||||||
g_clear_object (&frame->text_layout);
|
g_clear_object (&frame->text_layout);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_frames_font_changed (MetaFrames *frames)
|
meta_frames_font_changed (MetaFrames *frames)
|
||||||
@ -375,13 +368,7 @@ meta_ui_frame_ensure_layout (MetaUIFrame *frame,
|
|||||||
layout = meta_theme_get_frame_layout (meta_theme_get_default (), type);
|
layout = meta_theme_get_frame_layout (meta_theme_get_default (), type);
|
||||||
|
|
||||||
if (layout != frame->cache_layout)
|
if (layout != frame->cache_layout)
|
||||||
{
|
|
||||||
if (frame->text_layout)
|
|
||||||
{
|
|
||||||
g_assert (g_str_equal (frame->title, pango_layout_get_text (frame->text_layout)));
|
|
||||||
g_clear_object (&frame->text_layout);
|
g_clear_object (&frame->text_layout);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
frame->cache_layout = layout;
|
frame->cache_layout = layout;
|
||||||
|
|
||||||
@ -423,10 +410,6 @@ meta_ui_frame_ensure_layout (MetaUIFrame *frame,
|
|||||||
font_desc);
|
font_desc);
|
||||||
|
|
||||||
pango_font_description_free (font_desc);
|
pango_font_description_free (font_desc);
|
||||||
|
|
||||||
/* Save some RAM */
|
|
||||||
g_free (frame->title);
|
|
||||||
frame->title = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user