Don't follow the cursor when expanding to secondary palette.

This commit is contained in:
Marco Pesenti Gritti 2007-07-25 16:01:07 +02:00
parent 9731a93c3f
commit 01fbe53175
2 changed files with 13 additions and 3 deletions

1
NEWS
View File

@ -1,3 +1,4 @@
* Don't follow the cursor when expanding to secondary palette. (marco)
* #2370 Update spanish translation. (marco) * #2370 Update spanish translation. (marco)
* #2014 Add icons in the share dropdown in activities. (marco) * #2014 Add icons in the share dropdown in activities. (marco)

View File

@ -69,6 +69,8 @@ class Palette(gobject.GObject):
gobject.GObject.__init__(self) gobject.GObject.__init__(self)
self._full_request = [0, 0] self._full_request = [0, 0]
self._cursor_x = 0
self._cursor_y = 0
self._state = self._SECONDARY self._state = self._SECONDARY
self._invoker = None self._invoker = None
self._group_id = None self._group_id = None
@ -250,6 +252,12 @@ class Palette(gobject.GObject):
self._set_state(state) self._set_state(state)
def _update_cursor_position(self):
display = gtk.gdk.display_get_default()
screen, x, y, mask = display.get_pointer()
self._cursor_x = x
self._cursor_y = y
def _update_position(self): def _update_position(self):
x = y = 0 x = y = 0
@ -259,11 +267,11 @@ class Palette(gobject.GObject):
position = self._position position = self._position
if position == self.AT_CURSOR: if position == self.AT_CURSOR:
display = gtk.gdk.display_get_default()
screen, x, y, mask = display.get_pointer()
dist = style.PALETTE_CURSOR_DISTANCE dist = style.PALETTE_CURSOR_DISTANCE
rect = gtk.gdk.Rectangle(self._cursor_x - dist,
self._cursor_y - dist,
dist * 2, dist * 2)
rect = gtk.gdk.Rectangle(x - dist, y - dist, dist * 2, dist * 2)
x, y = self._get_at_cursor_position(rect) x, y = self._get_at_cursor_position(rect)
elif position == self.AROUND: elif position == self.AROUND:
x, y = self._get_around_position() x, y = self._get_around_position()
@ -282,6 +290,7 @@ class Palette(gobject.GObject):
if self._up: if self._up:
return return
self._update_cursor_position()
self._update_full_request() self._update_full_request()
self._invoker.connect_to_parent() self._invoker.connect_to_parent()