tigervnc: update to 1.9.0.

This commit is contained in:
Rasmus Thomsen 2018-10-16 11:28:09 +02:00 committed by maxice8
parent 1acd35357c
commit e29531b735
2 changed files with 18 additions and 132 deletions

View file

@ -1,119 +0,0 @@
From 46665b6c791597d5f4f7a0351c491e4dd38b0d71 Mon Sep 17 00:00:00 2001
From: Pierre Ossman <ossman@cendio.se>
Date: Tue, 12 Jun 2018 15:57:27 +0200
Subject: [PATCH 1/2] Update comment about keyboard grab on focus changes
It is no longer a workaround but rather intended behaviour.
From 1d94124f6854e73eef58c595b2b1a4d2a7333962 Mon Sep 17 00:00:00 2001
From: Pierre Ossman <ossman@cendio.se>
Date: Tue, 12 Jun 2018 15:58:34 +0200
Subject: [PATCH 2/2] Ignore fake focus events from XGrabKeyboard()
Grabbing (and ungrabbing) the keyboard generates fake focus events
with modern versions of Xorg. This causes an infinite loop since we
update the grab status on focus events.
Work around this by ignoring these fake events.
--- vncviewer/DesktopWindow.cxx
+++ vncviewer/DesktopWindow.cxx
@@ -662,20 +662,16 @@ int DesktopWindow::fltkHandle(int event,
if (dw && fullscreenSystemKeys) {
switch (event) {
+ // Focus might not stay with us just because we have grabbed the
+ // keyboard. E.g. we might have sub windows, or we're not using
+ // all monitors and the user clicked on another application.
+ // Make sure we update our grabs with the focus changes.
case FL_FOCUS:
- // FIXME: We reassert the keyboard grabbing on focus as FLTK there are
- // some issues we need to work around:
- // a) Fl::grab(0) on X11 will release the keyboard grab for us.
- // b) Gaining focus on the system level causes FLTK to switch
- // window level on OS X.
if (dw->fullscreen_active())
dw->grabKeyboard();
break;
case FL_UNFOCUS:
- // FIXME: We need to relinquish control when the entire window loses
- // focus as it is very tied to this specific window on some
- // platforms and we want to be able to open subwindows.
dw->ungrabKeyboard();
break;
}
@@ -729,6 +725,23 @@ void DesktopWindow::fullscreen_on()
fullscreen();
}
+#if !defined(WIN32) && !defined(__APPLE__)
+Bool eventIsFocusWithSerial(Display *display, XEvent *event, XPointer arg)
+{
+ unsigned long serial;
+
+ serial = *(unsigned long*)arg;
+
+ if (event->xany.serial != serial)
+ return False;
+
+ if ((event->type != FocusIn) && (event->type != FocusOut))
+ return False;
+
+ return True;
+}
+#endif
+
void DesktopWindow::grabKeyboard()
{
// Grabbing the keyboard is fairly safe as FLTK reroutes events to the
@@ -752,6 +765,11 @@ void DesktopWindow::grabKeyboard()
#else
int ret;
+ XEvent xev;
+ unsigned long serial;
+
+ serial = XNextRequest(fl_display);
+
ret = XGrabKeyboard(fl_display, fl_xid(this), True,
GrabModeAsync, GrabModeAsync, CurrentTime);
if (ret) {
@@ -774,6 +792,16 @@ void DesktopWindow::grabKeyboard()
None, None, CurrentTime);
if (ret)
vlog.error(_("Failure grabbing mouse"));
+
+ // Xorg 1.20+ generates FocusIn/FocusOut even when there is no actual
+ // change of focus. This causes us to get stuck in an endless loop
+ // grabbing and ungrabbing the keyboard. Avoid this by filtering out
+ // any focus events generated by XGrabKeyboard().
+ XSync(fl_display, False);
+ while (XCheckIfEvent(fl_display, &xev, &eventIsFocusWithSerial,
+ (XPointer)&serial) == True) {
+ vlog.debug("Ignored synthetic focus event cause by grab change");
+ }
#endif
}
@@ -791,8 +819,20 @@ void DesktopWindow::ungrabKeyboard()
if (Fl::grab())
return;
+ XEvent xev;
+ unsigned long serial;
+
+ serial = XNextRequest(fl_display);
+
XUngrabPointer(fl_display, fl_event_time);
XUngrabKeyboard(fl_display, fl_event_time);
+
+ // See grabKeyboard()
+ XSync(fl_display, False);
+ while (XCheckIfEvent(fl_display, &xev, &eventIsFocusWithSerial,
+ (XPointer)&serial) == True) {
+ vlog.debug("Ignored synthetic focus event cause by grab change");
+ }
#endif
}

View file

@ -1,43 +1,48 @@
# Template file for 'tigervnc'
pkgname=tigervnc
version=1.8.0
revision=4
_xorg_version=1.19.6
version=1.9.0
revision=1
_xorg_version=1.20.0
build_style=cmake
short_desc="VNC client forked from TightVNC"
maintainer="Evan Deaubl <evan@deaubl.name>"
license="GPL-2"
license="GPL-2.0-or-later"
hostmakedepends="automake xorg-util-macros font-util pkg-config libtool xtrans"
makedepends="fltk-devel zlib-devel libXtst-devel libjpeg-turbo-devel pixman-devel
xorgproto libxkbfile-devel libXfont2-devel gnutls-devel"
xorgproto libxkbfile-devel libXfont2-devel gnutls-devel libdrm-devel"
depends="perl xauth xkeyboard-config"
conflicts="turbovnc>=0"
homepage="http://www.tigervnc.org"
homepage="https://www.tigervnc.org"
distfiles="https://github.com/TigerVNC/tigervnc/archive/v${version}.tar.gz>tigervnc-${version}.tar.gz
${XORG_SITE}/xserver/xorg-server-${_xorg_version}.tar.bz2"
checksum="9951dab0e10f8de03996ec94bec0d938da9f36d48dca8c954e8bbc95c16338f8
a732502f1db000cf36a376cd0c010ffdbf32ecdd7f1fa08ba7f5bdf9601cc197"
checksum="f15ced8500ec56356c3bf271f52e58ed83729118361c7103eab64a618441f740
9d967d185f05709274ee0c4f861a4672463986e550ca05725ce27974f550d3e6"
post_configure() {
cd ${wrksrc}/unix/xserver
cp -R ${XBPS_BUILDDIR}/xorg-server-${_xorg_version}/* .
patch -p1 <../xserver119.patch
autoreconf -fiv
patch -p1 <../xserver120.patch
autoreconf -fi
./configure --host=${XBPS_CROSS_TRIPLET} --prefix=/usr \
--with-pic --without-dtrace --disable-static \
--disable-xvfb --disable-xnest --disable-xorg --disable-dmx \
--disable-xwin --disable-xwayland --disable-xephyr \
--disable-kdrive --disable-config-hal --disable-config-udev \
--disable-dri --enable-dri2 --enable-dri3 --enable-glx \
--disable-unit-tests --disable-devel-docs --disable-selective-werror
--disable-unit-tests --disable-devel-docs --disable-selective-werror \
CFLAGS="$CFLAGS -I${XBPS_CROSS_BASE}/usr/include/libdrm"
# Hardcodes TIGERVNC_BUILDDIR which we have to set later on because
# we do out of source builds
sed "s/TIGERVNC_BUILDDIR =/TIGERVNC_BUILDDIR :=/" -i hw/vnc/Makefile
}
post_build() {
cd ${wrksrc}/unix/xserver
make LIB_DIR=${wrksrc}/build/common
make TIGERVNC_BUILDDIR=${wrksrc}/build
}
post_install() {
cd ${wrksrc}/unix/xserver/hw/vnc
make LIB_DIR=${wrksrc}/build/common DESTDIR=${DESTDIR} install
make TIGERVNC_BUILDDIR=${wrksrc}/build DESTDIR=${DESTDIR} install
}