Commit 5bf28a38 authored by Alexander Larsson's avatar Alexander Larsson

gdk: Drop support for native (and thus foreign) subwindows

We can't really support these on e.g. wayland anyway, and we're trying
to get rid of subwindow at totally in the long term, so lets drop this.
It allows us to drop a lot of complexity.
parent 5c3192c7
......@@ -385,11 +385,6 @@ _gdk_broadway_window_destroy (GdkWindow *window,
impl->id);
}
static void
gdk_broadway_window_destroy_foreign (GdkWindow *window)
{
}
/* This function is called when the XWindow is really gone.
*/
static void
......@@ -522,12 +517,6 @@ gdk_window_broadway_raise (GdkWindow *window)
{
}
static void
gdk_window_broadway_restack_under (GdkWindow *window,
GList *native_siblings /* in requested order, first is bottom-most */)
{
}
static void
gdk_window_broadway_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
......@@ -1012,18 +1001,6 @@ gdk_broadway_window_set_functions (GdkWindow *window,
return;
}
static cairo_region_t *
gdk_broadway_window_get_shape (GdkWindow *window)
{
return NULL;
}
static cairo_region_t *
gdk_broadway_window_get_input_shape (GdkWindow *window)
{
return NULL;
}
static void
gdk_broadway_window_end_paint (GdkWindow *window)
{
......@@ -1516,7 +1493,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->get_events = gdk_window_broadway_get_events;
impl_class->raise = gdk_window_broadway_raise;
impl_class->lower = gdk_window_broadway_lower;
impl_class->restack_under = gdk_window_broadway_restack_under;
impl_class->restack_toplevel = gdk_window_broadway_restack_toplevel;
impl_class->move_resize = gdk_window_broadway_move_resize;
impl_class->reparent = gdk_window_broadway_reparent;
......@@ -1527,9 +1503,6 @@ gdk_window_impl_broadway_class_init (GdkWindowImplBroadwayClass *klass)
impl_class->shape_combine_region = gdk_window_broadway_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_broadway_input_shape_combine_region;
impl_class->destroy = _gdk_broadway_window_destroy;
impl_class->destroy_foreign = gdk_broadway_window_destroy_foreign;
impl_class->get_shape = gdk_broadway_window_get_shape;
impl_class->get_input_shape = gdk_broadway_window_get_input_shape;
impl_class->end_paint = gdk_broadway_window_end_paint;
impl_class->beep = gdk_broadway_window_beep;
......
......@@ -316,13 +316,6 @@ gdk_pre_parse (void)
(GDebugKey *) gdk_vulkan_keys,
G_N_ELEMENTS (gdk_vulkan_keys));
if (getenv ("GDK_NATIVE_WINDOWS"))
{
g_warning ("The GDK_NATIVE_WINDOWS environment variable is not supported in GTK3.\n"
"See the documentation for gdk_window_ensure_native() on how to get native windows.");
g_unsetenv ("GDK_NATIVE_WINDOWS");
}
rendering_mode = g_getenv ("GDK_RENDERING");
if (rendering_mode)
{
......
......@@ -192,7 +192,6 @@ struct _GdkWindow
GList *filters;
GList *children;
GList children_list_node;
GList *native_children;
struct {
/* The temporary surface that we're painting to. This will be composited
......
This diff is collapsed.
......@@ -516,8 +516,6 @@ void gdk_window_move_region (GdkWindow *window,
const cairo_region_t *region,
gint dx,
gint dy);
GDK_AVAILABLE_IN_ALL
gboolean gdk_window_ensure_native (GdkWindow *window);
/*
* This allows for making shaped (partially transparent) windows
......
......@@ -63,8 +63,6 @@ struct _GdkWindowImplClass
void (* withdraw) (GdkWindow *window);
void (* raise) (GdkWindow *window);
void (* lower) (GdkWindow *window);
void (* restack_under) (GdkWindow *window,
GList *native_siblings);
void (* restack_toplevel) (GdkWindow *window,
GdkWindow *sibling,
gboolean above);
......@@ -114,8 +112,6 @@ struct _GdkWindowImplClass
gboolean (* begin_paint) (GdkWindow *window);
void (* end_paint) (GdkWindow *window);
cairo_region_t * (* get_shape) (GdkWindow *window);
cairo_region_t * (* get_input_shape) (GdkWindow *window);
void (* shape_combine_region) (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
......@@ -150,13 +146,6 @@ struct _GdkWindowImplClass
gboolean foreign_destroy);
/* Called when gdk_window_destroy() is called on a foreign window
* or an ancestor of the foreign window. It should generally reparent
* the window out of it's current heirarchy, hide it, and then
* send a message to the owner requesting that the window be destroyed.
*/
void (*destroy_foreign) (GdkWindow *window);
/* optional */
gboolean (* beep) (GdkWindow *window);
......
......@@ -731,14 +731,6 @@ gdk_mir_window_impl_lower (GdkWindow *window)
/* We don't support client window stacking */
}
static void
gdk_mir_window_impl_restack_under (GdkWindow *window,
GList *native_siblings)
{
//g_printerr ("gdk_mir_window_impl_restack_under window=%p\n", window);
/* We don't support client window stacking */
}
static void
gdk_mir_window_impl_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
......@@ -980,20 +972,6 @@ gdk_mir_window_impl_end_paint (GdkWindow *window)
send_buffer (window);
}
static cairo_region_t *
gdk_mir_window_impl_get_shape (GdkWindow *window)
{
//g_printerr ("gdk_mir_window_impl_get_shape window=%p\n", window);
return NULL;
}
static cairo_region_t *
gdk_mir_window_impl_get_input_shape (GdkWindow *window)
{
//g_printerr ("gdk_mir_window_impl_get_input_shape window=%p\n", window);
return NULL;
}
static void
gdk_mir_window_impl_shape_combine_region (GdkWindow *window,
const cairo_region_t *shape_region,
......@@ -1024,12 +1002,6 @@ gdk_mir_window_impl_destroy (GdkWindow *window,
ensure_no_surface (window);
}
static void
gdk_mir_window_impl_destroy_foreign (GdkWindow *window)
{
//g_printerr ("gdk_mir_window_impl_destroy_foreign window=%p\n", window);
}
static void
gdk_mir_window_impl_focus (GdkWindow *window,
guint32 timestamp)
......@@ -1695,7 +1667,6 @@ gdk_mir_window_impl_class_init (GdkMirWindowImplClass *klass)
impl_class->withdraw = gdk_mir_window_impl_withdraw;
impl_class->raise = gdk_mir_window_impl_raise;
impl_class->lower = gdk_mir_window_impl_lower;
impl_class->restack_under = gdk_mir_window_impl_restack_under;
impl_class->restack_toplevel = gdk_mir_window_impl_restack_toplevel;
impl_class->move_resize = gdk_mir_window_impl_move_resize;
impl_class->move_to_rect = gdk_mir_window_impl_move_to_rect;
......@@ -1708,12 +1679,9 @@ gdk_mir_window_impl_class_init (GdkMirWindowImplClass *klass)
impl_class->get_device_state = gdk_mir_window_impl_get_device_state;
impl_class->begin_paint = gdk_mir_window_impl_begin_paint;
impl_class->end_paint = gdk_mir_window_impl_end_paint;
impl_class->get_shape = gdk_mir_window_impl_get_shape;
impl_class->get_input_shape = gdk_mir_window_impl_get_input_shape;
impl_class->shape_combine_region = gdk_mir_window_impl_shape_combine_region;
impl_class->input_shape_combine_region = gdk_mir_window_impl_input_shape_combine_region;
impl_class->destroy = gdk_mir_window_impl_destroy;
impl_class->destroy_foreign = gdk_mir_window_impl_destroy_foreign;
impl_class->focus = gdk_mir_window_impl_focus;
impl_class->set_type_hint = gdk_mir_window_impl_set_type_hint;
impl_class->get_type_hint = gdk_mir_window_impl_get_type_hint;
......
......@@ -2752,20 +2752,6 @@ gdk_quartz_window_set_shadow_width (GdkWindow *window,
_gdk_quartz_window_update_has_shadow (impl);
}
static cairo_region_t *
gdk_quartz_window_get_shape (GdkWindow *window)
{
/* FIXME: implement */
return NULL;
}
static cairo_region_t *
gdk_quartz_window_get_input_shape (GdkWindow *window)
{
/* FIXME: implement */
return NULL;
}
/* Protocol to build cleanly for OSX < 10.7 */
@protocol ScaleFactor
- (CGFloat) backingScaleFactor;
......@@ -2817,8 +2803,6 @@ gdk_window_impl_quartz_class_init (GdkWindowImplQuartzClass *klass)
impl_class->input_shape_combine_region = gdk_window_quartz_input_shape_combine_region;
impl_class->destroy = gdk_quartz_window_destroy;
impl_class->destroy_foreign = gdk_quartz_window_destroy_foreign;
impl_class->get_shape = gdk_quartz_window_get_shape;
impl_class->get_input_shape = gdk_quartz_window_get_input_shape;
impl_class->begin_paint = gdk_window_impl_quartz_begin_paint;
impl_class->get_scale_factor = gdk_quartz_window_get_scale_factor;
......
......@@ -2566,12 +2566,6 @@ gdk_window_wayland_lower (GdkWindow *window)
{
}
static void
gdk_window_wayland_restack_under (GdkWindow *window,
GList *native_siblings)
{
}
static void
gdk_window_wayland_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
......@@ -2812,23 +2806,6 @@ gdk_wayland_window_destroy (GdkWindow *window,
drop_cairo_surfaces (window);
}
static void
gdk_window_wayland_destroy_foreign (GdkWindow *window)
{
}
static cairo_region_t *
gdk_wayland_window_get_shape (GdkWindow *window)
{
return NULL;
}
static cairo_region_t *
gdk_wayland_window_get_input_shape (GdkWindow *window)
{
return NULL;
}
static void
gdk_wayland_window_focus (GdkWindow *window,
guint32 timestamp)
......@@ -3617,7 +3594,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
impl_class->get_events = gdk_window_wayland_get_events;
impl_class->raise = gdk_window_wayland_raise;
impl_class->lower = gdk_window_wayland_lower;
impl_class->restack_under = gdk_window_wayland_restack_under;
impl_class->restack_toplevel = gdk_window_wayland_restack_toplevel;
impl_class->move_resize = gdk_window_wayland_move_resize;
impl_class->move_to_rect = gdk_window_wayland_move_to_rect;
......@@ -3629,9 +3605,6 @@ _gdk_window_impl_wayland_class_init (GdkWindowImplWaylandClass *klass)
impl_class->shape_combine_region = gdk_window_wayland_shape_combine_region;
impl_class->input_shape_combine_region = gdk_window_wayland_input_shape_combine_region;
impl_class->destroy = gdk_wayland_window_destroy;
impl_class->destroy_foreign = gdk_window_wayland_destroy_foreign;
impl_class->get_shape = gdk_wayland_window_get_shape;
impl_class->get_input_shape = gdk_wayland_window_get_input_shape;
impl_class->begin_paint = gdk_window_impl_wayland_begin_paint;
impl_class->end_paint = gdk_window_impl_wayland_end_paint;
impl_class->beep = gdk_window_impl_wayland_beep;
......
......@@ -951,9 +951,8 @@ gdk_win32_window_foreign_new_for_display (GdkDisplay *display,
impl->wrapper = window;
parent = GetParent (anid);
window->parent = gdk_win32_handle_table_lookup (parent);
if (!window->parent || GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_FOREIGN)
window->parent = gdk_get_default_root_window ();
/* Always treat foreigns as toplevels */
window->parent = gdk_get_default_root_window ();
window->parent->children = g_list_concat (&window->children_list_node, window->parent->children);
window->parent->impl_window->native_children =
......@@ -1040,18 +1039,6 @@ gdk_win32_window_destroy (GdkWindow *window,
}
}
static void
gdk_win32_window_destroy_foreign (GdkWindow *window)
{
/* It's somebody else's window, but in our hierarchy, so reparent it
* to the desktop, and then try to destroy it.
*/
gdk_window_hide (window);
gdk_window_reparent (window, NULL, 0, 0);
PostMessage (GDK_WINDOW_HWND (window), WM_CLOSE, 0, 0);
}
/* This function is called when the window really gone.
*/
static void
......@@ -2301,13 +2288,6 @@ gdk_win32_window_get_root_coords (GdkWindow *window,
(ty + _gdk_offset_y) / impl->window_scale));
}
static void
gdk_win32_window_restack_under (GdkWindow *window,
GList *native_siblings)
{
// ### TODO
}
static void
gdk_win32_window_restack_toplevel (GdkWindow *window,
GdkWindow *sibling,
......@@ -5595,35 +5575,6 @@ gdk_win32_window_set_opacity (GdkWindow *window,
}
}
static cairo_region_t *
gdk_win32_window_get_shape (GdkWindow *window)
{
HRGN hrgn = CreateRectRgn (0, 0, 0, 0);
int type = GetWindowRgn (GDK_WINDOW_HWND (window), hrgn);
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (type == SIMPLEREGION || type == COMPLEXREGION)
{
cairo_region_t *region = _gdk_win32_hrgn_to_region (hrgn, impl->window_scale);
DeleteObject (hrgn);
return region;
}
return NULL;
}
static void
gdk_win32_input_shape_combine_region (GdkWindow *window,
const cairo_region_t *shape_region,
gint offset_x,
gint offset_y)
{
/* Partial input shape support is implemented by handling the
* WM_NCHITTEST message.
*/
}
gboolean
gdk_win32_window_is_win32 (GdkWindow *window)
{
......@@ -6058,7 +6009,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
impl_class->get_events = gdk_win32_window_get_events;
impl_class->raise = gdk_win32_window_raise;
impl_class->lower = gdk_win32_window_lower;
impl_class->restack_under = gdk_win32_window_restack_under;
impl_class->restack_toplevel = gdk_win32_window_restack_toplevel;
impl_class->move_resize = gdk_win32_window_move_resize;
impl_class->reparent = gdk_win32_window_reparent;
......@@ -6070,9 +6020,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
impl_class->shape_combine_region = gdk_win32_window_shape_combine_region;
impl_class->input_shape_combine_region = gdk_win32_input_shape_combine_region;
impl_class->destroy = gdk_win32_window_destroy;
impl_class->destroy_foreign = gdk_win32_window_destroy_foreign;
impl_class->get_shape = gdk_win32_window_get_shape;
//FIXME?: impl_class->get_input_shape = gdk_win32_window_get_input_shape;
impl_class->begin_paint = gdk_win32_window_begin_paint;
impl_class->end_paint = gdk_win32_window_end_paint;
......@@ -6135,10 +6082,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
HGDIOBJ
gdk_win32_window_get_handle (GdkWindow *window)
{
/* Try to ensure the window has a native window */
if (!_gdk_window_has_impl (window))
gdk_window_ensure_native (window);
if (!GDK_WINDOW_IS_WIN32 (window))
{
g_warning (G_STRLOC " window is not a native Win32 window");
......
......@@ -35,50 +35,6 @@ struct _GdkWindowQueueItem
cairo_region_t *antiexpose_area;
};
void
_gdk_x11_window_move_resize_child (GdkWindow *window,
gint x,
gint y,
gint width,
gint height)
{
GdkWindowImplX11 *impl;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (width * impl->window_scale > 65535 ||
height * impl->window_scale > 65535)
{
g_warning ("Native children wider or taller than 65535 pixels are not supported");
if (width * impl->window_scale > 65535)
width = 65535 / impl->window_scale;
if (height * impl->window_scale > 65535)
height = 65535 / impl->window_scale;
}
window->x = x;
window->y = y;
impl->unscaled_width = width * impl->window_scale;
impl->unscaled_height = height * impl->window_scale;
window->width = width;
window->height = height;
/* We don't really care about origin overflow, because on overflow
* the window won't be visible anyway and thus it will be shaped
* to nothing
*/
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
(window->x + window->parent->abs_x) * impl->window_scale,
(window->y + window->parent->abs_y) * impl->window_scale,
width * impl->window_scale,
height * impl->window_scale);
}
static Bool
expose_serial_predicate (Display *xdisplay,
XEvent *xev,
......
......@@ -70,11 +70,6 @@ gint _gdk_x11_display_send_xevent (GdkDisplay *display,
XEvent *event_send);
/* Routines from gdkgeometry-x11.c */
void _gdk_x11_window_move_resize_child (GdkWindow *window,
gint x,
gint y,
gint width,
gint height);
void _gdk_x11_window_process_expose (GdkWindow *window,
gulong serial,
GdkRectangle *area);
......
......@@ -525,7 +525,11 @@ _gdk_x11_window_change_property (GdkWindow *window,
if (GDK_WINDOW_DESTROYED (window))
return;
gdk_window_ensure_native (window);
if (!gdk_window_has_native (window))
{
g_warning ("Can't change property on non-native window");
return;
}
display = gdk_window_get_display (window);
xproperty = gdk_x11_atom_to_xatom_for_display (display, property);
......
......@@ -121,7 +121,11 @@ _gdk_x11_display_set_selection_owner (GdkDisplay *display,
if (GDK_WINDOW_DESTROYED (owner) || !GDK_WINDOW_IS_X11 (owner))
return FALSE;
gdk_window_ensure_native (owner);
if (!gdk_window_has_native (owner))
{
g_warning ("Can't use selectors on non-native window");
return FALSE;
}
xdisplay = GDK_WINDOW_XDISPLAY (owner);
xwindow = GDK_WINDOW_XID (owner);
}
......@@ -191,7 +195,11 @@ _gdk_x11_display_convert_selection (GdkDisplay *display,
if (GDK_WINDOW_DESTROYED (requestor) || !GDK_WINDOW_IS_X11 (requestor))
return;
gdk_window_ensure_native (requestor);
if (!gdk_window_has_native (requestor))
{
g_warning ("Can't use selections on non-native window");
return;
}
XConvertSelection (GDK_WINDOW_XDISPLAY (requestor),
gdk_x11_atom_to_xatom_for_display (display, selection),
......
......@@ -943,6 +943,11 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
/* The common code warns for this case */
xparent = GDK_SCREEN_XROOTWIN (screen);
}
break;
case GDK_WINDOW_CHILD:
g_assert_not_reached ();
break;
}
if (!window->input_only)
......@@ -1037,8 +1042,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay *display,
connect_frame_clock (window);
if (GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD)
gdk_window_freeze_toplevel_updates (window);
gdk_window_freeze_toplevel_updates (window);
}
static GdkEventMask
......@@ -1124,14 +1128,10 @@ gdk_x11_window_foreign_new_for_display (GdkDisplay *display,
impl->wrapper = win;
impl->window_scale = GDK_X11_SCREEN (screen)->window_scale;
win->parent = gdk_x11_window_lookup_for_display (display, parent);
if (!win->parent || GDK_WINDOW_TYPE (win->parent) == GDK_WINDOW_FOREIGN)
win->parent = gdk_screen_get_root_window (screen);
/* Always treat foreigns as toplevels */
win->parent = gdk_screen_get_root_window (screen);
win->parent->children = g_list_concat (&win->children_list_node, win->parent->children);
win->parent->impl_window->native_children =
g_list_prepend (win->parent->impl_window->native_children, win);
impl->xid = window;
......@@ -1224,46 +1224,6 @@ gdk_x11_window_destroy (GdkWindow *window,
XDestroyWindow (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window));
}
static void
gdk_x11_window_destroy_foreign (GdkWindow *window)
{
/* It's somebody else's window, but in our hierarchy,
* so reparent it to the root window, and then send
* it a delete event, as if we were a WM
*/
XClientMessageEvent xclient;
GdkDisplay *display;
display = GDK_WINDOW_DISPLAY (window);
gdk_x11_display_error_trap_push (display);
gdk_window_hide (window);
gdk_window_reparent (window, NULL, 0, 0);
memset (&xclient, 0, sizeof (xclient));
xclient.type = ClientMessage;
xclient.window = GDK_WINDOW_XID (window);
xclient.message_type = gdk_x11_get_xatom_by_name_for_display (display, "WM_PROTOCOLS");
xclient.format = 32;
xclient.data.l[0] = gdk_x11_get_xatom_by_name_for_display (display, "WM_DELETE_WINDOW");
xclient.data.l[1] = CurrentTime;
xclient.data.l[2] = 0;
xclient.data.l[3] = 0;
xclient.data.l[4] = 0;
XSendEvent (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
False, 0, (XEvent *)&xclient);
gdk_x11_display_error_trap_pop_ignored (display);
}
static GdkWindow *
get_root (GdkWindow *window)
{
GdkScreen *screen = gdk_window_get_screen (window);
return gdk_screen_get_root_window (screen);
}
/* This function is called when the XWindow is really gone.
*/
static void
......@@ -1531,34 +1491,6 @@ gdk_window_x11_show (GdkWindow *window, gboolean already_mapped)
gdk_x11_window_apply_fullscreen_mode (window);
}
static void
post_unmap (GdkWindow *window)
{
GdkWindow *start_window = NULL;
if (window->input_only)
return;
if (window->window_type == GDK_WINDOW_CHILD)
start_window = _gdk_window_get_impl_window ((GdkWindow *)window->parent);
else if (window->window_type == GDK_WINDOW_TEMP)
start_window = get_root (window);
if (start_window)
{
if (window->window_type == GDK_WINDOW_CHILD && window->parent)
{
GdkRectangle invalid_rect;
gdk_window_get_position (window, &invalid_rect.x, &invalid_rect.y);
invalid_rect.width = gdk_window_get_width (window);
invalid_rect.height = gdk_window_get_height (window);
gdk_window_invalidate_rect ((GdkWindow *)window->parent,
&invalid_rect, TRUE);
}
}
}
static void
gdk_window_x11_hide (GdkWindow *window)
{
......@@ -1587,7 +1519,6 @@ gdk_window_x11_hide (GdkWindow *window)
XUnmapWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window));
post_unmap (window);
}
static void
......@@ -1604,8 +1535,6 @@ gdk_window_x11_withdraw (GdkWindow *window)
XWithdrawWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), 0);
post_unmap (window);
}
}
......@@ -1616,25 +1545,14 @@ window_x11_move (GdkWindow *window,
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
{
/* The window isn't actually damaged, but it's parent is */
window_pre_damage (window);
_gdk_x11_window_move_resize_child (window,
x, y,
window->width, window->height);
}
else
{
XMoveWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
x * impl->window_scale, y * impl->window_scale);
XMoveWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
x * impl->window_scale, y * impl->window_scale);
if (impl->override_redirect)
{
window->x = x;
window->y = y;
}
if (impl->override_redirect)
{
window->x = x;
window->y = y;
}
}
......@@ -1643,6 +1561,8 @@ window_x11_resize (GdkWindow *window,
gint width,
gint height)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (width < 1)
width = 1;
......@@ -1651,33 +1571,22 @@ window_x11_resize (GdkWindow *window,
window_pre_damage (window);
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
XResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
width * impl->window_scale, height * impl->window_scale);
if (impl->override_redirect)
{
_gdk_x11_window_move_resize_child (window,
window->x, window->y,
width, height);
impl->unscaled_width = width * impl->window_scale;
impl->unscaled_height = height * impl->window_scale;
window->width = width;
window->height = height;
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
XResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
width * impl->window_scale, height * impl->window_scale);
if (impl->override_redirect)
{
impl->unscaled_width = width * impl->window_scale;
impl->unscaled_height = height * impl->window_scale;
window->width = width;
window->height = height;
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
}
else
{
if (width * impl->window_scale != impl->unscaled_width || height * impl->window_scale != impl->unscaled_height)
window->resize_count += 1;
}
if (width * impl->window_scale != impl->unscaled_width || height * impl->window_scale != impl->unscaled_height)
window->resize_count += 1;
}
}
......@@ -1688,6 +1597,8 @@ window_x11_move_resize (GdkWindow *window,
gint width,
gint height)
{
GdkWindowImplX11 *impl = GDK_WINDOW_IMPL_X11 (window->impl);
if (width < 1)
width = 1;
......@@ -1696,37 +1607,27 @@ window_x11_move_resize (GdkWindow *window,
window_pre_damage (window);
if (GDK_WINDOW_TYPE (window) == GDK_WINDOW_CHILD)
XMoveResizeWindow (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window),
x * impl->window_scale, y * impl->window_scale,
width * impl->window_scale, height * impl->window_scale);
if (impl->override_redirect)
{
_gdk_x11_window_move_resize_child (window, x, y, width, height);
window->x = x;
window->y = y;
impl->unscaled_width = width * impl->window_scale;