forked from AuroraMiddleware/gtk
gdk: Remove attributes_mask from gdk_window_new()
The only remaining values were always treated as 0, so we just hardcode them to 0.
This commit is contained in:
parent
9fe8b1e112
commit
d2c26c471c
@ -123,8 +123,7 @@ void _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindowAttr *attributes);
|
||||
gboolean _gdk_broadway_display_set_selection_owner (GdkDisplay *display,
|
||||
GdkWindow *owner,
|
||||
GdkAtom selection,
|
||||
|
@ -256,8 +256,7 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
GdkWindowImplBroadway *impl;
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
|
@ -1931,16 +1931,14 @@ _gdk_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
GDK_DISPLAY_GET_CLASS (display)->create_window_impl (display,
|
||||
window,
|
||||
real_parent,
|
||||
screen,
|
||||
event_mask,
|
||||
attributes,
|
||||
attributes_mask);
|
||||
attributes);
|
||||
}
|
||||
|
||||
GdkWindow *
|
||||
|
@ -195,8 +195,7 @@ struct _GdkDisplayClass
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindowAttr *attributes);
|
||||
|
||||
GdkKeymap * (*get_keymap) (GdkDisplay *display);
|
||||
void (*push_error_trap) (GdkDisplay *display);
|
||||
@ -324,8 +323,7 @@ void _gdk_display_create_window_impl (GdkDisplay *display
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindowAttr *attributes);
|
||||
GdkWindow * _gdk_display_create_window (GdkDisplay *display);
|
||||
|
||||
gboolean gdk_display_make_gl_context_current (GdkDisplay *display,
|
||||
|
@ -87,12 +87,6 @@ typedef enum {
|
||||
GDK_GL_GLES = 1 << 6
|
||||
} GdkGLFlags;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_WA_X = 1 << 1,
|
||||
GDK_WA_Y = 1 << 2
|
||||
} GdkWindowAttributesType;
|
||||
|
||||
extern GList *_gdk_default_filters;
|
||||
extern GdkWindow *_gdk_parent_root;
|
||||
|
||||
@ -429,8 +423,7 @@ cairo_surface_t *
|
||||
_gdk_window_ref_cairo_surface (GdkWindow *window);
|
||||
|
||||
GdkWindow* gdk_window_new (GdkWindow *parent,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindowAttr *attributes);
|
||||
void _gdk_window_destroy (GdkWindow *window,
|
||||
gboolean foreign_destroy);
|
||||
void _gdk_window_clear_update_area (GdkWindow *window);
|
||||
|
@ -1113,30 +1113,13 @@ sync_native_window_stack_position (GdkWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_window_new: (constructor)
|
||||
* @parent: (allow-none): a #GdkWindow, or %NULL to create the window as a child of
|
||||
* the default root window for the default display.
|
||||
* @attributes: attributes of the new window
|
||||
* @attributes_mask: (type GdkWindowAttributesType): mask indicating which
|
||||
* fields in @attributes are valid
|
||||
*
|
||||
* Creates a new #GdkWindow using the attributes from
|
||||
* @attributes. See #GdkWindowAttr and #GdkWindowAttributesType for
|
||||
* more details. Note: to use this on displays other than the default
|
||||
* display, @parent must be specified.
|
||||
*
|
||||
* Returns: (transfer full): the new #GdkWindow
|
||||
**/
|
||||
GdkWindow*
|
||||
gdk_window_new (GdkWindow *parent,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
GdkWindow *window;
|
||||
GdkScreen *screen;
|
||||
GdkDisplay *display;
|
||||
int x, y;
|
||||
gboolean native;
|
||||
GdkEventMask event_mask;
|
||||
GdkWindow *real_parent;
|
||||
@ -1176,18 +1159,8 @@ gdk_window_new (GdkWindow *parent,
|
||||
window->focus_on_map = TRUE;
|
||||
window->event_compression = TRUE;
|
||||
|
||||
if (attributes_mask & GDK_WA_X)
|
||||
x = attributes->x;
|
||||
else
|
||||
x = 0;
|
||||
|
||||
if (attributes_mask & GDK_WA_Y)
|
||||
y = attributes->y;
|
||||
else
|
||||
y = 0;
|
||||
|
||||
window->x = x;
|
||||
window->y = y;
|
||||
window->x = attributes->x;
|
||||
window->y = attributes->y;
|
||||
window->width = (attributes->width > 1) ? (attributes->width) : (1);
|
||||
window->height = (attributes->height > 1) ? (attributes->height) : (1);
|
||||
window->alpha = 255;
|
||||
@ -1260,7 +1233,7 @@ gdk_window_new (GdkWindow *parent,
|
||||
event_mask = get_native_event_mask (window);
|
||||
|
||||
/* Create the impl */
|
||||
_gdk_display_create_window_impl (display, window, real_parent, screen, event_mask, attributes, attributes_mask);
|
||||
_gdk_display_create_window_impl (display, window, real_parent, screen, event_mask, attributes);
|
||||
window->impl_window = window;
|
||||
|
||||
parent->impl_window->native_children = g_list_prepend (parent->impl_window->native_children, window);
|
||||
@ -1321,13 +1294,14 @@ gdk_window_new_toplevel (GdkDisplay *display,
|
||||
|
||||
attr.event_mask = event_mask;
|
||||
attr.wclass = GDK_INPUT_OUTPUT;
|
||||
attr.x = 0;
|
||||
attr.y = 0;
|
||||
attr.width = width;
|
||||
attr.height = height;
|
||||
attr.window_type = GDK_WINDOW_TOPLEVEL;
|
||||
|
||||
return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
|
||||
&attr,
|
||||
0);
|
||||
&attr);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1362,8 +1336,7 @@ gdk_window_new_popup (GdkDisplay *display,
|
||||
attr.window_type = GDK_WINDOW_TEMP;
|
||||
|
||||
return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
|
||||
&attr,
|
||||
GDK_WA_X | GDK_WA_Y);
|
||||
&attr);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1395,8 +1368,7 @@ gdk_window_new_temp (GdkDisplay *display)
|
||||
attr.window_type = GDK_WINDOW_TEMP;
|
||||
|
||||
return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
|
||||
&attr,
|
||||
GDK_WA_X | GDK_WA_Y);
|
||||
&attr);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1428,7 +1400,7 @@ gdk_window_new_child (GdkWindow *parent,
|
||||
attr.height = position->height;
|
||||
attr.window_type = GDK_WINDOW_CHILD;
|
||||
|
||||
return gdk_window_new (parent, &attr, GDK_WA_X | GDK_WA_Y);
|
||||
return gdk_window_new (parent, &attr);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1460,7 +1432,7 @@ gdk_window_new_input (GdkWindow *parent,
|
||||
attr.height = position->height;
|
||||
attr.window_type = GDK_WINDOW_CHILD;
|
||||
|
||||
return gdk_window_new (parent, &attr, GDK_WA_X | GDK_WA_Y);
|
||||
return gdk_window_new (parent, &attr);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@ -1777,7 +1749,7 @@ gdk_window_ensure_native (GdkWindow *window)
|
||||
window, parent,
|
||||
screen,
|
||||
get_native_event_mask (window),
|
||||
NULL, 0);
|
||||
NULL);
|
||||
new_impl = window->impl;
|
||||
|
||||
parent->impl_window->native_children =
|
||||
|
@ -83,7 +83,7 @@ GdkCursor *_gdk_mir_cursor_new_for_name (GdkDisplay *display, const gchar *name)
|
||||
|
||||
const gchar *_gdk_mir_cursor_get_name (GdkCursor *cursor);
|
||||
|
||||
GdkWindowImpl *_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window, GdkWindowAttr *attributes, gint attributes_mask);
|
||||
GdkWindowImpl *_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window);
|
||||
|
||||
void _gdk_mir_window_impl_set_surface_state (GdkMirWindowImpl *impl, MirSurfaceState state);
|
||||
|
||||
|
@ -393,8 +393,7 @@ gdk_mir_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
//g_printerr ("gdk_mir_display_create_window_impl");
|
||||
//g_printerr (" window=%p", window);
|
||||
@ -404,7 +403,7 @@ gdk_mir_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
if (attributes->wclass == GDK_INPUT_OUTPUT)
|
||||
{
|
||||
window->impl = _gdk_mir_window_impl_new (display, window, attributes, attributes_mask);
|
||||
window->impl = _gdk_mir_window_impl_new (display, window);
|
||||
window->impl_window = window;
|
||||
}
|
||||
else /* attributes->wclass == GDK_INPUT_ONLY */
|
||||
|
@ -255,7 +255,7 @@ gdk_mir_screen_get_root_window (GdkScreen *screen)
|
||||
s->root_window->width = width;
|
||||
s->root_window->height = height;
|
||||
s->root_window->viewable = TRUE;
|
||||
s->root_window->impl = _gdk_mir_window_impl_new (s->display, s->root_window, NULL, 0);
|
||||
s->root_window->impl = _gdk_mir_window_impl_new (s->display, s->root_window);
|
||||
|
||||
return s->root_window;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ get_default_title (void)
|
||||
}
|
||||
|
||||
GdkWindowImpl *
|
||||
_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window, GdkWindowAttr *attributes, gint attributes_mask)
|
||||
_gdk_mir_window_impl_new (GdkDisplay *display, GdkWindow *window)
|
||||
{
|
||||
GdkMirWindowImpl *impl = g_object_new (GDK_TYPE_MIR_WINDOW_IMPL, NULL);
|
||||
|
||||
|
@ -124,8 +124,7 @@ void _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindowAttr *attributes);
|
||||
|
||||
/* Display methods - keymap */
|
||||
GdkKeymap * _gdk_quartz_display_get_keymap (GdkDisplay *display);
|
||||
|
@ -774,8 +774,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
GdkWindowImplQuartz *impl;
|
||||
GdkWindowImplQuartz *parent_impl;
|
||||
@ -834,9 +833,7 @@ _gdk_quartz_display_create_window_impl (GdkDisplay *display,
|
||||
window->width,
|
||||
window->height);
|
||||
|
||||
if (window->window_type == GDK_WINDOW_TEMP ||
|
||||
((attributes_mask & GDK_WA_TYPE_HINT) &&
|
||||
attributes->type_hint == GDK_WINDOW_TYPE_HINT_SPLASHSCREEN))
|
||||
if (window->window_type == GDK_WINDOW_TEMP)
|
||||
{
|
||||
style_mask = NSBorderlessWindowMask;
|
||||
}
|
||||
|
@ -137,8 +137,7 @@ void _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindowAttr *attributes);
|
||||
|
||||
GdkWindow *_gdk_wayland_display_get_selection_owner (GdkDisplay *display,
|
||||
GdkAtom selection);
|
||||
|
@ -657,8 +657,7 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
|
||||
GdkWindowImplWayland *impl;
|
||||
@ -3703,8 +3702,7 @@ gdk_wayland_window_new_subsurface (GdkDisplay *display,
|
||||
attr.window_type = GDK_WINDOW_SUBSURFACE;
|
||||
|
||||
return gdk_window_new (gdk_screen_get_root_window (gdk_display_get_default_screen (display)),
|
||||
&attr,
|
||||
GDK_WA_X | GDK_WA_Y);
|
||||
&attr);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -690,8 +690,7 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
HWND hwndNew;
|
||||
HANDLE hparent;
|
||||
@ -705,8 +704,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
|
||||
gint window_width, window_height;
|
||||
gint offset_x = 0, offset_y = 0;
|
||||
gint x, y, real_x = 0, real_y = 0;
|
||||
/* check consistency of redundant information */
|
||||
guint remaining_mask = attributes_mask;
|
||||
|
||||
g_return_if_fail (display == _gdk_display);
|
||||
|
||||
@ -719,22 +716,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay *display,
|
||||
(attributes->wclass == GDK_INPUT_OUTPUT ? "" : "input-only"))
|
||||
);
|
||||
|
||||
/* to ensure to not miss important information some additional check against
|
||||
* attributes which may silently work on X11 */
|
||||
if ((attributes_mask & GDK_WA_X) != 0)
|
||||
{
|
||||
g_assert (attributes->x == window->x);
|
||||
remaining_mask &= ~GDK_WA_X;
|
||||
}
|
||||
if ((attributes_mask & GDK_WA_Y) != 0)
|
||||
{
|
||||
g_assert (attributes->y == window->y);
|
||||
remaining_mask &= ~GDK_WA_Y;
|
||||
}
|
||||
|
||||
if (remaining_mask != 0)
|
||||
g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X", remaining_mask);
|
||||
|
||||
hparent = GDK_WINDOW_HWND (real_parent);
|
||||
|
||||
impl = g_object_new (GDK_TYPE_WINDOW_IMPL_WIN32, NULL);
|
||||
|
@ -272,8 +272,7 @@ void _gdk_x11_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask);
|
||||
GdkWindowAttr *attributes);
|
||||
|
||||
void _gdk_x11_precache_atoms (GdkDisplay *display,
|
||||
const gchar * const *atom_names,
|
||||
|
@ -899,8 +899,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *real_parent,
|
||||
GdkScreen *screen,
|
||||
GdkEventMask event_mask,
|
||||
GdkWindowAttr *attributes,
|
||||
gint attributes_mask)
|
||||
GdkWindowAttr *attributes)
|
||||
{
|
||||
GdkWindowImplX11 *impl;
|
||||
GdkX11Screen *x11_screen;
|
||||
|
Loading…
Reference in New Issue
Block a user