Skip to content

Commit

Permalink
fix(gui): delay window movement to make it more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
dynobo committed Jan 19, 2024
1 parent 669a51b commit a7c0f22
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions normcap/gui/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ def move_windows_via_window_calls_extension(title_id: str, position: Rect) -> bo
window_title = response[0]
if window_title == title_id:
window_id = window["id"]
break

response = proxy.move_resize(
window_id,
Expand Down
8 changes: 5 additions & 3 deletions normcap/gui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,13 @@ def set_fullscreen(self) -> None:

self.showFullScreen()

if system_info.display_manager_is_wayland():
self._move_to_position_on_wayland()

self.setFocus()

if system_info.display_manager_is_wayland():
# Movement is delayed to ensure the window is fully active and
# registered within the window manager
QtCore.QTimer.singleShot(20, lambda: self._move_to_position_on_wayland())

def clear_selection(self) -> None:
self.selection_rect = QtCore.QRect()
self.ui_container.rect = self.selection_rect
Expand Down

0 comments on commit a7c0f22

Please sign in to comment.