I'm developing a note application with PySide6 on Ubuntu 22.04. The note windows should be like usual windows, but they should have no taskbar entry.
I tried already multiple approaches, including the answers from Hide PyQt app from taskbar. It seems they are fine for single window apps, but have some caveats for multi window apps. Here is how far I got:
import sys
from PySide6.QtWidgets import *
from PySide6.QtCore import *
from PySide6.QtGui import *
class NoteWindow(QFrame):
i = 1
def __init__(self):
super().__init__()
self.setWindowFlags(Qt.Tool)
self.setWindowTitle(str(self.i))
NoteWindow.i += 1
self.show()
app = QApplication([])
w1 = NoteWindow()
w2 = NoteWindow()
# close the app after 10 seconds
close_timer = QTimer()
close_timer.singleShot(10000, app.quit)
sys.exit(app.exec())
There is no taskbar entry, but the second window is always in front of the first one. I would like to have the clicked window in front (I think this is the usual window behavior).
Do you have any ideas? Ideally it should work cross-platform.