summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-01-17 14:20:13 +0000
committerMatthias Clasen <mclasen@redhat.com>2021-01-17 14:20:13 +0000
commit00883016af4797f380ba3a4fdb10832ed7d51d26 (patch)
treea57a5cf693196969e8109ee2a46553572217bed7
parentf0d8b614d0a46ad92fee6eab94eb2f1659055621 (diff)
parent5ea377759929f5330c95443ced1c5db17b0a9999 (diff)
downloadgtk+-00883016af4797f380ba3a4fdb10832ed7d51d26.tar.gz
Merge branch 'wip/baedert/for-master' into 'master'
Wip/baedert/for master Closes #3593 See merge request GNOME/gtk!3086
-rw-r--r--gsk/gl/gskglrenderer.c34
-rw-r--r--gtk/gtkaccessible.c12
-rw-r--r--gtk/gtkbuilder.c44
-rw-r--r--gtk/gtkbuilderparser.c81
-rw-r--r--gtk/gtkbuilderprivate.h10
-rw-r--r--gtk/gtklabel.c74
-rw-r--r--gtk/gtkshortcutaction.h4
-rw-r--r--gtk/gtkwidget.c10
8 files changed, 138 insertions, 131 deletions
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 89cc3684ce..c1ef336eed 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -1554,7 +1554,7 @@ rounded_inner_rect_contains_rect (const GskRoundedRect *rounded,
MAX (rounded->corner[GSK_CORNER_BOTTOM_LEFT].height,
rounded->corner[GSK_CORNER_BOTTOM_RIGHT].height);
- return graphene_rect_contains_rect (&inner, rect);
+ return _graphene_rect_contains_rect (&inner, rect);
}
/* Current clip is NOT rounded but new one is definitely! */
@@ -1644,8 +1644,8 @@ render_clipped_child (GskGLRenderer *self,
/* well fuck */
const float scale_x = builder->scale_x;
const float scale_y = builder->scale_y;
- const GskRoundedRect scaled_clip = GSK_ROUNDED_RECT_INIT (clip->origin.x * scale_x,
- clip->origin.y * scale_y,
+ const GskRoundedRect scaled_clip = GSK_ROUNDED_RECT_INIT ((builder->dx + clip->origin.x) * scale_x,
+ (builder->dy + clip->origin.y) * scale_y,
clip->size.width * scale_x,
clip->size.height * scale_y);
gboolean is_offscreen;
@@ -1746,7 +1746,6 @@ render_rounded_clip_node (GskGLRenderer *self,
}
else
{
- GskRoundedRect scaled_clip;
gboolean is_offscreen;
TextureRegion region;
/* NOTE: We are *not* transforming the clip by the current modelview here.
@@ -1755,19 +1754,7 @@ render_rounded_clip_node (GskGLRenderer *self,
*
* We do, however, apply the scale factor to the child clip of course.
*/
- scaled_clip.bounds.origin.x = clip->bounds.origin.x * scale_x;
- scaled_clip.bounds.origin.y = clip->bounds.origin.y * scale_y;
- scaled_clip.bounds.size.width = clip->bounds.size.width * scale_x;
- scaled_clip.bounds.size.height = clip->bounds.size.height * scale_y;
-
- /* Increase corner radius size by scale factor */
- for (i = 0; i < 4; i ++)
- {
- scaled_clip.corner[i].width = clip->corner[i].width * scale_x;
- scaled_clip.corner[i].height = clip->corner[i].height * scale_y;
- }
-
- ops_push_clip (builder, &scaled_clip);
+ ops_push_clip (builder, &transformed_clip);
if (!add_offscreen_ops (self, builder, &node->bounds,
child,
&region, &is_offscreen,
@@ -1779,7 +1766,8 @@ render_rounded_clip_node (GskGLRenderer *self,
ops_set_program (builder, &self->programs->blit_program);
ops_set_texture (builder, region.texture_id);
- load_offscreen_vertex_data (ops_draw (builder, NULL), node, builder);
+ load_vertex_data_with_region (ops_draw (builder, NULL), &node->bounds, builder,
+ &region, is_offscreen);
}
}
@@ -3830,9 +3818,9 @@ add_offscreen_ops (GskGLRenderer *self,
gboolean *is_offscreen,
guint flags)
{
- float width, height;
const float dx = builder->dx;
const float dy = builder->dy;
+ float width, height;
float scale_x;
float scale_y;
int render_target;
@@ -3931,8 +3919,8 @@ add_offscreen_ops (GskGLRenderer *self,
render_target);
}
- viewport = GRAPHENE_RECT_INIT (bounds->origin.x * scale_x,
- bounds->origin.y * scale_y,
+ viewport = GRAPHENE_RECT_INIT ((bounds->origin.x + dx) * scale_x,
+ (bounds->origin.y + dy) * scale_y,
width, height);
init_projection_matrix (&item_proj, &viewport);
@@ -3945,8 +3933,8 @@ add_offscreen_ops (GskGLRenderer *self,
if (flags & RESET_CLIP)
ops_push_clip (builder, &GSK_ROUNDED_RECT_INIT_FROM_RECT (viewport));
- builder->dx = 0;
- builder->dy = 0;
+ builder->dx = dx;
+ builder->dy = dy;
prev_opacity = ops_set_opacity (builder, 1.0);
diff --git a/gtk/gtkaccessible.c b/gtk/gtkaccessible.c
index ed89fa9714..c5934c80f8 100644
--- a/gtk/gtkaccessible.c
+++ b/gtk/gtkaccessible.c
@@ -496,12 +496,12 @@ gtk_accessible_update_relation_value (GtkAccessible *self,
GtkAccessibleRelation relations[],
const GValue values[])
{
+ GtkATContext *context;
+
g_return_if_fail (GTK_IS_ACCESSIBLE (self));
g_return_if_fail (n_relations > 0);
- GtkATContext *context = gtk_accessible_get_at_context (self);
- if (context == NULL)
- return;
+ context = gtk_accessible_get_at_context (self);
for (int i = 0; i < n_relations; i++)
{
@@ -520,13 +520,15 @@ gtk_accessible_update_relation_value (GtkAccessible *self,
break;
}
- gtk_at_context_set_accessible_relation (context, relation, real_value);
+ if (context)
+ gtk_at_context_set_accessible_relation (context, relation, real_value);
if (real_value != NULL)
gtk_accessible_value_unref (real_value);
}
- gtk_at_context_update (context);
+ if (context)
+ gtk_at_context_update (context);
}
/**
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index d3edc4d0da..29dbe8ef9d 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -260,7 +260,7 @@ typedef struct
char *domain;
GHashTable *objects;
GSList *delayed_properties;
- GSList *signals;
+ GPtrArray *signals;
GSList *bindings;
char *filename;
char *resource_prefix;
@@ -375,8 +375,8 @@ gtk_builder_finalize (GObject *object)
#endif
g_hash_table_destroy (priv->objects);
-
- g_slist_free_full (priv->signals, (GDestroyNotify)_free_signal_info);
+ if (priv->signals)
+ g_ptr_array_free (priv->signals, TRUE);
G_OBJECT_CLASS (gtk_builder_parent_class)->finalize (object);
}
@@ -527,19 +527,21 @@ static void
gtk_builder_get_parameters (GtkBuilder *builder,
GType object_type,
const char *object_name,
- GSList *properties,
+ GPtrArray *properties,
GParamFlags filter_flags,
ObjectProperties *parameters,
ObjectProperties *filtered_parameters)
{
GtkBuilderPrivate *priv = gtk_builder_get_instance_private (builder);
- GSList *l;
DelayedProperty *property;
GError *error = NULL;
- for (l = properties; l; l = l->next)
+ if (!properties)
+ return;
+
+ for (guint i = 0; i < properties->len; i++)
{
- PropertyInfo *prop = (PropertyInfo*)l->data;
+ PropertyInfo *prop = g_ptr_array_index (properties, i);
const char *property_name = g_intern_string (prop->pspec->name);
GValue property_value = G_VALUE_INIT;
@@ -1018,12 +1020,14 @@ _gtk_builder_add (GtkBuilder *builder,
void
_gtk_builder_add_signals (GtkBuilder *builder,
- GSList *signals)
+ GPtrArray *signals)
{
GtkBuilderPrivate *priv = gtk_builder_get_instance_private (builder);
- priv->signals = g_slist_concat (priv->signals,
- g_slist_copy (signals));
+ if (G_UNLIKELY (!priv->signals))
+ priv->signals = g_ptr_array_new_with_free_func ((GDestroyNotify)_free_signal_info);
+
+ g_ptr_array_extend_and_steal (priv->signals, signals);
}
static gboolean
@@ -1851,18 +1855,17 @@ gtk_builder_connect_signals (GtkBuilder *builder,
GError **error)
{
GtkBuilderPrivate *priv = gtk_builder_get_instance_private (builder);
- GSList *l;
GObject *object;
GObject *connect_object;
- gboolean result = FALSE;
+ gboolean result = TRUE;
- if (!priv->signals)
+ if (!priv->signals ||
+ priv->signals->len == 0)
return TRUE;
- priv->signals = g_slist_reverse (priv->signals);
- for (l = priv->signals; l; l = l->next)
+ for (guint i = 0; i < priv->signals->len; i++)
{
- SignalInfo *signal = (SignalInfo*)l->data;
+ SignalInfo *signal = g_ptr_array_index (priv->signals, i);
GClosure *closure;
g_assert (signal != NULL);
@@ -1895,7 +1898,10 @@ gtk_builder_connect_signals (GtkBuilder *builder,
error);
if (closure == NULL)
- break;
+ {
+ result = false;
+ break;
+ }
g_signal_connect_closure_by_id (object,
signal->id,
@@ -1903,10 +1909,8 @@ gtk_builder_connect_signals (GtkBuilder *builder,
closure,
signal->flags & G_CONNECT_AFTER ? TRUE : FALSE);
}
- if (l == NULL)
- result = TRUE;
- g_slist_free_full (priv->signals, (GDestroyNotify)_free_signal_info);
+ g_ptr_array_free (priv->signals, TRUE);
priv->signals = NULL;
return result;
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index 41935df8e1..b368d82cc5 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -32,7 +32,8 @@
#include <string.h>
-typedef struct {
+typedef struct
+{
const GtkBuildableParser *last_parser;
gpointer last_user_data;
int last_depth;
@@ -41,9 +42,8 @@ typedef struct {
static void
pop_subparser_stack (GtkBuildableParseContext *context)
{
- GtkBuildableParserStack *stack =
- &g_array_index (context->subparser_stack, GtkBuildableParserStack,
- context->subparser_stack->len - 1);
+ GtkBuildableParserStack *stack = &g_array_index (context->subparser_stack, GtkBuildableParserStack,
+ context->subparser_stack->len - 1);
context->awaiting_pop = TRUE;
context->held_user_data = context->user_data;
@@ -57,15 +57,17 @@ pop_subparser_stack (GtkBuildableParseContext *context)
static void
possibly_finish_subparser (GtkBuildableParseContext *context)
{
- if (context->subparser_stack->len > 0)
- {
- GtkBuildableParserStack *stack =
- &g_array_index (context->subparser_stack, GtkBuildableParserStack,
- context->subparser_stack->len - 1);
+ GtkBuildableParserStack *stack;
- if (stack->last_depth == context->tag_stack->len)
- pop_subparser_stack (context);
- }
+ if (!context->subparser_stack ||
+ context->subparser_stack->len == 0)
+ return;
+
+ stack = &g_array_index (context->subparser_stack, GtkBuildableParserStack,
+ context->subparser_stack->len - 1);
+
+ if (stack->last_depth == context->tag_stack->len)
+ pop_subparser_stack (context);
}
static void
@@ -128,6 +130,9 @@ proxy_error (GMarkupParseContext *gm_context,
/* report the error all the way up to free all the user-data */
+ if (!context->subparser_stack)
+ return;
+
while (context->subparser_stack->len > 0)
{
pop_subparser_stack (context);
@@ -157,7 +162,7 @@ gtk_buildable_parse_context_init (GtkBuildableParseContext *context,
context->parser = parser;
context->user_data = user_data;
- context->subparser_stack = g_array_new (FALSE, FALSE, sizeof (GtkBuildableParserStack));
+ context->subparser_stack = NULL;
context->tag_stack = g_ptr_array_new ();
context->held_user_data = NULL;
context->awaiting_pop = FALSE;
@@ -166,7 +171,9 @@ gtk_buildable_parse_context_init (GtkBuildableParseContext *context,
static void
gtk_buildable_parse_context_free (GtkBuildableParseContext *context)
{
- g_array_unref (context->subparser_stack);
+ if (context->subparser_stack)
+ g_array_unref (context->subparser_stack);
+
g_ptr_array_unref (context->tag_stack);
}
@@ -245,6 +252,9 @@ gtk_buildable_parse_context_push (GtkBuildableParseContext *context,
context->parser = parser;
context->user_data = user_data;
+ if (!context->subparser_stack)
+ context->subparser_stack = g_array_new (FALSE, FALSE, sizeof (GtkBuildableParserStack));
+
g_array_append_val (context->subparser_stack, stack);
}
@@ -461,8 +471,6 @@ builder_construct (ParserData *data,
if (object_info->object && object_info->applied_properties)
return object_info->object;
- object_info->properties = g_slist_reverse (object_info->properties);
-
if (object_info->object == NULL)
{
object = _gtk_builder_construct (data->builder, object_info, error);
@@ -789,19 +797,21 @@ free_object_info (ObjectInfo *info)
{
/* Do not free the signal items, which GtkBuilder takes ownership of */
g_type_class_unref (info->oclass);
- g_slist_free (info->signals);
- g_slist_free_full (info->properties, (GDestroyNotify)free_property_info);
+ if (info->signals)
+ g_ptr_array_free (info->signals, TRUE);
+ if (info->properties)
+ g_ptr_array_free (info->properties, TRUE);
g_free (info->constructor);
g_free (info->id);
g_slice_free (ObjectInfo, info);
}
static void
-parse_child (ParserData *data,
- const char *element_name,
+parse_child (ParserData *data,
+ const char *element_name,
const char **names,
const char **values,
- GError **error)
+ GError **error)
{
ObjectInfo* object_info;
@@ -1697,7 +1707,6 @@ parse_custom (GtkBuildableParseContext *context,
ObjectInfo* object_info = (ObjectInfo*)parent_info;
if (!object_info->object)
{
- object_info->properties = g_slist_reverse (object_info->properties);
object_info->object = _gtk_builder_construct (data->builder,
object_info,
error);
@@ -1875,7 +1884,10 @@ end_element (GtkBuildableParseContext *context,
g_string_assign (prop_info->text, translated);
}
- object_info->properties = g_slist_prepend (object_info->properties, prop_info);
+ if (G_UNLIKELY (!object_info->properties))
+ object_info->properties = g_ptr_array_new_with_free_func ((GDestroyNotify)free_property_info);
+
+ g_ptr_array_add (object_info->properties, prop_info);
}
else
g_assert_not_reached ();
@@ -1943,8 +1955,13 @@ end_element (GtkBuildableParseContext *context,
if (GTK_IS_BUILDABLE (object_info->object) &&
GTK_BUILDABLE_GET_IFACE (object_info->object)->parser_finished)
- data->finalizers = g_slist_prepend (data->finalizers, object_info->object);
- _gtk_builder_add_signals (data->builder, object_info->signals);
+ g_ptr_array_add (data->finalizers, object_info->object);
+
+ if (object_info->signals)
+ {
+ _gtk_builder_add_signals (data->builder, object_info->signals);
+ object_info->signals = NULL;
+ }
free_object_info (object_info);
}
@@ -1962,7 +1979,11 @@ end_element (GtkBuildableParseContext *context,
ObjectInfo *object_info = (ObjectInfo*)state_peek_info (data, CommonInfo);
g_assert (object_info != NULL);
signal_info->object_name = g_strdup (object_info->id);
- object_info->signals = g_slist_prepend (object_info->signals, signal_info);
+
+ if (G_UNLIKELY (!object_info->signals))
+ object_info->signals = g_ptr_array_new ();
+
+ g_ptr_array_add (object_info->signals, signal_info);
}
else if (strcmp (element_name, "constant") == 0 ||
strcmp (element_name, "closure") == 0 ||
@@ -2154,6 +2175,7 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
data.object_ids = g_hash_table_new_full (g_str_hash, g_str_equal,
(GDestroyNotify)g_free, NULL);
data.stack = g_ptr_array_new ();
+ data.finalizers = g_ptr_array_new ();
if (requested_objs)
{
@@ -2193,10 +2215,9 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
}
/* Common parser_finished, for all created objects */
- data.finalizers = g_slist_reverse (data.finalizers);
- for (l = data.finalizers; l; l = l->next)
+ for (guint i = 0; i < data.finalizers->len; i++)
{
- GtkBuildable *buildable = (GtkBuildable*)l->data;
+ GtkBuildable *buildable = g_ptr_array_index (data.finalizers, i);
gtk_buildable_parser_finished (GTK_BUILDABLE (buildable), builder);
if (_gtk_builder_lookup_failed (builder, error))
@@ -2206,10 +2227,10 @@ _gtk_builder_parser_parse_buffer (GtkBuilder *builder,
out:
g_slist_free_full (data.custom_finalizers, (GDestroyNotify)free_subparser);
- g_slist_free (data.finalizers);
g_free (data.domain);
g_hash_table_destroy (data.object_ids);
g_ptr_array_free (data.stack, TRUE);
+ g_ptr_array_free (data.finalizers, TRUE);
gtk_buildable_parse_context_free (&data.ctx);
/* restore the original domain */
diff --git a/gtk/gtkbuilderprivate.h b/gtk/gtkbuilderprivate.h
index 74c688b2de..34a48dd454 100644
--- a/gtk/gtkbuilderprivate.h
+++ b/gtk/gtkbuilderprivate.h
@@ -46,9 +46,11 @@ typedef struct {
GObjectClass *oclass;
char *id;
char *constructor;
- GSList *properties;
- GSList *signals;
+
+ GPtrArray *properties;
+ GPtrArray *signals;
GSList *bindings;
+
GObject *object;
CommonInfo *parent;
gboolean applied_properties;
@@ -177,7 +179,7 @@ typedef struct {
SubParser *subparser;
GtkBuildableParseContext ctx;
const char *filename;
- GSList *finalizers;
+ GPtrArray *finalizers;
GSList *custom_finalizers;
const char **requested_objects; /* NULL if all the objects are requested */
@@ -218,7 +220,7 @@ void _gtk_builder_add_object (GtkBuilder *builder,
void _gtk_builder_add (GtkBuilder *builder,
ChildInfo *child_info);
void _gtk_builder_add_signals (GtkBuilder *builder,
- GSList *signals);
+ GPtrArray *signals);
gboolean _gtk_builder_finish (GtkBuilder *builder,
GError **error);
void _free_signal_info (SignalInfo *info,
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 1c8a31f231..d520fa0e8e 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -1165,12 +1165,6 @@ gtk_label_get_preferred_size (GtkWidget *widget,
/* Normal desired width */
*minimum_size = smallest_rect.width;
*natural_size = widest_rect.width;
-
- if (minimum_baseline)
- *minimum_baseline = -1;
-
- if (natural_baseline)
- *natural_baseline = -1;
}
else /* GTK_ORIENTATION_VERTICAL */
{
@@ -1178,19 +1172,15 @@ gtk_label_get_preferred_size (GtkWidget *widget,
{
*minimum_size = smallest_rect.height;
*natural_size = widest_rect.height;
- if (minimum_baseline)
- *minimum_baseline = smallest_baseline;
- if (natural_baseline)
- *natural_baseline = widest_baseline;
+ *minimum_baseline = smallest_baseline;
+ *natural_baseline = widest_baseline;
}
else
{
*minimum_size = widest_rect.height;
*natural_size = smallest_rect.height;
- if (minimum_baseline)
- *minimum_baseline = widest_baseline;
- if (natural_baseline)
- *natural_baseline = smallest_baseline;
+ *minimum_baseline = widest_baseline;
+ *natural_baseline = smallest_baseline;
}
}
}
@@ -1223,45 +1213,38 @@ get_layout_location (GtkLabel *self,
int *yp)
{
GtkWidget *widget = GTK_WIDGET (self);
- int layout_width, layout_height, x, y;
- float xalign, yalign;
+ const int widget_width = gtk_widget_get_width (widget);
+ const int widget_height = gtk_widget_get_height (widget);
PangoRectangle logical;
- int baseline, layout_baseline, baseline_offset;
- int widget_width, widget_height;
+ float xalign;
+ int baseline;
+ int x, y;
+
+ g_assert (xp);
+ g_assert (yp);
xalign = self->xalign;
- yalign = self->yalign;
if (_gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
xalign = 1.0 - xalign;
pango_layout_get_pixel_extents (self->layout, NULL, &logical);
-
- layout_width = logical.width;
- layout_height = logical.height;
-
- widget_width = gtk_widget_get_width (widget);
- widget_height = gtk_widget_get_height (widget);
+ x = floor ((xalign * (widget_width - logical.width)) - logical.x);
baseline = gtk_widget_get_allocated_baseline (widget);
-
- x = floor ((xalign * (widget_width - layout_width)) - logical.x);
-
- baseline_offset = 0;
if (baseline != -1)
{
- layout_baseline = pango_layout_get_baseline (self->layout) / PANGO_SCALE;
- baseline_offset = baseline - layout_baseline;
- yalign = 0.0; /* Can't support yalign while baseline aligning */
+ int layout_baseline = pango_layout_get_baseline (self->layout) / PANGO_SCALE;
+ /* yalign is 0 because we can't support yalign while baseline aligning */
+ y = baseline - layout_baseline;
+ }
+ else
+ {
+ y = floor ((widget_height - logical.height) * self->yalign);
}
- y = floor ((widget_height - layout_height) * yalign) + baseline_offset;
-
- if (xp)
- *xp = x;
-
- if (yp)
- *yp = y;
+ *xp = x;
+ *yp = y;
}
static void
@@ -3500,7 +3483,10 @@ no_uline:
/* Extract the text to display */
if (!pango_parse_markup (new_text, -1, '_',
do_mnemonics ? &attrs : NULL, &text, NULL, &error))
- goto error_set;
+ {
+ g_free (new_text);
+ goto error_set;
+ }
if (do_mnemonics)
{
@@ -4978,11 +4964,17 @@ gtk_label_get_layout_offsets (GtkLabel *self,
int *x,
int *y)
{
+ int local_x, local_y;
g_return_if_fail (GTK_IS_LABEL (self));
gtk_label_ensure_layout (self);
+ get_layout_location (self, &local_x, &local_y);
+
+ if (x)
+ *x = local_x;
- get_layout_location (self, x, y);
+ if (y)
+ *y = local_y;
}
/**
diff --git a/gtk/gtkshortcutaction.h b/gtk/gtkshortcutaction.h
index 9c874a641b..9c15172a96 100644
--- a/gtk/gtkshortcutaction.h
+++ b/gtk/gtkshortcutaction.h
@@ -33,8 +33,8 @@ G_BEGIN_DECLS
/**
* GtkShortcutFunc:
* @widget: The widget passed to the activation
- * @args: The arguments passed to the activation
- * @user_data: The user data provided when activating the action
+ * @args: (nullable): The arguments passed to the activation
+ * @user_data: (nullable): The user data provided when activating the action
*
* Prototype for shortcuts based on user callbacks.
*/
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 45a3720b18..5ac8b9ac84 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4185,7 +4185,7 @@ void
gtk_widget_class_add_binding (GtkWidgetClass *widget_class,
guint keyval,
GdkModifierType mods,
- GtkShortcutFunc func,
+ GtkShortcutFunc callback,
const char *format_string,
...)
{
@@ -4194,7 +4194,7 @@ gtk_widget_class_add_binding (GtkWidgetClass *widget_class,
g_return_if_fail (GTK_IS_WIDGET_CLASS (widget_class));
shortcut = gtk_shortcut_new (gtk_keyval_trigger_new (keyval, mods),
- gtk_callback_action_new (func, NULL, NULL));
+ gtk_callback_action_new (callback, NULL, NULL));
if (format_string)
{
va_list args;
@@ -9123,14 +9123,12 @@ GtkAlign
gtk_widget_get_halign (GtkWidget *widget)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
- GtkAlign align;
g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_ALIGN_FILL);
- align = priv->halign;
- if (align == GTK_ALIGN_BASELINE)
+ if (priv->halign == GTK_ALIGN_BASELINE)
return GTK_ALIGN_FILL;
- return align;
+ return priv->halign;
}
/**