Open ninetynin opened 1 month ago
I couldn't reproduce, could you make a minimal repro? and for good measures could you record the buggy behavior?
I couldn't reproduce, could you make a minimal repro? and for good measures could you record the buggy behavior?
https://github.com/user-attachments/assets/244d1dc4-6727-4186-8f36-149cad196610
@amrbashir as you can see its getting hidden after i click on some icon present in taskbar even when always on top is enabled and this is main.rs rn
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::Manager;
use wchar::wchz;
use windows::{core::PCWSTR, Win32::{Foundation::HANDLE, UI::WindowsAndMessaging::{GetForegroundWindow, SetPropW}}};
fn main() {
tauri::Builder::default()
.setup(|app| {
let win = app.get_window("main").unwrap();
unsafe {
let mut name: Vec<u16> = wchz!("NonRudeHWND").to_vec();
let handle = HANDLE(std::ptr::null_mut()); // Use a null pointer
SetPropW(GetForegroundWindow(), PCWSTR(name.as_mut_ptr()), handle);
}
win.show();
Ok(())
})
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
ive tried other ways by setting up using https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos this fn and setting SWP_NOZORDER | SWP_NOOWNERZORDER but its of no use its still getting hidden and there is another problem arising with setting up those is its taking this as main full screen program and is not opening any other window while clicking on taskbar so i had to go to desktop and click on application icon in taskbar then only it works but im not using that fn and using the main way suggested from the linked issue and its of no use too and i went to that author github repo and he hasnt implemented in his project rather it is only in todo so any help is appreciated thanks
I still can't reproduce, please upload a full repo so I can test it
Describe the bug
I implemented my application using Tauri. However, whenever I switch to a new application by clicking on the taskbar, the application window disappears. After some research, I found that this is likely due to a Windows taskbar Z-order issue, as mentioned in this Tauri GitHub issue.
I tried the suggested approach from the GitHub issue using unsafe Win32 code (see the code snippet below), but the issue still persists.
Reproduction
and set
and in js
so that i can use this as a widget for personal use on desktop taskbar
Expected behavior
The Tauri window gets hidden when switching to another application from the taskbar, likely due to a taskbar Z-order issue.
I attempted the code snippet provided in the GitHub issue but am not experienced with Win32 unsafe code. Despite implementing the code, the issue persists.
Full
tauri info
outputStack trace
No response
Additional context
If there’s any further guidance on how to handle the taskbar Z-order issue, or a correct implementation of Win32 calls in Tauri, it would be much appreciated! Let me know if you need more details or if I can provide further context.