Skip to content

Commit

Permalink
fix(gui): second instance triggers second capture window #580
Browse files Browse the repository at this point in the history
  • Loading branch information
dynobo committed Jan 14, 2024
1 parent e221fdc commit 9050099
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

# Changelog

## v0.5.4 (upcoming)
## v0.5.4 (2024-01-15)

- All: Fix duplicate capture window if started twice
([#580](https://github.com/dynobo/normcap/issues/580))
- Linux: Improve robustness of window positioning on Wayland.
- Linux: Improve debug output regarding clipboard methods.
([#581](https://github.com/dynobo/normcap/issues/581))

## v0.5.3 (2024-01-04)

Expand Down
5 changes: 5 additions & 0 deletions normcap/gui/tray.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,14 @@ def _on_ready_read(self) -> None:
"""Process messages received from other NormCap instances."""
if not self._socket_in:
return

message = self._socket_in.readAll()
# TODO: Test if `is message` check is necessary
if message and message.data().decode("utf-8", errors="ignore") == "capture":
logger.info("Received socket signal to capture.")
if self.windows:
logger.debug("Capture window(s) already open. Doing nothing.")
return
self._show_windows(delay_screenshot=True)

@QtCore.Slot(QtWidgets.QSystemTrayIcon.ActivationReason)
Expand Down

0 comments on commit 9050099

Please sign in to comment.