API: Remove ability to set visuals on windows

And with it, gtk_widget_get_visual() and gtk_widget_set_visual() are
gone.

We now always use the RGBA visual (if available) and otherwise fall back
to the system visual.
This commit is contained in:
Benjamin Otte 2016-10-06 16:02:39 +02:00
parent 380494c1d7
commit 662001b60a
44 changed files with 54 additions and 1990 deletions

View File

@ -255,10 +255,9 @@ gtk_rotated_bin_realize (GtkWidget *widget)
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -194,10 +194,9 @@ gtk_mirror_bin_realize (GtkWidget *widget)
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -1340,11 +1340,6 @@ gdk_window_new (GdkWindow *parent,
return NULL;
}
if (attributes_mask & GDK_WA_VISUAL)
{
g_return_val_if_fail (gdk_visual_get_screen (attributes->visual) == screen, NULL);
}
display = gdk_screen_get_display (screen);
window = _gdk_display_create_window (display);
@ -1418,9 +1413,8 @@ gdk_window_new (GdkWindow *parent,
return NULL;
}
if (attributes_mask & GDK_WA_VISUAL)
window->visual = attributes->visual;
else
window->visual = gdk_screen_get_rgba_visual (screen);
if (window->visual == NULL)
window->visual = gdk_screen_get_system_visual (screen);
window->event_mask = attributes->event_mask;

View File

@ -91,7 +91,6 @@ typedef enum
* @GDK_WA_TITLE: Honor the title field
* @GDK_WA_X: Honor the X coordinate field
* @GDK_WA_Y: Honor the Y coordinate field
* @GDK_WA_VISUAL: Honor the visual field
* @GDK_WA_NOREDIR: Honor the override_redirect field
* @GDK_WA_TYPE_HINT: Honor the type_hint field
*
@ -107,9 +106,8 @@ typedef enum
GDK_WA_TITLE = 1 << 1,
GDK_WA_X = 1 << 2,
GDK_WA_Y = 1 << 3,
GDK_WA_VISUAL = 1 << 4,
GDK_WA_NOREDIR = 1 << 5,
GDK_WA_TYPE_HINT = 1 << 6
GDK_WA_NOREDIR = 1 << 4,
GDK_WA_TYPE_HINT = 1 << 5
} GdkWindowAttributesType;
/* Size restriction enumeration.
@ -352,7 +350,6 @@ struct _GdkWindowAttr
gint width;
gint height;
GdkWindowWindowClass wclass;
GdkVisual *visual;
GdkWindowType window_type;
gboolean override_redirect;
GdkWindowTypeHint type_hint;

View File

@ -4512,9 +4512,8 @@ create_foreign_dnd_window (GdkDisplay *display)
attrs.width = attrs.height = 1;
attrs.wclass = GDK_INPUT_OUTPUT;
attrs.window_type = GDK_WINDOW_TEMP;
attrs.visual = gdk_screen_get_system_visual (screen);
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
mask = GDK_WA_X | GDK_WA_Y;
return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
}

View File

@ -508,9 +508,8 @@ create_dnd_window (GdkScreen *screen)
attrs.wclass = GDK_INPUT_OUTPUT;
attrs.window_type = GDK_WINDOW_TEMP;
attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
attrs.visual = gdk_screen_get_system_visual (screen);
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
}

View File

@ -672,7 +672,6 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
* except for toplevel window where OS/Window Manager placement
* is used.
*
* The visual parameter, is based on GDK_WA_VISUAL if set already.
* From attributes the only things used is: colormap, title,
* wmclass and type_hint. [1]. We are checking redundant information
* and complain if that changes, which would break this implementation
@ -734,9 +733,9 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
remaining_mask &= ~GDK_WA_NOREDIR;
}
if ((remaining_mask & ~(GDK_WA_VISUAL|GDK_WA_TITLE|GDK_WA_TYPE_HINT)) != 0)
if ((remaining_mask & ~(GDK_WA_TITLE|GDK_WA_TYPE_HINT)) != 0)
g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X",
remaining_mask & ~(GDK_WA_VISUAL|GDK_WA_TITLE|GDK_WA_TYPE_HINT));
remaining_mask & ~(GDK_WA_TITLE|GDK_WA_TYPE_HINT));
hparent = GDK_WINDOW_HWND (real_parent);
@ -744,10 +743,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
impl->wrapper = GDK_WINDOW (window);
window->impl = GDK_WINDOW_IMPL (impl);
if (attributes_mask & GDK_WA_VISUAL)
g_assert ((gdk_screen_get_system_visual (screen) == attributes->visual) ||
(gdk_screen_get_rgba_visual (screen) == attributes->visual));
impl->override_redirect = override_redirect;
impl->layered = FALSE;
impl->layered_opacity = 1.0;

View File

@ -2001,11 +2001,8 @@ create_drag_window (GdkScreen *screen)
attrs.wclass = GDK_INPUT_OUTPUT;
attrs.window_type = GDK_WINDOW_TEMP;
attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
attrs.visual = gdk_screen_get_rgba_visual (screen);
if (!attrs.visual)
attrs.visual = gdk_screen_get_system_visual (screen);
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
}

View File

@ -8,7 +8,6 @@ deprecated_h_sources = \
deprecated/gtkcolorseldialog.h \
deprecated/gtkfontsel.h \
deprecated/gtkgradient.h \
deprecated/gtkhandlebox.h \
deprecated/gtkhbbox.h \
deprecated/gtkhpaned.h \
deprecated/gtkhscale.h \
@ -52,7 +51,6 @@ deprecated_c_sources = \
deprecated/gtkcolorseldialog.c \
deprecated/gtkfontsel.c \
deprecated/gtkgradient.c \
deprecated/gtkhandlebox.c \
deprecated/gtkhbbox.c \
deprecated/gtkhpaned.c \
deprecated/gtkhscale.c \

File diff suppressed because it is too large Load Diff

View File

@ -1,111 +0,0 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
* Copyright (C) 1998 Elliot Lee
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
* file for a list of people on the GTK+ Team. See the ChangeLog
* files for a list of changes. These files are distributed with
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
*/
/* The GtkHandleBox is to allow widgets to be dragged in and out of
* their parents.
*/
#ifndef __GTK_HANDLE_BOX_H__
#define __GTK_HANDLE_BOX_H__
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif
#include <gtk/gtkbin.h>
G_BEGIN_DECLS
#define GTK_TYPE_HANDLE_BOX (gtk_handle_box_get_type ())
#define GTK_HANDLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HANDLE_BOX, GtkHandleBox))
#define GTK_HANDLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HANDLE_BOX, GtkHandleBoxClass))
#define GTK_IS_HANDLE_BOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HANDLE_BOX))
#define GTK_IS_HANDLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HANDLE_BOX))
#define GTK_HANDLE_BOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HANDLE_BOX, GtkHandleBoxClass))
typedef struct _GtkHandleBox GtkHandleBox;
typedef struct _GtkHandleBoxPrivate GtkHandleBoxPrivate;
typedef struct _GtkHandleBoxClass GtkHandleBoxClass;
struct _GtkHandleBox
{
GtkBin bin;
/*< private >*/
GtkHandleBoxPrivate *priv;
};
/**
* GtkHandleBoxClass:
* @parent_class: The parent class.
* @child_attached: Signal emitted when the contents of the handlebox
* are reattached to the main window. Deprecated: 3.4.
* @child_detached: Signal emitted when the contents of the handlebox
* are detached from the main window. Deprecated: 3.4.
*/
struct _GtkHandleBoxClass
{
GtkBinClass parent_class;
void (*child_attached) (GtkHandleBox *handle_box,
GtkWidget *child);
void (*child_detached) (GtkHandleBox *handle_box,
GtkWidget *child);
/*< private >*/
/* Padding for future expansion */
void (*_gtk_reserved1) (void);
void (*_gtk_reserved2) (void);
void (*_gtk_reserved3) (void);
void (*_gtk_reserved4) (void);
};
GDK_DEPRECATED_IN_3_4
GType gtk_handle_box_get_type (void) G_GNUC_CONST;
GDK_DEPRECATED_IN_3_4
GtkWidget* gtk_handle_box_new (void);
GDK_DEPRECATED_IN_3_4
void gtk_handle_box_set_shadow_type (GtkHandleBox *handle_box,
GtkShadowType type);
GDK_DEPRECATED_IN_3_4
GtkShadowType gtk_handle_box_get_shadow_type (GtkHandleBox *handle_box);
GDK_DEPRECATED_IN_3_4
void gtk_handle_box_set_handle_position (GtkHandleBox *handle_box,
GtkPositionType position);
GDK_DEPRECATED_IN_3_4
GtkPositionType gtk_handle_box_get_handle_position(GtkHandleBox *handle_box);
GDK_DEPRECATED_IN_3_4
void gtk_handle_box_set_snap_edge (GtkHandleBox *handle_box,
GtkPositionType edge);
GDK_DEPRECATED_IN_3_4
GtkPositionType gtk_handle_box_get_snap_edge (GtkHandleBox *handle_box);
GDK_DEPRECATED_IN_3_4
gboolean gtk_handle_box_get_child_detached (GtkHandleBox *handle_box);
G_END_DECLS
#endif /* __GTK_HANDLE_BOX_H__ */

View File

@ -439,9 +439,8 @@ gtk_misc_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
gtk_widget_set_window (widget, window);

View File

@ -253,7 +253,6 @@
#include <gtk/deprecated/gtkcolorseldialog.h>
#include <gtk/deprecated/gtkfontsel.h>
#include <gtk/deprecated/gtkgradient.h>
#include <gtk/deprecated/gtkhandlebox.h>
#include <gtk/deprecated/gtkhbbox.h>
#include <gtk/deprecated/gtkhpaned.h>
#include <gtk/deprecated/gtkhsv.h>

View File

@ -1840,22 +1840,16 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context,
if (!info->icon_window)
{
GdkScreen *screen;
GdkVisual *visual;
gboolean has_rgba;
screen = gdk_window_get_screen (gdk_drag_context_get_source_window (context));
visual = gdk_screen_get_rgba_visual (screen);
has_rgba = visual != NULL && gdk_screen_is_composited (screen);
info->icon_window = gtk_window_new (GTK_WINDOW_POPUP);
gtk_window_set_type_hint (GTK_WINDOW (info->icon_window), GDK_WINDOW_TYPE_HINT_DND);
gtk_window_set_screen (GTK_WINDOW (info->icon_window), screen);
gtk_widget_set_size_request (info->icon_window, 24, 24);
if (visual)
gtk_widget_set_visual (info->icon_window, visual);
gtk_widget_set_events (info->icon_window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
if (has_rgba)
if (gdk_screen_is_composited (screen))
gtk_widget_set_app_paintable (info->icon_window, TRUE);
gtk_window_set_hardcoded_window (GTK_WINDOW (info->icon_window),
@ -2077,8 +2071,6 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
GdkScreen *screen;
GdkRectangle extents;
cairo_pattern_t *pattern;
GdkVisual *rgba_visual;
gboolean has_rgba;
cairo_matrix_t matrix;
g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
@ -2087,16 +2079,11 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
_gtk_cairo_surface_extents (surface, &extents);
screen = gdk_window_get_screen (gdk_drag_context_get_source_window (context));
rgba_visual = gdk_screen_get_rgba_visual (screen);
window = gtk_window_new (GTK_WINDOW_POPUP);
has_rgba = rgba_visual != NULL && gdk_screen_is_composited (screen);
gtk_window_set_screen (GTK_WINDOW (window), screen);
if (has_rgba)
gtk_widget_set_visual (GTK_WIDGET (window), rgba_visual);
gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_DND);
gtk_widget_set_events (window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
@ -2111,8 +2098,8 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
g_signal_connect_data (window,
"draw",
has_rgba ? G_CALLBACK (gtk_drag_draw_icon_pattern)
: G_CALLBACK (gtk_drag_draw_icon_pattern_and_background),
gdk_screen_is_composited (screen) ? G_CALLBACK (gtk_drag_draw_icon_pattern)
: G_CALLBACK (gtk_drag_draw_icon_pattern_and_background),
pattern,
(GClosureNotify) cairo_pattern_destroy,
G_CONNECT_AFTER);

View File

@ -208,10 +208,9 @@ gtk_drawing_area_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -418,10 +418,9 @@ gtk_event_box_realize (GtkWidget *widget)
visible_window = gtk_widget_get_has_window (widget);
if (visible_window)
{
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -393,11 +393,10 @@ gtk_fixed_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -1314,10 +1314,9 @@ gtk_icon_view_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -899,10 +899,9 @@ gtk_layout_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -2733,12 +2733,11 @@ gtk_menu_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_KEY_PRESS_MASK |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK );
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -598,7 +598,6 @@ gtk_menu_shell_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
@ -607,7 +606,7 @@ gtk_menu_shell_realize (GtkWidget *widget)
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -2952,9 +2952,8 @@ show_drag_window (GtkNotebook *notebook,
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
priv->drag_window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes,

View File

@ -175,10 +175,9 @@ gtk_offscreen_window_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_OFFSCREEN;
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -149,8 +149,7 @@ gtk_overlay_create_child_window (GtkOverlay *overlay,
attributes.height = allocation.height;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.visual = gtk_widget_get_visual (widget);
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
attributes.event_mask = gtk_widget_get_events (widget);
window = gdk_window_new (gtk_widget_get_window (widget),

View File

@ -1614,7 +1614,6 @@ gtk_paned_create_child_window (GtkPaned *paned,
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = gtk_widget_get_events (widget);
attributes.visual = gtk_widget_get_visual (widget);
if (child)
{
GtkAllocation allocation;
@ -1643,13 +1642,13 @@ gtk_paned_create_child_window (GtkPaned *paned,
gtk_widget_get_allocation (child, &allocation);
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes_mask = GDK_WA_X | GDK_WA_Y| GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
}
else
{
attributes.width = 1;
attributes.height = 1;
attributes_mask = GDK_WA_VISUAL;
attributes_mask = 0;
}
window = gdk_window_new (gtk_widget_get_window (widget),

View File

@ -399,7 +399,6 @@ gtk_popover_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask =
gtk_widget_get_events (widget) |
@ -410,7 +409,7 @@ gtk_popover_realize (GtkWidget *widget)
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
gtk_widget_set_window (widget, window);

View File

@ -365,10 +365,9 @@ gtk_revealer_real_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask =
gtk_widget_get_events (widget);
attributes_mask = (GDK_WA_X | GDK_WA_Y) | GDK_WA_VISUAL;
attributes_mask = (GDK_WA_X | GDK_WA_Y);
priv->view_window =
gdk_window_new (gtk_widget_get_parent_window ((GtkWidget*) revealer),

View File

@ -4170,8 +4170,7 @@ create_indicator_window (GtkScrolledWindow *scrolled_window,
attributes.height = allocation.height;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.visual = gtk_widget_get_visual (widget);
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
attributes.event_mask = gtk_widget_get_events (widget);
window = gdk_window_new (gtk_widget_get_window (widget),
@ -4443,8 +4442,7 @@ gtk_scrolled_window_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.x = allocation.x;
attributes.y = allocation.y;
attributes.visual = gtk_widget_get_visual (widget);
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
attributes.event_mask = gtk_widget_get_events (widget) |
GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;

View File

@ -295,7 +295,6 @@ gtk_separator_tool_item_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_ONLY;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget) |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |

View File

@ -977,13 +977,12 @@ gtk_spin_button_realize (GtkWidget *widget)
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_ONLY;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= GDK_BUTTON_PRESS_MASK
| GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK
| GDK_POINTER_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
gtk_css_gadget_get_border_allocation (priv->up_button, &up_allocation, NULL);
gtk_css_gadget_get_border_allocation (priv->down_button, &down_allocation, NULL);

View File

@ -351,10 +351,9 @@ gtk_stack_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask =
gtk_widget_get_events (widget);
attributes_mask = (GDK_WA_X | GDK_WA_Y) | GDK_WA_VISUAL;
attributes_mask = (GDK_WA_X | GDK_WA_Y);
priv->view_window =
gdk_window_new (gtk_widget_get_window (GTK_WIDGET (stack)),

View File

@ -4686,10 +4686,9 @@ gtk_text_view_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
@ -9944,10 +9943,9 @@ text_window_realize (GtkTextWindow *win,
attributes.width = win->allocation.width;
attributes.height = win->allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (win->widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gtk_widget_get_window (widget);

View File

@ -1255,12 +1255,11 @@ gtk_tool_item_group_realize (GtkWidget *widget)
attributes.width = allocation.width - border_width * 2;
attributes.height = allocation.height - border_width * 2;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_VISIBILITY_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_BUTTON_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -730,14 +730,13 @@ gtk_tool_palette_realize (GtkWidget *widget)
attributes.width = allocation.width - border_width * 2;
attributes.height = allocation.height - border_width * 2;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget)
| GDK_VISIBILITY_NOTIFY_MASK
| GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
| GDK_BUTTON_MOTION_MASK
| GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK
| GDK_TOUCH_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -2434,10 +2434,9 @@ gtk_tree_view_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
@ -4046,9 +4045,8 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
gtk_widget_get_allocation (button, &drag_allocation);
width = attributes.width = drag_allocation.width;
height = attributes.height = drag_allocation.height;
attributes.visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
tree_view->priv->drag_highlight_window = gdk_window_new (tree_view->priv->header_window, &attributes, attributes_mask);
gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
@ -4092,9 +4090,8 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
attributes.window_type = GDK_WINDOW_TEMP;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
attributes.x = x;
attributes.y = y;
attributes.width = width;
@ -4173,9 +4170,8 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
attributes.window_type = GDK_WINDOW_TEMP;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
attributes.x = x;
attributes.y = y;
attributes.width = width;
@ -10068,9 +10064,8 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
attributes.y = 0;
attributes.width = button_allocation.width;
attributes.height = button_allocation.height;
attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
tree_view->priv->drag_window = gdk_window_new (tree_view->priv->header_window,
&attributes,

View File

@ -1329,7 +1329,6 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
attr.window_type = GDK_WINDOW_CHILD;
attr.wclass = GDK_INPUT_ONLY;
attr.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
attr.event_mask = gtk_widget_get_events (GTK_WIDGET (tree_view)) |
(GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |

View File

@ -850,13 +850,12 @@ gtk_viewport_realize (GtkWidget *widget)
attributes.height = allocation.height;
attributes.window_type = GDK_WINDOW_CHILD;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
event_mask = gtk_widget_get_events (widget);
attributes.event_mask = event_mask | GDK_SCROLL_MASK | GDK_TOUCH_MASK | GDK_SMOOTH_SCROLL_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -828,7 +828,6 @@ static GQuark quark_pango_context = 0;
static GQuark quark_mnemonic_labels = 0;
static GQuark quark_tooltip_markup = 0;
static GQuark quark_tooltip_window = 0;
static GQuark quark_visual = 0;
static GQuark quark_modifier_style = 0;
static GQuark quark_enabled_devices = 0;
static GQuark quark_size_groups = 0;
@ -997,7 +996,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
quark_mnemonic_labels = g_quark_from_static_string ("gtk-mnemonic-labels");
quark_tooltip_markup = g_quark_from_static_string ("gtk-tooltip-markup");
quark_tooltip_window = g_quark_from_static_string ("gtk-tooltip-window");
quark_visual = g_quark_from_static_string ("gtk-widget-visual");
quark_modifier_style = g_quark_from_static_string ("gtk-widget-modifier-style");
quark_enabled_devices = g_quark_from_static_string ("gtk-widget-enabled-devices");
quark_size_groups = g_quark_from_static_string ("gtk-widget-size-groups");
@ -6990,9 +6988,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
}
push_group =
widget->priv->alpha != 255 &&
(!_gtk_widget_is_toplevel (widget) ||
gtk_widget_get_visual (widget) == gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)));
widget->priv->alpha != 255 && !_gtk_widget_is_toplevel (widget);
if (push_group)
cairo_push_group (cr);
@ -11512,74 +11508,6 @@ gtk_widget_get_ancestor (GtkWidget *widget,
return widget;
}
/**
* gtk_widget_set_visual:
* @widget: a #GtkWidget
* @visual: (allow-none): visual to be used or %NULL to unset a previous one
*
* Sets the visual that should be used for by widget and its children for
* creating #GdkWindows. The visual must be on the same #GdkScreen as
* returned by gtk_widget_get_screen(), so handling the
* #GtkWidget::screen-changed signal is necessary.
*
* Setting a new @visual will not cause @widget to recreate its windows,
* so you should call this function before @widget is realized.
**/
void
gtk_widget_set_visual (GtkWidget *widget,
GdkVisual *visual)
{
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (visual == NULL || GDK_IS_VISUAL (visual));
if (visual)
g_return_if_fail (gtk_widget_get_screen (widget) == gdk_visual_get_screen (visual));
g_object_set_qdata_full (G_OBJECT (widget),
quark_visual,
visual ? g_object_ref (visual) : NULL,
g_object_unref);
}
/**
* gtk_widget_get_visual:
* @widget: a #GtkWidget
*
* Gets the visual that will be used to render @widget.
*
* Returns: (transfer none): the visual for @widget
**/
GdkVisual*
gtk_widget_get_visual (GtkWidget *widget)
{
GtkWidget *w;
GdkVisual *visual;
GdkScreen *screen;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
if (!_gtk_widget_get_has_window (widget) &&
widget->priv->window)
return gdk_window_get_visual (widget->priv->window);
screen = gtk_widget_get_screen (widget);
for (w = widget; w != NULL; w = w->priv->parent)
{
visual = g_object_get_qdata (G_OBJECT (w), quark_visual);
if (visual)
{
if (gdk_visual_get_screen (visual) == screen)
return visual;
g_warning ("Ignoring visual set on widget '%s' that is not on the correct screen.",
gtk_widget_get_name (widget));
}
}
return gdk_screen_get_system_visual (screen);
}
/**
* gtk_widget_get_settings:
* @widget: a #GtkWidget
@ -15959,8 +15887,7 @@ gtk_widget_update_alpha (GtkWidget *widget)
if (_gtk_widget_get_realized (widget))
{
if (_gtk_widget_is_toplevel (widget) &&
gtk_widget_get_visual (widget) != gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)))
if (_gtk_widget_is_toplevel (widget))
gdk_window_set_opacity (priv->window, priv->alpha / 255.0);
gtk_widget_queue_draw (widget);

View File

@ -998,11 +998,6 @@ GtkWidget* gtk_widget_get_toplevel (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
GType widget_type);
GDK_AVAILABLE_IN_ALL
GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_visual (GtkWidget *widget,
GdkVisual *visual);
GDK_AVAILABLE_IN_ALL
GdkScreen * gtk_widget_get_screen (GtkWidget *widget);

View File

@ -4017,15 +4017,10 @@ gtk_window_enable_csd (GtkWindow *window)
{
GtkWindowPrivate *priv = window->priv;
GtkWidget *widget = GTK_WIDGET (window);
GdkVisual *visual;
/* We need a visual with alpha for client shadows */
if (priv->use_client_shadow)
{
visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
if (visual != NULL)
gtk_widget_set_visual (widget, visual);
gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
}
else
@ -6483,10 +6478,9 @@ popover_realize (GtkWidget *widget,
attributes.y = rect.y;
attributes.width = rect.width;
attributes.height = rect.height;
attributes.visual = gtk_widget_get_visual (GTK_WIDGET (window));
attributes.event_mask = gtk_widget_get_events (popover->widget) |
GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
popover->window = gdk_window_new (parent_window, &attributes, attributes_mask);
gtk_widget_register_window (GTK_WIDGET (window), popover->window);
@ -7005,10 +6999,9 @@ gtk_window_realize (GtkWidget *widget)
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
gdk_window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);
@ -7080,7 +7073,6 @@ gtk_window_realize (GtkWidget *widget)
attributes.title = priv->title;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes_mask = 0;
parent_window = gdk_screen_get_root_window (_gtk_window_get_screen (window));
@ -7105,7 +7097,7 @@ gtk_window_realize (GtkWidget *widget)
attributes.type_hint = priv->type_hint;
attributes_mask |= GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
attributes_mask |= GDK_WA_TYPE_HINT;
attributes_mask |= (priv->title ? GDK_WA_TITLE : 0);
gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask);
@ -7123,10 +7115,9 @@ gtk_window_realize (GtkWidget *widget)
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
if (priv->client_decorated && priv->type == GTK_WINDOW_TOPLEVEL)
{
@ -10595,7 +10586,6 @@ gtk_window_set_screen (GtkWindow *window,
GtkWindowPrivate *priv;
GtkWidget *widget;
GdkScreen *previous_screen;
gboolean was_rgba;
gboolean was_mapped;
g_return_if_fail (GTK_IS_WINDOW (window));
@ -10613,11 +10603,6 @@ gtk_window_set_screen (GtkWindow *window,
previous_screen = priv->screen;
if (gdk_screen_get_rgba_visual (previous_screen) == gtk_widget_get_visual (widget))
was_rgba = TRUE;
else
was_rgba = FALSE;
was_mapped = _gtk_widget_get_mapped (widget);
if (was_mapped)
@ -10651,15 +10636,6 @@ gtk_window_set_screen (GtkWindow *window,
}
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SCREEN]);
if (was_rgba && priv->use_client_shadow)
{
GdkVisual *visual;
visual = gdk_screen_get_rgba_visual (screen);
if (visual)
gtk_widget_set_visual (widget, visual);
}
if (was_mapped)
gtk_widget_map (widget);

View File

@ -278,8 +278,7 @@ deemphasize_window (GtkWidget *window)
GdkScreen *screen;
screen = gtk_widget_get_screen (window);
if (gdk_screen_is_composited (screen) &&
gtk_widget_get_visual (window) == gdk_screen_get_rgba_visual (screen))
if (gdk_screen_is_composited (screen))
{
cairo_rectangle_int_t rect;
cairo_region_t *region;
@ -300,8 +299,7 @@ reemphasize_window (GtkWidget *window)
GdkScreen *screen;
screen = gtk_widget_get_screen (window);
if (gdk_screen_is_composited (screen) &&
gtk_widget_get_visual (window) == gdk_screen_get_rgba_visual (screen))
if (gdk_screen_is_composited (screen))
{
gtk_widget_set_opacity (window, 1.0);
gtk_widget_input_shape_combine_region (window, NULL);

View File

@ -279,10 +279,9 @@ gtk_offscreen_box_realize (GtkWidget *widget)
| GDK_ENTER_NOTIFY_MASK
| GDK_LEAVE_NOTIFY_MASK;
attributes.visual = gtk_widget_get_visual (widget);
attributes.wclass = GDK_INPUT_OUTPUT;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -52,10 +52,9 @@ da_realize (GtkWidget *widget)
attributes.width = allocation.width;
attributes.height = allocation.height;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.visual = gtk_widget_get_visual (widget);
attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
attributes_mask = GDK_WA_X | GDK_WA_Y;
window = gdk_window_new (gtk_widget_get_parent_window (widget),
&attributes, attributes_mask);

View File

@ -226,27 +226,6 @@ build_alpha_widgets (void)
return grid;
}
static void
on_alpha_screen_changed (GtkWindow *window,
GdkScreen *old_screen,
GtkWidget *label)
{
GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (window));
GdkVisual *visual = gdk_screen_get_rgba_visual (screen);
if (!visual)
{
visual = gdk_screen_get_system_visual (screen);
gtk_label_set_markup (GTK_LABEL (label), "<b>Screen doesn't support alpha</b>");
}
else
{
gtk_label_set_markup (GTK_LABEL (label), "<b>Screen supports alpha</b>");
}
gtk_widget_set_visual (GTK_WIDGET (window), visual);
}
static void
on_composited_changed (GtkWidget *window,
GtkLabel *label)
@ -288,9 +267,6 @@ create_alpha_window (GtkWidget *widget)
label = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
on_alpha_screen_changed (GTK_WINDOW (window), NULL, label);
g_signal_connect (window, "screen-changed",
G_CALLBACK (on_alpha_screen_changed), label);
label = gtk_label_new (NULL);
gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
@ -366,10 +342,9 @@ create_pattern (GtkWidget *widget,
attributes.height = h;
attributes.wclass = GDK_INPUT_OUTPUT;
attributes.event_mask = GDK_EXPOSURE_MASK;
attributes.visual = gtk_widget_get_visual (widget);
child = gdk_window_new (parent, &attributes,
GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL);
GDK_WA_X | GDK_WA_Y);
pattern_set_bg (widget, child, level);