-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[bug] Window changes position when AlwaysOnTop and AcceptFirstMouse window combined with Normal window #6568
Comments
@hakoptak I have encountered a similar problem I would like to point out that this problem only occurs when clicking on the |
@hakoptak If you are still facing this problem, try this solution and post whether it solved your problem or not? ahkohd/tauri-macos-menubar-app-example#54 (comment) |
The gist of the problem: Demo: https://youtu.be/McfLrebxq7I?t=20 This is my final solution that solves the problem perfectly: <script setup lang="ts">
import { appWindow } from "@tauri-apps/api/window";
const fixDragging = (event: MouseEvent) => {
if (
event.currentTarget === event.target &&
// and was left mouse button
event.button === 0 &&
// and was normal click or double click
(event.detail === 1 || event.detail === 2)
) {
event.preventDefault();
setTimeout(() => appWindow.startDragging(), 100);
}
};
</script>
<template>
<div class="title-bar" @mousedown="fixDragging"></div>
</template>
@FabianLars I don't want to create a new issue, ping you to notice how quick and easy it is to close this problem.
setTimeout(() => window.__TAURI_INTERNALS__.invoke('plugin:window|' + cmd), 100); I think it also makes sense to add a delay to maximize the window, as perhaps double-clicking could also cause a problem.
setTimeout(() => window.__TAURI_INTERNALS__.invoke('plugin:window|internal_toggle_maximize'), 100); |
Hi @doroved, thanks for addressing the issue. I have disabled the AcceptFirstMouse feature and never looked back. If I have time I will try to enable it to see if this is fixed. If so I will close this issue. |
I doubt it's fixed, since you had this problem on version 2+beta and I had it on 1.6.7 |
Describe the bug
Hello,
My app has two windows, one is alwaysOnTop and has acceptFirstMouse, the other is a normal window. The problem (see recording below) occurs when the normal window is clicked and then the on top window. When the op top window is clicked its window suddenly shifts position:
Screen.Recording.2023-03-26.at.21.33.44.mov
In the recording I try to explain that the offset of the shifted window is exactly the mouse position + top left window offset.
This bug may be related to #4056.
Reproduction
See recording. Below you find the window properties:
Expected behavior
The always on top window should not shift in position.
Platform and versions
Stack trace
Additional context
No response
The text was updated successfully, but these errors were encountered: