Bug 46432

Summary: [bug] Can not get keyboard focus if previous client exits abnomally (e.g. Ctrl-C)
Product: Wayland Reporter: zhiwen.wu <zhiwen.wu>
Component: westonAssignee: Wayland bug list <wayland-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: ullysses.a.eoff
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description zhiwen.wu@linux.intel.com 2012-02-22 00:51:45 UTC
weston commit: 31f9d0e8de4f788aaf35fb8072dc290da19b097a
waylad commit: ab3b5cd71ce6dd1a532d9c1fecabb1a6e9d1a055

Step to reproduce:
1. src/weston 
2. clients/weston-terminal
3. Ctrl-c
4. clients/weston-terminal
no keyboard focus on weston-terminal.

I found that wl_input_device_set_keyboard_focus() return at wayland_server.c:603.
The reason is device->keyboard_focus is not reset when the surface
with keyboard focus destroied. Next time weston-terminal launched, weston_surface_activate() calls wl_input_device_set_keyboard_focus(), but the value of surface is equal to previous one. That make  wl_input_device_set_keyboard_focus() returned early, and no keyboard focus set.

Maybe we should add some code in destroy_surface() to repick the keyboard_focus for the surface with keyboard focus.
Comment 1 Kristian Høgsberg 2012-08-13 17:42:50 UTC
Should be fixed in e377822c64151c8ba1fcfb2e3ccdd62768fcd1d2

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.