mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 08:00:42 -05:00
pointer: Don't send modifiers on mouse enter
I talked to Kristian about this. It should be enough to simply send it when we activate the surface and give it keyboard focus.
This commit is contained in:
parent
ff5867e4d3
commit
48f7232492
@ -60,14 +60,6 @@
|
||||
|
||||
#include "meta-wayland-private.h"
|
||||
|
||||
static MetaWaylandSeat *
|
||||
meta_wayland_keyboard_get_seat (MetaWaylandKeyboard *keyboard)
|
||||
{
|
||||
MetaWaylandSeat *seat = wl_container_of (keyboard, seat, keyboard);
|
||||
|
||||
return seat;
|
||||
}
|
||||
|
||||
static int
|
||||
create_anonymous_file (off_t size,
|
||||
GError **error)
|
||||
@ -291,28 +283,11 @@ default_grab_modifiers (MetaWaylandKeyboardGrab *grab, uint32_t serial,
|
||||
uint32_t mods_locked, uint32_t group)
|
||||
{
|
||||
MetaWaylandKeyboard *keyboard = grab->keyboard;
|
||||
MetaWaylandSeat *seat = meta_wayland_keyboard_get_seat (keyboard);
|
||||
MetaWaylandPointer *pointer = &seat->pointer;
|
||||
struct wl_resource *resource, *pr;
|
||||
|
||||
resource = keyboard->focus_resource;
|
||||
if (!resource)
|
||||
return;
|
||||
|
||||
wl_keyboard_send_modifiers (resource, serial, mods_depressed,
|
||||
mods_latched, mods_locked, group);
|
||||
|
||||
if (pointer && pointer->focus_surface && pointer->focus_surface != keyboard->focus_surface)
|
||||
if (keyboard->focus_resource)
|
||||
{
|
||||
pr = find_resource_for_surface (&keyboard->resource_list, pointer->focus_surface);
|
||||
if (pr)
|
||||
{
|
||||
wl_keyboard_send_modifiers (pr, serial,
|
||||
mods_depressed,
|
||||
mods_latched,
|
||||
mods_locked,
|
||||
group);
|
||||
}
|
||||
wl_keyboard_send_modifiers (keyboard->focus_resource, serial, mods_depressed,
|
||||
mods_latched, mods_locked, group);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -55,14 +55,6 @@
|
||||
|
||||
static void meta_wayland_pointer_end_popup_grab (MetaWaylandPointer *pointer);
|
||||
|
||||
static MetaWaylandSeat *
|
||||
meta_wayland_pointer_get_seat (MetaWaylandPointer *pointer)
|
||||
{
|
||||
MetaWaylandSeat *seat = wl_container_of (pointer, seat, pointer);
|
||||
|
||||
return seat;
|
||||
}
|
||||
|
||||
static void
|
||||
release_focus (MetaWaylandPointer *pointer)
|
||||
{
|
||||
@ -331,9 +323,6 @@ void
|
||||
meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
MetaWaylandSurface *surface)
|
||||
{
|
||||
MetaWaylandSeat *seat = meta_wayland_pointer_get_seat (pointer);
|
||||
MetaWaylandKeyboard *kbd = &seat->keyboard;
|
||||
|
||||
if (pointer->focus_surface == surface && pointer->focus_resource != NULL)
|
||||
return;
|
||||
|
||||
@ -371,20 +360,6 @@ meta_wayland_pointer_set_focus (MetaWaylandPointer *pointer,
|
||||
struct wl_display *display = wl_client_get_display (client);
|
||||
uint32_t serial = wl_display_next_serial (display);
|
||||
|
||||
if (kbd)
|
||||
{
|
||||
struct wl_resource *kr = find_resource_for_surface (&kbd->resource_list, pointer->focus_surface);
|
||||
if (kr)
|
||||
{
|
||||
wl_keyboard_send_modifiers (kr,
|
||||
serial,
|
||||
kbd->modifier_state.mods_depressed,
|
||||
kbd->modifier_state.mods_latched,
|
||||
kbd->modifier_state.mods_locked,
|
||||
kbd->modifier_state.group);
|
||||
}
|
||||
}
|
||||
|
||||
meta_window_handle_enter (pointer->focus_surface->window,
|
||||
/* XXX -- can we reliably get a timestamp for setting focus? */
|
||||
clutter_get_current_event_time (),
|
||||
|
Loading…
Reference in New Issue
Block a user