[gtk+] switch: Don't include margins in input window size
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] switch: Don't include margins in input window size
- Date: Tue, 12 Jan 2016 20:58:09 +0000 (UTC)
commit a8ceeb17667e40b61806e3e9a8e631c304e30b17
Author: Timm Bäder <mail baedert org>
Date: Tue Jan 12 21:36:37 2016 +0100
switch: Don't include margins in input window size
https://bugzilla.gnome.org/show_bug.cgi?id=760509
gtk/gtkswitch.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkswitch.c b/gtk/gtkswitch.c
index 8c1616f..9f6f659 100644
--- a/gtk/gtkswitch.c
+++ b/gtk/gtkswitch.c
@@ -485,6 +485,17 @@ gtk_switch_allocate_contents (GtkCssGadget *gadget,
&slider_alloc,
baseline,
out_clip);
+
+ if (gtk_widget_get_realized (GTK_WIDGET (self)))
+ {
+ GtkAllocation border_allocation;
+ gtk_css_gadget_get_border_allocation (gadget, &border_allocation, NULL);
+ gdk_window_move_resize (priv->event_window,
+ border_allocation.x,
+ border_allocation.y,
+ border_allocation.width,
+ border_allocation.height);
+ }
}
static void
@@ -495,19 +506,11 @@ gtk_switch_size_allocate (GtkWidget *widget,
GtkAllocation clip;
gtk_widget_set_allocation (widget, allocation);
-
- if (gtk_widget_get_realized (widget))
- gdk_window_move_resize (priv->event_window,
- allocation->x,
- allocation->y,
- allocation->width,
- allocation->height);
-
gtk_css_gadget_allocate (priv->gadget,
allocation,
gtk_widget_get_allocated_baseline (widget),
&clip);
-
+
gtk_widget_set_clip (widget, &clip);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]