From 297cd72757f6ac6784af6689a74a7680a0c77857 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Mon, 26 Nov 2012 17:40:15 +0100 Subject: [PATCH] window: Avoid odd scrolling on OSK presence Now it suffices to have the widget and osk rectangles intersect, to have "clear-request-area" emitted, so cater for the situations where the focus rect lies outside the osk area. Signed-off-by: Carlos Garnacho Acked-by: Simon Schampijer --- src/sugar3/graphics/window.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sugar3/graphics/window.py b/src/sugar3/graphics/window.py index d7547951..6f19ad71 100644 --- a/src/sugar3/graphics/window.py +++ b/src/sugar3/graphics/window.py @@ -297,11 +297,18 @@ class Window(Gtk.Window): def __request_clear_area_cb(self, activity, osk_rect, cursor_rect): self._clear_area_dy = cursor_rect.y + cursor_rect.height - osk_rect.y + + if self._clear_area_dy < 0: + self._clear_area_dy = 0 + return False + self.queue_resize() + return True def __unset_clear_area_cb(self, activity, snap_back): self._clear_area_dy = 0 self.queue_resize() + return True def __size_allocate_cb(self, widget, allocation): self.set_allocation(allocation)