summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorQuentin Glidic2016-07-11 16:20:08 +0200
committerQuentin Glidic2016-07-12 16:27:16 +0200
commitf64d790703785222216a7eedb092b819f18e722e (patch)
tree4a149b296fe1fab227743ca5e62f36a409ba839e /packages
parent111c052b7748b3ba9eab5b471d14c0589688d7b9 (diff)
downloadsardemff7-pending-f64d790703785222216a7eedb092b819f18e722e.tar.xz
mozilla-app: Wayland patch try
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'packages')
-rw-r--r--packages/net-www/nightly/files/wayland.patch90
-rw-r--r--packages/net-www/nightly/nightly-scm.exheres-01
2 files changed, 91 insertions, 0 deletions
diff --git a/packages/net-www/nightly/files/wayland.patch b/packages/net-www/nightly/files/wayland.patch
new file mode 100644
index 0000000..dea634e
--- /dev/null
+++ b/packages/net-www/nightly/files/wayland.patch
@@ -0,0 +1,90 @@
+diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
+index 4ac1d34..eadaa84 100644
+--- a/widget/gtk/nsWindow.cpp
++++ b/widget/gtk/nsWindow.cpp
+@@ -126,6 +126,7 @@ using namespace mozilla::widget;
+ #include "NativeKeyBindings.h"
+
+ #include <dlfcn.h>
++#include <sys/time.h>
+
+ #include "mozilla/layers/APZCTreeManager.h"
+
+@@ -290,21 +291,26 @@ namespace mozilla {
+ class CurrentX11TimeGetter
+ {
+ public:
+- explicit CurrentX11TimeGetter(GdkWindow* aWindow)
++ explicit CurrentX11TimeGetter(GdkWindow* aWindow, bool aIsX11Display)
+ : mWindow(aWindow)
++ , mIsX11Display(aIsX11Display)
+ , mAsyncUpdateStart()
+ {
+ }
+
+ guint32 GetCurrentTime() const
+ {
+- return gdk_x11_get_server_time(mWindow);
++ if (mIsX11Display) {
++ return gdk_x11_get_server_time(mWindow);
++ } else {
++ return g_get_monotonic_time()/1000;
++ }
+ }
+
+ void GetTimeAsyncForPossibleBackwardsSkew(const TimeStamp& aNow)
+ {
+ // Check for in-flight request
+- if (!mAsyncUpdateStart.IsNull()) {
++ if (!mIsX11Display || !mAsyncUpdateStart.IsNull()) {
+ return;
+ }
+ mAsyncUpdateStart = aNow;
+@@ -321,6 +327,9 @@ public:
+ gboolean PropertyNotifyHandler(GtkWidget* aWidget,
+ GdkEventProperty* aEvent)
+ {
++ if (!mIsX11Display)
++ return FALSE;
++
+ if (aEvent->atom !=
+ gdk_x11_xatom_to_atom(TimeStampPropAtom())) {
+ return FALSE;
+@@ -343,6 +352,7 @@ private:
+ // This is safe because this class is stored as a member of mWindow and
+ // won't outlive it.
+ GdkWindow* mWindow;
++ bool mIsX11Display;
+ TimeStamp mAsyncUpdateStart;
+ };
+
+@@ -1392,6 +1402,10 @@ nsWindow::GetLastUserInputTime()
+ // drags, WM_DELETE_WINDOW delete events, but not usually mouse motion nor
+ // button and key releases. Therefore use the most recent of
+ // gdk_x11_display_get_user_time and the last time that we have seen.
++ GdkDisplay *display = gdk_display_get_default();
++ if (!GDK_IS_X11_DISPLAY(display))
++ return sLastUserInputTime;
++
+ guint32 timestamp =
+ gdk_x11_display_get_user_time(gdk_display_get_default());
+ if (sLastUserInputTime != GDK_CURRENT_TIME &&
+@@ -3059,7 +3073,7 @@ mozilla::CurrentX11TimeGetter*
+ nsWindow::GetCurrentTimeGetter() {
+ MOZ_ASSERT(mGdkWindow, "Expected mGdkWindow to be set");
+ if (MOZ_UNLIKELY(!mCurrentTimeGetter)) {
+- mCurrentTimeGetter = MakeUnique<CurrentX11TimeGetter>(mGdkWindow);
++ mCurrentTimeGetter = MakeUnique<CurrentX11TimeGetter>(mGdkWindow, mIsX11Display);
+ }
+ return mCurrentTimeGetter.get();
+ }
+@@ -3941,7 +3955,8 @@ nsWindow::Create(nsIWidget* aParent,
+ // Similarly double buffering is controlled by the window's owning
+ // widget. Disable double buffering for painting directly to the
+ // X Window.
+- gtk_widget_set_double_buffered(widgets[i], FALSE);
++ if (mIsX11Display)
++ gtk_widget_set_double_buffered(widgets[i], FALSE);
+ }
+
+ // We create input contexts for all containers, except for
diff --git a/packages/net-www/nightly/nightly-scm.exheres-0 b/packages/net-www/nightly/nightly-scm.exheres-0
index e882f5d..adef4a9 100644
--- a/packages/net-www/nightly/nightly-scm.exheres-0
+++ b/packages/net-www/nightly/nightly-scm.exheres-0
@@ -9,6 +9,7 @@ HOMEPAGE="http://www.mozilla.com/en-US/firefox"
PLATFORMS="~amd64"
DEFAULT_SRC_PREPARE_PATCHES=(
+ "${FILES}"/wayland.patch
"${FILES}"/gtk2less.patch
)