Skip to content

Commit

Permalink
Revert "Don't temporarily deactivate Crystal when LoadUrlsProgressDia…
Browse files Browse the repository at this point in the history
…log closes on Windows"

This reverts commit d837ac5.

Fixes segfault on Windows when running tests like:
$ crystal --test crystal.tests.test_load_urls
  • Loading branch information
davidfstr committed Jan 19, 2024
1 parent 30804af commit f729c83
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
2 changes: 0 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ Release Notes ⋮

* Fixes
* Fix disappearance of error nodes when new root URL or group is added.
* Fix flicker effect related to the Crystal app deactivating momentarily
when the "Loading URLs..." dialog closes on Windows.

### v1.7.0b (December 18, 2023)

Expand Down
7 changes: 0 additions & 7 deletions src/crystal/browser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from crystal.progress import (
CancelLoadUrls,
DummyOpenProjectProgressListener,
LoadUrlsProgressDialog,
OpenProjectProgressListener,
)
from crystal.server import ProjectServer
Expand Down Expand Up @@ -126,12 +125,6 @@ def __init__(self,
min_height = task_pane.GetBestSize().Height * 2
raw_frame.MinSize = wx.Size(min_width, min_height)

# Attach Project's LoadUrlsProgressListener to main window's frame
# HACK: Is using private API of Project
load_urls_progress_listener = project._load_urls_progress_listener
if isinstance(load_urls_progress_listener, LoadUrlsProgressDialog):
load_urls_progress_listener.parent = raw_frame

self._frame = raw_frame
except:
raw_frame.Destroy()
Expand Down
3 changes: 0 additions & 3 deletions src/crystal/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ class _AbstractProgressDialog:
_dialog_title: str # abstract
_CancelException: Type[Exception] # abstract

parent: Optional[wx.Window]
_dialog_style: Optional[int]
_dialog: Optional[wx.ProgressDialog]

def __init__(self) -> None:
self.parent = None
self._dialog_style = None
self._dialog = None
self.reset()
Expand Down Expand Up @@ -71,7 +69,6 @@ def _update_can_cancel(self, can_cancel: bool, new_message: str) -> None:
# TODO: Shouldn't the maximum of the previous dialog version,
# if any, be preserved here?
maximum=1,
parent=self.parent,
style=new_style
)
self._dialog.Name = new_name
Expand Down

0 comments on commit f729c83

Please sign in to comment.