Skip to content

Commit cf28a8e

Browse files
committed
Merge remote-tracking branch 'origin/dev' into fix-windows-white-flash
2 parents 2e26c91 + 3c2b444 commit cf28a8e

File tree

17 files changed

+319
-46
lines changed

17 files changed

+319
-46
lines changed

.github/workflows/covector-version-or-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ jobs:
5252
labels: "version updates"
5353
branch: "release"
5454
body: ${{ steps.covector.outputs.change }}
55+
sign-commits: true

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## \[0.34.5]
4+
5+
- [`92e22209`](https://github.com/tauri-apps/tao/commit/92e22209fb58248449175b5b86697243d6a93db2) ([#1152](https://github.com/tauri-apps/tao/pull/1152) by [@lucasfernog](https://github.com/tauri-apps/tao/../../lucasfernog)) Emit `Event::LoopDestroyed` on activity destroy on Android.
6+
- [`da1514be`](https://github.com/tauri-apps/tao/commit/da1514be09993ea4aace8c64cfdf0af14f22b818) ([#1150](https://github.com/tauri-apps/tao/pull/1150) by [@Legend-Master](https://github.com/tauri-apps/tao/../../Legend-Master)) Fix maximized windows have empty edges when using auto hide task bar on Windows
7+
8+
## \[0.34.4]
9+
10+
- [`25f2c58a`](https://github.com/tauri-apps/tao/commit/25f2c58aca96215113d1a4feae5c854e3349cf06) ([#1148](https://github.com/tauri-apps/tao/pull/1148) by [@lucasfernog](https://github.com/tauri-apps/tao/../../lucasfernog)) Trigger `WindowEvent::Destroyed` when the Android activity is destroyed. In this case, the app should either exit by setting the control flow to `ControlFlow::ExitWithCode` or NOT call the create() external function when the activity is recreated and `onCreate` is called, handling how to recreate the app window via a separate hook that can leverage the existing tao event loop.
11+
12+
## \[0.34.3]
13+
14+
- [`0defcd01`](https://github.com/tauri-apps/tao/commit/0defcd015c615b95f42ce3437b06174816f76602) ([#1132](https://github.com/tauri-apps/tao/pull/1132) by [@Legend-Master](https://github.com/tauri-apps/tao/../../Legend-Master)) Exclude audit PDF file from the crate published to crates.io
15+
- [`3969a1a4`](https://github.com/tauri-apps/tao/commit/3969a1a45cfe2e173431eb1134b49e03c30bdc32) ([#1138](https://github.com/tauri-apps/tao/pull/1138) by [@aspcartman](https://github.com/tauri-apps/tao/../../aspcartman)) On macOS, fixed an issue that caused the window background color to be applied incorrectly (typically black).
16+
- [`28f5a96a`](https://github.com/tauri-apps/tao/commit/28f5a96a7d80859d97a84586b6c68fd4daac05d4) ([#1119](https://github.com/tauri-apps/tao/pull/1119) by [@Legend-Master](https://github.com/tauri-apps/tao/../../Legend-Master)) Fix `WindowEvent::MouseWheel` doesn't account for mouse wheel speed settings
17+
- [`a1edbeb4`](https://github.com/tauri-apps/tao/commit/a1edbeb448d1104b8e9dd3181a04d45ff846a397) ([#1126](https://github.com/tauri-apps/tao/pull/1126) by [@Legend-Master](https://github.com/tauri-apps/tao/../../Legend-Master)) Emit `Event::LoopDestroyed` on receiving `WM_ENDSESSION` message on Windows
18+
19+
## \[0.34.2]
20+
21+
- [`60a47340`](https://github.com/tauri-apps/tao/commit/60a47340c967eaaf5b4a41f0be6708d6daf950e3) ([#1108](https://github.com/tauri-apps/tao/pull/1108) by [@Simon-Laux](https://github.com/tauri-apps/tao/../../Simon-Laux)) feat: MacOS: add universal applink support
22+
by implementing `application:willContinueUserActivityWithType:` and `application:continueUserActivity:restorationHandler:`,
23+
reusing the existing `Event::Opened { urls }` event for the user facing api.
24+
25+
## \[0.34.1]
26+
27+
- [`f73c70fd`](https://github.com/tauri-apps/tao/commit/f73c70fd870016dc1298599cdbc9bcaa8db5d7bf) ([#1120](https://github.com/tauri-apps/tao/pull/1120) by [@robertrpf](https://github.com/tauri-apps/tao/../../robertrpf)) Added `WindowBuilder::with_focusable` to allow creating unfocusable windows.
28+
- [`f73c70fd`](https://github.com/tauri-apps/tao/commit/f73c70fd870016dc1298599cdbc9bcaa8db5d7bf) ([#1120](https://github.com/tauri-apps/tao/pull/1120) by [@robertrpf](https://github.com/tauri-apps/tao/../../robertrpf)) Added `Window::set_focusable`.
29+
330
## \[0.34.0]
431

532
- [`773d324b`](https://github.com/tauri-apps/tao/commit/773d324be5462fbe472b9bec7505bb04bdc1cf9a) ([#1121](https://github.com/tauri-apps/tao/pull/1121) by [@FabianLars](https://github.com/tauri-apps/tao/../../FabianLars)) Fixed an issue that caused a panic on macOS when tao received `nil` from the OS when trying to get the current NSScreen.

Cargo.lock

Lines changed: 18 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tao"
3-
version = "0.34.0"
3+
version = "0.34.5"
44
description = "Cross-platform window manager library."
55
authors = [
66
"Tauri Programme within The Commons Conservancy",
@@ -14,6 +14,7 @@ readme = "README.md"
1414
repository = "https://github.com/tauri-apps/tao"
1515
documentation = "https://docs.rs/tao"
1616
categories = [ "gui" ]
17+
include = ["/README.md", "src/**/*.rs", "examples/**/*.rs", "LICENSE*"]
1718

1819
[package.metadata.docs.rs]
1920
features = [ "rwh_04", "rwh_05", "rwh_06", "serde", "x11" ]
@@ -106,6 +107,7 @@ tao-macros = { version = "0.1.0", path = "./tao-macros" }
106107

107108
[target."cfg(any(target_os = \"ios\", target_os = \"macos\"))".dependencies]
108109
objc2 = "0.6"
110+
block2 = "0.6"
109111

110112
[target."cfg(target_os = \"macos\")".dependencies]
111113
objc2-foundation = { version = "0.3", default-features = false, features = [
@@ -140,6 +142,7 @@ objc2-app-kit = { version = "0.3", default-features = false, features = [
140142
"NSScreen",
141143
"NSView",
142144
"NSWindow",
145+
"NSUserActivity"
143146
] }
144147
core-foundation = "0.10"
145148
core-graphics = "0.24"
@@ -152,4 +155,4 @@ gdkx11-sys = { version = "0.18", optional = true }
152155
gdkwayland-sys = "0.18.0"
153156
x11-dl = { version = "2.21", optional = true }
154157
parking_lot = "0.12"
155-
dlopen2 = "0.7.0"
158+
dlopen2 = "0.8.0"

examples/timer.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
// Copyright 2021-2023 Tauri Programme within The Commons Conservancy
33
// SPDX-License-Identifier: Apache-2.0
44

5-
use std::time::Duration;
6-
use std::time::Instant;
5+
use std::time::{Duration, Instant};
76

87
use tao::{
98
event::{Event, StartCause, WindowEvent},

src/event_loop.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
//! [create_proxy]: crate::event_loop::EventLoop::create_proxy
1414
//! [event_loop_proxy]: crate::event_loop::EventLoopProxy
1515
//! [send_event]: crate::event_loop::EventLoopProxy::send_event
16-
use std::time::Instant;
17-
use std::{error, fmt, marker::PhantomData, ops::Deref};
16+
use std::{error, fmt, marker::PhantomData, ops::Deref, time::Instant};
1817

1918
use crate::{
2019
dpi::PhysicalPosition,

src/platform_impl/android/mod.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,17 @@ impl<T: 'static> EventLoop<T> {
184184
}
185185
);
186186
}
187+
Event::Destroy => {
188+
call_event_handler!(
189+
event_handler,
190+
self.window_target(),
191+
control_flow,
192+
event::Event::WindowEvent {
193+
window_id: window::WindowId(WindowId),
194+
event: event::WindowEvent::Destroyed,
195+
}
196+
);
197+
}
187198
_ => {}
188199
},
189200
Some(EventSource::InputQueue) => {
@@ -335,6 +346,14 @@ impl<T: 'static> EventLoop<T> {
335346
start: Instant::now(),
336347
requested_resume: None,
337348
};
349+
350+
call_event_handler!(
351+
event_handler,
352+
self.window_target(),
353+
control_flow,
354+
event::Event::LoopDestroyed
355+
);
356+
338357
break 'event_loop code;
339358
}
340359
ControlFlow::Poll => {
@@ -564,6 +583,10 @@ impl Window {
564583
warn!("set_focus not yet implemented on Android");
565584
}
566585

586+
pub fn set_focusable(&self, _focusable: bool) {
587+
warn!("set_focusable not yet implemented on Android");
588+
}
589+
567590
pub fn is_focused(&self) -> bool {
568591
log::warn!("`Window::is_focused` is ignored on Android");
569592
false

src/platform_impl/android/ndk_glue.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub static PACKAGE: OnceCell<&str> = OnceCell::new();
4747
/// - `private external fun focus(focus: Boolean)`
4848
/// 4. a one time setup function that will be ran once after tao has created its event loop in the `create` function above.
4949
/// 5. the main entry point of your android application.
50+
#[rustfmt::skip]
5051
#[macro_export]
5152
macro_rules! android_binding {
5253
($domain:ident, $package:ident, $activity:ident, $setup:path, $main:ident) => {

src/platform_impl/ios/window.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ impl Inner {
7272
warn!("set_focus not yet implemented on iOS");
7373
}
7474

75+
pub fn set_focusable(&self, _focusable: bool) {
76+
warn!("set_focusable not yet implemented on iOS");
77+
}
78+
7579
pub fn is_focused(&self) -> bool {
7680
warn!("`Window::is_focused` is ignored on iOS");
7781
false

src/platform_impl/linux/window.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl Window {
8787

8888
let mut window_builder = gtk::ApplicationWindow::builder()
8989
.application(app)
90-
.accept_focus(attributes.focused);
90+
.accept_focus(attributes.focusable && attributes.focused);
9191
if let Parent::ChildOf(parent) = pl_attribs.parent {
9292
window_builder = window_builder.transient_for(&parent);
9393
}
@@ -231,8 +231,8 @@ impl Window {
231231
}
232232

233233
// restore accept-focus after the window has been drawn
234-
// if the window was initially created without focus
235-
if !attributes.focused {
234+
// if the window was initially created without focus and is supposed to be focusable
235+
if attributes.focusable && !attributes.focused {
236236
let signal_id = Arc::new(RefCell::new(None));
237237
let signal_id_ = signal_id.clone();
238238
let id = window.connect_draw(move |window, _| {
@@ -594,6 +594,10 @@ impl Window {
594594
}
595595
}
596596

597+
pub fn set_focusable(&self, focusable: bool) {
598+
self.window.set_accept_focus(focusable);
599+
}
600+
597601
pub fn is_focused(&self) -> bool {
598602
self.window.is_active()
599603
}

0 commit comments

Comments
 (0)