wayfire: update to 0.2

This commit is contained in:
Julio Galvan 2019-06-04 05:55:52 -07:00 committed by Juan RP
parent b600d61430
commit 54bfb12fb4
3 changed files with 3 additions and 117 deletions

View file

@ -1,22 +0,0 @@
--- src/api/img.hpp 2019-02-05 15:46:42.000000000 +0100
+++ - 2019-02-13 14:59:35.302813580 +0100
@@ -5,8 +5,6 @@
#include <GLES2/gl2.h>
#include <string>
-#define ulong unsigned long
-
namespace image_io
{
/* Load the image from the given file, binding it to the given GL texture target
--- src/core/img.cpp 2019-02-05 15:46:42.000000000 +0100
+++ - 2019-02-13 14:59:57.760169039 +0100
@@ -19,7 +19,7 @@
namespace image_io {
using Loader = std::function<bool(const char *, GLuint)>;
- using Writer = std::function<void(const char *name, uint8_t *pixels, ulong, ulong)>;
+ using Writer = std::function<void(const char *name, uint8_t *pixels, unsigned long, unsigned long)>;
namespace {
std::unordered_map<std::string, Loader> loaders;
std::unordered_map<std::string, Writer> writers;

View file

@ -1,92 +0,0 @@
From 76a7bc32f4c2960a6e55436a79983cc4c5cef611 Mon Sep 17 00:00:00 2001
From: Greg V <greg@unrelenting.technology>
Date: Sat, 23 Feb 2019 23:42:46 +0300
Subject: [PATCH] Track wlroots: new drag'n'drop handling
---
src/core/seat/input-manager.hpp | 5 +++--
src/core/seat/seat.cpp | 38 +++++++++++++++++++++++++++------
2 files changed, 34 insertions(+), 9 deletions(-)
diff --git a/src/core/seat/input-manager.hpp b/src/core/seat/input-manager.hpp
index 6585d29..9d5a7b0 100644
--- src/core/seat/input-manager.hpp
+++ src/core/seat/input-manager.hpp
@@ -62,8 +62,9 @@ class input_manager
wayfire_grab_interface active_grab = nullptr;
bool session_active = true;
- wl_listener input_device_created, new_drag_icon, request_set_cursor,
- request_set_selection, request_set_primary_selection;
+ wl_listener input_device_created, request_start_drag, start_drag,
+ request_set_cursor, request_set_selection,
+ request_set_primary_selection;
signal_callback_t config_updated;
diff --git a/src/core/seat/seat.cpp b/src/core/seat/seat.cpp
index b00866b..fbcd254 100644
--- src/core/seat/seat.cpp
+++ src/core/seat/seat.cpp
@@ -56,8 +56,8 @@ wf_drag_icon::wf_drag_icon(wlr_drag_icon *ic)
wf_point wf_drag_icon::get_output_position()
{
- auto pos = icon->is_pointer ?
- core->get_cursor_position() : core->get_touch_position(icon->touch_id);
+ auto pos = icon->drag->grab_type == WLR_DRAG_GRAB_KEYBOARD_TOUCH ?
+ core->get_touch_position(icon->drag->touch_id) : core->get_cursor_position();
GetTuple(x, y, pos);
@@ -97,11 +97,32 @@ void wf_drag_icon::damage(const wlr_box& box)
});
}
-static void handle_new_drag_icon_cb(wl_listener*, void *data)
+static void handle_request_start_drag_cb(wl_listener*, void *data)
{
- auto di = static_cast<wlr_drag_icon*> (data);
+ auto ev = static_cast<wlr_seat_request_start_drag_event*> (data);
+ auto seat = core->get_current_seat();
- auto icon = std::unique_ptr<wf_drag_icon>(new wf_drag_icon(di));
+ if (wlr_seat_validate_pointer_grab_serial(seat, ev->origin, ev->serial)) {
+ wlr_seat_start_pointer_drag(seat, ev->drag, ev->serial);
+ return;
+ }
+
+ struct wlr_touch_point *point;
+ if (wlr_seat_validate_touch_grab_serial(seat, ev->origin, ev->serial, &point)) {
+ wlr_seat_start_touch_drag(seat, ev->drag, ev->serial, point);
+ return;
+ }
+
+ log_debug("Ignoring start_drag request: "
+ "could not validate pointer or touch serial %" PRIu32, ev->serial);
+ wlr_data_source_destroy(ev->drag->source);
+}
+
+static void handle_start_drag_cb(wl_listener*, void *data)
+{
+ auto d = static_cast<wlr_drag*> (data);
+
+ auto icon = std::unique_ptr<wf_drag_icon>(new wf_drag_icon(d->icon));
core->input->drag_icons.push_back(std::move(icon));
}
@@ -139,8 +160,11 @@ void input_manager::create_seat()
request_set_cursor.notify = handle_request_set_cursor;
wl_signal_add(&seat->events.request_set_cursor, &request_set_cursor);
- new_drag_icon.notify = handle_new_drag_icon_cb;
- wl_signal_add(&seat->events.new_drag_icon, &new_drag_icon);
+ request_start_drag.notify = handle_request_start_drag_cb;
+ wl_signal_add(&seat->events.request_start_drag, &request_start_drag);
+
+ start_drag.notify = handle_start_drag_cb;
+ wl_signal_add(&seat->events.start_drag, &start_drag);
request_set_selection.notify = handle_request_set_selection_cb;
wl_signal_add(&seat->events.request_set_selection, &request_set_selection);

View file

@ -1,7 +1,7 @@
# Template file for 'wayfire'
pkgname=wayfire
version=0.1
revision=3
version=0.2
revision=1
build_style=meson
hostmakedepends="pkg-config wayland-devel"
makedepends="wlroots-devel glm cairo-devel wf-config"
@ -10,7 +10,7 @@ maintainer="Young Jin Park <youngjinpark20@gmail.com>"
license="MIT"
homepage="https://wayfire.org"
distfiles="https://github.com/WayfireWM/wayfire/archive/v${version}.tar.gz"
checksum=ce6ed0ba62296992f4a0c05b92d05b33911d1d192346611df845414ffd9a18b8
checksum=94fe93bb2b86048fd1c7601f97b167767e19618bb6b6226e21c22fbd052540bf
case $XBPS_TARGET_MACHINE in
*-musl) makedepends+=" libexecinfo-devel"