[gtk+] window: Draw decorations in the right place
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] window: Draw decorations in the right place
- Date: Thu, 25 Feb 2016 22:22:11 +0000 (UTC)
commit 5df1e98b2ac8698539a7e7416fdb18d5c3ad36ed
Author: Benjamin Otte <otte redhat com>
Date: Thu Feb 25 23:20:31 2016 +0100
window: Draw decorations in the right place
When we draw our own shadows, we need to offset the calls to render the
background to the border rectangle.
gtk/gtkwindow.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 4b686a1..12ad040 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -9902,18 +9902,24 @@ gtk_window_draw (GtkWidget *widget,
if (priv->use_client_shadow)
{
+ GtkBorder padding, border;
+
+ gtk_style_context_get_padding (context, gtk_style_context_get_state (context), &padding);
+ gtk_style_context_get_border (context, gtk_style_context_get_state (context), &border);
+ sum_borders (&border, &padding);
+
gtk_render_background (context, cr,
- window_border.left, window_border.top,
+ window_border.left - border.left, window_border.top - border.top,
allocation.width -
- (window_border.left + window_border.right),
+ (window_border.left + window_border.right - border.left - border.right),
allocation.height -
- (window_border.top + window_border.bottom));
+ (window_border.top + window_border.bottom - border.top -
border.bottom));
gtk_render_frame (context, cr,
- window_border.left, window_border.top,
+ window_border.left - border.left, window_border.top - border.top,
allocation.width -
- (window_border.left + window_border.right),
+ (window_border.left + window_border.right - border.left - border.right),
allocation.height -
- (window_border.top + window_border.bottom));
+ (window_border.top + window_border.bottom - border.top - border.bottom));
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]