[gtk+/parser: 5/66] gdk: Make sure offscreen windows aren't backend windows
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/parser: 5/66] gdk: Make sure offscreen windows aren't backend windows
- Date: Mon, 11 Apr 2011 22:29:34 +0000 (UTC)
commit d7135bec959ff1d467105e178a73782e31c8ea9b
Author: Benjamin Otte <otte redhat com>
Date: Sun Apr 3 19:17:42 2011 +0200
gdk: Make sure offscreen windows aren't backend windows
We don't want GDK_IS_X11_WINDOW() to trigger for offscreen windows as
the backend-specific APIs will fail on these windows.
gdk/gdkwindow.c | 7 +++++--
gdk/quartz/gdkwindow-quartz.c | 2 +-
gdk/win32/gdkwindow-win32.c | 4 ++--
gdk/x11/gdkwindow-x11.c | 4 ++--
4 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 8341106..a787c38 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1283,8 +1283,6 @@ gdk_window_new (GdkWindow *parent,
display = gdk_screen_get_display (screen);
- window = _gdk_display_create_window (display);
-
/* Windows with a foreign parent are treated as if they are children
* of the root window, except for actual creation.
*/
@@ -1292,6 +1290,11 @@ gdk_window_new (GdkWindow *parent,
if (GDK_WINDOW_TYPE (parent) == GDK_WINDOW_FOREIGN)
parent = gdk_screen_get_root_window (screen);
+ if (attributes->window_type == GDK_WINDOW_OFFSCREEN)
+ window = g_object_new (GDK_TYPE_WINDOW, NULL);
+ else
+ window = g_object_new (G_OBJECT_TYPE (parent), NULL);
+
window->parent = parent;
window->accept_focus = TRUE;
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index a6fc4ed..37ea9f3 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -1050,7 +1050,7 @@ _gdk_quartz_window_init_windowing (GdkDisplay *display,
g_assert (_gdk_root == NULL);
- _gdk_root = _gdk_display_create_window (display);
+ _gdk_root = g_object_new (GDK_TYPE_QUARTZ_WINDOW, NULL);
_gdk_root->impl = g_object_new (_gdk_root_window_impl_quartz_get_type (), NULL);
_gdk_root->impl_window = _gdk_root;
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 5e2208f..fe640dc 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -210,7 +210,7 @@ _gdk_windowing_window_init (GdkScreen *screen)
g_assert (_gdk_root == NULL);
- _gdk_root = _gdk_display_create_window (_gdk_display);
+ _gdk_root = g_object_new (GDK_TYPE_WIN32_WINDOW, NULL);
window = (GdkWindow *)_gdk_root;
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
@@ -662,7 +662,7 @@ gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
if ((window = gdk_win32_window_lookup_for_display (display, anid)) != NULL)
return g_object_ref (window);
- window = _gdk_display_create_window (display);
+ window = g_object_new (GDK_TYPE_WIN32_WINDOW, NULL);
window->visual = gdk_screen_get_system_visual (_gdk_screen);
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index fd62e4c..3da71ec 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -481,7 +481,7 @@ _gdk_x11_screen_init_root_window (GdkScreen *screen)
g_assert (x11_screen->root_window == NULL);
- window = x11_screen->root_window = _gdk_display_create_window (gdk_screen_get_display (screen));
+ window = x11_screen->root_window = g_object_new (GDK_TYPE_X11_WINDOW, NULL);
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
window->impl_window = window;
@@ -929,7 +929,7 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
screen = _gdk_x11_display_screen_for_xrootwin (display, root);
- win = _gdk_display_create_window (display);
+ win = g_object_new (GDK_TYPE_X11_WINDOW, NULL);
win->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
win->impl_window = win;
win->visual = gdk_x11_screen_lookup_visual (screen,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]