Clipboard fixes.

This commit is contained in:
Tomeu Vizoso
2006-12-14 13:50:42 +01:00
parent e68f0e00e9
commit cc39ef169f
3 changed files with 22 additions and 14 deletions
+10 -5
View File
@@ -139,9 +139,14 @@ class ClipboardBox(hippo.CanvasBox):
return True;
def motion_notify_event_cb(self, widget, event):
if not self._pressed_button:
return True
# if the mouse button is not pressed, no drag should occurr
if not event.state & gtk.gdk.BUTTON1_MASK:
self._pressed_button = None
return True
logging.debug("motion_notify_event_cb")
@@ -152,10 +157,10 @@ class ClipboardBox(hippo.CanvasBox):
y = event.y
state = event.state
if widget.drag_check_threshold(self._press_start_x,
self._press_start_y,
x,
y):
if widget.drag_check_threshold(int(self._press_start_x),
int(self._press_start_y),
int(x),
int(y)):
targets = self._get_targets_for_dnd(
self._last_clicked_icon.get_object_id())
+1 -2
View File
@@ -30,8 +30,7 @@ class ClipboardPanelWindow(PanelWindow):
# Offering dnd drags
self.drag_source_set(0, [], 0)
self.add_events(gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.POINTER_MOTION_MASK |
gtk.gdk.POINTER_MOTION_HINT_MASK)
gtk.gdk.POINTER_MOTION_HINT_MASK)
self.connect("motion_notify_event", box.motion_notify_event_cb)
self.connect("button_press_event", box.button_press_event_cb)
self.connect("drag_end", box.drag_end_cb)