After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 719725 - wayland: Fix setting keyboard focus for new clients
wayland: Fix setting keyboard focus for new clients
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2013-12-02 21:40 UTC by Rui Matos
Modified: 2013-12-03 16:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wayland: Fix setting keyboard focus for new clients (1.17 KB, patch)
2013-12-02 21:40 UTC, Rui Matos
accepted-commit_now Details | Review
window: Possibly set the pointer focus on newly mapped wayland windows (1009 bytes, patch)
2013-12-03 14:58 UTC, Rui Matos
committed Details | Review
wayland: Fix setting keyboard/pointer focus for new clients (1.73 KB, patch)
2013-12-03 14:58 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2013-12-02 21:40:36 UTC
See patch.
Comment 1 Rui Matos 2013-12-02 21:40:38 UTC
Created attachment 263342 [details] [review]
wayland: Fix setting keyboard focus for new clients

When we have a new client, we set the focus on one of its surfaces
when we map it but the client might not have called
wl_seat.get_keyboard yet. When it finally calls get_keyboard we must
then register its resource as the focus_resource which means that we
can only return early here if focus_resource is already set.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-12-02 22:27:38 UTC
Review of attachment 263342 [details] [review]:

Yep.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-12-02 22:27:57 UTC
Review of attachment 263342 [details] [review]:

By the way, does this also need to be fixed for the pointer as well?
Comment 4 Rui Matos 2013-12-03 14:58:10 UTC
Created attachment 263396 [details] [review]
window: Possibly set the pointer focus on newly mapped wayland windows

Windows showing up under the pointer must get the pointer focus.

--
(In reply to comment #3)
> By the way, does this also need to be fixed for the pointer as well?

Yes it does. In fact we were not even trying to set the pointer focus
on new windows.
Comment 5 Rui Matos 2013-12-03 14:58:23 UTC
Created attachment 263397 [details] [review]
wayland: Fix setting keyboard/pointer focus for new clients

When we have a new client, we potentially set the focus on one of its
surfaces when we map it but the client might not have called
wl_seat.get_keyboard/pointer yet. When it finally calls
get_keyboard/pointer we must then register its resource as the
focus_resource which means that we can only return early if
focus_resource is already set.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-12-03 15:31:54 UTC
Review of attachment 263396 [details] [review]:

OK.
Comment 7 Jasper St. Pierre (not reading bugmail) 2013-12-03 15:44:58 UTC
Review of attachment 263397 [details] [review]:

Yep.
Comment 8 Rui Matos 2013-12-03 16:19:08 UTC
Attachment 263396 [details] pushed as 3f022ca - window: Possibly set the pointer focus on newly mapped wayland windows
Attachment 263397 [details] pushed as 461f74e - wayland: Fix setting keyboard/pointer focus for new clients