Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #3242 and #3240

See merge request GNOME/gtk!2679
This commit is contained in:
Matthias Clasen
2020-10-09 13:35:57 +00:00
6 changed files with 52 additions and 18 deletions

View File

@@ -184,7 +184,7 @@
<gresource prefix="/listview_settings">
<file>listview_settings.ui</file>
</gresource>
<gresource prefix="/listview_ucd">
<gresource prefix="/listview_ucd_data/">
<file>ucdnames.data</file>
</gresource>
<gresource prefix="/listview_weather">

View File

@@ -74,7 +74,7 @@ ucd_model_new (void)
guint u;
char *name;
bytes = g_resources_lookup_data ("/listview_ucd/ucdnames.data", 0, NULL);
bytes = g_resources_lookup_data ("/listview_ucd_data/ucdnames.data", 0, NULL);
v = g_variant_ref_sink (g_variant_new_from_bytes (G_VARIANT_TYPE ("a(us)"), bytes, TRUE));
iter = g_variant_iter_new (v);
@@ -116,6 +116,18 @@ setup_label (GtkSignalListItemFactory *factory,
gtk_list_item_set_child (GTK_LIST_ITEM (listitem), label);
}
static void
setup_ellipsizing_label (GtkSignalListItemFactory *factory,
GObject *listitem)
{
GtkWidget *label;
label = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 20);
gtk_list_item_set_child (GTK_LIST_ITEM (listitem), label);
}
static void
bind_codepoint (GtkSignalListItemFactory *factory,
GObject *listitem)
@@ -279,21 +291,21 @@ create_ucd_view (GtkWidget *label)
gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column);
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_label), NULL);
g_signal_connect (factory, "setup", G_CALLBACK (setup_ellipsizing_label), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind_name), NULL);
column = gtk_column_view_column_new ("Name", factory);
gtk_column_view_column_set_resizable (column, TRUE);
gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column);
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_label), NULL);
g_signal_connect (factory, "setup", G_CALLBACK (setup_ellipsizing_label), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind_type), NULL);
column = gtk_column_view_column_new ("Type", factory);
gtk_column_view_column_set_resizable (column, TRUE);
gtk_column_view_append_column (GTK_COLUMN_VIEW (cv), column);
factory = gtk_signal_list_item_factory_new ();
g_signal_connect (factory, "setup", G_CALLBACK (setup_label), NULL);
g_signal_connect (factory, "setup", G_CALLBACK (setup_ellipsizing_label), NULL);
g_signal_connect (factory, "bind", G_CALLBACK (bind_break_type), NULL);
column = gtk_column_view_column_new ("Break Type", factory);
gtk_column_view_column_set_resizable (column, TRUE);

View File

@@ -277,15 +277,22 @@ with surfaces, you may have to change it to call the API in these
interfaces, depending on whether the surface you are dealing with
is a toplevel or a popup.
As part of this reorganization, X11-only concepts such as sticky or
keep-below have been removed. If you need to use them on your X11 windows,
you will have to set the corresponding X11 properties (as specified in the
EWMH) yourself. Subsurfaces are only supported with the Wayland backend,
using gdk_wayland_surface_new_subsurface(). Native and foreign subwindows
are no longer supported. These concepts were complicating the code and
could not be supported across backends.
As part of this reorganization, X11-only concepts such as sticky,
keep-below, urgency, skip-taskbar or window groups have either been
removed or moved to X11 backend api. If you need to use them on your
X11 windows, you will have to use those backend apis or set the
corresponding X11 properties (as specified in the EWMH) yourself.
gdk_window_reparent() is no longer available.
Subsurfaces are only supported with the Wayland backend, using
gdk_wayland_surface_new_subsurface(). Native and foreign subwindows
are no longer supported. These concepts were complicating the code
and could not be supported across backends.
A number of GdkWindow APIs are no longer available. This includes
gdk_window_reparent(), gdk_window_set_geometry_hints(), gdk_window_raise(),
gdk_window_restack(), gdk_window_move(), gdk_window_resize(). If
you need to manually control the position or stacking of your X11
windows, you you will have to use Xlib apis.
A number of minor API cleanups have happened in GdkSurface
as well. For example, gdk_surface_input_shape_combine_region()
@@ -459,6 +466,17 @@ GtkButtonBox has been removed. Use a GtkBox instead.
The GtkBox pack-start and -end methods have been replaced by gtk_box_prepend()
and gtk_box_append(). You can also reorder box children as necessary.
### Adapt to GtkWindow API changes
Following the GdkSurface changes, a number of GtkWindow APIs that were
X11-specific have been removed. This includes gtk_window_set_geometry_hints(),
gtk_window_set_gravity(), gtk_window_move(), gtk_window_parse_geometry(),
gtk_window_set_keep_above(), gtk_window_set_keep_below(),
gtk_window_begin_resize_drag(), gtk_window_begin_move_drag().
Most likely, you should just stop using them. In some cases, you can
fall back to using the underlying #GdkToplevel APIS (for example,
gdk_toplevel_begin_resize()).
### Adapt to GtkHeaderBar and GtkActionBar API changes
The gtk_header_bar_set_show_close_button() function has been renamed to

View File

@@ -1648,8 +1648,11 @@ gtk_main_do_event (GdkEvent *event)
break;
case GDK_FOCUS_CHANGE:
if (!_gtk_widget_captured_event (target_widget, event, target_widget))
gtk_widget_event (target_widget, event, target_widget);
{
GtkWidget *root = GTK_WIDGET (gtk_widget_get_root (target_widget));
if (!_gtk_widget_captured_event (root, event, root))
gtk_widget_event (root, event, root);
}
break;
case GDK_KEY_PRESS:

View File

@@ -5242,8 +5242,8 @@ _gtk_window_unset_focus_and_default (GtkWindow *window,
{
if (_gtk_widget_get_visible (parent))
{
gtk_window_set_focus (window, parent);
break;
if (gtk_widget_grab_focus (parent))
break;
}
parent = gtk_widget_get_parent (parent);

View File

@@ -34,6 +34,7 @@ graphene_req = '>= 1.9.1'
epoxy_req = '>= 1.4'
cloudproviders_req = '>= 0.3.1'
xkbcommon_req = '>= 0.2.0'
sysprof_req = '>= 3.38.0'
gnome = import('gnome')
@@ -680,7 +681,7 @@ cdata.set('HAVE_CLOUDPROVIDERS', cloudproviders_dep.found())
# libsysprof-capture support
if not get_option('sysprof').disabled()
libsysprof_capture_dep = dependency('sysprof-capture-4',
libsysprof_capture_dep = dependency('sysprof-capture-4', version: sysprof_req,
required: get_option('sysprof'),
default_options: [
'enable_examples=false',