Skip to content
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]: I can open many dialogs many times #1055

Open
Kekun opened this issue Jul 3, 2024 · 2 comments
Open

[Bug]: I can open many dialogs many times #1055

Kekun opened this issue Jul 3, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Kekun
Copy link
Contributor

Kekun commented Jul 3, 2024

Describe the bug

There is a short time window before the modal dialog appears where you can still click the Reply button, so if you double-click it you end up with two modal dialogs one on top of the other.

Similarly, if I spam Ctrl+, I can generate as many Preferences dialog as I want, and with F1 I can create as many About dialogs as I want. I suspect the problem happens pretty much everywhere in the app.

I think Tuba should better track its state, especially regarding opened dialogs. The simple way to do this is to store that dialog's object in a field of the object that creates it, to ignore any subsequent creation requests if there already is a dialog, and to clear that field when the dialog is destroyed. That way you can only have a single instance of each dialog.

Steps To Reproduce

  1. Double-click Reply on a message

  2. Press F1 several times

  3. Press Ctrl+, several times

Logs and/or Screenshots

Capture.video.du.2024-07-03.10-06-17.webm

Instance Backend

Mastodon

Operating System

Fedora Linux 40.20240702.0 (Silverblue)

Package

Flatpak

Troubleshooting information

os: GNOME 46 (Flatpak runtime)
prefix: /app
flatpak: true
version: 0.8.1 (production)
gtk: 4.14.4 (4.14.4)
libadwaita: 1.5.1 (1.5.1)
libsoup: 3.4.4 (3.4.4)
libgtksourceview: 5.12.0 (5.12.0)

Additional Context

No response

@Kekun Kekun added the bug Something isn't working label Jul 3, 2024
@GeopJr
Copy link
Owner

GeopJr commented Jul 3, 2024

They are all the aftermath of moving to AdwDialogs from modals. Modals, being different windows, you also get the 'shortcut focus' so the app's shortcuts wouldnt work on them/while they are visible/while they are focused (im bad at explaining it, the gist is that the shortcuts dont work when theres a modal). But the new Dialogs are shown in the main window itself.

Not sure if that's something that should be dealt on libadwaita's side (I don't have the time to track it down rn), but it's common across all AdwDialog apps

Screencast.from.2024-07-03.11-17-09.webm

The reply one, I can easily deal from our side I guess, but the others should probably be dealt across all apps. A quick fix from apps' side would be checking if Adw.Window#get_dialogs is empty

@Kekun
Copy link
Contributor Author

Kekun commented Jul 3, 2024

Ah indeed, thanks for the explanation, I didn't think about this: AdwDialog looks so much like a modal window that I forgot it's not an actual window. 🤦 Then indeed it's a libadwaita issue, it should block clicks and actions on the """parent""" window when an AdwDialog is presented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants