Merge pull request #716 from mattrose/714-fixdadt

Remove hack to ensure that focus is set.
This commit is contained in:
Matt Rose 2023-03-09 17:11:02 -05:00 committed by GitHub
commit 3d79ca5072
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 14 deletions

View File

@ -312,6 +312,7 @@ class Terminator(Borg):
"""Layout operations have finished, record that fact""" """Layout operations have finished, record that fact"""
self.doing_layout = False self.doing_layout = False
maker = Factory() maker = Factory()
t = 0
window_last_active_term_mapping = {} window_last_active_term_mapping = {}
for window in self.windows: for window in self.windows:
@ -349,22 +350,12 @@ class Terminator(Borg):
t = 0 t = 0
window.get_window().focus(t) window.get_window().focus(t)
# Awful workaround to be sure that the last focused window is actually the one focused. # Going by the docs, this should be all that's needed to ensure that the
# Don't ask, don't tell policy on this. Even this is not 100% # last_active_window is focussed.
if self.last_active_window: if self.last_active_window:
window = self.find_window_by_uuid(self.last_active_window.urn) window = self.find_window_by_uuid(self.last_active_window.urn)
count = 0 window.present_with_time(t)
while count < 1000 and Gtk.events_pending(): window.set_focus()
count += 1
Gtk.main_iteration_do(False)
window.show()
window.grab_focus()
try:
t = GdkX11.x11_get_server_time(window.get_window())
except (NameError,TypeError, AttributeError):
t = 0
window.get_window().focus(t)
self.prelayout_windows = None self.prelayout_windows = None
def on_gtk_theme_name_notify(self, settings, prop): def on_gtk_theme_name_notify(self, settings, prop):