X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gdk%2Fwayland%2Fgdkdevice-wayland.c;h=7381d217b920b9b5702d37780c1b28058038bc5b;hb=9d0febc9a64a5bfb0fcfc3a88de4757f6c1ff090;hp=1e0080fa469ddb7f44cdafab95c73396c42e4996;hpb=5f07e937c8d421446763e3295df64b2afc1a354f;p=~andy%2Fgtk diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 1e0080fa4..7381d217b 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -12,9 +12,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #define _GNU_SOURCE @@ -378,6 +376,19 @@ input_handle_button(void *data, struct wl_input_device *input_device, GdkDisplayWayland *display = GDK_DISPLAY_WAYLAND (device->display); GdkEvent *event; uint32_t modifier; + int gdk_button; + + switch (button) { + case 273: + gdk_button = 3; + break; + case 274: + gdk_button = 2; + break; + default: + gdk_button = button - 271; + break; + } device->time = time; event = gdk_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE); @@ -390,10 +401,10 @@ input_handle_button(void *data, struct wl_input_device *input_device, event->button.y_root = (gdouble) device->y; event->button.axes = NULL; event->button.state = device->modifiers; - event->button.button = button - 271; + event->button.button = gdk_button; gdk_event_set_screen (event, display->screen); - modifier = 1 << (8 + button - 272); + modifier = 1 << (8 + gdk_button - 1); if (state) device->modifiers |= modifier; else @@ -675,6 +686,7 @@ input_handle_keyboard_focus(void *data, device->time = time; if (device->keyboard_focus) { + _gdk_wayland_window_remove_focus (device->keyboard_focus); event = gdk_event_new (GDK_FOCUS_CHANGE); event->focus_change.window = g_object_ref (device->keyboard_focus); event->focus_change.send_event = FALSE; @@ -709,6 +721,8 @@ input_handle_keyboard_focus(void *data, device, device->keyboard_focus)); _gdk_wayland_display_deliver_event (device->display, event); + + _gdk_wayland_window_add_focus (device->keyboard_focus); } } @@ -1016,7 +1030,7 @@ gdk_wayland_device_get_selection_type_atoms (GdkDevice *gdk_device, device = GDK_DEVICE_CORE (gdk_device)->device; - if (device->selection_offer->types->len == 0) + if (!device->selection_offer || device->selection_offer->types->len == 0) { *atoms_out = NULL; return 0;