Beispiel #1
0
 def onMpvIdle(self):
     w = self._activeWindowOnPlay
     if not self.app.activeWindow() and w and not sip.isdeleted(
             w) and w.isVisible():
         w.activateWindow()
         w.raise_()
     self._activeWindowOnPlay = None
Beispiel #2
0
 def on_av_player_did_end_playing(self, player: Any) -> None:
     "Restore window focus after a video was played."
     w = self._activeWindowOnPlay
     if not self.app.activeWindow() and w and not sip.isdeleted(w) and w.isVisible():
         w.activateWindow()
         w.raise_()
     self._activeWindowOnPlay = None
Beispiel #3
0
 def _shouldIgnoreWebEvent(self):
     # async web events may be received after the profile has been closed
     # or the underlying webview has been deleted
     from aqt import mw
     if sip.isdeleted(self):
         return True
     if not mw.col and self.requiresCol:
         return True
     return False
Beispiel #4
0
 def hideCompleter(self):
     if sip.isdeleted(self.completer):
         return
     self.completer.popup().hide()
Beispiel #5
0
 def onMpvIdle(self):
     w = self._activeWindowOnPlay
     if not self.app.activeWindow() and w and not sip.isdeleted(w) and w.isVisible():
         w.activateWindow()
         w.raise_()
     self._activeWindowOnPlay = None