-
Notifications
You must be signed in to change notification settings - Fork 15k
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]: showOpenDialog / showSaveDialog opens _behind_ the app after the second call onward #32857
Comments
@Prinzhorn it looks like this is a function of a new-ish Gnome focus-stealing prevention behavior; it happens when a notification pops at the top saying "app_name is ready". I'll try to see if there's some kind of way around it. In the meantime, here's a workaround you can probably use: https://ubuntuhandbook.org/index.php/2020/12/quick-tip-remove-window-is-ready-notification-focus-window-immediately/ |
Thanks for looking into this. FWIW |
@Prinzhorn you're right - it happened after #19159 because the transient window isn't being set properly anymore. I'm looking into it :) |
I'm also running into this issue, but in my case I do not get the Gnome notification at all, and the workaround doesn't work either, as I'm using the Cinnamon DE, which was forked from Gnome a long time ago. But the issue is exactly the same, second dialog opens behind the window, and in my case breaks mouse interaction with both the parent and the dialog. I have to alt-tab and kill the app to get back any mouse interaction. Is there any more info required to resolve this issue, if so, I'll happily provide it, as this is quite a big issue for one of my apps. Interestingly, |
Also having this issue on our project as detailed in rstudio/rstudio#11100 . The first open file dialog called by |
Same here: a dialog preceded by notification opens behind the main window. The simplest case -- just a
Ubuntu 20.04.4 LTS, GNOME 3.36.8 |
Got this issue too |
After some test, I found that this issue didn't exist on electron 13.6.9 but appears in 14.0.1. Hope this information helps. @codebytere |
I use fedora 35, gnome 41, architecture x64, electron 19.x.y. and I have the same problem. the electron I use is not customized, but pre-built. Hope this information helps. |
To be more precise. Maybe I missed it. The problem always occurs after the second or more calls of the showOpenDialog method. In version 17.4.7, the showOpenDialog dialog opens in front of the application but is out of focus and the notification tile is not displayed. After selecting the file, the dialog is in focus. The user impression is that everything is fine, but still not. So version 17.4.7 is also affected by the problem On version 18.3.3 and higher, in addition to the mentioned problem, the following occurs: I don't know if this has anything to do with the mentioned problem because it doesn't appear on version 17.4.7. Greeting. |
@darac-10 as mentioned above, we already know precisely why this is occurring. It's simply that we don't know how to address the problem. |
@codebytere, I have looked at this too (original author of the aforementioned PR), and I haven't found a way to fix it. I have previously advocated for reverting the PR since there is no easy solution that I can see to fix the problems. |
This bug exists in KDE and is 100% reproducible since the beginning of times (I can remember being hit with it using Draw.io in 2018, so it's been going on at least 5 years now). |
As the author of the bug, this is incorrect. The bug was introduced in 2021. |
My memory could fail me, but I'm pretty sure I experienced this bug from the get go, and I started using draw.io in 2018. |
The first time it works fine, but when called a second time, the dialog box appears behind the main window. |
I see this issue as well on ubuntu 22.04 when calling dialog.showOpenDialog with a parent window set. The first call seems to work, then the subsequent calls all open the dialog behind the app with the system notification triggered, etc I noticed that when downloading a file via electron's webcontents::downloadURL API, and not manually setting a save path on the DownloadItem, a save dialog is opened. This dialog seems to work correctly, opening on top of the app and in focus. I looked into the electron source to see if I could identify what's different here, but I was quickly out of my depth. It looks like they end up using the same FileChooserDialog code path. However, I wanted to share this in case it's insightful in fixing the issue: This seems to be where downloadURL eventually opens a properly functioning (save) dialog:
and this is where I believe dialog.showOpenDialog leads to:
I see in the earlier comments that there is a missing parent window param when creating the gtk dialog object. What I don't understand is why it works the first time 😅 |
On Debian testing (trixie) with Kde, the dialog is opened behind the parent window for the very first call when trying to 'Save as...' (tested with Draw.io desktop 24.0.4 which uses electron 28.1.0). |
I found similar issue in Gnome notification. On Gnome with Firefox or any application can be reproduce. When download something from Firefox, and click to "Open in folder" button, Firefox open Nautilus application. Same issue on Fractal 6 client. When application in background, gnome send notification every message, but nitifications has no function. Won't open, won't move into top layer the application. |
Is this related in any way to flatpak/xdg-desktop-portal-gtk#137? |
关于这个问题( |
Hi, any sign of a fix for this please? |
Do you see any Electron PRs linked to this issue? No? Then no there is no sign of a fix. Please avoid commenting if you have nothing to add to the issue. |
Preflight Checklist
Electron Version
16.0.8, 17.0.0, 18.0.0-alpha.1
What operating system are you using?
Ubuntu
Operating System Version
Linux alex-desktop 5.13.0-28-generic #31~20.04.1-Ubuntu SMP Wed Jan 19 14:08:10 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
Opening a file save / open dialog opens the dialog on top of the app
Actual Behavior
The first time it works, every dialog after that opens behind the app
Testcase Gist URL
https://gist.github.com/0302a1125c460df377ff8733e7ddb154
Additional Information
Related
#27053
#24959
But this doesn't require any special arguments.
Steps:
Fiddle itself has the same issue when I click "Save As"
The text was updated successfully, but these errors were encountered: