Skip to content

Commit

Permalink
Playtime: Use standalone embedding on Windows as well (for removing t…
Browse files Browse the repository at this point in the history
…itlebar)
  • Loading branch information
helgoboss committed Nov 20, 2023
1 parent 6f36797 commit 979bf9b
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions main/src/infrastructure/ui/app/app_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,18 @@ pub fn create_shared_app_instance(session: WeakSession) -> SharedAppInstance {
// app is not shown anyway. (However, with just a bit more effort, we could implement this
// for standalone mode as well.)
if cfg!(target_os = "windows") {
// On Windows, parented mode works wonderfully. It needs some tricks (see View
// implementation) but it's worth it. That's why we use parented mode on Windows.
let app_panel = AppPanel::new(session);
let instance = ParentedAppInstance {
panel: SharedView::new(app_panel),
// On Windows, parented mode works in general. With a few tricks (see AppPanel View
// implementation). However, I had issues completely removing the window title bar, maybe
// because SWELL windows are dialog windows and they work differently? Anyway, this was
// the reason that I switched to a standalone window.
// let app_panel = AppPanel::new(session);
// let instance = ParentedAppInstance {
// panel: SharedView::new(app_panel),
// };
// share(instance)
let instance = StandaloneAppInstance {
session,
running_state: None,
};
share(instance)
} else if cfg!(target_os = "macos") {
Expand Down Expand Up @@ -161,7 +168,6 @@ impl AppInstance for StandaloneAppInstance {
}
let session_id = extract_session_id(&self.session)?;
let app_handle = app_library.start_app_instance(None, session_id)?;
app_library.show_app_instance(None, app_handle)?;
let running_state = StandaloneAppRunningState {
common_state: CommonAppRunningState {
app_handle,
Expand Down

0 comments on commit 979bf9b

Please sign in to comment.