Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[unity] Add patch for libxi 1.7

  • Loading branch information...
commit 046f03402a899e5439204093569c8a494430f200 1 parent 4cb07f4
@chenxiaolong authored
Showing with 699 additions and 12 deletions.
  1. +686 −0 unity/0004_Port_to_XI_1.7.patch
  2. +13 −12 unity/PKGBUILD
View
686 unity/0004_Port_to_XI_1.7.patch
@@ -0,0 +1,686 @@
+=== modified file 'CMakeLists.txt'
+--- CMakeLists.txt 2013-03-07 16:48:26 +0000
++++ CMakeLists.txt 2013-03-08 19:26:19 +0000
+@@ -218,6 +218,7 @@
+ libgeis
+ x11
+ xfixes
++ xi>=1.6.99.1
+ xrender>=0.9
+ )
+ endif ()
+
+=== modified file 'debian/changelog'
+--- debian/changelog 2013-03-08 10:34:29 +0000
++++ debian/changelog 2013-03-08 19:26:19 +0000
+@@ -167,6 +167,10 @@
+ [ Automatic PS uploader ]
+ * Automatic snapshot from revision 3140
+
++ [ Brandon Schaefer ]
++ * Moved PointerBarrier logic to the new xserver 1.14 (libXi 1.6.99.1)
++ version.
++
+ -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Fri, 08 Feb 2013 04:02:00 +0000
+
+ unity (6.12.0daily13.02.07-0ubuntu1) raring; urgency=low
+
+=== modified file 'debian/control'
+--- debian/control 2013-03-06 10:42:08 +0000
++++ debian/control 2013-03-08 19:26:19 +0000
+@@ -43,6 +43,7 @@
+ libunity-common,
+ libzeitgeist-dev (>= 0.3.18),
+ libxfixes-dev (>= 1:5.0-4ubuntu4),
++ libxi-dev (>= 1.6.99.1),
+ libgtest-dev,
+ google-mock,
+ Standards-Version: 3.9.3
+
+=== modified file 'launcher/EdgeBarrierController.cpp'
+--- launcher/EdgeBarrierController.cpp 2013-02-13 19:21:49 +0000
++++ launcher/EdgeBarrierController.cpp 2013-03-08 19:26:19 +0000
+@@ -21,6 +21,7 @@
+ #include "EdgeBarrierController.h"
+ #include "EdgeBarrierControllerPrivate.h"
+ #include "Decaymulator.h"
++#include <NuxCore/Logger.h>
+ #include "unity-shared/UScreen.h"
+ #include "UnityCore/GLibSource.h"
+
+@@ -32,11 +33,50 @@
+ namespace
+ {
+ int const Y_BREAK_BUFFER = 20;
+-}
+-
++ int const MAJOR = 2;
++ int const MINOR = 3;
++}
++
++DECLARE_LOGGER(logger, "unity.edge_barrier_controller");
++
++int GetXI2OpCode()
++{
++ Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
++
++ int opcode, event_base, error_base;
++ if (!XQueryExtension(dpy, "XFIXES",
++ &opcode,
++ &event_base,
++ &error_base))
++ {
++ LOG_ERROR(logger) << "Missing XFixes";
++ return -1;
++ }
++
++ if (!XQueryExtension (dpy, "XInputExtension",
++ &opcode,
++ &event_base,
++ &error_base))
++ {
++ LOG_ERROR(logger) << "Missing XInput";
++ return -1;
++ }
++
++ int maj = MAJOR;
++ int min = MINOR;
++
++ if (XIQueryVersion(dpy, &maj, &min) == BadRequest)
++ {
++ LOG_ERROR(logger) << "Need XInput version 2.3";
++ return -1;
++ }
++
++ return opcode;
++}
+
+ EdgeBarrierController::Impl::Impl(EdgeBarrierController *parent)
+- : edge_overcome_pressure_(0)
++ : xi2_opcode_(-1)
++ , edge_overcome_pressure_(0)
+ , parent_(parent)
+ {
+ UScreen *uscreen = UScreen::GetDefault();
+@@ -68,6 +108,13 @@
+ });
+ SetupBarriers(UScreen::GetDefault()->GetMonitors());
+ });
++
++ xi2_opcode_ = GetXI2OpCode();
++}
++
++EdgeBarrierController::Impl::~Impl()
++{
++ nux::GetGraphicsDisplay()->RemoveEventFilter(this);
+ }
+
+ void EdgeBarrierController::Impl::ResizeBarrierList(std::vector<nux::Geometry> const& layout)
+@@ -86,6 +133,18 @@
+ }
+ }
+
++void SetupXI2Events()
++{
++ Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
++
++ unsigned char mask_bits[XIMaskLen (XI_LASTEVENT)] = { 0 };
++ XIEventMask mask = { XIAllMasterDevices, sizeof (mask_bits), mask_bits };
++
++ XISetMask(mask.mask, XI_BarrierHit);
++ XISetMask(mask.mask, XI_BarrierLeave);
++ XISelectEvents (dpy, DefaultRootWindow(dpy), &mask, 1);
++}
++
+ void EdgeBarrierController::Impl::SetupBarriers(std::vector<nux::Geometry> const& layout)
+ {
+ bool edge_resist = parent_->sticky_edges();
+@@ -112,6 +171,9 @@
+ barrier->ConstructBarrier();
+ }
+
++ SetupXI2Events();
++ AddEventFilter();
++
+ float decay_responsiveness_mult = ((parent_->options()->edge_responsiveness() - 1) * .3f) + 1;
+ decaymulator_.rate_of_decay = parent_->options()->edge_decay_rate() * decay_responsiveness_mult;
+
+@@ -119,6 +181,67 @@
+ edge_overcome_pressure_ = parent_->options()->edge_overcome_pressure() * overcome_responsiveness_mult;
+ }
+
++void EdgeBarrierController::Impl::AddEventFilter()
++{
++ // Remove an old one, if it exists
++ nux::GetGraphicsDisplay()->RemoveEventFilter(this);
++
++ nux::GraphicsDisplay::EventFilterArg event_filter;
++ event_filter.filter = &HandleEventCB;
++ event_filter.data = this;
++
++ nux::GetGraphicsDisplay()->AddEventFilter(event_filter);
++}
++
++bool EdgeBarrierController::Impl::HandleEvent(XEvent xevent)
++{
++ Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
++ XGenericEventCookie *cookie = &xevent.xcookie;
++ bool ret = false;
++
++ switch (cookie->evtype)
++ {
++ case (XI_BarrierHit):
++ {
++ if (XGetEventData(dpy, cookie))
++ {
++ XIBarrierEvent* barrier_event = (XIBarrierEvent*)cookie->data;
++ PointerBarrierWrapper::Ptr wrapper = FindBarrierEventOwner(barrier_event);
++
++ if (wrapper)
++ ret = wrapper->HandleBarrierEvent(barrier_event);
++ }
++
++ XFreeEventData(dpy, cookie);
++ break;
++ }
++ default:
++ break;
++ }
++
++ return ret;
++}
++
++bool EdgeBarrierController::Impl::HandleEventCB(XEvent xevent, void* data)
++{
++ auto edge_barrier_controller = static_cast<EdgeBarrierController::Impl*>(data);
++ int const xi2_opcode = edge_barrier_controller->xi2_opcode_;
++
++ if (xevent.type != GenericEvent || xevent.xcookie.extension != xi2_opcode)
++ return false;
++
++ return edge_barrier_controller->HandleEvent(xevent);
++}
++
++PointerBarrierWrapper::Ptr EdgeBarrierController::Impl::FindBarrierEventOwner(XIBarrierEvent* barrier_event)
++{
++ for (auto barrier : barriers_)
++ if (barrier->OwnsBarrierEvent(barrier_event->barrier))
++ return barrier;
++
++ return nullptr;
++}
++
+ void EdgeBarrierController::Impl::BarrierReset()
+ {
+ decaymulator_.value = 0;
+
+=== modified file 'launcher/EdgeBarrierControllerPrivate.h'
+--- launcher/EdgeBarrierControllerPrivate.h 2013-02-13 19:21:49 +0000
++++ launcher/EdgeBarrierControllerPrivate.h 2013-03-08 19:26:19 +0000
+@@ -33,6 +33,7 @@
+ struct EdgeBarrierController::Impl
+ {
+ Impl(EdgeBarrierController *parent);
++ ~Impl();
+
+ void ResizeBarrierList(std::vector<nux::Geometry> const& layout);
+ void SetupBarriers(std::vector<nux::Geometry> const& layout);
+@@ -44,10 +45,18 @@
+
+ bool EventIsInsideYBreakZone(BarrierEvent::Ptr const& event);
+
++ void AddEventFilter();
++
++ PointerBarrierWrapper::Ptr FindBarrierEventOwner(XIBarrierEvent* barrier_event);
++
++ static bool HandleEventCB(XEvent event, void* data);
++ bool HandleEvent(XEvent event);
++
+ std::vector<PointerBarrierWrapper::Ptr> barriers_;
+ std::vector<EdgeBarrierSubscriber*> subscribers_;
+ Decaymulator decaymulator_;
+ glib::Source::UniquePtr release_timeout_;
++ int xi2_opcode_;
+ float edge_overcome_pressure_;
+ EdgeBarrierController* parent_;
+ };
+
+=== modified file 'launcher/PointerBarrier.cpp'
+--- launcher/PointerBarrier.cpp 2013-02-11 23:57:09 +0000
++++ launcher/PointerBarrier.cpp 2013-03-08 19:26:19 +0000
+@@ -13,12 +13,14 @@
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
++*
++* Authored by: Jason Smith <jason.smith@canonical.com>
++* Brandon Schaefer <brandon.schaefer@canonical.com>
++*
+ */
+
+ #include <unistd.h>
+ #include <stdlib.h>
+-#include <stdio.h>
+-#include <X11/extensions/Xfixes.h>
+
+ #include "PointerBarrier.h"
+
+@@ -27,14 +29,6 @@
+ namespace ui
+ {
+
+-namespace local
+-{
+-namespace
+-{
+- bool is_selected_for = false;
+-}
+-}
+-
+ PointerBarrierWrapper::PointerBarrierWrapper()
+ : active(false)
+ , released(false)
+@@ -42,10 +36,11 @@
+ , smoothing(75)
+ , max_velocity_multiplier(1.0f)
+ , direction(BOTH)
+- , event_base_(0)
++ , xi2_opcode_(0)
+ , last_event_(0)
++ , current_device_(0)
+ , first_event_(false)
+- , barrier(0)
++ , barrier_(0)
+ , smoothing_count_(0)
+ , smoothing_accum_(0)
+ {}
+@@ -62,34 +57,14 @@
+
+ Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
+
+- int error_base;
+- XFixesQueryExtension(dpy, &event_base_, &error_base);
+-
+- int maj,min;
+- XFixesQueryVersion(dpy, &maj, &min);
+-
+- barrier = XFixesCreatePointerBarrierVelocity(dpy,
+- DefaultRootWindow(dpy),
+- x1, y1,
+- x2, y2,
+- static_cast<int>(direction),
+- threshold,
+- 0,
+- NULL);
+-
+- if (!local::is_selected_for)
+- {
+- XFixesSelectBarrierInput(dpy, DefaultRootWindow(dpy), 0xdeadbeef);
+- local::is_selected_for = true;
+- }
++ barrier_ = XFixesCreatePointerBarrier(dpy,
++ DefaultRootWindow(dpy),
++ x1, y1,
++ x2, y2,
++ static_cast<int>(direction),
++ 0, NULL);
+
+ active = true;
+-
+- nux::GraphicsDisplay::EventFilterArg event_filter;
+- event_filter.filter = &PointerBarrierWrapper::HandleEventWrapper;
+- event_filter.data = this;
+-
+- nux::GetGraphicsDisplay()->AddEventFilter(event_filter);
+ }
+
+ void PointerBarrierWrapper::DestroyBarrier()
+@@ -100,14 +75,13 @@
+ active = false;
+
+ Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
+- XFixesDestroyPointerBarrier(dpy, barrier);
+-
+- nux::GetGraphicsDisplay()->RemoveEventFilter(this);
++ XFixesDestroyPointerBarrier(dpy, barrier_);
+ }
+
+ void PointerBarrierWrapper::ReleaseBarrier(int event_id)
+ {
+- XFixesBarrierReleasePointer(nux::GetGraphicsDisplay()->GetX11Display(), barrier, event_id);
++ Display *dpy = nux::GetGraphicsDisplay()->GetX11Display();
++ XIBarrierReleasePointer(dpy, current_device_, barrier_, event_id);
+ }
+
+ void PointerBarrierWrapper::EmitCurrentData(int event_id, int x, int y)
+@@ -134,63 +108,77 @@
+ return first_event_;
+ }
+
+-bool PointerBarrierWrapper::HandleEvent(XEvent xevent)
+-{
+- if (xevent.type - event_base_ == XFixesBarrierNotify)
+- {
+- auto notify_event = reinterpret_cast<XFixesBarrierNotifyEvent*>(&xevent);
+-
+- if (notify_event->barrier == barrier && notify_event->subtype == XFixesBarrierHitNotify)
++int GetEventVelocity(XIBarrierEvent* event)
++{
++ double dx, dy;
++ double speed;
++ unsigned int millis;
++
++ dx = event->dx;
++ dy = event->dy;
++
++ // Sometimes dtime is 0, if so we don't want to divide by zero!
++ millis = event->dtime ?: 1;
++
++ speed = sqrt(dx * dx + dy * dy) / millis * 1000;
++
++ return speed;
++}
++
++bool PointerBarrierWrapper::OwnsBarrierEvent(PointerBarrier const barrier) const
++{
++ return barrier_ == barrier;
++}
++
++bool PointerBarrierWrapper::HandleBarrierEvent(XIBarrierEvent* barrier_event)
++{
++ int velocity = GetEventVelocity(barrier_event);
++ smoothing_accum_ += velocity;
++ smoothing_count_++;
++
++ current_device_ = barrier_event->deviceid;
++
++ if (velocity > threshold)
++ {
++ smoothing_timeout_.reset();
++ ReleaseBarrier(barrier_event->eventid);
++ }
++ else if (released)
++ {
++ /* If the barrier is released, just emit the current event without
++ * waiting, so there won't be any delay on releasing the barrier. */
++ smoothing_timeout_.reset();
++
++ SendBarrierEvent(barrier_event->root_x, barrier_event->root_y,
++ velocity, barrier_event->eventid);
++ }
++ else if (!smoothing_timeout_)
++ {
++ int x = barrier_event->root_x;
++ int y = barrier_event->root_y;
++ int event = barrier_event->eventid;
++
++ // If we are a new event, don't delay sending the first event
++ if (last_event_ != event)
+ {
+- smoothing_accum_ += notify_event->velocity;
+- smoothing_count_++;
+-
+- if (released)
+- {
+- /* If the barrier is released, just emit the current event without
+- * waiting, so there won't be any delay on releasing the barrier. */
+- smoothing_timeout_.reset();
+-
+- SendBarrierEvent(notify_event->x, notify_event->y,
+- notify_event->velocity, notify_event->event_id);
+- }
+- else if (!smoothing_timeout_)
+- {
+- int x = notify_event->x;
+- int y = notify_event->y;
+- int event = notify_event->event_id;
+-
+- // If we are a new event, don't delay sending the first event
+- if (last_event_ != event)
+- {
+- first_event_ = true;
+- last_event_ = event;
+-
+- SendBarrierEvent(notify_event->x, notify_event->y,
+- notify_event->velocity, notify_event->event_id);
+-
+- first_event_ = false;
+- }
+-
+- smoothing_timeout_.reset(new glib::Timeout(smoothing, [this, event, x, y] () {
+- EmitCurrentData(event, x, y);
+-
+- smoothing_timeout_.reset();
+- return false;
+- }));
+- }
++ first_event_ = true;
++ last_event_ = event;
++
++ SendBarrierEvent(barrier_event->root_x, barrier_event->root_y,
++ velocity, barrier_event->eventid);
++
++ first_event_ = false;
+ }
+
+- return notify_event->barrier == barrier;
++ smoothing_timeout_.reset(new glib::Timeout(smoothing, [this, event, x, y] () {
++ EmitCurrentData(event, x, y);
++
++ smoothing_timeout_.reset();
++ return false;
++ }));
+ }
+
+- return false;
+-}
+-
+-bool PointerBarrierWrapper::HandleEventWrapper(XEvent event, void* data)
+-{
+- PointerBarrierWrapper* wrapper = (PointerBarrierWrapper*)data;
+- return wrapper->HandleEvent(event);
++ return true;
+ }
+
+ }
+
+=== modified file 'launcher/PointerBarrier.h'
+--- launcher/PointerBarrier.h 2013-02-11 23:57:09 +0000
++++ launcher/PointerBarrier.h 2013-03-08 19:26:19 +0000
+@@ -23,6 +23,7 @@
+ #include <Nux/Nux.h>
+ #include <X11/Xlib.h>
+ #include <X11/extensions/Xfixes.h>
++#include <X11/extensions/XInput2.h>
+ #include <UnityCore/GLibSource.h>
+
+ namespace unity
+@@ -88,19 +89,20 @@
+
+ bool IsFirstEvent() const;
+
++ bool OwnsBarrierEvent(PointerBarrier const barrier) const;
++ bool HandleBarrierEvent(XIBarrierEvent* barrier_event);
++
+ protected:
+ void EmitCurrentData(int event_id, int x, int y);
+- bool HandleEvent(XEvent event);
+
+ private:
+- static bool HandleEventWrapper(XEvent event, void* data);
+-
+ void SendBarrierEvent(int x, int y, int velocity, int event_id);
+
+- int event_base_;
++ int xi2_opcode_;
+ int last_event_;
++ int current_device_;
+ bool first_event_;
+- PointerBarrier barrier;
++ PointerBarrier barrier_;
+
+ int smoothing_count_;
+ int smoothing_accum_;
+
+=== modified file 'tests/test_pointer_barrier.cpp'
+--- tests/test_pointer_barrier.cpp 2013-02-12 23:48:23 +0000
++++ tests/test_pointer_barrier.cpp 2013-03-08 19:26:19 +0000
+@@ -15,6 +15,7 @@
+ * <http://www.gnu.org/licenses/>
+ *
+ * Authored by: Marco Trevisan (Treviño) <marco.trevisan@canonical.com>
++ * Brandon Schaefer <brandon.schaefer@canonical.com>
+ *
+ */
+
+@@ -32,20 +33,21 @@
+ class MockPointerBarrier : public PointerBarrierWrapper
+ {
+ public:
+- bool HandleEvent(XEvent ev) { return PointerBarrierWrapper::HandleEvent(ev); }
++ bool HandleBarrierEvent(XIBarrierEvent* b_ev) { return PointerBarrierWrapper::HandleBarrierEvent(b_ev); }
+ };
+
+-XFixesBarrierNotifyEvent GetGenericEvent (unsigned int id)
++XIBarrierEvent GetGenericEvent (unsigned int id)
+ {
+- XFixesBarrierNotifyEvent ev;
++ XIBarrierEvent ev;
+
+- ev.type = XFixesBarrierNotify;
+- ev.subtype = XFixesBarrierHitNotify;
++ ev.evtype = GenericEvent;
+ ev.barrier = 0;
+- ev.event_id = id;
+- ev.x = 555;
+- ev.y = 333;
+- ev.velocity = std::numeric_limits<int>::max();
++ ev.eventid = id;
++ ev.root_x = 555;
++ ev.root_y = 333;
++ ev.dx = 10;
++ ev.dy = 10;
++ ev.dtime = 15;
+
+ return ev;
+ }
+@@ -70,29 +72,11 @@
+ EXPECT_EQ(bev.event_id, 4);
+ }
+
+-TEST(TestPointerBarrier, HandleInvalidEvents)
+-{
+- MockPointerBarrier pb;
+- XFixesBarrierNotifyEvent ev;
+- auto xev = reinterpret_cast<XEvent*>(&ev);
+-
+- ev.type = XFixesBarrierNotify + 1;
+- EXPECT_FALSE(pb.HandleEvent(*xev));
+-
+- ev.type = XFixesBarrierNotify;
+- ev.subtype = XFixesBarrierHitNotify + 1;
+- ev.barrier = 1;
+- EXPECT_FALSE(pb.HandleEvent(*xev));
+-
+- ev.barrier = 0;
+- EXPECT_TRUE(pb.HandleEvent(*xev));
+-}
+-
+ TEST(TestPointerBarrier, HandleHitNotifyEvents)
+ {
+ MockPointerBarrier pb;
+- XFixesBarrierNotifyEvent ev = GetGenericEvent(0xdeadbeef);
+- auto xev = reinterpret_cast<XEvent*>(&ev);
++ pb.threshold = 1000;
++ XIBarrierEvent ev = GetGenericEvent(0xdeadbeef);
+
+ bool got_event = false;
+
+@@ -102,14 +86,14 @@
+ got_event = true;
+
+ EXPECT_EQ(pbw, &pb);
+- EXPECT_EQ(bev->x, ev.x);
+- EXPECT_EQ(bev->y, ev.y);
++ EXPECT_EQ(bev->x, ev.root_x);
++ EXPECT_EQ(bev->y, ev.root_y);
+ EXPECT_EQ(bev->velocity, 600 * pb.max_velocity_multiplier);
+- EXPECT_EQ(bev->event_id, ev.event_id);
++ EXPECT_EQ(bev->event_id, ev.eventid);
+ }
+ });
+
+- EXPECT_TRUE(pb.HandleEvent(*xev));
++ EXPECT_TRUE(pb.HandleBarrierEvent(&ev));
+ EXPECT_FALSE(got_event);
+
+ Utils::WaitForTimeoutMSec(pb.smoothing());
+@@ -120,30 +104,30 @@
+ TEST(TestPointerBarrier, HandleHitNotifyReleasedEvents)
+ {
+ MockPointerBarrier pb;
+- XFixesBarrierNotifyEvent ev = GetGenericEvent(0xabba);
+- auto xev = reinterpret_cast<XEvent*>(&ev);
++ pb.threshold = 1000;
++ XIBarrierEvent ev = GetGenericEvent(0xabba);
+ bool got_event = false;
+
+ pb.barrier_event.connect([&] (PointerBarrierWrapper* pbw, BarrierEvent::Ptr bev) {
+ got_event = true;
+
+ EXPECT_EQ(pbw, &pb);
+- EXPECT_EQ(bev->x, ev.x);
+- EXPECT_EQ(bev->y, ev.y);
+- EXPECT_EQ(bev->velocity, ev.velocity);
+- EXPECT_EQ(bev->event_id, ev.event_id);
++ EXPECT_EQ(bev->x, ev.root_x);
++ EXPECT_EQ(bev->y, ev.root_y);
++ EXPECT_GT(bev->velocity, 0);
++ EXPECT_EQ(bev->event_id, ev.eventid);
+ });
+
+ pb.released = true;
+- EXPECT_TRUE(pb.HandleEvent(*xev));
++ EXPECT_TRUE(pb.HandleBarrierEvent(&ev));
+ EXPECT_TRUE(got_event);
+ }
+
+ TEST(TestPointerBarrier, ReciveFirstEvent)
+ {
+ MockPointerBarrier pb;
+- XFixesBarrierNotifyEvent ev = GetGenericEvent(0xabba);
+- auto xev = reinterpret_cast<XEvent*>(&ev);
++ pb.threshold = 1000;
++ XIBarrierEvent ev = GetGenericEvent(0xabba);
+
+ bool first_is_true = false;
+
+@@ -151,15 +135,15 @@
+ first_is_true = true;
+ });
+
+- EXPECT_TRUE(pb.HandleEvent(*xev));
++ EXPECT_TRUE(pb.HandleBarrierEvent(&ev));
+ EXPECT_TRUE(first_is_true);
+ }
+
+ TEST(TestPointerBarrier, ReciveSecondEventFirstFalse)
+ {
+ MockPointerBarrier pb;
+- XFixesBarrierNotifyEvent ev = GetGenericEvent(0xabba);
+- auto xev = reinterpret_cast<XEvent*>(&ev);
++ pb.threshold = 1000;
++ XIBarrierEvent ev = GetGenericEvent(0xabba);
+ int events_recived = 0;
+
+ pb.barrier_event.connect([&] (PointerBarrierWrapper* pbw, BarrierEvent::Ptr bev) {
+@@ -171,7 +155,7 @@
+ EXPECT_FALSE(pbw->IsFirstEvent());
+ });
+
+- EXPECT_TRUE(pb.HandleEvent(*xev));
++ EXPECT_TRUE(pb.HandleBarrierEvent(&ev));
+
+ Utils::WaitForTimeoutMSec(pb.smoothing());
+
+
View
25 unity/PKGBUILD
@@ -6,7 +6,7 @@ pkgname=unity
pkgver=6.12.0
_actual_ver="${pkgver}"
_extra_ver="daily13.03.01"
-pkgrel=101
+pkgrel=102
if [ "${_UBUNTU}" == true ]; then
_ubuntu_rel=0ubuntu1
@@ -18,8 +18,8 @@ pkgdesc="A desktop experience designed for efficiency of space and interaction"
arch=('i686' 'x86_64')
url="https://launchpad.net/unity"
license=('GPL')
-depends=('bamf' 'boost' 'compiz-ubuntu>=0.9.8.4' 'clutter-gtk' 'gjs' 'gnome-desktop' 'gnome-screensaver' 'gnome-session-ubuntu' 'libgnomeui' 'libindicator' 'libindicator3' 'libnotify' 'libunique' 'libunity' 'libunity-misc' 'libxfixes-ubuntu' 'libzeitgeist' 'nux' 'unity-asset-pool' 'xorg-server>=1.12.0-100')
-makedepends=('cmake' 'doxygen' 'intltool' 'pkg-config' 'python2-distribute')
+depends=('bamf' 'boost' 'compiz-ubuntu>=0.9.8.4' 'clutter-gtk' 'gjs' 'gnome-desktop' 'gnome-screensaver' 'gnome-session-ubuntu' 'libgnomeui' 'libindicator' 'libindicator3' 'libnotify' 'libunique' 'libunity' 'libunity-misc' 'libxfixes' 'libzeitgeist' 'nux' 'unity-asset-pool' 'libxi>=1.7')
+makedepends=('cmake' 'doxygen' 'intltool' 'patchutils' 'pkg-config' 'python2-distribute')
checkdepends=('gtest-ubuntu' 'gmock-ubuntu')
groups=('unity')
provides=("unity-core=${_actual_ver}")
@@ -33,6 +33,7 @@ source=("https://launchpad.net/ubuntu/+archive/primary/+files/unity_${_actual_ve
'0001_Remove_gtest.patch'
'0002_ArchLinux_Branding.patch'
'0003_Revert_r3134_Remove_Systray_Whitelist.patch'
+ '0004_Port_to_XI_1.7.patch'
'launcher_bfb.png'
'unity-migrate-dconf-path.desktop'
'10_unity.gschema.override')
@@ -42,6 +43,7 @@ sha512sums=('952e986d25ad7a61a22f0dcdf719c7e5a40c2c9136b9afaf9328e26c16786aae58c
'd4f9bc2078df390003b8749955ff22be4538e79cb57efac8a29b98ee1567eb7787e61c1f577884e7ae801b7eeb3207370a1cec1fdce86cb217da50f981374fad'
'6fbfa03faadb23d7908bb1b9cc61a3bdfd5ff412b9a1104103aef7d60cd146ccd51b022b5a64bc1ece116d7f754e9d5372cf8fa790fb7f150a87d84b1dc616fb'
'a5e58f44c4a4c20dc577bf79bc949598c0762cc104f71ea1dac13711df1f20e1088aaec179e7e6f36830f704033ec26adc3572c6cf8a862a4a272b24dd4ac01e'
+ 'f6745256b356b2d3e089dac388216e6234db40948c039e02b716638862da25470c1e018fde3b27032e598c652c7bd633704620dcf569565766d8771b6676cf58'
'dc93362a6f1532dc478c45e774d124aa54f18b8a445770d43134d212ac4811514264f16ebc308e2512c01b04dbaf0708e5a29011dd75e7ed9385cfdf869f1b26'
'8eb535adc7aefd95c0ccfdd35525b4be764c4377ae5fc6002ad6ef6fd84b733c9054f8228083ce50eac1f970fdc1ef987ad1eb47813e7621b481ec3f490a9df7'
'872c48f85350d2d815418afab340946f85ec1f9f3e1ab748fc1199df342df52642447736a5b783fb17eb324a961bbf8badc4e8401512e7182e4ff2e25b53d3a1')
@@ -56,6 +58,12 @@ build() {
# Upstream support for the systray whitelist was removed
patch -p0 -i "${srcdir}/0003_Revert_r3134_Remove_Systray_Whitelist.patch"
+ # Port to XI 1.7 (thanks to qiuwei for finding this!)
+ # Source: https://code.launchpad.net/~brandontschaefer/unity/move-pointer-barrier-to-xi-1.6.99.1
+ #patch -p0 -i "${srcdir}/0004_Port_to_XI_1.7.patch"
+ cat "${srcdir}/0004_Port_to_XI_1.7.patch" | \
+ filterdiff --exclude debian/changelog --exclude debian/control | patch -p0
+
# Apply Ubuntu patches
patch -p1 -i "${srcdir}/unity_${_actual_ver}${_extra_ver}-${_ubuntu_rel}.diff"
for i in $(cat debian/patches/series | grep -v '#'); do
@@ -67,13 +75,6 @@ build() {
patch -p1 -i "${srcdir}/0001_Remove_gtest.patch"
fi
- # Cannot find gmodule
- #CXXFLAGS="${CXXFLAGS} $(pkg-config --cflags --libs gmodule-2.0)"
- #CFLAGS="${CFLAGS} $(pkg-config --cflags --libs gmodule-2.0)"
-
- # Link against pthread
- #LDFLAGS="${LDFLAGS} -lpthread"
-
# Install translations from Launchpad
pushd po
rm LINGUAS && touch LINGUAS # Recreate LINGUAS (list of languages) file
@@ -99,8 +100,8 @@ build() {
-Duse_pch=OFF \
..
- #MAKEFLAGS="-j1"
- make ${MAKEFLAGS}
+ #export MAKEFLAGS="-j1"
+ make
# Make sure that the GSettings schema files were created
pushd generated/glib-2.0/schemas/

0 comments on commit 046f034

Please sign in to comment.
Something went wrong with that request. Please try again.