[gimp] libgimpwidgets, app: silence warnings about State 0 for GimpRuler and GtkScrolledWindow doesn't matc
- From: Jacob Boerema <jboerema src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets, app: silence warnings about State 0 for GimpRuler and GtkScrolledWindow doesn't matc
- Date: Mon, 28 Dec 2020 19:05:46 +0000 (UTC)
commit b3f3120e3295f317fe86c15bd27c1cd5ee74050a
Author: Jacob Boerema <jgboerema gmail com>
Date: Mon Dec 28 14:05:09 2020 -0500
libgimpwidgets, app: silence warnings about State 0 for GimpRuler and GtkScrolledWindow doesn't match
state 128 set via gtk_style_context_set_state ()
When run with GIMP_DEBUG=Gtk we get a lot of debug warnings for GimpRuler and once in a while for
GtkScrolledWindow that State 0
doesn't match state 128 set via gtk_style_context_set_state (). This happens because we didn't enter the
current state flags of
the widget but 0 and apparently Gtk isn't happy about that.
Let's fix this by using the actual state flags by calling gtk_widget_get_state_flags.
app/widgets/gimpcontainerbox.c | 2 +-
libgimpwidgets/gimpruler.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/app/widgets/gimpcontainerbox.c b/app/widgets/gimpcontainerbox.c
index fc19fda605..b8c4fc12a2 100644
--- a/app/widgets/gimpcontainerbox.c
+++ b/app/widgets/gimpcontainerbox.c
@@ -167,7 +167,7 @@ gimp_container_box_set_size_request (GimpContainerBox *box,
sw_style = gtk_widget_get_style_context (box->scrolled_win);
- gtk_style_context_get_border (sw_style, 0, &border);
+ gtk_style_context_get_border (sw_style, gtk_widget_get_state_flags (box->scrolled_win), &border);
border_x += border.left + border.right + scrollbar_width;
border_y += border.top + border.bottom;
diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c
index 965af0b2f7..51a2b3c2d4 100644
--- a/libgimpwidgets/gimpruler.c
+++ b/libgimpwidgets/gimpruler.c
@@ -902,7 +902,7 @@ gimp_ruler_size_request (GtkWidget *widget,
size = 2 + ink_rect.height * 1.7;
- gtk_style_context_get_border (context, 0, &border);
+ gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget), &border);
requisition->width = border.left + border.right;
requisition->height = border.top + border.bottom;
@@ -1022,7 +1022,7 @@ gimp_ruler_draw_ticks (GimpRuler *ruler)
return;
gtk_widget_get_allocation (widget, &allocation);
- gtk_style_context_get_border (context, 0, &border);
+ gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget), &border);
layout = gimp_ruler_get_layout (widget, "0123456789");
pango_layout_get_extents (layout, &ink_rect, &logical_rect);
@@ -1215,7 +1215,7 @@ gimp_ruler_get_pos_rect (GimpRuler *ruler,
return rect;
gtk_widget_get_allocation (widget, &allocation);
- gtk_style_context_get_border (context, 0, &border);
+ gtk_style_context_get_border (context, gtk_widget_get_state_flags (widget), &border);
if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]