DnD overlay improvement

LP#249065 if composite is disable, dnd is flickering
This commit is contained in:
Emmanuel Bretelle 2008-07-16 20:17:53 +01:00
parent aeebfea852
commit d26fcec77e
1 changed files with 17 additions and 10 deletions

View File

@ -146,6 +146,7 @@ class TerminatorTerm (gtk.VBox):
self._vte.connect ("grab-focus", self.on_vte_focus)
self._vte.connect ("focus-out-event", self.on_vte_focus_out)
self._vte.connect ("focus-in-event", self.on_vte_focus_in)
self._vte.set_double_buffered(True)
exit_action = self.conf.exit_action
if exit_action == "restart":
@ -215,17 +216,12 @@ text/plain
alloc = widget.allocation
rect = gtk.gdk.Rectangle(0, 0, alloc.width, alloc.height)
widget.window.invalidate_rect(rect, True)
widget.window.process_updates(True)
context = widget.window.cairo_create()
if self.conf.use_theme_colors:
color = self._vte.get_style ().text[gtk.STATE_NORMAL]
else:
color = gtk.gdk.color_parse (self.conf.foreground_color)
context.set_source_rgba(color.red, color.green, color.blue, 0.5)
pos = self.get_location(widget, x, y)
topleft = (0,0)
topright = (alloc.width,0)
@ -247,12 +243,23 @@ text/plain
if pos == "bottom":
coord = (bottomleft, bottomright, middleright , middleleft)
widget.window.invalidate_rect(rect, True)
widget.window.process_updates(True)
context = widget.window.cairo_create()
context.push_group()
context.set_source_rgba(color.red, color.green, color.blue, 0.5)
if len(coord) > 0 :
context.move_to(coord[len(coord)-1][0],coord[len(coord)-1][1])
for i in coord:
context.line_to(i[0],i[1])
context.fill()
context.fill()
context.pop_group_to_source()
context.paint()
gtk.gdk.flush()
def on_drag_drop(self, widget, drag_context, x, y, time):
parent = widget.get_parent()