[gtk+/gtk-3-6] scrolledwindow: set GDK_EXPOSURE_MASK on the overshoot window
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-3-6] scrolledwindow: set GDK_EXPOSURE_MASK on the overshoot window
- Date: Wed, 17 Oct 2012 13:58:02 +0000 (UTC)
commit cf3913b08949f477c735230a089f139ec11e94ed
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Oct 17 00:59:59 2012 -0400
scrolledwindow: set GDK_EXPOSURE_MASK on the overshoot window
Currently we use gtk_style_context_set_background() when the state flags
change in order to propagate the background color to the overshoot
window, but this is actually only needed because the window doesn't get
expose events, since we always draw a full background in draw().
This also fixes some problems when the GdkWindow of the scrolled
window's child is composited, as seen in oxygen-gtk3.
https://bugzilla.gnome.org/show_bug.cgi?id=686265
gtk/gtkscrolledwindow.c | 39 +--------------------------------------
1 files changed, 1 insertions(+), 38 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index a18c4cf..7929863 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -274,9 +274,6 @@ static void gtk_scrolled_window_realize (GtkWidget *wid
static void gtk_scrolled_window_unrealize (GtkWidget *widget);
static void gtk_scrolled_window_map (GtkWidget *widget);
static void gtk_scrolled_window_unmap (GtkWidget *widget);
-static void gtk_scrolled_window_state_flags_changed (GtkWidget *widget,
- GtkStateFlags previous_state);
-static void gtk_scrolled_window_style_updated (GtkWidget *widget);
static void gtk_scrolled_window_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
@@ -352,8 +349,6 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
widget_class->unrealize = gtk_scrolled_window_unrealize;
widget_class->map = gtk_scrolled_window_map;
widget_class->unmap = gtk_scrolled_window_unmap;
- widget_class->state_flags_changed = gtk_scrolled_window_state_flags_changed;
- widget_class->style_updated = gtk_scrolled_window_style_updated;
widget_class->grab_notify = gtk_scrolled_window_grab_notify;
container_class->add = gtk_scrolled_window_add;
@@ -3379,14 +3374,13 @@ gtk_scrolled_window_realize (GtkWidget *widget)
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK |
- GDK_BUTTON_MOTION_MASK | GDK_TOUCH_MASK;
+ GDK_BUTTON_MOTION_MASK | GDK_TOUCH_MASK | GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
scrolled_window->priv->overshoot_window =
gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
-
gdk_window_set_user_data (scrolled_window->priv->overshoot_window, widget);
child_widget = gtk_bin_get_child (GTK_BIN (widget));
@@ -3433,37 +3427,6 @@ gtk_scrolled_window_unmap (GtkWidget *widget)
}
static void
-_gtk_scrolled_window_update_background (GtkScrolledWindow *scrolled_window)
-{
- GtkWidget *widget = GTK_WIDGET (scrolled_window);
-
- if (gtk_widget_get_realized (widget))
- {
- GtkStyleContext *context;
-
- context = gtk_widget_get_style_context (widget);
- gtk_style_context_set_background (context, scrolled_window->priv->overshoot_window);
- }
-}
-
-static void
-gtk_scrolled_window_state_flags_changed (GtkWidget *widget,
- GtkStateFlags previous_state)
-{
- _gtk_scrolled_window_update_background (GTK_SCROLLED_WINDOW (widget));
- gtk_widget_queue_draw (widget);
-}
-
-static void
-gtk_scrolled_window_style_updated (GtkWidget *widget)
-{
- GTK_WIDGET_CLASS (gtk_scrolled_window_parent_class)->style_updated (widget);
-
- _gtk_scrolled_window_update_background (GTK_SCROLLED_WINDOW (widget));
- gtk_widget_queue_draw (widget);
-}
-
-static void
gtk_scrolled_window_grab_notify (GtkWidget *widget,
gboolean was_grabbed)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]