Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1260773 - [GTK3][Wayland] Child popup gets focus-in, focus-out events
Summary: [GTK3][Wayland] Child popup gets focus-in, focus-out events
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gtk3
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Martin Stransky
QA Contact: Fedora Extras Quality Assurance
URL: https://github.com/stransky/gecko-dev
Whiteboard:
Depends On:
Blocks: ffwayland 1264355
TreeView+ depends on / blocked
 
Reported: 2015-09-07 17:05 UTC by Martin Stransky
Modified: 2017-06-19 12:12 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: ffwayland
: 1264355 (view as bug list)
Environment:
Last Closed: 2017-06-19 12:12:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Test program (5.71 KB, text/plain)
2015-10-20 07:45 UTC, Olivier Fourdan
no flags Details
Test program (5.71 KB, text/plain)
2015-10-20 07:47 UTC, Olivier Fourdan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNOME Bugzilla 783957 0 None None None 2017-06-19 12:12:28 UTC
Mozilla Foundation 635134 0 None None None Never

Description Martin Stransky 2015-09-07 17:05:09 UTC
When popup window is created (menubar for instance), it's misplaced (rendered at 0,0) and rendered behind main application. Works fine on broadway backend.

When I hit the "Super" key, those windows (menu bar, etc.) are rendered as an extra applications side by the main Firefox window.

Comment 1 Olivier Fourdan 2015-09-08 13:28:03 UTC
Hi Martin, can you provide a simple reproducer?

gtk3-demo seems to work fine and a simple menu app I had works fine as well on current f23 with gnome-3.17.9x.

There used to be some issues with popup menu some times ago but it's been fixed in both mutter and gtk+

https://bugzilla.gnome.org/show_bug.cgi?id=749716
https://bugzilla.gnome.org/show_bug.cgi?id=748951
https://bugzilla.gnome.org/show_bug.cgi?id=749717

Comment 2 Martin Stransky 2015-09-10 08:55:57 UTC
Okay, taking back for now - looks like Firefox emits too much input events so the window is created and then destroyed by Firefox itself.

Comment 3 Martin Stransky 2015-09-25 10:26:43 UTC
It's cause bu focus-out event which is send to container window (e.g. event widget) right after the popup is created. But the popups should not have the focus, it must stay on parent window as on X11.

Comment 4 Martin Stransky 2015-10-19 18:59:24 UTC
Olivier, I found the problem. When I create a popup (and set it transient for the parent) the new popup receives focus-in and parent gets focus-out. I don't see this on X11 where focus is still on parent. Is that related to the position problem? Does wayland handle focus differently?

Comment 5 Olivier Fourdan 2015-10-20 07:45:46 UTC
Created attachment 1084643 [details]
Test program

(In reply to Martin Stransky from comment #4)
> Olivier, I found the problem. When I create a popup (and set it transient
> for the parent) the new popup receives focus-in and parent gets focus-out. I
> don't see this on X11 where focus is still on parent. Is that related to the
> position problem? Does wayland handle focus differently?

I don't see this being mentioned in the docs for Wayland [1] and I cannot reproduce using the attached reproducer, focus remains on the main window even when the popup is mapped on screen.

I suspect gdk is not using a popup in your case, especially if the (expected to be popup) window is not placed relative to its parent window.

[1] http://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Input

Comment 6 Olivier Fourdan 2015-10-20 07:47:47 UTC
Created attachment 1084644 [details]
Test program

(fix the confusing messages in the focus in/out handlers)

Comment 7 Martin Stransky 2015-10-20 07:53:02 UTC
(In reply to Olivier Fourdan from comment #5)
> I suspect gdk is not using a popup in your case, especially if the (expected
> to be popup) window is not placed relative to its parent window.
> 
> [1] http://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-Input

Yes, that may be the case - but the window is created as GTK_WINDOW_POPUP so one may expect it is a popup ;-) So the example you created for correct placing should also fix the focus, right?

Comment 8 Olivier Fourdan 2015-10-20 09:16:48 UTC
(In reply to Martin Stransky from comment #7)
> Yes, that may be the case - but the window is created as GTK_WINDOW_POPUP so
> one may expect it is a popup ;-) So the example you created for correct
> placing should also fix the focus, right?

Specifying a GTK_WINDOW_POPUP does not imply that gdk will use an XdgPopup eventually, see what I wrote in https://bugzilla.redhat.com/show_bug.cgi?id=1264355#c10 

You need a grab as well otherwise the gdk backend for Wayland will not create an xdg_popup, as this is required anyway by the xdg_popup:

http://cgit.freedesktop.org/wayland/weston/tree/protocol/xdg-shell.xml#n542

(In reply to Martin Stransky from comment #7)
> So the example you created for correct placing should also fix the focus,
> right?

I don't see any focus transition with xdg_popup.

Comment 9 Jan Kurik 2016-02-24 13:44:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 10 Martin Stransky 2017-06-19 12:00:41 UTC
Olivier, I just came across this bug again and looks like the recent mutter version has this bug now. I tested your example (Thanks for it!) and it shows that focus *is* transferred on wayland/mutter while it stays on weston. Will file bug at b.g.o for that. Thanks!

Comment 11 Martin Stransky 2017-06-19 12:12:29 UTC
Filed as https://bugzilla.gnome.org/show_bug.cgi?id=783957


Note You need to log in before you can comment on or make changes to this bug.