window: make guess_grab_pointer() more reliable

Now either the current focus keyboard or the client pointer
(i.e. the pointer paired to the last keyboard that had the
window focus) are used to guess the pointer that should be
grabbed.
This commit is contained in:
Carlos Garnacho 2011-07-19 21:02:21 +02:00
parent 74520ab20b
commit 8e3b9be79c

View File

@ -10760,10 +10760,8 @@ meta_window_get_client_pointer (MetaWindow *window)
MetaDevice *
meta_window_guess_grab_pointer (MetaWindow *window)
{
/* FIXME: This ought to be the very last resort, ideally
* the current/last focus device should be used to find
* this out, or the client pointer.
*/
return meta_device_map_lookup (window->display->device_map,
META_CORE_POINTER_ID);
if (window->focus_keyboard)
return meta_device_get_paired_device (window->focus_keyboard);
return meta_window_get_client_pointer (window);
}