mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-05 16:20:10 +00:00
gdk: Create windows via _gdk_display_create_window()
THe use of this function will become visible in the next commits. But wrapping g_object_new() is a generally a good idea anyway.
This commit is contained in:
parent
503087dfc9
commit
3036922b3d
@ -2498,6 +2498,12 @@ _gdk_display_create_window_impl (GdkDisplay *display,
|
||||
attributes_mask);
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
_gdk_display_create_window (GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_keymap_get_for_display:
|
||||
* @display: the #GdkDisplay.
|
||||
|
@ -287,6 +287,7 @@ void _gdk_display_create_window_impl (GdkDisplay *display
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindow * _gdk_display_create_window (GdkDisplay *display);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
@ -1307,7 +1307,9 @@ gdk_window_new (GdkWindow *parent,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
window = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
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.
|
||||
@ -1409,7 +1411,6 @@ gdk_window_new (GdkWindow *parent,
|
||||
}
|
||||
else if (native)
|
||||
{
|
||||
display = gdk_screen_get_display (screen);
|
||||
event_mask = get_native_event_mask (window);
|
||||
|
||||
/* Create the impl */
|
||||
|
@ -1041,7 +1041,7 @@ _gdk_windowing_window_init (void)
|
||||
|
||||
g_assert (_gdk_root == NULL);
|
||||
|
||||
_gdk_root = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
_gdk_root = _gdk_display_create_window (_gdk_display);
|
||||
|
||||
_gdk_root->impl = g_object_new (_gdk_root_window_impl_quartz_get_type (), NULL);
|
||||
_gdk_root->impl_window = _gdk_root;
|
||||
|
@ -203,7 +203,8 @@ _gdk_windowing_window_init (GdkScreen *screen)
|
||||
|
||||
g_assert (_gdk_root == NULL);
|
||||
|
||||
_gdk_root = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
_gdk_root = _gdk_display_create_window (_gdk_display);
|
||||
|
||||
private = (GdkWindowObject *)_gdk_root;
|
||||
private->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
|
||||
private->impl_window = private;
|
||||
@ -632,7 +633,7 @@ gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
|
||||
|
||||
g_return_val_if_fail (display == _gdk_display, NULL);
|
||||
|
||||
window = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
window = _gdk_display_create_window (display);
|
||||
private = (GdkWindowObject *)window;
|
||||
private->visual = gdk_screen_get_system_visual (_gdk_screen);
|
||||
private->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
|
||||
|
@ -460,7 +460,7 @@ _gdk_x11_screen_init_root_window (GdkScreen *screen)
|
||||
|
||||
g_assert (x11_screen->root_window == NULL);
|
||||
|
||||
window = x11_screen->root_window = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
window = x11_screen->root_window = _gdk_display_create_window (gdk_screen_get_display (screen));
|
||||
|
||||
window->impl = g_object_new (GDK_TYPE_WINDOW_IMPL_X11, NULL);
|
||||
window->impl_window = window;
|
||||
@ -906,7 +906,7 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
|
||||
|
||||
screen = _gdk_x11_display_screen_for_xrootwin (display, root);
|
||||
|
||||
win = g_object_new (GDK_TYPE_WINDOW, NULL);
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user