x11: round the scaled size *up* when we get a ConfigureNotify

Although we specify a resize increment to try and get a size that is
a multiple of the window scale, maximization typically wins
over the resize increment, so the window might be odd sized.

Round *up* in this case, rather than down, since it's better to
truncate a line or two at the bottom and right of the window rather
than have a line or two that we don't know what to do with.

https://bugzilla.gnome.org/show_bug.cgi?id=739750
This commit is contained in:
Owen W. Taylor 2014-11-06 16:17:33 -05:00 committed by Alexander Larsson
parent f5d96f7110
commit 608c25453b

View File

@ -767,8 +767,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
: ""));
if (window && GDK_WINDOW_TYPE (window) == GDK_WINDOW_ROOT)
{
window->width = xevent->xconfigure.width / window_impl->window_scale;
window->height = xevent->xconfigure.height / window_impl->window_scale;
window->width = (xevent->xconfigure.width + window_impl->window_scale - 1) / window_impl->window_scale;
window->height = (xevent->xconfigure.height + window_impl->window_scale - 1) / window_impl->window_scale;
_gdk_window_update_size (window);
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));
@ -793,8 +793,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
{
event->configure.type = GDK_CONFIGURE;
event->configure.window = window;
event->configure.width = xevent->xconfigure.width / window_impl->window_scale;
event->configure.height = xevent->xconfigure.height / window_impl->window_scale;
event->configure.width = (xevent->xconfigure.width + window_impl->window_scale - 1) / window_impl->window_scale;
event->configure.height = (xevent->xconfigure.height + window_impl->window_scale - 1) / window_impl->window_scale;
if (!xevent->xconfigure.send_event &&
!xevent->xconfigure.override_redirect &&
@ -826,8 +826,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
{
window->x = event->configure.x;
window->y = event->configure.y;
window->width = xevent->xconfigure.width / window_impl->window_scale;
window->height = xevent->xconfigure.height / window_impl->window_scale;
window->width = event->configure.width;
window->height = event->configure.height;
_gdk_window_update_size (window);
_gdk_x11_window_update_size (GDK_WINDOW_IMPL_X11 (window->impl));