summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2019-05-23 12:55:13 -0400
committerraveit65 <[email protected]>2019-06-16 18:12:44 +0200
commitb989f7fbf5fc643e8ec91a96ee4e6d8a3192cf63 (patch)
treebbff85ce5edbc10e06204c7ed5451e12f770f401 /src/ui
parenta2582172dbb6e54a48b5bc6a69761e2758b712b3 (diff)
downloadmarco-b989f7fbf5fc643e8ec91a96ee4e6d8a3192cf63.tar.bz2
marco-b989f7fbf5fc643e8ec91a96ee4e6d8a3192cf63.tar.xz
theme-viewer: Fix invisible borders
https://bugzilla.gnome.org/show_bug.cgi?id=662895 upstream commit: https://gitlab.gnome.org/GNOME/metacity/commit/6836a621
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/preview-widget.c17
-rw-r--r--src/ui/theme-viewer.c4
2 files changed, 11 insertions, 10 deletions
diff --git a/src/ui/preview-widget.c b/src/ui/preview-widget.c
index d8b8c4bd..43d7ea15 100644
--- a/src/ui/preview-widget.c
+++ b/src/ui/preview-widget.c
@@ -211,8 +211,8 @@ meta_preview_draw (GtkWidget *widget,
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
gtk_widget_get_allocation (widget, &allocation);
- client_width = allocation.width - preview->borders.visible.left - preview->borders.visible.right - border_width * 2;
- client_height = allocation.height - preview->borders.visible.top - preview->borders.visible.bottom - border_width * 2;
+ client_width = allocation.width - preview->borders.total.left - preview->borders.total.right - border_width * 2;
+ client_height = allocation.height - preview->borders.total.top - preview->borders.total.bottom - border_width * 2;
if (client_width < 0)
client_width = 1;
@@ -256,7 +256,7 @@ meta_preview_get_preferred_width (GtkWidget *widget,
ensure_info (preview);
- *minimum = *natural = preview->borders.visible.left + preview->borders.visible.right;
+ *minimum = *natural = preview->borders.total.left + preview->borders.total.right;
child = gtk_bin_get_child (GTK_BIN (preview));
if (child && gtk_widget_get_visible (child))
@@ -292,7 +292,7 @@ meta_preview_get_preferred_height (GtkWidget *widget,
ensure_info (preview);
- *minimum = *natural = preview->borders.visible.top + preview->borders.visible.bottom;
+ *minimum = *natural = preview->borders.total.top + preview->borders.total.bottom;
child = gtk_bin_get_child (GTK_BIN (preview));
if (child && gtk_widget_get_visible (child))
@@ -337,11 +337,12 @@ meta_preview_size_allocate (GtkWidget *widget,
gtk_widget_get_visible (child))
{
gtk_widget_get_allocation (widget, &widget_allocation);
- child_allocation.x = widget_allocation.x + border_width + preview->borders.visible.left;
- child_allocation.y = widget_allocation.y + border_width + preview->borders.visible.top;
+ child_allocation.x = widget_allocation.x + border_width + preview->borders.total.left;
+ child_allocation.y = widget_allocation.y + border_width + preview->borders.total.top;
+
+ child_allocation.width = MAX (1, widget_allocation.width - border_width * 2 - preview->borders.total.left - preview->borders.total.right);
+ child_allocation.height = MAX (1, widget_allocation.height - border_width * 2 - preview->borders.total.top - preview->borders.total.bottom);
- child_allocation.width = MAX (1, widget_allocation.width - border_width * 2 - preview->borders.visible.left - preview->borders.visible.right);
- child_allocation.height = MAX (1, widget_allocation.height - border_width * 2 - preview->borders.visible.top - preview->borders.visible.bottom);
gtk_widget_size_allocate (gtk_bin_get_child (GTK_BIN (widget)), &child_allocation);
}
}
diff --git a/src/ui/theme-viewer.c b/src/ui/theme-viewer.c
index 53273c8d..f6a6efa6 100644
--- a/src/ui/theme-viewer.c
+++ b/src/ui/theme-viewer.c
@@ -1061,8 +1061,8 @@ run_theme_benchmark (void)
*/
pixmap = gdk_window_create_similar_surface (gtk_widget_get_window (widget),
CAIRO_CONTENT_COLOR,
- client_width + borders.visible.left + borders.visible.right,
- client_height + borders.visible.top + borders.visible.bottom);
+ client_width + borders.total.left + borders.total.right,
+ client_height + borders.total.top + borders.total.bottom);
cr = cairo_create (pixmap);
meta_theme_draw_frame (global_theme,