Compare commits

..

1 Commits

Author SHA1 Message Date
Matthias Clasen 05e8057b5b Fix gtk_column_view_sort_by_column
We must clear the current sort columns before
setting the new one, to prevent double arrows
in the headers.

Fixes: #4696
2022-04-18 20:37:04 -04:00
43 changed files with 3906 additions and 8100 deletions
+1 -1
View File
@@ -100,7 +100,7 @@ show_page (GtkTextView *text_view,
theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (text_view)));
icon = gtk_icon_theme_lookup_icon (theme,
"view-conceal-symbolic",
"eye-not-looking-symbolic",
NULL,
16,
1,
+13 -19
View File
@@ -518,6 +518,19 @@ init_randr15 (GdkX11Screen *x11_screen)
XRRFreeCrtcInfo (crtc);
}
monitor = find_monitor_by_output (x11_display, output);
if (monitor)
monitor->remove = FALSE;
else
{
monitor = g_object_new (GDK_TYPE_X11_MONITOR,
"display", display,
NULL);
monitor->output = output;
monitor->add = TRUE;
g_list_store_append (x11_display->monitors, monitor);
}
/* Fetch minimal manufacturer information (PNP ID) from EDID */
{
#define EDID_LENGTH 128
@@ -530,7 +543,6 @@ init_randr15 (GdkX11Screen *x11_screen)
edid_atom = XInternAtom (disp, RR_PROPERTY_RANDR_EDID, FALSE);
gdk_x11_display_error_trap_push (display);
XRRGetOutputProperty (disp, output,
edid_atom,
0,
@@ -543,11 +555,6 @@ init_randr15 (GdkX11Screen *x11_screen)
&nbytes,
&bytes_left,
&prop);
if (gdk_x11_display_error_trap_pop (display))
{
XRRFreeOutputInfo (output_info);
continue;
}
// Check partial EDID header (whole header: 00 ff ff ff ff ff ff 00)
if (nbytes >= EDID_LENGTH && prop[0] == 0x00 && prop[1] == 0xff)
@@ -568,19 +575,6 @@ init_randr15 (GdkX11Screen *x11_screen)
#undef EDID_LENGTH
}
monitor = find_monitor_by_output (x11_display, output);
if (monitor)
monitor->remove = FALSE;
else
{
monitor = g_object_new (GDK_TYPE_X11_MONITOR,
"display", display,
NULL);
monitor->output = output;
monitor->add = TRUE;
g_list_store_append (x11_display->monitors, monitor);
}
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry);
name = g_strndup (output_info->name, output_info->nameLen);
+13 -19
View File
@@ -1418,7 +1418,7 @@ gtk_at_spi_context_unregister_object (GtkAtSpiContext *self)
g_clear_pointer (&self->interfaces, g_variant_unref);
}
/* }}} */
/* {{{ GObject boilerplate */
/* {{{ GObject boilerplate */
static void
gtk_at_spi_context_finalize (GObject *gobject)
{
@@ -1443,22 +1443,6 @@ gtk_at_spi_context_constructed (GObject *gobject)
static const char *get_bus_address (GdkDisplay *display);
static void
register_object (GtkAtSpiRoot *root,
GtkAtSpiContext *context)
{
GtkAccessible *accessible = gtk_at_context_get_accessible (GTK_AT_CONTEXT (context));
gtk_atspi_connect_text_signals (accessible,
(GtkAtspiTextChangedCallback *)emit_text_changed,
(GtkAtspiTextSelectionCallback *)emit_text_selection_changed,
context);
gtk_atspi_connect_selection_signals (accessible,
(GtkAtspiSelectionCallback *)emit_selection_changed,
context);
gtk_at_spi_context_register_object (context);
}
static void
gtk_at_spi_context_realize (GtkATContext *context)
{
@@ -1505,10 +1489,11 @@ gtk_at_spi_context_realize (GtkATContext *context)
if (self->connection == NULL)
return;
GtkAccessible *accessible = gtk_at_context_get_accessible (context);
#ifdef G_ENABLE_DEBUG
if (GTK_DEBUG_CHECK (A11Y))
{
GtkAccessible *accessible = gtk_at_context_get_accessible (context);
GtkAccessibleRole role = gtk_at_context_get_accessible_role (context);
char *role_name = g_enum_to_string (GTK_TYPE_ACCESSIBLE_ROLE, role);
g_message ("Realizing ATSPI context “%s” for accessible “%s”, with role: “%s”",
@@ -1519,7 +1504,16 @@ gtk_at_spi_context_realize (GtkATContext *context)
}
#endif
gtk_at_spi_root_queue_register (self->root, self, register_object);
gtk_atspi_connect_text_signals (accessible,
(GtkAtspiTextChangedCallback *)emit_text_changed,
(GtkAtspiTextSelectionCallback *)emit_text_selection_changed,
self);
gtk_atspi_connect_selection_signals (accessible,
(GtkAtspiSelectionCallback *)emit_selection_changed,
self);
gtk_at_spi_context_register_object (self);
gtk_at_spi_root_queue_register (self->root, self);
}
static void
-1
View File
@@ -113,7 +113,6 @@ pango_underline_to_string (PangoUnderline value)
const char *
pango_wrap_mode_to_string (PangoWrapMode mode)
{
/* Keep these in sync with gtk_wrap_mode_to_string() */
switch (mode)
{
case PANGO_WRAP_WORD:
+11 -35
View File
@@ -474,24 +474,16 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot *self,
window_ref);
}
typedef struct {
GtkAtSpiRoot *root;
GtkAtSpiRootRegisterFunc register_func;
} RegistrationData;
static void
on_registration_reply (GObject *gobject,
GAsyncResult *result,
gpointer user_data)
{
RegistrationData *data = user_data;
GtkAtSpiRoot *self = data->root;
GtkAtSpiRoot *self = user_data;
GError *error = NULL;
GVariant *reply = g_dbus_connection_call_finish (G_DBUS_CONNECTION (gobject), result, &error);
self->register_id = 0;
if (error != NULL)
{
g_critical ("Unable to register the application: %s", error->message);
@@ -517,27 +509,19 @@ on_registration_reply (GObject *gobject,
/* Drain the list of queued GtkAtSpiContexts, and add them to the cache */
if (self->queued_contexts != NULL)
{
for (GList *l = g_list_reverse (self->queued_contexts); l != NULL; l = l->next)
{
if (data->register_func != NULL)
data->register_func (self, l->data);
gtk_at_spi_cache_add_context (self->cache, l->data);
}
for (GList *l = self->queued_contexts; l != NULL; l = l->next)
gtk_at_spi_cache_add_context (self->cache, l->data);
g_clear_pointer (&self->queued_contexts, g_list_free);
}
self->toplevels = gtk_window_get_toplevels ();
g_free (data);
}
static gboolean
root_register (gpointer user_data)
root_register (gpointer data)
{
RegistrationData *data = user_data;
GtkAtSpiRoot *self = data->root;
GtkAtSpiRoot *self = data;
const char *unique_name;
/* Register the root element; every application has a single root, so we only
@@ -593,7 +577,9 @@ root_register (gpointer user_data)
G_DBUS_CALL_FLAGS_NONE, -1,
NULL,
on_registration_reply,
data);
self);
self->register_id = 0;
return G_SOURCE_REMOVE;
}
@@ -601,24 +587,18 @@ root_register (gpointer user_data)
/*< private >
* gtk_at_spi_root_queue_register:
* @self: a `GtkAtSpiRoot`
* @context: the AtSpi context to register
* @func: the function to call when the root has been registered
*
* Queues the registration of the root object on the AT-SPI bus.
*/
void
gtk_at_spi_root_queue_register (GtkAtSpiRoot *self,
GtkAtSpiContext *context,
GtkAtSpiRootRegisterFunc func)
gtk_at_spi_root_queue_register (GtkAtSpiRoot *self,
GtkAtSpiContext *context)
{
/* The cache is available if the root has finished registering itself; if we
* are still waiting for the registration to finish, add the context to a queue
*/
if (self->cache != NULL)
{
if (func != NULL)
func (self, context);
gtk_at_spi_cache_add_context (self->cache, context);
return;
}
@@ -632,11 +612,7 @@ gtk_at_spi_root_queue_register (GtkAtSpiRoot *self,
if (self->register_id != 0)
return;
RegistrationData *data = g_new (RegistrationData, 1);
data->root = self;
data->register_func = func;
self->register_id = g_idle_add (root_register, data);
self->register_id = g_idle_add (root_register, self);
gdk_source_set_static_name_by_id (self->register_id, "[gtk] ATSPI root registration");
}
+1 -5
View File
@@ -34,13 +34,9 @@ G_DECLARE_FINAL_TYPE (GtkAtSpiRoot, gtk_at_spi_root, GTK, AT_SPI_ROOT, GObject)
GtkAtSpiRoot *
gtk_at_spi_root_new (const char *bus_address);
typedef void (* GtkAtSpiRootRegisterFunc) (GtkAtSpiRoot *root,
GtkAtSpiContext *context);
void
gtk_at_spi_root_queue_register (GtkAtSpiRoot *self,
GtkAtSpiContext *context,
GtkAtSpiRootRegisterFunc func);
GtkAtSpiContext *context);
void
gtk_at_spi_root_unregister (GtkAtSpiRoot *self,
+2 -23
View File
@@ -55,27 +55,6 @@ gtk_text_direction_to_string (GtkTextDirection direction)
}
}
static const char *
gtk_wrap_mode_to_string (GtkWrapMode wrap_mode)
{
/* Keep these in sync with pango_wrap_mode_to_string(); note that
* here we have an extra case for NONE.
*/
switch (wrap_mode)
{
case GTK_WRAP_NONE:
return "none";
case GTK_WRAP_CHAR:
return "char";
case GTK_WRAP_WORD:
return "word";
case GTK_WRAP_WORD_CHAR:
return "word-char";
default:
g_assert_not_reached ();
}
}
void
gtk_text_view_add_default_attributes (GtkTextView *view,
GVariantBuilder *builder)
@@ -96,7 +75,7 @@ gtk_text_view_add_default_attributes (GtkTextView *view,
g_variant_builder_add (builder, "{ss}", "direction",
gtk_text_direction_to_string (text_attrs->direction));
g_variant_builder_add (builder, "{ss}", "wrap-mode",
gtk_wrap_mode_to_string (text_attrs->wrap_mode));
pango_wrap_mode_to_string ((PangoWrapMode)text_attrs->wrap_mode));
g_variant_builder_add (builder, "{ss}", "editable",
text_attrs->editable ? "true" : "false");
g_variant_builder_add (builder, "{ss}", "invisible",
@@ -277,7 +256,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
"wrap-mode", &wrap_mode,
NULL);
if (val_set)
g_variant_builder_add (builder, "{ss}", "wrap-mode", gtk_wrap_mode_to_string (wrap_mode));
g_variant_builder_add (builder, "{ss}", "wrap-mode", pango_wrap_mode_to_string ((PangoWrapMode)wrap_mode));
temp_tags = temp_tags->next;
}
val_set = FALSE;
+2 -41
View File
@@ -288,12 +288,6 @@ gtk_box_layout_compute_opposite_size (GtkBoxLayout *self,
*natural = largest_nat;
}
/* if widgets haven't reached their min opposite size at this
* huge value, things went massively wrong and we need to bail to not
* cause an infinite loop.
*/
#define MAX_ALLOWED_SIZE (1 << 20)
static int
distribute_remaining_size (GtkRequestedSize *sizes,
gsize n_sizes,
@@ -327,40 +321,7 @@ distribute_remaining_size (GtkRequestedSize *sizes,
{
int test;
if (min > MAX_ALLOWED_SIZE)
{
/* sanity check! */
for (i = 0; i < n_sizes; i++)
{
int check_min, check_nat;
gtk_widget_measure (sizes[i].data,
orientation,
MAX_ALLOWED_SIZE,
&sizes[i].minimum_size, &sizes[i].natural_size,
NULL, NULL);
gtk_widget_measure (sizes[i].data,
orientation,
-1,
&check_min, &check_nat,
NULL, NULL);
if (check_min < sizes[i].minimum_size)
{
g_critical ("%s %p reports a minimum %s of %u, but minimum %s for %s of %u is %u. Expect overlapping widgets.",
G_OBJECT_TYPE_NAME (sizes[i].data), sizes[i].data,
orientation == GTK_ORIENTATION_HORIZONTAL ? "width" : "height",
check_min,
orientation == GTK_ORIENTATION_HORIZONTAL ? "width" : "height",
orientation == GTK_ORIENTATION_HORIZONTAL ? "height" : "width",
MAX_ALLOWED_SIZE, sizes[i].minimum_size);
sizes[i].minimum_size = check_min;
sizes[i].natural_size = check_nat;
}
total_size += sizes[i].minimum_size;
}
return MAX (0, available - total_size);
}
if (max == MAX_ALLOWED_SIZE)
if (max == G_MAXINT)
test = min * 2;
else
test = (min + max) / 2;
@@ -504,7 +465,7 @@ gtk_box_layout_compute_opposite_size_for_size (GtkBoxLayout *self,
self->orientation,
available,
min_size,
MAX_ALLOWED_SIZE);
G_MAXINT);
/* Bring children up to size first */
available = gtk_distribute_natural_allocation (available, nvis_children, sizes);
+20 -142
View File
@@ -86,10 +86,9 @@
* ```
*
* A `GtkCheckButton` has a main node with name checkbutton. If the
* [property@Gtk.CheckButton:label] or [property@Gtk.CheckButton:child]
* properties are set, it contains a child widget. The indicator node
* is named check when no group is set, and radio if the checkbutton
* is grouped together with other checkbuttons.
* [property@Gtk.CheckButton:label] property is set, it contains a label
* child. The indicator node is named check when no group is set, and
* radio if the checkbutton is grouped together with other checkbuttons.
*
* # Accessibility
*
@@ -98,12 +97,11 @@
typedef struct {
GtkWidget *indicator_widget;
GtkWidget *child;
GtkWidget *label_widget;
guint inconsistent: 1;
guint active: 1;
guint inconsistent: 1;
guint active: 1;
guint use_underline: 1;
guint child_type: 1;
GtkCheckButton *group_next;
GtkCheckButton *group_prev;
@@ -118,7 +116,6 @@ enum {
PROP_LABEL,
PROP_INCONSISTENT,
PROP_USE_UNDERLINE,
PROP_CHILD,
/* actionable properties */
PROP_ACTION_NAME,
@@ -132,11 +129,6 @@ enum {
LAST_SIGNAL
};
enum {
LABEL_CHILD,
WIDGET_CHILD
};
static void gtk_check_button_actionable_iface_init (GtkActionableInterface *iface);
static guint signals[LAST_SIGNAL] = { 0 };
@@ -154,7 +146,7 @@ gtk_check_button_dispose (GObject *object)
g_clear_object (&priv->action_helper);
g_clear_pointer (&priv->indicator_widget, gtk_widget_unparent);
g_clear_pointer (&priv->child, gtk_widget_unparent);
g_clear_pointer (&priv->label_widget, gtk_widget_unparent);
gtk_check_button_set_group (GTK_CHECK_BUTTON (object), NULL);
@@ -234,9 +226,6 @@ gtk_check_button_set_property (GObject *object,
case PROP_USE_UNDERLINE:
gtk_check_button_set_use_underline (GTK_CHECK_BUTTON (object), g_value_get_boolean (value));
break;
case PROP_CHILD:
gtk_check_button_set_child (GTK_CHECK_BUTTON (object), g_value_get_object (value));
break;
case PROP_ACTION_NAME:
gtk_check_button_set_action_name (GTK_ACTIONABLE (object), g_value_get_string (value));
break;
@@ -271,9 +260,6 @@ gtk_check_button_get_property (GObject *object,
case PROP_USE_UNDERLINE:
g_value_set_boolean (value, gtk_check_button_get_use_underline (GTK_CHECK_BUTTON (object)));
break;
case PROP_CHILD:
g_value_set_object (value, gtk_check_button_get_child (GTK_CHECK_BUTTON (object)));
break;
case PROP_ACTION_NAME:
g_value_set_string (value, gtk_action_helper_get_action_name (priv->action_helper));
break;
@@ -502,36 +488,6 @@ gtk_check_button_focus (GtkWidget *widget,
}
}
static void
gtk_check_button_real_set_child (GtkCheckButton *self,
GtkWidget *child,
guint child_type)
{
GtkCheckButtonPrivate *priv = gtk_check_button_get_instance_private (self);
g_return_if_fail (GTK_IS_CHECK_BUTTON (self));
g_clear_pointer (&priv->child, gtk_widget_unparent);
priv->child = child;
if (priv->child)
{
gtk_widget_set_parent (priv->child, GTK_WIDGET (self));
gtk_widget_insert_after (priv->child, GTK_WIDGET (self), priv->indicator_widget);
}
if (child_type == priv->child_type)
return;
priv->child_type = child_type;
if (child_type != LABEL_CHILD)
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_LABEL]);
else
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_CHILD]);
}
static void
gtk_check_button_real_activate (GtkCheckButton *self)
{
@@ -636,20 +592,6 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkCheckButton:child: (attributes org.gtk.Property.get=gtk_check_button_get_child org.gtk.Property.set=gtk_check_button_set_child)
*
* The child widget.
*
* Since: 4.8
*/
props[PROP_CHILD] =
g_param_spec_object ("child",
P_("Child"),
P_("The child widget"),
GTK_TYPE_WIDGET,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, LAST_PROP, props);
g_object_class_override_property (object_class, PROP_ACTION_NAME, "action-name");
@@ -914,7 +856,7 @@ gtk_check_button_set_active (GtkCheckButton *self,
* gtk_check_button_get_label: (attributes org.gtk.Method.get_property=label)
* @self: a `GtkCheckButton`
*
* Returns the label of the check button or `NULL` if [property@CheckButton:child] is set.
* Returns the label of the check button.
*
* Returns: (nullable) (transfer none): The label @self shows next
* to the indicator. If no label is shown, %NULL will be returned.
@@ -926,8 +868,8 @@ gtk_check_button_get_label (GtkCheckButton *self)
g_return_val_if_fail (GTK_IS_CHECK_BUTTON (self), "");
if (priv->child_type == LABEL_CHILD && priv->child != NULL)
return gtk_label_get_label (GTK_LABEL (priv->child));
if (priv->label_widget)
return gtk_label_get_label (GTK_LABEL (priv->label_widget));
return NULL;
}
@@ -949,41 +891,33 @@ gtk_check_button_set_label (GtkCheckButton *self,
const char *label)
{
GtkCheckButtonPrivate *priv = gtk_check_button_get_instance_private (self);
GtkWidget *child;
g_return_if_fail (GTK_IS_CHECK_BUTTON (self));
g_object_freeze_notify (G_OBJECT (self));
if (label == NULL || label[0] == '\0')
{
gtk_check_button_real_set_child (self, NULL, LABEL_CHILD);
g_clear_pointer (&priv->label_widget, gtk_widget_unparent);
gtk_widget_remove_css_class (GTK_WIDGET (self), "text-button");
}
else
{
if (priv->child_type != LABEL_CHILD || priv->child == NULL)
if (!priv->label_widget)
{
child = gtk_label_new (NULL);
gtk_widget_set_hexpand (child, TRUE);
gtk_label_set_xalign (GTK_LABEL (child), 0.0f);
if (priv->use_underline)
gtk_label_set_use_underline (GTK_LABEL (child), priv->use_underline);
gtk_check_button_real_set_child (self, GTK_WIDGET (child), LABEL_CHILD);
priv->label_widget = gtk_label_new (NULL);
gtk_widget_set_hexpand (priv->label_widget, TRUE);
gtk_label_set_xalign (GTK_LABEL (priv->label_widget), 0.0f);
gtk_label_set_use_underline (GTK_LABEL (priv->label_widget), priv->use_underline);
gtk_widget_insert_after (priv->label_widget, GTK_WIDGET (self), priv->indicator_widget);
}
gtk_widget_add_css_class (GTK_WIDGET (self), "text-button");
gtk_label_set_label (GTK_LABEL (priv->child), label);
gtk_label_set_label (GTK_LABEL (priv->label_widget), label);
}
gtk_accessible_update_property (GTK_ACCESSIBLE (self),
GTK_ACCESSIBLE_PROPERTY_LABEL, label,
-1);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_LABEL]);
g_object_thaw_notify (G_OBJECT (self));
}
/**
@@ -1111,64 +1045,8 @@ gtk_check_button_set_use_underline (GtkCheckButton *self,
return;
priv->use_underline = setting;
if (priv->child_type == LABEL_CHILD)
gtk_label_set_use_underline (GTK_LABEL (priv->child), priv->use_underline);
if (priv->label_widget)
gtk_label_set_use_underline (GTK_LABEL (priv->label_widget), priv->use_underline);
g_object_notify_by_pspec (G_OBJECT (self), props[PROP_USE_UNDERLINE]);
}
/**
* gtk_check_button_set_child: (attributes org.gtk.Method.set_property=child)
* @button: a `GtkCheckButton`
* @child: (nullable): the child widget
*
* Sets the child widget of @button.
*
* Note that by using this API, you take full responsibility for setting
* up the proper accessibility label and description information for @button.
* Most likely, you'll either set the accessibility label or description
* for @button explicitly, or you'll set a labelled-by or described-by
* relations from @child to @button.
*
* Since: 4.8
*/
void
gtk_check_button_set_child (GtkCheckButton *button,
GtkWidget *child)
{
g_return_if_fail (GTK_IS_CHECK_BUTTON (button));
g_return_if_fail (child == NULL || GTK_IS_WIDGET (child));
g_object_freeze_notify (G_OBJECT (button));
gtk_widget_remove_css_class (GTK_WIDGET (button), "text-button");
gtk_check_button_real_set_child (button, child, WIDGET_CHILD);
g_object_notify_by_pspec (G_OBJECT (button), props[PROP_CHILD]);
g_object_thaw_notify (G_OBJECT (button));
}
/**
* gtk_check_button_get_child: (attributes org.gtk.Method.get_property=child)
* @button: a `GtkCheckButton`
*
* Gets the child widget of @button or `NULL` if [property@CheckButton:label] is set.
*
* Returns: (nullable) (transfer none): the child widget of @button
*
* Since: 4.8
*/
GtkWidget *
gtk_check_button_get_child (GtkCheckButton *button)
{
GtkCheckButtonPrivate *priv = gtk_check_button_get_instance_private (button);
g_return_val_if_fail (GTK_IS_CHECK_BUTTON (button), NULL);
if (priv->child_type == WIDGET_CHILD)
return priv->child;
return NULL;
}
-5
View File
@@ -95,11 +95,6 @@ gboolean gtk_check_button_get_use_underline (GtkCheckButton *self);
GDK_AVAILABLE_IN_ALL
void gtk_check_button_set_use_underline (GtkCheckButton *self,
gboolean setting);
GDK_AVAILABLE_IN_4_8
GtkWidget * gtk_check_button_get_child (GtkCheckButton *button);
GDK_AVAILABLE_IN_4_8
void gtk_check_button_set_child (GtkCheckButton *button,
GtkWidget *child);
G_END_DECLS
+2 -3
View File
@@ -1703,9 +1703,8 @@ gtk_column_view_sort_by_column (GtkColumnView *self,
g_return_if_fail (column == NULL || GTK_IS_COLUMN_VIEW_COLUMN (column));
g_return_if_fail (column == NULL || gtk_column_view_column_get_column_view (column) == self);
if (column == NULL)
gtk_column_view_sorter_clear (GTK_COLUMN_VIEW_SORTER (self->sorter));
else
gtk_column_view_sorter_clear (GTK_COLUMN_VIEW_SORTER (self->sorter));
if (column != NULL)
gtk_column_view_sorter_set_column (GTK_COLUMN_VIEW_SORTER (self->sorter),
column,
direction == GTK_SORT_DESCENDING);
+2 -8
View File
@@ -942,12 +942,7 @@ parser_get_compose_table (GtkComposeParser *parser)
if (char_data->len > 0)
g_string_append_c (char_data, 0);
if (char_data->len >= 0x8000)
{
g_warning ("GTK can't handle compose tables this large (%s)", parser->compose_file ? parser->compose_file : "");
g_string_free (char_data, TRUE);
return NULL;
}
g_assert (char_data->len < 0x8000);
encoded_value = (guint16) (char_data->len | 0x8000);
g_string_append (char_data, value);
@@ -1155,8 +1150,7 @@ parse:
* is probably a copy of the system one, we take steps to keep things working,
* and thell the user about it.
*/
if (found_old_cache && !found_include &&
compose_table != NULL && compose_table->n_sequences < 100)
if (found_old_cache && !found_include && compose_table->n_sequences < 100)
{
if (rewrite_compose_file (compose_file))
{
+22 -43
View File
@@ -60,42 +60,30 @@ typedef struct {
static void
filechooser_portal_data_clear (FilechooserPortalData *data)
filechooser_portal_data_free (FilechooserPortalData *data)
{
if (data->portal_response_signal_id != 0)
{
g_dbus_connection_signal_unsubscribe (data->connection,
data->portal_response_signal_id);
data->portal_response_signal_id = 0;
}
g_dbus_connection_signal_unsubscribe (data->connection,
data->portal_response_signal_id);
g_clear_object (&data->connection);
g_object_unref (data->connection);
if (data->grab_widget)
{
gtk_grab_remove (data->grab_widget);
g_clear_object (&data->grab_widget);
g_object_unref (data->grab_widget);
}
g_clear_object (&data->self);
if (data->exported_window)
{
gtk_window_unexport_handle (data->exported_window);
g_clear_object (&data->exported_window);
}
gtk_window_unexport_handle (data->exported_window);
g_clear_pointer (&data->portal_handle, g_free);
}
g_clear_object (&data->exported_window);
static void
filechooser_portal_data_free (FilechooserPortalData *data)
{
if (data != NULL)
{
filechooser_portal_data_clear (data);
g_free (data);
}
g_free (data->portal_handle);
g_free (data);
}
static void
@@ -187,18 +175,10 @@ response_cb (GDBusConnection *connection,
break;
}
/* Keep a reference on the native dialog until we can emit the response
* signal; filechooser_portal_data_free() will drop a reference on the
* dialog as well
*/
g_object_ref (self);
filechooser_portal_data_free (data);
self->mode_data = NULL;
_gtk_native_dialog_emit_response (GTK_NATIVE_DIALOG (self), gtk_response);
g_object_unref (self);
}
static void
@@ -259,6 +239,7 @@ open_file_msg_cb (GObject *source_object,
if (data->hidden)
{
/* The dialog was hidden before we got the handle, close it now */
send_close (data);
filechooser_portal_data_free (data);
self->mode_data = NULL;
}
@@ -363,15 +344,15 @@ show_portal_file_chooser (GtkFileChooserNative *self,
data->portal_handle = gtk_get_portal_request_path (data->connection, &token);
data->portal_response_signal_id =
g_dbus_connection_signal_subscribe (data->connection,
PORTAL_BUS_NAME,
PORTAL_REQUEST_INTERFACE,
"Response",
data->portal_handle,
NULL,
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
response_cb,
self, NULL);
g_dbus_connection_signal_subscribe (data->connection,
PORTAL_BUS_NAME,
PORTAL_REQUEST_INTERFACE,
"Response",
data->portal_handle,
NULL,
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
response_cb,
self, NULL);
multiple = gtk_file_chooser_get_select_multiple (GTK_FILE_CHOOSER (self));
directory = gtk_file_chooser_get_action (GTK_FILE_CHOOSER (self)) == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER;
@@ -546,9 +527,7 @@ gtk_file_chooser_native_portal_hide (GtkFileChooserNative *self)
if (data->portal_handle)
send_close (data);
/* We clear the data because we might have in-flight async
* operations that can still access it
*/
filechooser_portal_data_clear (data);
filechooser_portal_data_free (data);
self->mode_data = NULL;
}
+5 -12
View File
@@ -2193,9 +2193,7 @@ update_default (GtkFileChooserWidget *impl)
return;
files = gtk_file_chooser_get_files (GTK_FILE_CHOOSER (impl));
sensitive = (g_list_model_get_n_items (files) > 0 ||
impl->action == GTK_FILE_CHOOSER_ACTION_SAVE ||
impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER);
sensitive = (g_list_model_get_n_items (files) > 0 || impl->action == GTK_FILE_CHOOSER_ACTION_SAVE);
gtk_widget_set_sensitive (button, sensitive);
g_object_unref (files);
@@ -5448,7 +5446,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
* So we want the selection to be "bar/foo.txt". Jump to the case for the
* filename entry to see if that is the case.
*/
if (g_list_model_get_n_items (G_LIST_MODEL (info.result)) == 0 && impl->location_entry)
if (info.result == NULL && impl->location_entry)
goto file_entry;
}
else if (impl->location_entry &&
@@ -5466,7 +5464,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
goto out;
if (!is_well_formed)
goto empty;
return NULL;
if (info.file_from_entry)
{
@@ -5476,7 +5474,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
else if (!file_list_seen)
goto file_list;
else
goto empty;
return NULL;
}
else if (impl->toplevel_last_focus_widget == impl->browse_files_tree_view)
goto file_list;
@@ -5497,7 +5495,7 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
* then we fall back to the current directory
*/
if (impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER &&
g_list_model_get_n_items (G_LIST_MODEL (info.result)) == 0)
info.result == NULL)
{
GFile *current_folder;
@@ -5508,11 +5506,6 @@ gtk_file_chooser_widget_get_files (GtkFileChooser *chooser)
}
return G_LIST_MODEL (info.result);
empty:
g_list_store_remove_all (info.result);
return G_LIST_MODEL (info.result);
}
/* Shows or hides the filter widgets */
+1 -1
View File
@@ -339,7 +339,7 @@ parser_end_element (GtkBuildableParseContext *context,
{
SubParserData *data = (SubParserData*)user_data;
if (data->string && data->parsing)
if (data->string)
{
switch (data->type)
{
+10 -28
View File
@@ -132,9 +132,7 @@ gtk_image_definition_new_paintable (GdkPaintable *paintable)
GtkImageDefinition *
gtk_image_definition_ref (GtkImageDefinition *def)
{
GtkImageDefinitionEmpty *empty = (GtkImageDefinitionEmpty *) def;
empty->ref_count++;
def->empty.ref_count++;
return def;
}
@@ -142,11 +140,9 @@ gtk_image_definition_ref (GtkImageDefinition *def)
void
gtk_image_definition_unref (GtkImageDefinition *def)
{
GtkImageDefinitionEmpty *empty = (GtkImageDefinitionEmpty *) def;
def->empty.ref_count--;
empty->ref_count--;
if (empty->ref_count > 0)
if (def->empty.ref_count > 0)
return;
switch (def->type)
@@ -156,22 +152,13 @@ gtk_image_definition_unref (GtkImageDefinition *def)
g_assert_not_reached ();
break;
case GTK_IMAGE_PAINTABLE:
{
GtkImageDefinitionPaintable *paintable = (GtkImageDefinitionPaintable *) def;
g_object_unref (paintable->paintable);
}
g_object_unref (def->paintable.paintable);
break;
case GTK_IMAGE_ICON_NAME:
{
GtkImageDefinitionIconName *icon_name = (GtkImageDefinitionIconName *) def;
g_free (icon_name->icon_name);
}
g_free (def->icon_name.icon_name);
break;
case GTK_IMAGE_GICON:
{
GtkImageDefinitionGIcon *gicon = (GtkImageDefinitionGIcon *) def;
g_object_unref (gicon->gicon);
}
g_object_unref (def->gicon.gicon);
break;
}
@@ -202,32 +189,27 @@ gtk_image_definition_get_scale (const GtkImageDefinition *def)
const char *
gtk_image_definition_get_icon_name (const GtkImageDefinition *def)
{
const GtkImageDefinitionIconName *icon_name = (const GtkImageDefinitionIconName *) def;
if (def->type != GTK_IMAGE_ICON_NAME)
return NULL;
return icon_name->icon_name;
return def->icon_name.icon_name;
}
GIcon *
gtk_image_definition_get_gicon (const GtkImageDefinition *def)
{
const GtkImageDefinitionGIcon *gicon = (const GtkImageDefinitionGIcon *) def;
if (def->type != GTK_IMAGE_GICON)
return NULL;
return gicon->gicon;
return def->gicon.gicon;
}
GdkPaintable *
gtk_image_definition_get_paintable (const GtkImageDefinition *def)
{
const GtkImageDefinitionPaintable *paintable = (const GtkImageDefinitionPaintable *) def;
if (def->type != GTK_IMAGE_PAINTABLE)
return NULL;
return paintable->paintable;
return def->paintable.paintable;
}
-3
View File
@@ -174,9 +174,6 @@ text_input_preedit_apply (GtkIMContextWaylandGlobal *global)
return;
context = GTK_IM_CONTEXT_WAYLAND (global->current);
if (context->pending_preedit.text == NULL &&
context->current_preedit.text == NULL)
return;
state_change = ((context->pending_preedit.text == NULL)
!= (context->current_preedit.text == NULL));
-3
View File
@@ -112,7 +112,6 @@ gtk_magnifier_snapshot (GtkWidget *widget,
width = gtk_widget_get_width (widget);
height = gtk_widget_get_height (widget);
paintable_width = gdk_paintable_get_intrinsic_width (magnifier->paintable);
paintable_height = gdk_paintable_get_intrinsic_height (magnifier->paintable);
if (paintable_width <= 0.0 || paintable_height <= 0.0)
@@ -217,8 +216,6 @@ gtk_magnifier_init (GtkMagnifier *magnifier)
magnifier->magnification = 1;
magnifier->resize = FALSE;
magnifier->paintable = gtk_widget_paintable_new (NULL);
gtk_widget_paintable_set_observed_area (GTK_WIDGET_PAINTABLE (magnifier->paintable),
GTK_WIDGET_PAINTABLE_AREA_RENDERED);
g_signal_connect_swapped (magnifier->paintable, "invalidate-contents", G_CALLBACK (gtk_widget_queue_draw), magnifier);
g_signal_connect_swapped (magnifier->paintable, "invalidate-size", G_CALLBACK (gtk_widget_queue_resize), magnifier);
}
+4 -4
View File
@@ -169,12 +169,12 @@ visibility_toggled (GObject *object,
{
if (gtk_text_get_visibility (GTK_TEXT (entry->entry)))
{
gtk_image_set_from_icon_name (GTK_IMAGE (entry->peek_icon), "view-conceal-symbolic");
gtk_image_set_from_icon_name (GTK_IMAGE (entry->peek_icon), "eye-open-negative-filled-symbolic");
gtk_widget_set_tooltip_text (entry->peek_icon, _("Hide Text"));
}
else
{
gtk_image_set_from_icon_name (GTK_IMAGE (entry->peek_icon), "view-reveal-symbolic");
gtk_image_set_from_icon_name (GTK_IMAGE (entry->peek_icon), "eye-not-looking-symbolic");
gtk_widget_set_tooltip_text (entry->peek_icon, _("Show Text"));
}
@@ -625,7 +625,7 @@ gtk_password_entry_set_show_peek_icon (GtkPasswordEntry *entry,
{
GtkGesture *press;
entry->peek_icon = gtk_image_new_from_icon_name ("view-reveal-symbolic");
entry->peek_icon = gtk_image_new_from_icon_name ("eye-not-looking-symbolic");
gtk_widget_set_tooltip_text (entry->peek_icon, _("Show Text"));
gtk_widget_set_parent (entry->peek_icon, GTK_WIDGET (entry));
@@ -703,7 +703,7 @@ gtk_password_entry_set_extra_menu (GtkPasswordEntry *entry,
section = g_menu_new ();
item = g_menu_item_new (_("_Show Text"), "misc.toggle-visibility");
g_menu_item_set_attribute (item, "touch-icon", "s", "view-reveal-symbolic");
g_menu_item_set_attribute (item, "touch-icon", "s", "eye-not-looking-symbolic");
g_menu_append_item (section, item);
g_object_unref (item);
+1 -1
View File
@@ -762,7 +762,7 @@ gtk_popover_menu_new_from_model (GMenuModel *model)
* %GTK_POPOVER_MENU_NESTED, which makes GTK create traditional,
* nested submenus instead of the default sliding submenus.
*
* Returns: the new `GtkPopoverMenu`
* Returns: (transfer full): the new `GtkPopoverMenu`
*/
GtkWidget *
gtk_popover_menu_new_from_model_full (GMenuModel *model,
+1 -1
View File
@@ -514,7 +514,7 @@ gtk_spin_button_class_init (GtkSpinButtonClass *class)
* adjustment = gtk_spin_button_get_adjustment (spin);
* value = (int)gtk_adjustment_get_value (adjustment);
* text = g_strdup_printf ("%02d", value);
* gtk_editable_set_text (GTK_EDITABLE (spin), text):
* gtk_spin_button_set_text (spin, text):
* g_free (text);
*
* return TRUE;
+3 -68
View File
@@ -24,7 +24,6 @@
#include "gtkintl.h"
#include "gtksnapshot.h"
#include "gtkrendernodepaintableprivate.h"
#include "gtktypebuiltins.h"
#include "gtkwidgetprivate.h"
/**
@@ -62,8 +61,6 @@ struct _GtkWidgetPaintable
GdkPaintable *current_image; /* the image that we are presenting */
GdkPaintable *pending_image; /* the image that we should be presenting */
GtkWidgetPaintableArea area;
};
struct _GtkWidgetPaintableClass
@@ -74,28 +71,12 @@ struct _GtkWidgetPaintableClass
enum {
PROP_0,
PROP_WIDGET,
PROP_OBSERVED_AREA,
N_PROPS,
};
static GParamSpec *properties[N_PROPS] = { NULL, };
static gboolean
gtk_widget_paintable_compute_bounds (GtkWidgetPaintable *self,
graphene_rect_t *bounds)
{
if (self->area == GTK_WIDGET_PAINTABLE_AREA_WIDGET)
return gtk_widget_compute_bounds (self->widget, self->widget, bounds);
else if (self->widget->priv->render_node)
{
gsk_render_node_get_bounds (self->widget->priv->render_node, bounds);
return TRUE;
}
return FALSE;
}
static void
gtk_widget_paintable_paintable_snapshot (GdkPaintable *paintable,
GdkSnapshot *snapshot,
@@ -113,7 +94,7 @@ gtk_widget_paintable_paintable_snapshot (GdkPaintable *paintable,
gtk_snapshot_push_clip (snapshot,
&GRAPHENE_RECT_INIT(0, 0, width, height));
if (gtk_widget_paintable_compute_bounds (self, &bounds))
if (gtk_widget_compute_bounds (self->widget, self->widget, &bounds))
{
gtk_snapshot_scale (snapshot, width / bounds.size.width, height / bounds.size.height);
gtk_snapshot_translate (snapshot, &bounds.origin);
@@ -181,10 +162,6 @@ gtk_widget_paintable_set_property (GObject *object,
gtk_widget_paintable_set_widget (self, g_value_get_object (value));
break;
case PROP_OBSERVED_AREA:
gtk_widget_paintable_set_observed_area (self, g_value_get_enum (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -205,10 +182,6 @@ gtk_widget_paintable_get_property (GObject *object,
g_value_set_object (value, self->widget);
break;
case PROP_OBSERVED_AREA:
g_value_set_enum (value, self->area);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -276,14 +249,6 @@ gtk_widget_paintable_class_init (GtkWidgetPaintableClass *klass)
GTK_TYPE_WIDGET,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_OBSERVED_AREA] =
g_param_spec_enum ("observed-area",
P_("Area"),
P_("Observed area"),
GTK_TYPE_WIDGET_PAINTABLE_AREA,
GTK_WIDGET_PAINTABLE_AREA_WIDGET,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, N_PROPS, properties);
}
@@ -291,7 +256,6 @@ static void
gtk_widget_paintable_init (GtkWidgetPaintable *self)
{
self->current_image = gdk_paintable_new_empty (0, 0);
self->area = GTK_WIDGET_PAINTABLE_AREA_WIDGET;
}
/**
@@ -320,12 +284,12 @@ gtk_widget_paintable_snapshot_widget (GtkWidgetPaintable *self)
if (self->widget == NULL)
return gdk_paintable_new_empty (0, 0);
if (!gtk_widget_paintable_compute_bounds (self, &bounds))
if (!gtk_widget_compute_bounds (self->widget, self->widget, &bounds))
return gdk_paintable_new_empty (0, 0);
if (self->widget->priv->render_node == NULL)
return gdk_paintable_new_empty (bounds.size.width, bounds.size.height);
return gtk_render_node_paintable_new (self->widget->priv->render_node, &bounds);
}
@@ -440,32 +404,3 @@ gtk_widget_paintable_pop_snapshot_count (GtkWidgetPaintable *self)
{
self->snapshot_count--;
}
/**
* gtk_widget_paintable_set_observed_area:
* @self: a `GtkWidgetPaintable`
* @area: the area to observe
*
* Sets what area the paintable should observe.
*
* Since: 4.8
*/
void
gtk_widget_paintable_set_observed_area (GtkWidgetPaintable *self,
GtkWidgetPaintableArea area)
{
if (self->area == area)
return;
self->area = area;
g_object_notify (G_OBJECT (self), "observed-area");
gdk_paintable_invalidate_size (GDK_PAINTABLE (self));
gdk_paintable_invalidate_contents (GDK_PAINTABLE (self));
}
GtkWidgetPaintableArea
gtk_widget_paintable_get_observed_area (GtkWidgetPaintable *self)
{
return self->area;
}
-21
View File
@@ -38,27 +38,6 @@ GDK_AVAILABLE_IN_ALL
void gtk_widget_paintable_set_widget (GtkWidgetPaintable *self,
GtkWidget *widget);
/**
* GtkWidgetPaintableArea:
* @GTK_WIDGET_PAINTABLE_AREA_WIDGET: Restrict the paintable to the widget bounds
* @GTK_WIDGET_PAINTABLE_AREA_RENDERED: Include all render nodes produced by the
* widget in the paintable area
*
* Used to indicate what area should be captured by a widget paintable.
*/
typedef enum {
GTK_WIDGET_PAINTABLE_AREA_WIDGET,
GTK_WIDGET_PAINTABLE_AREA_RENDERED
} GtkWidgetPaintableArea;
GDK_AVAILABLE_IN_4_8
void gtk_widget_paintable_set_observed_area (GtkWidgetPaintable *self,
GtkWidgetPaintableArea area);
GDK_AVAILABLE_IN_4_8
GtkWidgetPaintableArea
gtk_widget_paintable_get_observed_area (GtkWidgetPaintable *self);
G_END_DECLS
#endif /* __GTK_WIDGET_PAINTABLE_H__ */
Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 292 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
<path d="m 1.53125 0.46875 l -1.0625 1.0625 l 14 14 l 1.0625 -1.0625 l -2.382812 -2.382812 c 1.265624 -1.0625 2.171874 -2.496094 2.589843 -4.097657 c -0.914062 -3.523437 -4.097656 -5.984375 -7.738281 -5.988281 c -1.367188 0.011719 -2.707031 0.371094 -3.894531 1.042969 z m 6.46875 3.53125 c 2.210938 0 4 1.789062 4 4 c -0.003906 0.800781 -0.246094 1.578125 -0.699219 2.238281 l -1.46875 -1.46875 c 0.105469 -0.242187 0.164063 -0.503906 0.167969 -0.769531 c 0 -1.105469 -0.894531 -2 -2 -2 c -0.265625 0.003906 -0.527344 0.0625 -0.769531 0.167969 l -1.46875 -1.46875 c 0.660156 -0.453125 1.4375 -0.695313 2.238281 -0.699219 z m -6.144531 0.917969 c -0.753907 0.898437 -1.296875 1.957031 -1.59375 3.09375 c 0.914062 3.523437 4.097656 5.984375 7.738281 5.988281 c 0.855469 -0.007812 1.703125 -0.152344 2.511719 -0.425781 l -1.667969 -1.667969 c -0.277344 0.058594 -0.5625 0.089844 -0.84375 0.09375 c -2.210938 0 -4 -1.789062 -4 -4 c 0.003906 -0.28125 0.035156 -0.566406 0.09375 -0.84375 z m 0 0" fill="#2e3436"/>
</svg>

Before

Width:  |  Height:  |  Size: 1.1 KiB

@@ -1,4 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
<path d="m 8 2 c -3.648438 0.003906 -6.832031 2.476562 -7.738281 6.007812 c 0.914062 3.527344 4.097656 5.988282 7.738281 5.992188 c 3.648438 -0.003906 6.832031 -2.476562 7.738281 -6.011719 c -0.914062 -3.523437 -4.097656 -5.984375 -7.738281 -5.988281 z m 0 2 c 2.210938 0 4 1.789062 4 4 s -1.789062 4 -4 4 s -4 -1.789062 -4 -4 s 1.789062 -4 4 -4 z m 0 2 c -1.105469 0 -2 0.894531 -2 2 s 0.894531 2 2 2 s 2 -0.894531 2 -2 s -0.894531 -2 -2 -2 z m 0 0" fill="#2e3436"/>
</svg>

Before

Width:  |  Height:  |  Size: 606 B

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<path d="M13.98 1.99a1 1 0 0 0-.687.303l-.984.984A8 8 0 0 0 8 2 8 8 0 0 0 .262 8.01a8 8 0 0 0 2.943 4.37l-.912.913a1 1 0 1 0 1.414 1.414l11-11a1 1 0 0 0-.727-1.717zM8 4a4 4 0 0 1 2.611.974l-1.42 1.42A2 2 0 0 0 8 6a2 2 0 0 0-2 2 2 2 0 0 0 .396 1.19l-1.42 1.42A4 4 0 0 1 4 8a4 4 0 0 1 4-4zm7.03 2.209l-3.344 3.343a4 4 0 0 1-2.127 2.127l-2.28 2.28a8 8 0 0 0 .721.04 8 8 0 0 0 7.738-6.01 8 8 0 0 0-.709-1.78zm-7.53.79a.5.5 0 0 1 .5.5.5.5 0 0 1-.5.5.5.5 0 0 1-.5-.5.5.5 0 0 1 .5-.5z" fill="#2e3436"/>
</svg>

After

Width:  |  Height:  |  Size: 570 B

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns:osb="http://www.openswatchbook.org/uri/2009/osb" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 16 16" version="1.1" id="svg7384" height="16">
<metadata id="metadata90">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
<dc:title>Gnome Symbolic Icon Theme</dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<title id="title9167">Gnome Symbolic Icon Theme</title>
<defs id="defs7386">
<linearGradient osb:paint="solid" id="linearGradient7212">
<stop style="stop-color:#000000;stop-opacity:1;" offset="0" id="stop7214"/>
</linearGradient>
</defs>
<g transform="translate(-341.0002,-13.000323)" style="display:inline" id="layer9"/>
<g transform="translate(-100,-380.00032)" id="layer1"/>
<g transform="translate(-100,-380.00032)" style="display:inline" id="layer10">
<path d="m 108,382 a 8,8 0 0 0 -7.73828,6.00977 A 8,8 0 0 0 108,394 8,8 0 0 0 115.73828,387.99023 8,8 0 0 0 108,382 Z m 0,2 a 4,4 0 0 1 4,4 4,4 0 0 1 -4,4 4,4 0 0 1 -4,-4 4,4 0 0 1 4,-4 z" id="path2314" style="opacity:1;vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;marker-start:none;marker-mid:none;marker-end:none;paint-order:normal"/>
<path id="path2318" d="m 110,388.00003 a 2,2 0 0 1 -2,2 2,2 0 0 1 -2,-2 2,2 0 0 1 2,-2 2,2 0 0 1 2,2 z" style="vector-effect:none;fill:#2e3436;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"/>
</g>
<g transform="translate(-100,-380.00032)" id="g6387"/>
<g transform="translate(-100,-380.00032)" id="layer11"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

+4
View File
@@ -2979,6 +2979,7 @@ int array_container_shrink_to_fit(array_container_t *src) {
uint16_t *oldarray = src->array;
src->array =
(uint16_t *)realloc(oldarray, src->capacity * sizeof(uint16_t));
if (src->array == NULL) free(oldarray); // should never happen?
}
return savings;
}
@@ -3015,6 +3016,7 @@ void array_container_grow(array_container_t *container, int32_t min,
if (preserve) {
container->array =
(uint16_t *)realloc(array, new_capacity * sizeof(uint16_t));
if (container->array == NULL) free(array);
} else {
// Jon Strabala reports that some tools complain otherwise
if (array != NULL) {
@@ -6689,6 +6691,7 @@ int run_container_shrink_to_fit(run_container_t *src) {
src->capacity = src->n_runs;
rle16_t *oldruns = src->runs;
src->runs = (rle16_t *)realloc(oldruns, src->capacity * sizeof(rle16_t));
if (src->runs == NULL) free(oldruns); // should never happen?
return savings;
}
/* Create a new run container. Return NULL in case of failure. */
@@ -6728,6 +6731,7 @@ void run_container_grow(run_container_t *run, int32_t min, bool copy) {
rle16_t *oldruns = run->runs;
run->runs =
(rle16_t *)realloc(oldruns, run->capacity * sizeof(rle16_t));
if (run->runs == NULL) free(oldruns);
} else {
// Jon Strabala reports that some tools complain otherwise
if (run->runs != NULL) {
+1 -1
View File
@@ -1165,7 +1165,7 @@ spinbutton {
color: transparent;
&:focus-within {
background-color: $selected_text_bg_color;
color: $fg_color;
color: $selected_fg_color;
}
}
> block-cursor { @include entry(block_cursor); }
+1 -1
View File
@@ -483,7 +483,7 @@ gtk_ff_media_file_open (GtkMediaFile *file)
{
GtkFfMediaFile *video = GTK_FF_MEDIA_FILE (file);
AVStream *stream;
const AVCodec *codec;
AVCodec *codec;
int errnum;
video->format_ctx = avformat_alloc_context ();
+207 -220
View File
File diff suppressed because it is too large Load Diff
+289 -305
View File
File diff suppressed because it is too large Load Diff
+3062 -6695
View File
File diff suppressed because it is too large Load Diff
+198 -260
View File
File diff suppressed because it is too large Load Diff
-39
View File
@@ -116,44 +116,6 @@ test_mime_type (void)
g_object_unref (filter);
}
static void
test_buildable (void)
{
GtkBuilder *builder;
const char *buffer =
"<interface>\n"
"<object class=\"GtkFileFilter\" id=\"filter\">\n"
"<property name=\"name\">Audio Files</property>\n"
"<mime-types>\n"
"<mime-type>audio/*</mime-type>\n"
"</mime-types>\n"
"</object>\n"
"</interface>";
GtkFileFilter *filter;
GVariant *v1, *v2;
char *s1, *s2;
builder = gtk_builder_new ();
gtk_builder_add_from_string (builder, buffer, strlen (buffer), NULL);
filter = GTK_FILE_FILTER (gtk_builder_get_object (builder, "filter"));
v1 = gtk_file_filter_to_gvariant (filter);
v2 = g_variant_parse (NULL, "('Audio Files', [(1, 'audio/*')])", NULL, NULL, NULL);
s1 = g_variant_print (v1, FALSE);
s2 = g_variant_print (v2, FALSE);
g_assert_true (strcmp (s1, s2) == 0);
g_free (s1);
g_free (s2);
g_variant_unref (v1);
g_variant_unref (v2);
g_object_unref (builder);
}
int
main (int argc, char *argv[])
{
@@ -164,7 +126,6 @@ main (int argc, char *argv[])
g_test_add_func ("/filefilter/pattern", test_pattern);
g_test_add_func ("/filefilter/suffix", test_suffix);
g_test_add_func ("/filefilter/mimetype", test_mime_type);
g_test_add_func ("/filefilter/buildable", test_buildable);
return g_test_run ();
}
+1 -1
View File
@@ -76,6 +76,7 @@ tests = [
{ 'name': 'spinbutton' },
{ 'name': 'stringlist' },
{ 'name': 'templates' },
{ 'name': 'textbuffer' },
{ 'name': 'textiter' },
{ 'name': 'theme-validate' },
{ 'name': 'tooltips' },
@@ -118,7 +119,6 @@ internal_tests = [
{ 'name': 'propertylookuplistmodel' },
{ 'name': 'rbtree' },
{ 'name': 'timsort' },
{ 'name': 'textbuffer' },
{ 'name': 'texthistory' },
{ 'name': 'fnmatch' },
]
-69
View File
@@ -22,7 +22,6 @@
#include <gtk/gtk.h>
#include "gtk/gtktexttypes.h" /* Private header, for UNKNOWN_CHAR */
#include "gtk/a11y/gtkatspitextbufferprivate.h" /* Private header */
static void
gtk_text_iter_spew (const GtkTextIter *iter, const char *desc)
@@ -1819,72 +1818,6 @@ test_undo3 (void)
g_object_unref (buffer);
}
static void
test_serialize_wrap_mode (void)
{
GtkTextBuffer *buffer = gtk_text_buffer_new (NULL);
struct val {
GtkWrapMode mode;
const char *name;
} values[] = {
{ .mode = GTK_WRAP_NONE, .name = "none" },
{ .mode = GTK_WRAP_CHAR, .name = "char" },
{ .mode = GTK_WRAP_WORD, .name = "word" },
{ .mode = GTK_WRAP_WORD_CHAR, .name = "word-char" },
};
gsize i;
/* Four lines, each with a 2-byte run (digit plus newline) */
gtk_text_buffer_set_text (buffer, "0\n1\n2\n3\n", -1);
for (i = 0; i < G_N_ELEMENTS (values); i++)
{
GtkTextTag *tag = gtk_text_buffer_create_tag (buffer, NULL, "wrap-mode", values[i].mode, NULL);
GtkTextIter start;
GtkTextIter end;
gtk_text_buffer_get_iter_at_offset (buffer, &start, i * 2);
gtk_text_buffer_get_iter_at_offset (buffer, &end, (i + 1) * 2);
gtk_text_buffer_apply_tag (buffer, tag, &start, &end);
}
/* Get the attributes for each line run as a GVariant */
for (i = 0; i < G_N_ELEMENTS (values); i++)
{
/* Each line has a { wrap-mode: name } run */
GVariantBuilder expected_builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
g_variant_builder_add (&expected_builder, "{ss}", "wrap-mode", values[i].name);
GVariant *expected = g_variant_builder_end (&expected_builder);
GVariantBuilder result_builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int run_start, run_end;
gtk_text_buffer_get_run_attributes (buffer, &result_builder, 2 * i, &run_start, &run_end);
GVariant *result = g_variant_builder_end (&result_builder);
g_assert_cmpint (run_start, ==, 2 * i);
g_assert_cmpint (run_end, ==, 2 * (i + 1));
g_assert_cmpvariant (result, expected);
g_variant_unref (result);
g_variant_unref (expected);
}
g_assert_finalize_object (buffer);
}
static void
add_unix_only_tests (void)
{
#ifdef G_OS_UNIX
/* The atspi2 code for this is not available in Windows */
g_test_add_func ("/TextBuffer/Serialize wrap-mode", test_serialize_wrap_mode);
#endif
}
int
main (int argc, char** argv)
{
@@ -1911,7 +1844,5 @@ main (int argc, char** argv)
g_test_add_func ("/TextBuffer/Undo 2", test_undo2);
g_test_add_func ("/TextBuffer/Undo 3", test_undo3);
add_unix_only_tests ();
return g_test_run();
}
-13
View File
@@ -1,19 +1,6 @@
#! /usr/bin/env python3
import os
import sys
# Python 3.8.x or later on Windows require os.add_dll_directory()
# to be called on every directory that contains the required
# non-bundled, non-system DLLs of a module so that the module can
# be loaded successfully by Python. Make things easiler for people
# by calling os.add_dll_directory() on the valid paths in %PATH%.
if hasattr(os, 'add_dll_directory'):
paths = reversed(os.environ['PATH'].split(os.pathsep))
for path in paths:
if path != '' and os.path.isdir(path):
os.add_dll_directory(path)
import gi
gi.require_version('Gtk', '4.0')
-1
View File
@@ -100,7 +100,6 @@ snapshot_widget (GtkWidget *widget)
* to delay the snapshot.
*/
paintable = gtk_widget_paintable_new (widget);
gtk_widget_paintable_set_observed_area (GTK_WIDGET_PAINTABLE (paintable), GTK_WIDGET_PAINTABLE_AREA_RENDERED);
g_signal_connect (paintable, "invalidate-contents", G_CALLBACK (draw_paintable), &texture);
g_main_loop_run (loop);