#Make my window draggable?

9 messages · Page 1 of 1 (latest)

atomic delta
#

My settings window is not draggable. I pinpointed it down to:

  let settings_window = settings_window.title_bar_style(TitleBarStyle::Overlay);

With this its not longer draggable, wasen't there a solution for this which i cannot recall?

pub fn setup_settings_window<R: Runtime>(app_handle: &AppHandle<R>) -> Result<Window<R>> {
  let settings_window = WindowBuilder::new(
    app_handle,
    crate::SETTINGS_WINDOW_LABEL,
    WindowUrl::App("/pages/settings/settings.html".into()),
  )
      .title("Settings")
      .visible(false)
      .resizable(false)
      .inner_size(480., 380.)
      .focused(true)
      .skip_taskbar(true);

  #[cfg(target_os = "macos")]
      let settings_window = settings_window.title_bar_style(TitleBarStyle::Overlay);
  let settings_window = settings_window.build()?;

  // Wait for DOM to load to avoid showing empty screen
  settings_window.once("window_loaded", {
    let settings_window = settings_window.clone();
    move |_| {
      settings_window
          .show()
          .expect("Failed to show settings window on load")
    }
  });

  Ok(settings_window)
}
timid vale
#

for reference

atomic delta
#

ah thank you i could not recall what it was!

#

it mentions 'You need to define a custom drag region to make your window draggable, however due to a limitation you can't drag the window when it's not in focus https://github.com/tauri-apps/tauri/issues/4316.``` but not exactly how to do that. is this documented somewhere ?```

GitHub

Build smaller, faster, and more secure desktop applications with a web frontend. - Issues · tauri-apps/tauri

#

according to the docs <div data-tauri-drag-region className="title-panel"> <div data-tauri-drag-region> content here needs to be draggable </div> </div>

#

but i cannot place any divs in content needs to be draggable section it no longer works i guess i need the data-tauri-drag-region on the parent div to make it work?

solid folio
#

try