diff --git a/src/chat.py b/src/chat.py index 5de6c1010..06770537c 100644 --- a/src/chat.py +++ b/src/chat.py @@ -808,9 +808,14 @@ class Chat: parent = self.message_textviews[jid] def set_emoticons_menu_position(w, parent=parent): window = parent.get_window(gtk.TEXT_WINDOW_WIDGET) + # get the window position origin = window.get_origin() size = window.get_size() - return (origin[0], origin[1] + size[1], 0) + buf = parent.get_buffer() + # get the cursor position + cursor = parent.get_iter_location(buf.get_iter_at_mark(buf.get_insert())) + cursor = parent.buffer_to_window_coords(gtk.TEXT_WINDOW_TEXT, cursor.x, cursor.y) + return (origin[0] + cursor[0], origin[1] + size[1], 0) self.emoticons_menu.popup(None, None, set_emoticons_menu_position, 1, 0) elif event.keyval == gtk.keysyms.Page_Down: if event.state & gtk.gdk.SHIFT_MASK: # SHIFT + PAGE DOWN diff --git a/src/gajim.py b/src/gajim.py index 3f376de62..76f8837c4 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -1110,6 +1110,7 @@ class Interface: emot_file = gajim.config.get_per('emoticons', emot, 'path') if not self.image_is_ok(emot_file): continue + # This avoids duplicated emoticons with the same image eg. :) and :-) if not emot_file in self.emoticons.values(): pix = gtk.gdk.pixbuf_new_from_file(emot_file) if emot_file.endswith('.gif'):