summaryrefslogtreecommitdiff
path: root/src/terminal-window.c
diff options
context:
space:
mode:
authorMark Givens <[email protected]>2023-05-31 13:58:05 -0600
committerLuke from DC <[email protected]>2023-06-01 18:50:17 +0000
commite54d44322a07d0c64bd08882a1ad9507dc3e2af1 (patch)
tree55c169bfe1e65bd08a8e4bc39e097798c536649e /src/terminal-window.c
parent100709a1706e2481342f6fa5ab2688212ab2e8de (diff)
downloadmate-terminal-e54d44322a07d0c64bd08882a1ad9507dc3e2af1.tar.bz2
mate-terminal-e54d44322a07d0c64bd08882a1ad9507dc3e2af1.tar.xz
terminal-window: explicitly draw window frame and bg
Diffstat (limited to 'src/terminal-window.c')
-rw-r--r--src/terminal-window.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 53badc8..e9c23e0 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -1713,6 +1713,39 @@ terminal_window_realize (GtkWidget *widget)
}
static gboolean
+terminal_window_draw (GtkWidget *widget,
+ cairo_t *cr)
+{
+ if (gtk_widget_get_app_paintable(widget))
+ {
+ GtkAllocation child_allocation;
+ GtkStyleContext *context;
+ int width;
+ int height;
+ GtkWidget *child;
+
+ /* Get the *child* allocation, so we don't overwrite window borders */
+ child = gtk_bin_get_child (GTK_BIN (widget));
+ gtk_widget_get_allocation (child, &child_allocation);
+
+ context = gtk_widget_get_style_context (widget);
+ width = gtk_widget_get_allocated_width (widget);
+ height = gtk_widget_get_allocated_height (widget);
+ gtk_render_background (context, cr, 0, 0, width, height);
+ gtk_render_frame (context, cr, 0, 0, width, height);
+
+ gtk_render_background (context, cr,
+ child_allocation.x, child_allocation.y,
+ child_allocation.width, child_allocation.height);
+ gtk_render_frame (context, cr,
+ child_allocation.x, child_allocation.y,
+ child_allocation.width, child_allocation.height);
+ }
+
+ return GTK_WIDGET_CLASS (terminal_window_parent_class)->draw (widget, cr);
+}
+
+static gboolean
terminal_window_map_event (GtkWidget *widget,
GdkEventAny *event)
{
@@ -2345,6 +2378,7 @@ terminal_window_class_init (TerminalWindowClass *klass)
widget_class->show = terminal_window_show;
widget_class->realize = terminal_window_realize;
+ widget_class->draw = terminal_window_draw;
widget_class->map_event = terminal_window_map_event;
widget_class->window_state_event = terminal_window_state_event;
widget_class->screen_changed = terminal_window_screen_changed;