summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-11-03 20:15:08 +0000
committerMatthias Clasen <mclasen@redhat.com>2020-11-03 20:15:08 +0000
commitfd52220b1b46813152d649f04f4b2b6709576ac6 (patch)
tree09a6c97eda88517e8777ef8071414902f3546d88
parentdbdc909e1913568f4d3e9d3114eacf482a296b3d (diff)
parente9438224ab8b6bdc9280858f57d5972ab57ba6f2 (diff)
downloadgtk+-fd52220b1b46813152d649f04f4b2b6709576ac6.tar.gz
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master Closes #3318, #3319, and #3320 See merge request GNOME/gtk!2776
-rw-r--r--NEWS16
-rw-r--r--demos/widget-factory/widget-factory.c22
-rw-r--r--demos/widget-factory/widget-factory.ui4
-rw-r--r--docs/reference/gtk/migrating-3to4.md12
-rw-r--r--gdk/gdksurface.c8
-rw-r--r--gtk/gtkmagnifier.c2
-rw-r--r--gtk/gtkpopover.c4
-rw-r--r--gtk/gtkpopovermenu.c1
-rw-r--r--gtk/gtktexthandle.c17
-rw-r--r--gtk/theme/Adwaita/_common.scss3
10 files changed, 65 insertions, 24 deletions
diff --git a/NEWS b/NEWS
index 28a211ac31..107ef26293 100644
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,9 @@ Overview of Changes in master
* GtkTextView:
- Fix rendering and positioning of anchored children
+* Constraints:
+ - Fix loading constraints from ui files
+
* Media support:
- Use cubic instead of linear volume
@@ -42,10 +45,22 @@ Overview of Changes in master
- Deliver events on flush
- Drop the unused GdkPoint struct from the API
+* Demos:
+ - Add another constraints demo
+ - Tweak various demos to improve consistency
+
+* Tools:
+ - Improve gtk4-builder-tool handling of various
+ widgets when converting ui files from GTK 3
+
* Documentation:
- Use GtkApplication in all examples
- Improve and expand the widget gallery
+* Testsuite:
+ - Improve coverage of GDK
+ - Improve coverage of gtk4-builder-tool
+
* Build:
- Fix the build with cups 2.2.12
- Make cloudprint support build without warnings
@@ -55,6 +70,7 @@ Overview of Changes in master
- Make GtkGLArea work (with the cairo backend)
* Translation updates:
+ German
Polish
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index e86ebf6ee4..6d022bb203 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -260,6 +260,8 @@ activate_about (GSimpleAction *action,
gpointer user_data)
{
GtkApplication *app = user_data;
+ GtkWindow *window;
+ GtkWidget *button;
const char *authors[] = {
"Andrea Cimitan",
"Cosimo Cecchi",
@@ -277,6 +279,10 @@ activate_about (GSimpleAction *action,
s = g_string_new ("");
+ window = gtk_application_get_active_window (app);
+ button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "open_menubutton"));
+ gtk_menu_button_popdown (GTK_MENU_BUTTON (button));
+
os_name = g_get_os_info (G_OS_INFO_KEY_NAME);
os_version = g_get_os_info (G_OS_INFO_KEY_VERSION_ID);
if (os_name && os_version)
@@ -327,6 +333,21 @@ activate_about (GSimpleAction *action,
}
static void
+activate_shortcuts_window (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ GtkApplication *app = user_data;
+ GtkWindow *window;
+ GtkWidget *button;
+
+ window = gtk_application_get_active_window (app);
+ button = GTK_WIDGET (g_object_get_data (G_OBJECT (window), "open_menubutton"));
+ gtk_menu_button_popdown (GTK_MENU_BUTTON (button));
+ gtk_widget_activate_action (GTK_WIDGET (window), "win.show-help-overlay", NULL);
+}
+
+static void
activate_quit (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -2371,6 +2392,7 @@ main (int argc, char *argv[])
GAction *action;
static GActionEntry app_entries[] = {
{ "about", activate_about, NULL, NULL, NULL },
+ { "shortcuts", activate_shortcuts_window, NULL, NULL, NULL },
{ "quit", activate_quit, NULL, NULL, NULL },
{ "inspector", activate_inspector, NULL, NULL, NULL },
{ "main", NULL, "s", "'steak'", NULL },
diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui
index 36bee582cf..3a7e2533fa 100644
--- a/demos/widget-factory/widget-factory.ui
+++ b/demos/widget-factory/widget-factory.ui
@@ -51,7 +51,7 @@
</item>
<item>
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
- <attribute name="action">win.show-help-overlay</attribute>
+ <attribute name="action">app.shortcuts</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_About Widget Factory</attribute>
@@ -3220,7 +3220,7 @@ bad things might happen.</property>
<object class="GtkMenuButton">
<property name="halign">end</property>
<property name="icon-name">emblem-system-symbolic</property>
- <property name="menu-model">gear_menu</property>
+ <property name="menu-model">gear_menu_model</property>
<property name="tooltip-text">This is a menu button</property>
<layout>
<property name="column">1</property>
diff --git a/docs/reference/gtk/migrating-3to4.md b/docs/reference/gtk/migrating-3to4.md
index 7a70e21bc0..e3975d8517 100644
--- a/docs/reference/gtk/migrating-3to4.md
+++ b/docs/reference/gtk/migrating-3to4.md
@@ -1080,12 +1080,12 @@ gtk_icon_paintable_get_icon_name() and set the icon name on a #GtkImage.
### Update to GtkFileChooser API changes
-GtkFileChooser moved to a GFile-based API. If you need to convert a
-path or a URI, use g_file_new_for_path(), g_file_new_for_commandline_arg(),
-or g_file_new_for_uri(); similarly, if you need to get a path or a URI
-from a GFile, use g_file_get_path(), or g_file_get_uri(). With the
-removal or path and URI-based functions, the "local-only" property has
-been removed; GFile can be used to access non-local as well as local
+GtkFileChooser moved to a GFile-based API. If you need to convert a path
+or a URI, use g_file_new_for_path(), g_file_new_for_commandline_arg(),
+or g_file_new_for_uri(); similarly, if you need to get a path, name or URI
+from a GFile, use g_file_get_path(), g_file_get_basename() or g_file_get_uri().
+With the removal or path and URI-based functions, the "local-only" property
+has been removed; GFile can be used to access non-local as well as local
resources.
The GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER action has been removed. Use
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 43d3371609..f28c6ac4d1 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -1408,13 +1408,9 @@ impl_surface_add_update_area (GdkSurface *impl_surface,
void
gdk_surface_queue_render (GdkSurface *surface)
{
- cairo_region_t *region;
-
g_return_if_fail (GDK_IS_SURFACE (surface));
- region = cairo_region_create ();
- impl_surface_add_update_area (surface, region);
- cairo_region_destroy (region);
+ gdk_surface_invalidate_rect (surface, NULL);
}
/*
@@ -1495,7 +1491,9 @@ gdk_surface_freeze_updates (GdkSurface *surface)
surface->update_freeze_count++;
if (surface->update_freeze_count == 1)
+ {
_gdk_frame_clock_uninhibit_freeze (surface->frame_clock);
+ }
}
/*
diff --git a/gtk/gtkmagnifier.c b/gtk/gtkmagnifier.c
index af06d213d3..5b5b6ab7ac 100644
--- a/gtk/gtkmagnifier.c
+++ b/gtk/gtkmagnifier.c
@@ -202,6 +202,8 @@ gtk_magnifier_class_init (GtkMagnifierClass *klass)
P_("resize"),
FALSE,
G_PARAM_READWRITE));
+
+ gtk_widget_class_set_css_name (widget_class, "magnifier");
}
static void
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 1cfe499f52..2a17b677da 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -839,7 +839,7 @@ gtk_popover_init (GtkPopover *popover)
priv->final_position = GTK_POS_BOTTOM;
priv->autohide = TRUE;
priv->has_arrow = TRUE;
- priv->cascade_popdown = TRUE;
+ priv->cascade_popdown = FALSE;
controller = gtk_event_controller_key_new ();
g_signal_connect_swapped (controller, "key-pressed", G_CALLBACK (gtk_popover_key_pressed), popover);
@@ -1674,7 +1674,7 @@ gtk_popover_class_init (GtkPopoverClass *klass)
g_param_spec_boolean ("cascade-popdown",
P_("Cascade popdown"),
P_("Wether the popover pops down after a child popover"),
- TRUE,
+ FALSE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
diff --git a/gtk/gtkpopovermenu.c b/gtk/gtkpopovermenu.c
index 751d14c176..c3f39ed0ce 100644
--- a/gtk/gtkpopovermenu.c
+++ b/gtk/gtkpopovermenu.c
@@ -309,6 +309,7 @@ gtk_popover_menu_init (GtkPopoverMenu *popover)
g_free (controllers);
gtk_popover_disable_auto_mnemonics (GTK_POPOVER (popover));
+ gtk_popover_set_cascade_popdown (GTK_POPOVER (popover), TRUE);
}
static void
diff --git a/gtk/gtktexthandle.c b/gtk/gtktexthandle.c
index 4353a6226d..b5b645a7c9 100644
--- a/gtk/gtktexthandle.c
+++ b/gtk/gtktexthandle.c
@@ -116,22 +116,19 @@ gtk_text_handle_present_surface (GtkTextHandle *handle)
GdkPopupLayout *layout;
GdkRectangle rect;
GtkRequisition req;
- double x, y;
+ GtkWidget *parent;
gtk_widget_get_preferred_size (widget, NULL, &req);
gtk_text_handle_get_padding (handle, &handle->border);
- rect.x = handle->pointing_to.x;
- rect.y = handle->pointing_to.y + handle->pointing_to.height - handle->border.top;
+ parent = gtk_widget_get_parent (widget);
+ gtk_widget_get_surface_allocation (parent, &rect);
+
+ rect.x += handle->pointing_to.x;
+ rect.y += handle->pointing_to.y + handle->pointing_to.height - handle->border.top;
rect.width = req.width - handle->border.left - handle->border.right;
rect.height = 1;
- gtk_widget_translate_coordinates (gtk_widget_get_parent (widget),
- gtk_widget_get_ancestor (widget, GTK_TYPE_WINDOW),
- rect.x, rect.y, &x, &y);
- rect.x = x;
- rect.y = y;
-
if (handle->role == GTK_TEXT_HANDLE_ROLE_CURSOR)
rect.x -= rect.width / 2;
else if ((handle->role == GTK_TEXT_HANDLE_ROLE_SELECTION_END &&
@@ -420,6 +417,8 @@ gtk_text_handle_update_for_role (GtkTextHandle *handle)
gtk_widget_remove_css_class (widget, "bottom");
gtk_widget_remove_css_class (widget, "insertion-cursor");
}
+
+ gtk_widget_queue_draw (widget);
}
static void
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index 119694649d..a552965cdd 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -1845,6 +1845,9 @@ popover.background {
}
}
+magnifier {
+ background-color: $base_color;
+}
/*************
* Notebooks *