Skip to content

Commit

Permalink
fix: Prevent abort on cancelling record/capture (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Dec 2, 2020
1 parent e2f596b commit 09ef590
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Fixed
- Prevent abort on cancelling record/capture ([#3](/~https://github.com/orhun/menyoki/issues/3))

## [0.1.4] - 2020-12-02
### Added
Expand Down
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ fn main() -> AppResult {
.expect("Failed to initialize the logger");
settings.check();
let window = if settings.window_required {
WindowSystem::init(&settings)
if let Some(window) = WindowSystem::init(&settings)
.expect("Failed to access the window system")
.get_window()
{
Some(window)
} else {
return Ok(());
}
} else {
None
};
Expand Down
5 changes: 3 additions & 2 deletions src/x11/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,9 @@ impl Display {
trace!("{:?}", input_state);
debug!("Selected window: {:?}", xid);
self.ungrab_keys(xid);
if self.settings.border.is_some()
|| (self.settings.border.is_none() && self.settings.time.countdown == 0)
if (self.settings.border.is_some()
|| (self.settings.border.is_none() && self.settings.time.countdown == 0))
&& xid.is_some()
{
window.clear_area();
window.show_text(Some(String::from(" ")), FpsClock::new(1000));
Expand Down

0 comments on commit 09ef590

Please sign in to comment.