summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
Diffstat (limited to 'gdk')
-rw-r--r--gdk/broadway/gdkwindow-broadway.c1
-rw-r--r--gdk/gdkinternals.h1
-rw-r--r--gdk/gdkwindow.c24
-rw-r--r--gdk/gdkwindow.h3
-rw-r--r--gdk/mir/gdkmirwindowimpl.c17
-rw-r--r--gdk/quartz/GdkQuartzView.c4
-rw-r--r--gdk/quartz/gdkwindow-quartz.c7
-rw-r--r--gdk/wayland/gdkglcontext-wayland.c18
-rw-r--r--gdk/wayland/gdkwindow-wayland.c1
-rw-r--r--gdk/win32/gdkglcontext-win32.c29
-rw-r--r--gdk/win32/gdkmain-win32.c5
-rw-r--r--gdk/win32/gdkwindow-win32.c3
-rw-r--r--gdk/x11/gdkdisplay-x11.c15
-rw-r--r--gdk/x11/gdkglcontext-x11.c3
-rw-r--r--gdk/x11/gdkprivate-x11.h1
-rw-r--r--gdk/x11/gdkwindow-x11.c11
16 files changed, 40 insertions, 103 deletions
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 2dff60affd..6fb030038b 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -211,7 +211,6 @@ _gdk_broadway_screen_init_root_window (GdkScreen * screen)
window = broadway_screen->root_window;
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_BROADWAY, NULL);
window->impl_window = window;
- window->visual = gdk_screen_get_system_visual (screen);
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index f9951cdb19..02f0155a67 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -157,7 +157,6 @@ struct _GdkWindow
GdkWindow *parent;
GdkWindow *transient_for;
- GdkVisual *visual;
gpointer user_data;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 35eb40e15c..2eefac0ea8 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1231,10 +1231,6 @@ gdk_window_new (GdkWindow *parent,
return NULL;
}
- 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;
if (attributes->wclass == GDK_INPUT_OUTPUT)
@@ -2071,24 +2067,6 @@ gdk_window_get_window_type (GdkWindow *window)
}
/**
- * gdk_window_get_visual:
- * @window: a #GdkWindow
- *
- * Gets the #GdkVisual describing the pixel format of @window.
- *
- * Returns: (transfer none): a #GdkVisual
- *
- * Since: 2.24
- **/
-GdkVisual*
-gdk_window_get_visual (GdkWindow *window)
-{
- g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
-
- return window->visual;
-}
-
-/**
* gdk_window_get_screen:
* @window: a #GdkWindow
*
@@ -2103,7 +2081,7 @@ gdk_window_get_screen (GdkWindow *window)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
- return gdk_visual_get_screen (window->visual);
+ return gdk_display_get_default_screen (window->display);
}
/**
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 0991982039..08d7338e00 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -331,7 +331,6 @@ typedef enum
* @height: height of window
* @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible
* window that receives events)
- * @visual: #GdkVisual for window
* @window_type: type of window
* @cursor: cursor for the window (see gdk_window_set_cursor())
* @override_redirect: %TRUE to bypass the window manager
@@ -494,8 +493,6 @@ GDK_AVAILABLE_IN_ALL
gboolean gdk_window_is_destroyed (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
-GdkVisual * gdk_window_get_visual (GdkWindow *window);
-GDK_AVAILABLE_IN_ALL
GdkScreen * gdk_window_get_screen (GdkWindow *window);
GDK_AVAILABLE_IN_ALL
GdkDisplay * gdk_window_get_display (GdkWindow *window);
diff --git a/gdk/mir/gdkmirwindowimpl.c b/gdk/mir/gdkmirwindowimpl.c
index e4fc56a2a6..03dd4df377 100644
--- a/gdk/mir/gdkmirwindowimpl.c
+++ b/gdk/mir/gdkmirwindowimpl.c
@@ -1516,11 +1516,9 @@ find_eglconfig_for_window (GdkWindow *window,
{
GdkDisplay *display = gdk_window_get_display (window);
EGLDisplay *egl_display = _gdk_mir_display_get_egl_display (display);
- GdkVisual *visual = gdk_window_get_visual (window);
EGLint attrs[MAX_EGL_ATTRS];
EGLint count;
EGLConfig *configs;
- gboolean use_rgba;
int i = 0;
@@ -1536,19 +1534,8 @@ find_eglconfig_for_window (GdkWindow *window,
attrs[i++] = 1;
attrs[i++] = EGL_BLUE_SIZE;
attrs[i++] = 1;
-
- use_rgba = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
-
- if (use_rgba)
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 1;
- }
- else
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 0;
- }
+ attrs[i++] = EGL_ALPHA_SIZE;
+ attrs[i++] = 1;
attrs[i++] = EGL_NONE;
g_assert (i < MAX_EGL_ATTRS);
diff --git a/gdk/quartz/GdkQuartzView.c b/gdk/quartz/GdkQuartzView.c
index 97c60d051c..e945b2fb5e 100644
--- a/gdk/quartz/GdkQuartzView.c
+++ b/gdk/quartz/GdkQuartzView.c
@@ -574,9 +574,7 @@
if (GDK_WINDOW_DESTROYED (gdk_window))
return YES;
- /* A view is opaque if its GdkWindow doesn't have the RGBA visual */
- return gdk_window_get_visual (gdk_window) !=
- gdk_screen_get_rgba_visual (_gdk_screen);
+ return NO;
}
-(void)drawRect: (NSRect)rect
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 0bcfac5d42..7cd39f2cfc 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -862,11 +862,8 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
gdk_window_set_title (window, title);
- if (gdk_window_get_visual (window) == gdk_screen_get_rgba_visual (_gdk_screen))
- {
- [impl->toplevel setOpaque:NO];
- [impl->toplevel setBackgroundColor:[NSColor clearColor]];
- }
+ [impl->toplevel setOpaque:NO];
+ [impl->toplevel setBackgroundColor:[NSColor clearColor]];
content_rect.origin.x = 0;
content_rect.origin.y = 0;
diff --git a/gdk/wayland/gdkglcontext-wayland.c b/gdk/wayland/gdkglcontext-wayland.c
index 657368860f..05043d1f8e 100644
--- a/gdk/wayland/gdkglcontext-wayland.c
+++ b/gdk/wayland/gdkglcontext-wayland.c
@@ -373,12 +373,9 @@ find_eglconfig_for_window (GdkWindow *window,
{
GdkDisplay *display = gdk_window_get_display (window);
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
- GdkVisual *visual = gdk_window_get_visual (window);
EGLint attrs[MAX_EGL_ATTRS];
EGLint count;
EGLConfig *configs;
- gboolean use_rgba;
-
int i = 0;
attrs[i++] = EGL_SURFACE_TYPE;
@@ -393,19 +390,8 @@ find_eglconfig_for_window (GdkWindow *window,
attrs[i++] = 1;
attrs[i++] = EGL_BLUE_SIZE;
attrs[i++] = 1;
-
- use_rgba = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
-
- if (use_rgba)
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 1;
- }
- else
- {
- attrs[i++] = EGL_ALPHA_SIZE;
- attrs[i++] = 0;
- }
+ attrs[i++] = EGL_ALPHA_SIZE;
+ attrs[i++] = 1;
attrs[i++] = EGL_NONE;
g_assert (i < MAX_EGL_ATTRS);
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index b33c67ac64..41672fb656 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -359,7 +359,6 @@ _gdk_wayland_screen_create_root_window (GdkScreen *screen,
window = _gdk_display_create_window (GDK_DISPLAY (display_wayland));
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WAYLAND, NULL);
window->impl_window = window;
- window->visual = gdk_screen_get_system_visual (screen);
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
diff --git a/gdk/win32/gdkglcontext-win32.c b/gdk/win32/gdkglcontext-win32.c
index 520d253fd2..499f8313e4 100644
--- a/gdk/win32/gdkglcontext-win32.c
+++ b/gdk/win32/gdkglcontext-win32.c
@@ -278,7 +278,6 @@ _get_dummy_window_hwnd (GdkWGLDummy *dummy)
static gint
_get_wgl_pfd (HDC hdc,
- const gboolean need_alpha_bits,
PIXELFORMATDESCRIPTOR *pfd)
{
gint best_pf = 0;
@@ -293,16 +292,6 @@ _get_wgl_pfd (HDC hdc,
best_pf = ChoosePixelFormat (hdc, pfd);
- if (best_pf == 0)
- /* give another chance if need_alpha_bits is FALSE,
- * meaning we prefer to have an alpha channel anyways
- */
- if (!need_alpha_bits)
- {
- pfd->cAlphaBits = 0;
- best_pf = ChoosePixelFormat (hdc, pfd);
- }
-
return best_pf;
}
@@ -310,8 +299,7 @@ _get_wgl_pfd (HDC hdc,
* one and cache it for later use
*/
static gint
-_gdk_init_dummy_context (GdkWGLDummy *dummy,
- const gboolean need_alpha_bits)
+_gdk_init_dummy_context (GdkWGLDummy *dummy)
{
PIXELFORMATDESCRIPTOR pfd;
gboolean set_pixel_format_result = FALSE;
@@ -322,7 +310,7 @@ _gdk_init_dummy_context (GdkWGLDummy *dummy,
dummy->hdc = GetDC (dummy->hwnd);
memset (&pfd, 0, sizeof (PIXELFORMATDESCRIPTOR));
- best_idx = _get_wgl_pfd (dummy->hdc, need_alpha_bits, &pfd);
+ best_idx = _get_wgl_pfd (dummy->hdc, &pfd);
if (best_idx != 0)
set_pixel_format_result = SetPixelFormat (dummy->hdc,
@@ -342,8 +330,7 @@ _gdk_init_dummy_context (GdkWGLDummy *dummy,
}
gboolean
-_gdk_win32_display_init_gl (GdkDisplay *display,
- const gboolean need_alpha_bits)
+_gdk_win32_display_init_gl (GdkDisplay *display)
{
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
gint best_idx = 0;
@@ -358,7 +345,7 @@ _gdk_win32_display_init_gl (GdkDisplay *display,
* dummy GL Context, it is used to query functions
* and used for other stuff as well
*/
- best_idx = _gdk_init_dummy_context (&dummy, need_alpha_bits);
+ best_idx = _gdk_init_dummy_context (&dummy);
if (best_idx == 0 || !wglMakeCurrent (dummy.hdc, dummy.hglrc))
return FALSE;
@@ -541,15 +528,12 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
GdkDisplay *display = gdk_window_get_display (window);
GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (gdk_window_get_display (window));
GdkWin32GLContext *context = NULL;
- GdkVisual *visual = gdk_window_get_visual (window);
-
- gboolean need_alpha_bits = (visual == gdk_screen_get_rgba_visual (gdk_display_get_default_screen (display)));
/* Acquire and store up the Windows-specific HWND and HDC */
HWND hwnd;
HDC hdc;
- if (!_gdk_win32_display_init_gl (display, need_alpha_bits))
+ if (!_gdk_win32_display_init_gl (display))
{
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
@@ -580,7 +564,6 @@ _gdk_win32_window_create_gl_context (GdkWindow *window,
"shared-context", share,
NULL);
- context->need_alpha_bits = need_alpha_bits;
context->gl_hdc = hdc;
context->is_attached = attached;
@@ -662,7 +645,7 @@ gdk_win32_display_get_wgl_version (GdkDisplay *display,
if (!GDK_IS_WIN32_DISPLAY (display))
return FALSE;
- if (!_gdk_win32_display_init_gl (display, FALSE))
+ if (!_gdk_win32_display_init_gl (display))
return FALSE;
if (major != NULL)
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index de2d1f8970..5d17072834 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -964,12 +964,11 @@ _gdk_win32_window_description (GdkWindow *d)
{
g_return_val_if_fail (GDK_IS_WINDOW (d), NULL);
- return static_printf ("%s:%p:%dx%dx%d",
+ return static_printf ("%s:%p:%dx%d",
G_OBJECT_TYPE_NAME (d),
GDK_WINDOW_HWND (d),
gdk_window_get_width (GDK_WINDOW (d)),
- gdk_window_get_height (GDK_WINDOW (d)),
- gdk_visual_get_depth (gdk_window_get_visual (GDK_WINDOW (d))));
+ gdk_window_get_height (GDK_WINDOW (d)));
}
#endif /* G_ENABLE_DEBUG */
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 12d57c16ea..c0ba2bcd59 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -2262,10 +2262,9 @@ gdk_win32_window_get_geometry (GdkWindow *window,
if (height)
*height = rect.bottom - rect.top;
- GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ldx%d@%+ld%+ld\n",
+ GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ld@%+ld%+ld\n",
GDK_WINDOW_HWND (window),
rect.right - rect.left, rect.bottom - rect.top,
- gdk_window_get_visual (window)->depth,
rect.left, rect.top));
}
}
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index e4b99752b0..50af342a8f 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -2899,6 +2899,21 @@ gdk_x11_display_get_primary_monitor (GdkDisplay *display)
return NULL;
}
+GdkVisual *
+gdk_x11_display_get_window_visual (GdkX11Display *display)
+{
+ GdkScreen *screen;
+ GdkVisual *visual;
+
+ screen = gdk_display_get_default_screen (GDK_DISPLAY (display));
+
+ visual = gdk_screen_get_rgba_visual (screen);
+ if (visual == NULL)
+ visual = gdk_screen_get_system_visual (screen);
+
+ return visual;
+}
+
static void
gdk_x11_display_class_init (GdkX11DisplayClass * class)
{
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index 0819f89648..6de0e2909b 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -22,6 +22,7 @@
#include "gdkglcontext-x11.h"
#include "gdkdisplay-x11.h"
+#include "gdkprivate-x11.h"
#include "gdkscreen-x11.h"
#include "gdkx11display.h"
@@ -1275,7 +1276,7 @@ gdk_x11_window_create_gl_context (GdkWindow *window,
return NULL;
}
- visual = gdk_window_get_visual (window);
+ visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (display));
if (!find_fbconfig_for_visual (display, visual, &config, error))
return NULL;
diff --git a/gdk/x11/gdkprivate-x11.h b/gdk/x11/gdkprivate-x11.h
index f35d2af21d..058a3878cb 100644
--- a/gdk/x11/gdkprivate-x11.h
+++ b/gdk/x11/gdkprivate-x11.h
@@ -70,6 +70,7 @@ void _gdk_x11_screen_query_visual_types (GdkScreen *screen
GList * _gdk_x11_screen_list_visuals (GdkScreen *screen);
+GdkVisual * gdk_x11_display_get_window_visual (GdkX11Display *display);
void _gdk_x11_display_add_window (GdkDisplay *display,
XID *xid,
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index f6c49cdc85..675293b26d 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -466,7 +466,7 @@ gdk_x11_create_cairo_surface (GdkWindowImplX11 *impl,
{
GdkVisual *visual;
- visual = gdk_window_get_visual (impl->wrapper);
+ visual = gdk_x11_display_get_window_visual (GDK_X11_DISPLAY (gdk_window_get_display (impl->wrapper)));
return cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (impl->wrapper),
GDK_WINDOW_IMPL_X11 (impl)->xid,
GDK_VISUAL_XVISUAL (visual),
@@ -632,7 +632,6 @@ _gdk_x11_screen_init_root_window (GdkScreen *screen)
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
window->impl_window = window;
- window->visual = gdk_screen_get_system_visual (screen);
impl = GDK_WINDOW_IMPL_X11 (window->impl);
@@ -903,6 +902,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
GdkWindowImplX11 *impl;
GdkX11Screen *x11_screen;
GdkX11Display *display_x11;
+ GdkVisual *visual;
Window xparent;
Visual *xvisual;
@@ -929,7 +929,8 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
xattributes_mask = 0;
- xvisual = gdk_x11_visual_get_xvisual (window->visual);
+ visual = gdk_x11_display_get_window_visual (display_x11);
+ xvisual = gdk_x11_visual_get_xvisual (visual);
if (attributes_mask & GDK_WA_NOREDIR)
{
@@ -966,7 +967,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
xattributes.bit_gravity = NorthWestGravity;
xattributes_mask |= CWBitGravity;
- xattributes.colormap = _gdk_visual_get_x11_colormap (window->visual);
+ xattributes.colormap = _gdk_visual_get_x11_colormap (visual);
xattributes_mask |= CWColormap;
if (window->window_type == GDK_WINDOW_TEMP)
@@ -1128,8 +1129,6 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
win = _gdk_display_create_window (display);
win->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
win->impl_window = win;
- win->visual = gdk_x11_screen_lookup_visual (screen,
- XVisualIDFromVisual (attrs.visual));
impl = GDK_WINDOW_IMPL_X11 (win->impl);
impl->wrapper = win;