[gtk+/wip/otte/gtk4: 37/118] API: Remove ability to set visuals on windows
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/gtk4: 37/118] API: Remove ability to set visuals on windows
- Date: Fri, 7 Oct 2016 00:02:48 +0000 (UTC)
commit c6fbb158f930b338c9111817150acc12ceef62fc
Author: Benjamin Otte <otte redhat com>
Date: Thu Oct 6 16:02:39 2016 +0200
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.
demos/gtk-demo/offscreen_window.c | 3 +-
demos/gtk-demo/offscreen_window2.c | 3 +-
gdk/gdkwindow.c | 10 +-
gdk/gdkwindow.h | 7 +-
gdk/wayland/gdkdevice-wayland.c | 3 +-
gdk/wayland/gdkdnd-wayland.c | 3 +-
gdk/win32/gdkwindow-win32.c | 9 +-
gdk/x11/gdkdnd-x11.c | 5 +-
gtk/deprecated/Makefile.inc | 2 -
gtk/deprecated/gtkhandlebox.c | 1627 ------------------------------------
gtk/deprecated/gtkhandlebox.h | 111 ---
gtk/deprecated/gtkmisc.c | 3 +-
gtk/gtk.h | 1 -
gtk/gtkdnd.c | 19 +-
gtk/gtkdrawingarea.c | 3 +-
gtk/gtkeventbox.c | 3 +-
gtk/gtkfixed.c | 3 +-
gtk/gtkiconview.c | 3 +-
gtk/gtklayout.c | 3 +-
gtk/gtkmenu.c | 3 +-
gtk/gtkmenushell.c | 3 +-
gtk/gtknotebook.c | 3 +-
gtk/gtkoffscreenwindow.c | 3 +-
gtk/gtkoverlay.c | 3 +-
gtk/gtkpaned.c | 5 +-
gtk/gtkpopover.c | 3 +-
gtk/gtkrevealer.c | 3 +-
gtk/gtkscrolledwindow.c | 6 +-
gtk/gtkseparatortoolitem.c | 1 -
gtk/gtkspinbutton.c | 3 +-
gtk/gtkstack.c | 3 +-
gtk/gtktextview.c | 6 +-
gtk/gtktoolitemgroup.c | 3 +-
gtk/gtktoolpalette.c | 3 +-
gtk/gtktreeview.c | 15 +-
gtk/gtktreeviewcolumn.c | 1 -
gtk/gtkviewport.c | 3 +-
gtk/gtkwidget.c | 77 +--
gtk/gtkwidget.h | 5 -
gtk/gtkwindow.c | 32 +-
gtk/inspector/inspect-button.c | 6 +-
tests/gtkoffscreenbox.c | 3 +-
tests/subsurface.c | 3 +-
tests/testgtk.c | 27 +-
44 files changed, 54 insertions(+), 1990 deletions(-)
---
diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c
index acd4c41..20f0b6c 100644
--- a/demos/gtk-demo/offscreen_window.c
+++ b/demos/gtk-demo/offscreen_window.c
@@ -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);
diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c
index a9d1687..9d96500 100644
--- a/demos/gtk-demo/offscreen_window2.c
+++ b/demos/gtk-demo/offscreen_window2.c
@@ -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);
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 0c3a0c8..a6c0959 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -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;
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 319d836..d3b3240 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -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;
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index fd39676..f453df5 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -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);
}
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index adc33a4..817b72e 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -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);
}
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 6a5a7dc..0adb907 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -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;
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index bb322c4..1668551 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -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);
}
diff --git a/gtk/deprecated/Makefile.inc b/gtk/deprecated/Makefile.inc
index 4503938..e93bd66 100644
--- a/gtk/deprecated/Makefile.inc
+++ b/gtk/deprecated/Makefile.inc
@@ -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 \
diff --git a/gtk/deprecated/gtkmisc.c b/gtk/deprecated/gtkmisc.c
index 8ad92f0..2cab744 100644
--- a/gtk/deprecated/gtkmisc.c
+++ b/gtk/deprecated/gtkmisc.c
@@ -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);
diff --git a/gtk/gtk.h b/gtk/gtk.h
index a858454..7cc03bf 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -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>
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index e08907c..b90cadc 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -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);
diff --git a/gtk/gtkdrawingarea.c b/gtk/gtkdrawingarea.c
index 261bf34..16f8f3b 100644
--- a/gtk/gtkdrawingarea.c
+++ b/gtk/gtkdrawingarea.c
@@ -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);
diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c
index 288b5ff..dc06847 100644
--- a/gtk/gtkeventbox.c
+++ b/gtk/gtkeventbox.c
@@ -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);
diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c
index 79d00cd..097676d 100644
--- a/gtk/gtkfixed.c
+++ b/gtk/gtkfixed.c
@@ -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);
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 091c9a6..54d8982 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -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);
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index 26b74f2..7402651 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -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);
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 3e10e76..0143b3b 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -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);
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index e15102a..c284c6a 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -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);
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 29e5b31..6450943 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -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,
diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c
index a07c7f6..ec2594c 100644
--- a/gtk/gtkoffscreenwindow.c
+++ b/gtk/gtkoffscreenwindow.c
@@ -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);
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 0af10a5..29fc355 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -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),
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index cbe65e9..c6aafd2 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -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),
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index 6cb4d53..2461c26 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -395,7 +395,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) |
@@ -406,7 +405,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);
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index b23f66a..2e3d34f 100644
--- a/gtk/gtkrevealer.c
+++ b/gtk/gtkrevealer.c
@@ -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),
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index b974987..35631b3 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -4169,8 +4169,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),
@@ -4442,8 +4441,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;
diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c
index 2111439..228d90f 100644
--- a/gtk/gtkseparatortoolitem.c
+++ b/gtk/gtkseparatortoolitem.c
@@ -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 |
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 9e5e4c7..a3caec7 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -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);
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 22e19a6..ca3e4e4 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -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)),
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 01b60e5..f6be78b 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -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);
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index c4dbbcb..38fedeb 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -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);
diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c
index 83f8e48..a525823 100644
--- a/gtk/gtktoolpalette.c
+++ b/gtk/gtktoolpalette.c
@@ -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);
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index a7463cc..c5ea581 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -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);
@@ -4047,9 +4046,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);
@@ -4093,9 +4091,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;
@@ -4174,9 +4171,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;
@@ -10069,9 +10065,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,
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index fff7ce7..e61e392 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -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 |
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index a5487ff..1f7b494 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -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);
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 6bd2d4a..b2c1135 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -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);
@@ -11511,74 +11507,6 @@ gtk_widget_get_ancestor (GtkWidget *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
*
@@ -15957,8 +15885,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);
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index aacfc94..65a832d 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -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);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index eab9b7e..4a4131e 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -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
@@ -6464,10 +6459,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);
@@ -6986,10 +6980,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);
@@ -7061,7 +7054,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));
@@ -7086,7 +7078,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);
@@ -7104,10 +7096,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)
{
@@ -10576,7 +10567,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));
@@ -10594,11 +10584,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)
@@ -10632,15 +10617,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);
diff --git a/gtk/inspector/inspect-button.c b/gtk/inspector/inspect-button.c
index 3a1eb03..e8c5590 100644
--- a/gtk/inspector/inspect-button.c
+++ b/gtk/inspector/inspect-button.c
@@ -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);
diff --git a/tests/gtkoffscreenbox.c b/tests/gtkoffscreenbox.c
index 5f474ac..610ddd8 100644
--- a/tests/gtkoffscreenbox.c
+++ b/tests/gtkoffscreenbox.c
@@ -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);
diff --git a/tests/subsurface.c b/tests/subsurface.c
index 9f8f9c4..ce467ea 100644
--- a/tests/subsurface.c
+++ b/tests/subsurface.c
@@ -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);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 9b8149a..7becaae 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -227,27 +227,6 @@ build_alpha_widgets (void)
}
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]