Modal dialoges in gtk3 on wayland a problem?

For a longer time there was a bug in Lutris that the buttons on the header bar where without functions. Turns out that this was because the widgets attached to it where marked as modal. This was just a problem on native wayland.
The bugfix is here: https://github.com/lutris/lutris/commit/dd1d562554feebe4567afa624c326c437e3eae02

Now I don’t quite understand why this is and so I would be happy if someone could help me here (if possible).

I have no idea what kind of problem you were seeing, or what the commit you linked to is supposed to fix—it’s barely readable, and the commit message is strikingly unhelpful in describing the issue.

Widgets cannot be modal: only top-level windows can request to be made modal by the window manager.

You should probably ask the Lutris developers what they were seeing and thinking, and why did they make that commit.

2 Likes

Thanks - I’ll do that. The issue was that the buttons on the header bar (on X11) will create a little pop-up menu on click. That wasnt working on wayland. On click nothing showed up at all. Both of them where modal, Now after deactivating this modal behavior it works on wayland too. Because the dev also dont have any clue why that is (as you can see from the commit message) I was just curious. :joy:

Video of it: https://streamable.com/g94e4a

I suppose modal means https://developer.gnome.org/gtk3/stable/GtkPopover.html#GtkPopover--modal here.

Still, that commit makes no sense.

-    <property name="can_focus">False</property>
-    <property name="relative_to">viewoptions_menubutton</property>
+    <property name="can-focus">False</property>
+    <property name="relative-to">viewoptions_menubutton</property>
+    <property name="modal">False</property>

In all the noise I noticed this, so the change is in fact to the value of modal on the GtkPopover vs anything with GtkWidget

But what’s interesting me is that your setting an explicit relative-to on a popover used in a GtkMenuButton. Now would that cause what your seeing? No idea but it doesn’t seem like a good idea (and is completely unnessisary)

1 Like

I fired up glade, removed the relative-to property + set modal again. This brings back the bug that the popovers do not appear on click (in wayland).

One strange discovery, if I do dubbleclick, they appear in wayland.

(x11 still works with single click)

Great, another massive diff…

Just loaded it in Glade, works fine for me /shrug

Guess you doing something in your actual code somewhere

Great, another massive diff…

There is nothing I can do about. It’s Glade that produces this. I literally just click 5 times.

Guess you doing something in your actual code somewhere

Ok good to know. It’s not my code in any way, I’m just that curious user who can trigger that bug, not a dev.

Again - Thanks for your help @ all :smiling_face:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.