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 <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
Carlos Garnacho 2012-11-26 17:40:15 +01:00 committed by Simon Schampijer
parent 5a1b380dd6
commit 297cd72757

View File

@ -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)