fixed focus bug of CTk and CTkToplevel on macOS

This commit is contained in:
Tom Schimansky
2022-10-22 01:20:08 +02:00
parent 2288c255ac
commit 9d7eca7bb1
7 changed files with 64 additions and 38 deletions

View File

@ -70,9 +70,9 @@ class CTkToplevel(tkinter.Toplevel):
self.bind('<FocusIn>', self._focus_in_event)
def _focus_in_event(self, event):
# sometimes window looses focus on macOS if window is selected from Mission Control, so focus has to be forced again
# sometimes window looses jumps back on macOS if window is selected from Mission Control, so has to be lifted again
if sys.platform == "darwin":
self.focus_force()
self.lift()
def _update_dimensions_event(self, event=None):
detected_width = self.winfo_width() # detect current window size