Skip to content

Commit b2ee7a3

Browse files
authored
Merge pull request #8394 from languitar/qt5-wm-class
ENH: Unify WM_CLASS across backends
2 parents 0c9f7c2 + 46001b8 commit b2ee7a3

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

lib/matplotlib/backends/backend_gtk.py

+1
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ def __init__(self, canvas, num):
560560
FigureManagerBase.__init__(self, canvas, num)
561561

562562
self.window = gtk.Window()
563+
self.window.set_wmclass("matplotlib", "Matplotlib")
563564
self.set_window_title("Figure %d" % num)
564565
if window_icon:
565566
try:

lib/matplotlib/backends/backend_gtk3.py

+1
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,7 @@ def __init__(self, canvas, num):
399399
FigureManagerBase.__init__(self, canvas, num)
400400

401401
self.window = Gtk.Window()
402+
self.window.set_wmclass("matplotlib", "Matplotlib")
402403
self.set_window_title("Figure %d" % num)
403404
try:
404405
self.window.set_icon_from_file(window_icon)

lib/matplotlib/backends/backend_qt5.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _create_qApp():
143143
if display is None or not re.search(r':\d', display):
144144
raise RuntimeError('Invalid DISPLAY variable')
145145

146-
qApp = QtWidgets.QApplication([str(" ")])
146+
qApp = QtWidgets.QApplication(["matplotlib"])
147147
qApp.lastWindowClosed.connect(qApp.quit)
148148
else:
149149
qApp = app

lib/matplotlib/backends/backend_tkagg.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def new_figure_manager_given_figure(num, figure):
8686
Create a new figure manager instance for the given figure.
8787
"""
8888
_focus = windowing.FocusManager()
89-
window = Tk.Tk()
89+
window = Tk.Tk(className="matplotlib")
9090
window.withdraw()
9191

9292
if Tk.TkVersion >= 8.5:

0 commit comments

Comments
 (0)