-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conflict: acceptFirstMouse + data-tauri-drag-region #54
Comments
@ahkohd Hi, any thoughts on what the problem might be :) |
Perhaps we need to write our own |
Apparently there is a conflict between By the way, here tauri-apps/tauri#6568 there is a problem with NSWindow in Tauri 2.0.0-alpha.2, although I have everything ok in 1.6.2, only with NSPanel (by the way you should check .always_on_top for NSPanel). Here is the solution to the problem. At the moment it seems that everything is ok, I will click, test further) <script setup lang="ts">
import { appWindow } from "@tauri-apps/api/window";
const fixDragging = () => {
setTimeout(() => {
appWindow.startDragging();
}, 100);
};
</script>
<template>
<div
class="flex h-screen items-center justify-center text-slate-300"
@mousedown="fixDragging"
>
</template> If further tests show that the problem is fixed, then Tauri developers should add 100ms delay in this code. |
@doroved, I'm glad you found a workaround to this issue! |
I think we can close this issue, I described the problem and solution here: I don't know if it makes sense to do something for nspanel, it's probably better to wait for the edit to be made on the Tauri side, and if someone encounters this problem now, they can use my solution. |
Okay, I'll pin the issue. Thanks! |
In my application, I use the ability to pin a window and I ran into a problem, the cause of which I searched for many hours)
Make these edits to the code to reproduce the problem.
tauri-macos-menubar-app-example/src-tauri/src/fns.rs
Line 53 in dff4941
acceptFirstMouse
andstartDragging
After starting the application, open the application by clicking on the system tray icon, you can drag the window anywhere, then you have to click in the area outside the window, wait a few seconds, then click in the
data-tauri-drag-region
.It is still unclear what exactly triggers the problem, but you will notice that when you click on the
data-tauri-drag-region
again, the window position will change dramatically.https://youtu.be/McfLrebxq7I
And if you drag the window to the upper right corner and do the operation described above, the window will disappear altogether, apparently changing its position outside the visibility of the macbook window.
https://youtu.be/vof60XG6Dm4
When using a regular window, without tauri-nspanel with the settings
always_on_top(true)
andaccept_first_mouse(true)
I do not see such a problem.I hope you will be able to solve this problem and maybe better implement it in tauri-nspanel package.
The text was updated successfully, but these errors were encountered: