* 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 <http://www.gnu.org/licenses/>.
*/
#define _GNU_SOURCE
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);
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
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;
device, device->keyboard_focus));
_gdk_wayland_display_deliver_event (device->display, event);
+
+ _gdk_wayland_window_add_focus (device->keyboard_focus);
}
}
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;