desktop sharing bug fix

This commit is contained in:
ingvar1995 2017-10-08 00:39:08 +03:00
parent 24c8b18f7e
commit 5a5b0e9069
3 changed files with 11 additions and 2 deletions

View File

@ -153,6 +153,9 @@ class AV:
if state | TOXAV_FRIEND_CALL_STATE['ACCEPTING_V'] and call.out_video:
self.start_video_thread()
def is_video_call(self, number):
return self._calls[number].in_video
# -----------------------------------------------------------------------------------------------------------------
# Threads
# -----------------------------------------------------------------------------------------------------------------

View File

@ -816,7 +816,7 @@ class DesktopAreaSelectionWindow(RubberBandWindow):
rect = self.rubberband.geometry()
width, height = rect.width(), rect.height()
if width >= 8 and height >= 8:
self.parent.save(rect.x(), rect.y(), width, height)
self.parent.save(rect.x(), rect.y(), width - (width % 4), height - (height % 4))
self.close()

View File

@ -1281,11 +1281,17 @@ class Profile(basecontact.BaseContact, Singleton):
else:
text = QtWidgets.QApplication.translate("incoming_call", "Call finished")
self._screen.call_finished()
is_video = self._call.is_video_call(friend_number)
self._call.finish_call(friend_number, by_friend) # finish or decline call
if hasattr(self, '_call_widget'):
self._call_widget[friend_number].close()
del self._call_widget[friend_number]
threading.Timer(2.0, lambda: cv2.destroyWindow(str(friend_number))).start()
def destroy_window():
if is_video:
cv2.destroyWindow(str(friend_number))
threading.Timer(2.0, destroy_window).start()
friend = self.get_friend_by_number(friend_number)
friend.append_message(InfoMessage(text, time.time()))
if friend_number == self.get_active_number():