Merge remote-tracking branch 'origin' into ccook/spelling-fixes

This commit is contained in:
Cam Cook 2022-11-28 12:34:38 -05:00
commit 5b45efb49b
8 changed files with 203 additions and 41 deletions

View File

@ -93,6 +93,7 @@
#define OUTPUT_VERSION_WITH_DONE 2 #define OUTPUT_VERSION_WITH_DONE 2
#define NO_XDG_OUTPUT_DONE_SINCE_VERSION 3 #define NO_XDG_OUTPUT_DONE_SINCE_VERSION 3
#define XDG_ACTIVATION_VERSION 1 #define XDG_ACTIVATION_VERSION 1
#define OUTPUT_VERSION 3
static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland); static void _gdk_wayland_display_load_cursor_theme (GdkWaylandDisplay *display_wayland);
@ -397,8 +398,10 @@ gdk_registry_handle_global (void *data,
else if (strcmp (interface, "wl_output") == 0) else if (strcmp (interface, "wl_output") == 0)
{ {
output = output =
wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface, MIN (version, 2)); wl_registry_bind (display_wayland->wl_registry, id, &wl_output_interface,
gdk_wayland_display_add_output (display_wayland, id, output, MIN (version, 2)); MIN (version, OUTPUT_VERSION));
gdk_wayland_display_add_output (display_wayland, id, output,
MIN (version, OUTPUT_VERSION));
_gdk_wayland_display_async_roundtrip (display_wayland); _gdk_wayland_display_async_roundtrip (display_wayland);
} }
else if (strcmp (interface, "wl_seat") == 0) else if (strcmp (interface, "wl_seat") == 0)

View File

@ -48,7 +48,11 @@ gdk_wayland_monitor_finalize (GObject *object)
g_free (monitor->name); g_free (monitor->name);
g_clear_pointer (&monitor->xdg_output, zxdg_output_v1_destroy); g_clear_pointer (&monitor->xdg_output, zxdg_output_v1_destroy);
g_clear_pointer (&monitor->output, wl_output_destroy);
if (wl_output_get_version (monitor->output) >= WL_OUTPUT_RELEASE_SINCE_VERSION)
g_clear_pointer (&monitor->output, wl_output_release);
else
g_clear_pointer (&monitor->output, wl_output_destroy);
G_OBJECT_CLASS (gdk_wayland_monitor_parent_class)->finalize (object); G_OBJECT_CLASS (gdk_wayland_monitor_parent_class)->finalize (object);
} }

View File

@ -603,7 +603,7 @@ update_direction (GdkX11Keymap *keymap_x11,
keymap_x11->have_direction = TRUE; keymap_x11->have_direction = TRUE;
} }
if (!had_direction || old_direction != keymap_x11->current_direction) if (had_direction && old_direction != keymap_x11->current_direction)
{ {
g_object_notify (G_OBJECT (keyboard), "direction"); g_object_notify (G_OBJECT (keyboard), "direction");
return TRUE; return TRUE;

View File

@ -1631,7 +1631,7 @@ get_bus_address_dbus (GdkDisplay *display)
if (error != NULL) if (error != NULL)
{ {
GTK_DEBUG (A11Y, "Unable to acquire session bus: %s", error->message); g_warning ("Unable to acquire session bus: %s", error->message);
g_error_free (error); g_error_free (error);
return NULL; return NULL;
} }
@ -1648,8 +1648,8 @@ get_bus_address_dbus (GdkDisplay *display)
&error); &error);
if (error != NULL) if (error != NULL)
{ {
GTK_DEBUG (A11Y, "Unable to acquire the address of the accessibility bus: %s", g_warning ("Unable to acquire the address of the accessibility bus: %s",
error->message); error->message);
g_error_free (error); g_error_free (error);
} }

View File

@ -81,7 +81,7 @@ free_sorter (gpointer data)
* } * }
* ``` * ```
* *
* `GtkColumnViewSorter` was added in GTK 4.10 * Since: 4.10
*/ */
struct _GtkColumnViewSorter struct _GtkColumnViewSorter
{ {

View File

@ -55,6 +55,8 @@ void gtk_font_dialog_button_set_dialog (GtkFontDialogButton *s
* Depending on this value, the `PangoFontDescription` that * Depending on this value, the `PangoFontDescription` that
* is returned by [method@Gtk.FontDialogButton.get_font_desc] * is returned by [method@Gtk.FontDialogButton.get_font_desc]
* will have more or less fields set. * will have more or less fields set.
*
* Since: 4.10
*/ */
typedef enum typedef enum
{ {

View File

@ -52,6 +52,13 @@
* [method@Gtk.TreeExpander.set_child] sets the widget that displays * [method@Gtk.TreeExpander.set_child] sets the widget that displays
* the actual row contents. * the actual row contents.
* *
* `GtkTreeExpander` can be modified with properties such as [property@Gtk.indent-for-icon],
* [property@Gtk.indent-for-depth], and [property@Gtk.hide-expander] to achieve a
* different appearance. This can even be done to influence individual rows, for example
* by binding the [property@Gtk.hide-expander] property to the treelistrow's model's
* item count to hide the expander for rows without children, even if the row is
* expandable.
*
* # CSS nodes * # CSS nodes
* *
* ``` * ```
@ -85,6 +92,8 @@ struct _GtkTreeExpander
GtkWidget *expander_icon; GtkWidget *expander_icon;
guint notify_handler; guint notify_handler;
gboolean hide_expander;
gboolean indent_for_depth;
gboolean indent_for_icon; gboolean indent_for_icon;
guint expand_timer; guint expand_timer;
@ -94,9 +103,11 @@ enum
{ {
PROP_0, PROP_0,
PROP_CHILD, PROP_CHILD,
PROP_HIDE_EXPANDER,
PROP_INDENT_FOR_DEPTH,
PROP_INDENT_FOR_ICON,
PROP_ITEM, PROP_ITEM,
PROP_LIST_ROW, PROP_LIST_ROW,
PROP_INDENT_FOR_ICON,
N_PROPS N_PROPS
}; };
@ -169,8 +180,8 @@ gtk_tree_expander_update_for_list_row (GtkTreeExpander *self)
GtkWidget *child; GtkWidget *child;
guint i, depth; guint i, depth;
depth = gtk_tree_list_row_get_depth (self->list_row); depth = self->indent_for_depth ? gtk_tree_list_row_get_depth (self->list_row) : 0;
if (gtk_tree_list_row_is_expandable (self->list_row)) if (gtk_tree_list_row_is_expandable (self->list_row) && !self->hide_expander)
{ {
if (self->expander_icon == NULL) if (self->expander_icon == NULL)
{ {
@ -394,6 +405,18 @@ gtk_tree_expander_get_property (GObject *object,
g_value_set_object (value, self->child); g_value_set_object (value, self->child);
break; break;
case PROP_HIDE_EXPANDER:
g_value_set_boolean (value, gtk_tree_expander_get_hide_expander (self));
break;
case PROP_INDENT_FOR_DEPTH:
g_value_set_boolean (value, gtk_tree_expander_get_indent_for_depth (self));
break;
case PROP_INDENT_FOR_ICON:
g_value_set_boolean (value, gtk_tree_expander_get_indent_for_icon (self));
break;
case PROP_ITEM: case PROP_ITEM:
g_value_take_object (value, gtk_tree_expander_get_item (self)); g_value_take_object (value, gtk_tree_expander_get_item (self));
break; break;
@ -402,10 +425,6 @@ gtk_tree_expander_get_property (GObject *object,
g_value_set_object (value, self->list_row); g_value_set_object (value, self->list_row);
break; break;
case PROP_INDENT_FOR_ICON:
g_value_set_boolean (value, gtk_tree_expander_get_indent_for_icon (self));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break; break;
@ -426,14 +445,22 @@ gtk_tree_expander_set_property (GObject *object,
gtk_tree_expander_set_child (self, g_value_get_object (value)); gtk_tree_expander_set_child (self, g_value_get_object (value));
break; break;
case PROP_LIST_ROW: case PROP_HIDE_EXPANDER:
gtk_tree_expander_set_list_row (self, g_value_get_object (value)); gtk_tree_expander_set_hide_expander (self, g_value_get_boolean (value));
break;
case PROP_INDENT_FOR_DEPTH:
gtk_tree_expander_set_indent_for_depth (self, g_value_get_boolean (value));
break; break;
case PROP_INDENT_FOR_ICON: case PROP_INDENT_FOR_ICON:
gtk_tree_expander_set_indent_for_icon (self, g_value_get_boolean (value)); gtk_tree_expander_set_indent_for_icon (self, g_value_get_boolean (value));
break; break;
case PROP_LIST_ROW:
gtk_tree_expander_set_list_row (self, g_value_get_object (value));
break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break; break;
@ -532,6 +559,47 @@ gtk_tree_expander_class_init (GtkTreeExpanderClass *klass)
GTK_TYPE_WIDGET, GTK_TYPE_WIDGET,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS); G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* GtkTreeExpander:hide-expander: (attributes org.gtk.Property.get=gtk_tree_expander_get_hide_expander org.gtk.Property.set=gtk_tree_expander_set_hide_expander)
*
* Whether the expander icon should be hidden in a GtkTreeListRow.
* Note that this property simply hides the icon. The actions and keybinding
* (i.e. collapse and expand) are not affected by this property.
*
* A common use for this property would be to bind to the number of children in a
* GtkTreeListRow's model in order to hide the expander when a row has no children.
*
* Since: 4.10
*/
properties[PROP_HIDE_EXPANDER] =
g_param_spec_boolean ("hide-expander", NULL, NULL,
FALSE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkTreeExpander:indent-for-depth: (attributes org.gtk.Property.get=gtk_tree_expander_get_indent_for_depth org.gtk.Property.set=gtk_tree_expander_set_indent_for_depth)
*
* TreeExpander indents the child according to its depth.
*
* Since: 4.10
*/
properties[PROP_INDENT_FOR_DEPTH] =
g_param_spec_boolean ("indent-for-depth", NULL, NULL,
TRUE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/**
* GtkTreeExpander:indent-for-icon: (attributes org.gtk.Property.get=gtk_tree_expander_get_indent_for_icon org.gtk.Property.set=gtk_tree_expander_set_indent_for_icon)
*
* TreeExpander indents the child by the width of an expander-icon if it is not expandable.
*
* Since: 4.6
*/
properties[PROP_INDENT_FOR_ICON] =
g_param_spec_boolean ("indent-for-icon", NULL, NULL,
TRUE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
/** /**
* GtkTreeExpander:item: (attributes org.gtk.Property.get=gtk_tree_expander_get_item) * GtkTreeExpander:item: (attributes org.gtk.Property.get=gtk_tree_expander_get_item)
* *
@ -552,18 +620,6 @@ gtk_tree_expander_class_init (GtkTreeExpanderClass *klass)
GTK_TYPE_TREE_LIST_ROW, GTK_TYPE_TREE_LIST_ROW,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS); G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* GtkTreeExpander:indent-for-icon: (attributes org.gtk.Property.get=gtk_tree_expander_get_indent_for_icon org.gtk.Property.set=gtk_tree_expander_set_indent_for_icon)
*
* TreeExpander indents the child by the width of an expander-icon if it is not expandable.
*
* Since: 4.6
*/
properties[PROP_INDENT_FOR_ICON] =
g_param_spec_boolean ("indent-for-icon", NULL, NULL,
TRUE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, N_PROPS, properties); g_object_class_install_properties (gobject_class, N_PROPS, properties);
/** /**
@ -697,6 +753,7 @@ gtk_tree_expander_init (GtkTreeExpander *self)
gtk_widget_set_focusable (GTK_WIDGET (self), TRUE); gtk_widget_set_focusable (GTK_WIDGET (self), TRUE);
self->indent_for_icon = TRUE; self->indent_for_icon = TRUE;
self->indent_for_depth = TRUE;
controller = gtk_drop_controller_motion_new (); controller = gtk_drop_controller_motion_new ();
g_signal_connect (controller, "enter", G_CALLBACK (gtk_tree_expander_drag_enter), self); g_signal_connect (controller, "enter", G_CALLBACK (gtk_tree_expander_drag_enter), self);
@ -849,6 +906,49 @@ gtk_tree_expander_set_list_row (GtkTreeExpander *self,
g_object_thaw_notify (G_OBJECT (self)); g_object_thaw_notify (G_OBJECT (self));
} }
/**
* gtk_tree_expander_get_indent_for_depth: (attributes org.gtk.Method.get_property=indent-for-depth)
* @self: a `GtkTreeExpander`
*
* TreeExpander indents each level of depth with an additional indent.
*
* Returns: TRUE if the child should be indented . Otherwise FALSE.
*
* Since: 4.10
*/
gboolean
gtk_tree_expander_get_indent_for_depth (GtkTreeExpander *self)
{
g_return_val_if_fail (GTK_IS_TREE_EXPANDER (self), FALSE);
return self->indent_for_depth;
}
/**
* gtk_tree_expander_set_indent_for_depth: (attributes org.gtk.Method.set_property=indent-for-depth)
* @self: a `GtkTreeExpander` widget
* @indent_for_depth: TRUE if the child should be indented. Otherwise FALSE.
*
* Sets if the TreeExpander should indent the child according to its depth.
*
* Since: 4.10
*/
void
gtk_tree_expander_set_indent_for_depth (GtkTreeExpander *self,
gboolean indent_for_depth)
{
g_return_if_fail (GTK_IS_TREE_EXPANDER (self));
if (indent_for_depth == self->indent_for_depth)
return;
self->indent_for_depth = indent_for_depth;
gtk_tree_expander_update_for_list_row (self);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INDENT_FOR_DEPTH]);
}
/** /**
* gtk_tree_expander_get_indent_for_icon: (attributes org.gtk.Method.get_property=indent-for-icon) * gtk_tree_expander_get_indent_for_icon: (attributes org.gtk.Method.get_property=indent-for-icon)
* @self: a `GtkTreeExpander` * @self: a `GtkTreeExpander`
@ -878,7 +978,7 @@ gtk_tree_expander_get_indent_for_icon (GtkTreeExpander *self)
*/ */
void void
gtk_tree_expander_set_indent_for_icon (GtkTreeExpander *self, gtk_tree_expander_set_indent_for_icon (GtkTreeExpander *self,
gboolean indent_for_icon) gboolean indent_for_icon)
{ {
g_return_if_fail (GTK_IS_TREE_EXPANDER (self)); g_return_if_fail (GTK_IS_TREE_EXPANDER (self));
@ -891,3 +991,46 @@ gtk_tree_expander_set_indent_for_icon (GtkTreeExpander *self,
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INDENT_FOR_ICON]); g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_INDENT_FOR_ICON]);
} }
/**
* gtk_tree_expander_get_hide_expander: (attributes org.gtk.Method.get_property=hide-expander)
* @self: a `GtkTreeExpander`
*
* Gets whether the TreeExpander should be hidden in a GtkTreeListRow.
*
* Returns: TRUE if the expander icon should be hidden. Otherwise FALSE.
*
* Since: 4.10
*/
gboolean
gtk_tree_expander_get_hide_expander (GtkTreeExpander *self)
{
g_return_val_if_fail (GTK_IS_TREE_EXPANDER (self), FALSE);
return self->hide_expander;
}
/**
* gtk_tree_expander_set_hide_expander: (attributes org.gtk.Method.set_property=hide-expander)
* @self: a `GtkTreeExpander` widget
* @hide_expander: TRUE if the expander should be hidden. Otherwise FALSE.
*
* Sets whether the expander icon should be visible in a GtkTreeListRow.
*
* Since: 4.10
*/
void
gtk_tree_expander_set_hide_expander (GtkTreeExpander *self,
gboolean hide_expander)
{
g_return_if_fail (GTK_IS_TREE_EXPANDER (self));
if (hide_expander == self->hide_expander)
return;
self->hide_expander = hide_expander;
gtk_tree_expander_update_for_list_row (self);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_HIDE_EXPANDER]);
}

View File

@ -35,26 +35,36 @@ GDK_AVAILABLE_IN_ALL
G_DECLARE_FINAL_TYPE (GtkTreeExpander, gtk_tree_expander, GTK, TREE_EXPANDER, GtkWidget) G_DECLARE_FINAL_TYPE (GtkTreeExpander, gtk_tree_expander, GTK, TREE_EXPANDER, GtkWidget)
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_tree_expander_new (void); GtkWidget * gtk_tree_expander_new (void);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_tree_expander_get_child (GtkTreeExpander *self); GtkWidget * gtk_tree_expander_get_child (GtkTreeExpander *self);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_tree_expander_set_child (GtkTreeExpander *self, void gtk_tree_expander_set_child (GtkTreeExpander *self,
GtkWidget *child); GtkWidget *child);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
gpointer gtk_tree_expander_get_item (GtkTreeExpander *self); gpointer gtk_tree_expander_get_item (GtkTreeExpander *self);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
GtkTreeListRow * gtk_tree_expander_get_list_row (GtkTreeExpander *self); GtkTreeListRow * gtk_tree_expander_get_list_row (GtkTreeExpander *self);
GDK_AVAILABLE_IN_ALL GDK_AVAILABLE_IN_ALL
void gtk_tree_expander_set_list_row (GtkTreeExpander *self, void gtk_tree_expander_set_list_row (GtkTreeExpander *self,
GtkTreeListRow *list_row); GtkTreeListRow *list_row);
GDK_AVAILABLE_IN_4_10
gboolean gtk_tree_expander_get_indent_for_depth (GtkTreeExpander *self);
GDK_AVAILABLE_IN_4_10
void gtk_tree_expander_set_indent_for_depth (GtkTreeExpander *self,
gboolean indent_for_depth);
GDK_AVAILABLE_IN_4_6 GDK_AVAILABLE_IN_4_6
gboolean gtk_tree_expander_get_indent_for_icon (GtkTreeExpander *self); gboolean gtk_tree_expander_get_indent_for_icon (GtkTreeExpander *self);
GDK_AVAILABLE_IN_4_6 GDK_AVAILABLE_IN_4_6
void gtk_tree_expander_set_indent_for_icon (GtkTreeExpander *self, void gtk_tree_expander_set_indent_for_icon (GtkTreeExpander *self,
gboolean indent_for_icon); gboolean indent_for_icon);
GDK_AVAILABLE_IN_4_10
gboolean gtk_tree_expander_get_hide_expander (GtkTreeExpander *self);
GDK_AVAILABLE_IN_4_10
void gtk_tree_expander_set_hide_expander (GtkTreeExpander *self,
gboolean hide_expander);
G_END_DECLS G_END_DECLS