Show incoming fight reactions on unfocused visible players
This commit is contained in:
@@ -6,7 +6,7 @@ import wave
|
||||
|
||||
from PyQt6.QtCore import Qt, QTimer, QPropertyAnimation, QVariantAnimation, QPoint, QEasingCurve, QEvent
|
||||
from PyQt6.QtGui import QPainter, QPainterPath, QFont, QColor, QPen, QLinearGradient, QTransform
|
||||
from PyQt6.QtWidgets import QApplication, QWidget, QFrame, QLabel, QHBoxLayout, QVBoxLayout
|
||||
from PyQt6.QtWidgets import QWidget, QFrame, QLabel, QHBoxLayout, QVBoxLayout
|
||||
|
||||
|
||||
REACTIONS = {
|
||||
@@ -157,11 +157,7 @@ class RingsideStrip(QWidget):
|
||||
if kind not in REACTIONS or not self.video_frame.isVisible():
|
||||
return False
|
||||
owner = self.video_frame.window()
|
||||
# Avoid displaying an always-on-top effect over another application.
|
||||
active = QApplication.activeWindow()
|
||||
while active is not None and active is not owner:
|
||||
active = active.parentWidget()
|
||||
if active is None or owner.isMinimized():
|
||||
if owner.isMinimized():
|
||||
return False
|
||||
if self.owner_window is not owner:
|
||||
if self.owner_window is not None:
|
||||
@@ -211,7 +207,9 @@ class RingsideStrip(QWidget):
|
||||
|
||||
def eventFilter(self, watched, event):
|
||||
if self.isVisible():
|
||||
if event.type() in (QEvent.Type.Hide, QEvent.Type.WindowDeactivate, QEvent.Type.Close):
|
||||
if event.type() in (QEvent.Type.Hide, QEvent.Type.Close):
|
||||
self.dismiss()
|
||||
elif event.type() == QEvent.Type.WindowStateChange and self.owner_window.isMinimized():
|
||||
self.dismiss()
|
||||
elif event.type() in (QEvent.Type.Move, QEvent.Type.Resize):
|
||||
self.slide.stop()
|
||||
|
||||
Reference in New Issue
Block a user