diff options
author | Florian Müllner <fmuellner@gnome.org> | 2014-09-27 08:10:59 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2015-02-19 19:06:14 +0200 |
commit | 8e5781bc3d0ddab13afecc35dc9db101b028680c (patch) | |
tree | d5528f0e63e1c3840e7f3dd8aaf1881dc8e4c9c8 /src | |
parent | 80eb42647212ffa1f1e4f041d905f7dc1de71152 (diff) | |
download | metacity-8e5781bc3d0ddab13afecc35dc9db101b028680c.tar.gz |
frames: Rename layout to text_layout
... to differentiate PangoLayout from MetaFrameLayout.
https://bugzilla.gnome.org/show_bug.cgi?id=741917
Diffstat (limited to 'src')
-rw-r--r-- | src/ui/frames.c | 40 | ||||
-rw-r--r-- | src/ui/frames.h | 2 |
2 files changed, 18 insertions, 24 deletions
diff --git a/src/ui/frames.c b/src/ui/frames.c index ec211c50..c0adb2f8 100644 --- a/src/ui/frames.c +++ b/src/ui/frames.c @@ -392,15 +392,14 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data) invalidate_whole_window (frames, frame); meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow); - if (frame->layout) + if (frame->text_layout) { /* save title to recreate layout */ g_free (frame->title); - frame->title = g_strdup (pango_layout_get_text (frame->layout)); + frame->title = g_strdup (pango_layout_get_text (frame->text_layout)); - g_object_unref (G_OBJECT (frame->layout)); - frame->layout = NULL; + g_clear_object (&frame->text_layout); } } @@ -490,31 +489,30 @@ meta_frames_ensure_layout (MetaFrames *frames, if (style != frame->cache_style) { - if (frame->layout) + if (frame->text_layout) { /* save title to recreate layout */ g_free (frame->title); - frame->title = g_strdup (pango_layout_get_text (frame->layout)); + frame->title = g_strdup (pango_layout_get_text (frame->text_layout)); - g_object_unref (G_OBJECT (frame->layout)); - frame->layout = NULL; + g_clear_object (&frame->text_layout); } } frame->cache_style = style; - if (frame->layout == NULL) + if (frame->text_layout == NULL) { gpointer key, value; PangoFontDescription *font_desc; int size; - frame->layout = gtk_widget_create_pango_layout (widget, frame->title); + frame->text_layout = gtk_widget_create_pango_layout (widget, frame->title); - pango_layout_set_ellipsize (frame->layout, PANGO_ELLIPSIZE_END); - pango_layout_set_auto_dir (frame->layout, FALSE); - pango_layout_set_single_paragraph_mode (frame->layout, TRUE); + pango_layout_set_ellipsize (frame->text_layout, PANGO_ELLIPSIZE_END); + pango_layout_set_auto_dir (frame->text_layout, FALSE); + pango_layout_set_single_paragraph_mode (frame->text_layout, TRUE); if (meta_prefs_get_theme ()) { @@ -551,7 +549,7 @@ meta_frames_ensure_layout (MetaFrames *frames, GINT_TO_POINTER (frame->text_height)); } - pango_layout_set_font_description (frame->layout, + pango_layout_set_font_description (frame->text_layout, font_desc); pango_font_description_free (font_desc); @@ -669,7 +667,7 @@ meta_frames_manage_window (MetaFrames *frames, frame->xwindow = xwindow; frame->cache_style = NULL; - frame->layout = NULL; + frame->text_layout = NULL; frame->text_height = -1; frame->title = NULL; frame->expose_delayed = FALSE; @@ -714,8 +712,8 @@ meta_frames_unmanage_window (MetaFrames *frames, gdk_window_destroy (frame->window); - if (frame->layout) - g_object_unref (G_OBJECT (frame->layout)); + if (frame->text_layout) + g_object_unref (G_OBJECT (frame->text_layout)); if (frame->title) g_free (frame->title); @@ -1221,11 +1219,7 @@ meta_frames_set_title (MetaFrames *frames, g_free (frame->title); frame->title = g_strdup (title); - if (frame->layout) - { - g_object_unref (frame->layout); - frame->layout = NULL; - } + g_clear_object (&frame->text_layout); invalidate_whole_window (frames, frame); } @@ -2627,7 +2621,7 @@ meta_frames_paint (MetaFrames *frames, flags, w, h, - frame->layout, + frame->text_layout, frame->text_height, &button_layout, button_states, diff --git a/src/ui/frames.h b/src/ui/frames.h index fccd0373..dcce7a44 100644 --- a/src/ui/frames.h +++ b/src/ui/frames.h @@ -76,7 +76,7 @@ struct _MetaUIFrame GdkWindow *window; MetaStyleInfo *style_info; MetaFrameStyle *cache_style; - PangoLayout *layout; + PangoLayout *text_layout; int text_height; char *title; /* NULL once we have a layout */ guint expose_delayed : 1; |