Toast allways centered on KDE-Wayland
the toast is always centered in screen on my arch-linux with kde and wayland. I have tested all 3 demo apps. How can i help you debugging the problem?
That's really odd, I'll definitely look into it
Could you run this code and tell me where the toasts are being displayed?
import sys
from PyQt6.QtWidgets import QMainWindow, QPushButton, QApplication
from pyqttoast import Toast, ToastPreset, ToastPosition
class Window(QMainWindow):
def __init__(self):
super().__init__(parent=None)
# Add button and connect click event
self.button = QPushButton(self)
self.button.setText('Show toast')
self.button.clicked.connect(self.show_toast)
# Shows a toast notification every time the button is clicked
def show_toast(self):
toast = Toast(self)
toast.setDuration(5000) # Hide after 5 seconds
toast.setTitle('Success! Confirmation email sent.')
toast.setText('Check your email to complete signup.')
toast.applyPreset(ToastPreset.SUCCESS) # Apply style preset
toast.setPosition(ToastPosition.BOTTOM_RIGHT)
toast.show()
# Run demo
if __name__ == '__main__':
app = QApplication(sys.argv)
window = Window()
window.show()
app.exec()
the toast is being displayed in the center of the screen with our code.
I found the issue. Wayland intentionally has no mechanism for applications to specify their window position, so it's not possible to move the toast into a specific position. Unfortunately, as far as I know, this cannot be fixed.
See https://github.com/libsdl-org/SDL/issues/7197 https://mir-server.io/docs/window-positions-under-wayland
that is sad. Just to be curious: desktopenvironments like kde are able to pop up the notification on any place the like on wayland because ... ?