diff --git a/SOURCES/tigervnc-check-endianness-when-constructing-platformpixelbuffer.patch b/SOURCES/tigervnc-check-endianness-when-constructing-platformpixelbuffer.patch
new file mode 100644
index 0000000..2accecf
--- /dev/null
+++ b/SOURCES/tigervnc-check-endianness-when-constructing-platformpixelbuffer.patch
@@ -0,0 +1,21 @@
+From 86cec815e444842411f82c12b2c039ec455f2179 Mon Sep 17 00:00:00 2001
+From: Jan Grulich <jgrulich@redhat.com>
+Date: Wed, 8 Aug 2018 15:29:23 +0200
+Subject: Check endianness when constructing PlatformPixelBuffer()
+
+
+diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx
+index a2b506df..b5c94d57 100644
+--- a/vncviewer/PlatformPixelBuffer.cxx
++++ b/vncviewer/PlatformPixelBuffer.cxx
+@@ -34,8 +34,8 @@
+ static rfb::LogWriter vlog("PlatformPixelBuffer");
+ 
+ PlatformPixelBuffer::PlatformPixelBuffer(int width, int height) :
+-  FullFramePixelBuffer(rfb::PixelFormat(32, 24, false, true,
+-                                       255, 255, 255, 16, 8, 0),
++  FullFramePixelBuffer(rfb::PixelFormat(32, 24, ImageByteOrder(fl_display) == MSBFirst,
++                                        true, 255, 255, 255, 16, 8, 0),
+                        width, height, 0, stride),
+   Surface(width, height)
+ #if !defined(WIN32) && !defined(__APPLE__)
diff --git a/SOURCES/tigervnc-ignore-fake-focus-events-from-xgrabkeyboard.patch b/SOURCES/tigervnc-ignore-fake-focus-events-from-xgrabkeyboard.patch
new file mode 100644
index 0000000..8ee3181
--- /dev/null
+++ b/SOURCES/tigervnc-ignore-fake-focus-events-from-xgrabkeyboard.patch
@@ -0,0 +1,138 @@
+diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
+index 47fe8f8..8f387dc 100644
+--- a/vncviewer/DesktopWindow.cxx
++++ b/vncviewer/DesktopWindow.cxx
+@@ -1,16 +1,16 @@
+ /* Copyright (C) 2002-2005 RealVNC Ltd.  All Rights Reserved.
+  * Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB
+- * 
++ *
+  * This is free software; you can redistribute it and/or modify
+  * it under the terms of the GNU General Public License as published by
+  * the Free Software Foundation; either version 2 of the License, or
+  * (at your option) any later version.
+- * 
++ *
+  * This software is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+- * 
++ *
+  * You should have received a copy of the GNU General Public License
+  * along with this software; if not, write to the Free Software
+  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
+@@ -662,20 +662,16 @@ int DesktopWindow::fltkHandle(int event, Fl_Window *win)
+ 
+   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
+@@ -739,19 +752,24 @@ void DesktopWindow::grabKeyboard()
+ 
+ #if defined(WIN32)
+   int ret;
+-  
++
+   ret = win32_enable_lowlevel_keyboard(fl_xid(this));
+   if (ret != 0)
+     vlog.error(_("Failure grabbing keyboard"));
+ #elif defined(__APPLE__)
+   int ret;
+-  
++
+   ret = cocoa_capture_display(this, fullScreenAllMonitors);
+   if (ret != 0)
+     vlog.error(_("Failure grabbing keyboard"));
+ #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
+ }
+ 
diff --git a/SOURCES/tigervnc-kill-session-after-logout.patch b/SOURCES/tigervnc-kill-session-after-logout.patch
new file mode 100644
index 0000000..da265d0
--- /dev/null
+++ b/SOURCES/tigervnc-kill-session-after-logout.patch
@@ -0,0 +1,14 @@
+diff --git a/unix/vncserver b/unix/vncserver
+index b6e18c2..6b07218 100755
+--- a/unix/vncserver
++++ b/unix/vncserver
+@@ -63,7 +63,8 @@ $defaultXStartup
+     = ("#!/bin/sh\n\n".
+        "unset SESSION_MANAGER\n".
+        "unset DBUS_SESSION_BUS_ADDRESS\n".
+-       "exec /etc/X11/xinit/xinitrc\n");
++       "/etc/X11/xinit/xinitrc\n".
++       "vncserver -kill \$DISPLAY\n");
+
+ $defaultConfig
+     = ("## Supported server options to pass to vncserver upon invocation can be listed\n".
diff --git a/SOURCES/tigervnc-support-xorg120.patch b/SOURCES/tigervnc-support-xorg120.patch
new file mode 100644
index 0000000..d60e602
--- /dev/null
+++ b/SOURCES/tigervnc-support-xorg120.patch
@@ -0,0 +1,76 @@
+diff -up tigervnc-1.8.0/unix/xserver/hw/vnc/xorg-version.h.jx tigervnc-1.8.0/unix/xserver/hw/vnc/xorg-version.h
+--- tigervnc-1.8.0/unix/xserver/hw/vnc/xorg-version.h.jx	2017-05-16 09:53:28.000000000 -0400
++++ tigervnc-1.8.0/unix/xserver/hw/vnc/xorg-version.h	2018-06-06 15:42:07.388157181 -0400
+@@ -52,8 +52,10 @@
+ #define XORG 118
+ #elif XORG_VERSION_CURRENT < ((1 * 10000000) + (19 * 100000) + (99 * 1000))
+ #define XORG 119
++#elif XORG_VERSION_CURRENT < ((1 * 10000000) + (20 * 100000) + (99 * 1000))
++#define XORG 120
+ #else
+-#error "X.Org newer than 1.19 is not supported"
++#error "X.Org newer than 1.20 is not supported"
+ #endif
+
+ #endif
+diff -up tigervnc-1.8.0/unix/xserver/hw/vnc/xvnc.c.jx tigervnc-1.8.0/unix/xserver/hw/vnc/xvnc.c
+--- tigervnc-1.8.0/unix/xserver/hw/vnc/xvnc.c.jx	2017-05-16 09:53:28.000000000 -0400
++++ tigervnc-1.8.0/unix/xserver/hw/vnc/xvnc.c	2018-06-06 15:42:58.384936550 -0400
+@@ -46,6 +46,7 @@ from the X Consortium.
+ #include <X11/Xproto.h>
+ #include <X11/Xos.h>
+ #include "scrnintstr.h"
++#include "glx_extinit.h"
+ #include "servermd.h"
+ #include "fb.h"
+ #include "mi.h"
+@@ -202,6 +202,7 @@ vfbBitsPerPixel(int depth)
+
+ static void vfbFreeFramebufferMemory(vfbFramebufferInfoPtr pfb);
+
++#if XORG < 120
+ #ifdef DPMSExtension
+     /* Why support DPMS? Because stupid modern desktop environments
+        such as Unity 2D on Ubuntu 11.10 crashes if DPMS is not
+@@ -219,6 +220,7 @@ Bool DPMSSupported(void)
+     return FALSE;
+ }
+ #endif
++#endif
+
+ #if XORG < 111
+ void ddxGiveUp()
+@@ -1491,6 +1493,12 @@ vfbCloseScreen(ScreenPtr pScreen)
+ #endif
+ }
+
++#if XORG >= 120
++static void vncDPMS(ScreenPtr pScreen, int level)
++{
++}
++#endif
++
+ static Bool
+ #if XORG < 113
+ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv)
+@@ -1661,6 +1669,9 @@ vfbScreenInit(ScreenPtr pScreen, int arg
+     if (!ret) return FALSE;
+ #endif
+
++#if XORG >= 120
++    pScreen->DPMS = vncDPMS;
++#endif
+
+   return TRUE;
+
+@@ -1696,7 +1707,9 @@ InitOutput(ScreenInfo *scrInfo, int argc
+
+     vncPrintBanner();
+
+-#if XORG >= 113
++#if XORG >= 120
++    xorgGlxCreateVendor();
++#elif XORG >= 113
+ #ifdef GLXEXT
+     if (serverGeneration == 1)
+ #if XORG >= 116
diff --git a/SOURCES/tigervnc-use-current-server-time-for-ungrab.patch b/SOURCES/tigervnc-use-current-server-time-for-ungrab.patch
new file mode 100644
index 0000000..3bc3c1c
--- /dev/null
+++ b/SOURCES/tigervnc-use-current-server-time-for-ungrab.patch
@@ -0,0 +1,15 @@
+diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx
+index 8f387dc..a93aa50 100644
+--- a/vncviewer/DesktopWindow.cxx
++++ b/vncviewer/DesktopWindow.cxx
+@@ -824,8 +824,8 @@ void DesktopWindow::ungrabKeyboard()
+ 
+   serial = XNextRequest(fl_display);
+ 
+-  XUngrabPointer(fl_display, fl_event_time);
+-  XUngrabKeyboard(fl_display, fl_event_time);
++  XUngrabPointer(fl_display, CurrentTime);
++  XUngrabKeyboard(fl_display, CurrentTime);
+ 
+   // See grabKeyboard()
+   XSync(fl_display, False);
diff --git a/SOURCES/tigervnc-xserver119.patch b/SOURCES/tigervnc-xserver119.patch
deleted file mode 100644
index 614f104..0000000
--- a/SOURCES/tigervnc-xserver119.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff -up xserver/configure.ac.xserver116-rebased xserver/configure.ac
---- xserver/configure.ac.xserver116-rebased	2016-09-29 13:14:45.595441590 +0200
-+++ xserver/configure.ac	2016-09-29 13:14:45.631442006 +0200
-@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x
- AC_CONFIG_HEADERS(include/version-config.h)
- 
- AM_PROG_AS
-+AC_PROG_CXX
- AC_PROG_LN_S
- LT_PREREQ([2.2])
- LT_INIT([disable-static win32-dll])
-@@ -1863,6 +1864,10 @@ if test "x$XVFB" = xyes; then
- 	AC_SUBST([XVFB_SYS_LIBS])
- fi
- 
-+dnl Xvnc DDX
-+AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"])
-+AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"])
-+AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
- 
- dnl Xnest DDX
- 
-@@ -1898,6 +1903,8 @@ if test "x$XORG" = xauto; then
- fi
- AC_MSG_RESULT([$XORG])
- 
-+AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
-+
- if test "x$XORG" = xyes; then
- 	XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
- 	XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
-@@ -2116,7 +2123,6 @@ if test "x$XORG" = xyes; then
- 	AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
- 	AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
- 	AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
--	AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
- 	AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
- 	AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
- 	AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
-@@ -2691,6 +2697,7 @@ hw/dmx/Makefile
- hw/dmx/man/Makefile
- hw/vfb/Makefile
- hw/vfb/man/Makefile
-+hw/vnc/Makefile
- hw/xnest/Makefile
- hw/xnest/man/Makefile
- hw/xwin/Makefile
-diff -up xserver/hw/Makefile.am.xserver116-rebased xserver/hw/Makefile.am
---- xserver/hw/Makefile.am.xserver116-rebased	2016-09-29 13:14:45.601441659 +0200
-+++ xserver/hw/Makefile.am	2016-09-29 13:14:45.631442006 +0200
-@@ -38,7 +38,8 @@ SUBDIRS =			\
- 	$(DMX_SUBDIRS)		\
- 	$(KDRIVE_SUBDIRS)	\
- 	$(XQUARTZ_SUBDIRS)	\
--	$(XWAYLAND_SUBDIRS)
-+	$(XWAYLAND_SUBDIRS)	\
-+	vnc
- 
- DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
- 
-diff -up xserver/mi/miinitext.c.xserver116-rebased xserver/mi/miinitext.c
---- xserver/mi/miinitext.c.xserver116-rebased	2016-09-29 13:14:45.618441855 +0200
-+++ xserver/mi/miinitext.c	2016-09-29 13:14:45.631442006 +0200
-@@ -114,6 +114,10 @@ SOFTWARE.
- #include "micmap.h"
- #include "globals.h"
- 
-+#ifdef TIGERVNC
-+extern void vncExtensionInit(INITARGS);
-+#endif
-+
- /* The following is only a small first step towards run-time
-  * configurable extensions.
-  */
-@@ -238,6 +242,9 @@ EnableDisableExtensionError(const char *
- 
- /* List of built-in (statically linked) extensions */
- static const ExtensionModule staticExtensions[] = {
-+#ifdef TIGERVNC
-+    {vncExtensionInit, "VNC-EXTENSION", NULL},
-+#endif
-     {GEExtensionInit, "Generic Event Extension", &noGEExtension},
-     {ShapeExtensionInit, "SHAPE", NULL},
- #ifdef MITSHM
---- xserver/include/os.h~	2016-10-03 09:07:29.000000000 +0200
-+++ xserver/include/os.h	2016-10-03 14:13:00.013654506 +0200
-@@ -621,7 +621,7 @@
- extern _X_EXPORT void
- LogClose(enum ExitCode error);
- extern _X_EXPORT Bool
--LogSetParameter(LogParameter param, int value);
-+LogSetParameter(enum _LogParameter param, int value);
- extern _X_EXPORT void
- LogVWrite(int verb, const char *f, va_list args)
- _X_ATTRIBUTE_PRINTF(2, 0);
diff --git a/SOURCES/tigervnc-xserver120.patch b/SOURCES/tigervnc-xserver120.patch
new file mode 100644
index 0000000..e7eae3c
--- /dev/null
+++ b/SOURCES/tigervnc-xserver120.patch
@@ -0,0 +1,91 @@
+diff -up xserver/configure.ac.xserver116-rebased xserver/configure.ac
+--- xserver/configure.ac.xserver116-rebased	2016-09-29 13:14:45.595441590 +0200
++++ xserver/configure.ac	2016-09-29 13:14:45.631442006 +0200
+@@ -74,6 +74,7 @@ dnl forcing an entire recompile.x
+ AC_CONFIG_HEADERS(include/version-config.h)
+
+ AM_PROG_AS
++AC_PROG_CXX
+ AC_PROG_LN_S
+ LT_PREREQ([2.2])
+ LT_INIT([disable-static win32-dll])
+@@ -1863,6 +1864,10 @@ if test "x$XVFB" = xyes; then
+ 	AC_SUBST([XVFB_SYS_LIBS])
+ fi
+
++dnl Xvnc DDX
++AC_SUBST([XVNC_CPPFLAGS], ["-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"])
++AC_SUBST([XVNC_LIBS], ["$FB_LIB $FIXES_LIB $XEXT_LIB $CONFIG_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $DRI3_LIB $PRESENT_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $MAIN_LIB"])
++AC_SUBST([XVNC_SYS_LIBS], ["$GLX_SYS_LIBS"])
+
+ dnl Xnest DDX
+
+@@ -1898,6 +1903,8 @@ if test "x$XORG" = xauto; then
+ fi
+ AC_MSG_RESULT([$XORG])
+
++AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
++
+ if test "x$XORG" = xyes; then
+ 	XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
+ 	XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
+@@ -2116,7 +2123,6 @@ if test "x$XORG" = xyes; then
+ 	AC_DEFINE(XORG_SERVER, 1, [Building Xorg server])
+ 	AC_DEFINE(XORGSERVER, 1, [Building Xorg server])
+ 	AC_DEFINE(XFree86Server, 1, [Building XFree86 server])
+-	AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version])
+ 	AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs])
+ 	AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions])
+ 	AC_DEFINE(__XSERVERNAME__, "Xorg", [Name of X server])
+@@ -2691,6 +2697,7 @@ hw/dmx/Makefile
+ hw/dmx/man/Makefile
+ hw/vfb/Makefile
+ hw/vfb/man/Makefile
++hw/vnc/Makefile
+ hw/xnest/Makefile
+ hw/xnest/man/Makefile
+ hw/xwin/Makefile
+diff -up xserver/hw/Makefile.am.xserver116-rebased xserver/hw/Makefile.am
+--- xserver/hw/Makefile.am.xserver116-rebased	2016-09-29 13:14:45.601441659 +0200
++++ xserver/hw/Makefile.am	2016-09-29 13:14:45.631442006 +0200
+@@ -38,7 +38,8 @@ SUBDIRS =			\
+ 	$(DMX_SUBDIRS)		\
+ 	$(KDRIVE_SUBDIRS)	\
+ 	$(XQUARTZ_SUBDIRS)	\
+-	$(XWAYLAND_SUBDIRS)
++	$(XWAYLAND_SUBDIRS)	\
++	vnc
+
+ DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive xwayland
+
+diff --git xserver/mi/miinitext.c xserver/mi/miinitext.c
+index 5596e21..003fc3c 100644
+--- xserver/mi/miinitext.c
++++ xserver/mi/miinitext.c
+@@ -107,8 +107,15 @@ SOFTWARE.
+ #include "os.h"
+ #include "globals.h"
+
++#ifdef TIGERVNC
++extern void vncExtensionInit(INITARGS);
++#endif
++
+ /* List of built-in (statically linked) extensions */
+ static const ExtensionModule staticExtensions[] = {
++#ifdef TIGERVNC
++    {vncExtensionInit, "VNC-EXTENSION", NULL},
++#endif
+     {GEExtensionInit, "Generic Event Extension", &noGEExtension},
+     {ShapeExtensionInit, "SHAPE", NULL},
+ #ifdef MITSHM
+--- xserver/include/os.h~	2016-10-03 09:07:29.000000000 +0200
++++ xserver/include/os.h	2016-10-03 14:13:00.013654506 +0200
+@@ -621,7 +621,7 @@
+ extern _X_EXPORT void
+ LogClose(enum ExitCode error);
+ extern _X_EXPORT Bool
+-LogSetParameter(LogParameter param, int value);
++LogSetParameter(enum _LogParameter param, int value);
+ extern _X_EXPORT void
+ LogVWrite(int verb, const char *f, va_list args)
+ _X_ATTRIBUTE_PRINTF(2, 0);
diff --git a/SOURCES/tigervnc-xvnc-update-manpage.patch b/SOURCES/tigervnc-xvnc-update-manpage.patch
new file mode 100644
index 0000000..58f987e
--- /dev/null
+++ b/SOURCES/tigervnc-xvnc-update-manpage.patch
@@ -0,0 +1,215 @@
+diff --git a/unix/xserver/hw/vnc/Xvnc.man b/unix/xserver/hw/vnc/Xvnc.man
+index 04e8f94..cfccf4e 100644
+--- a/unix/xserver/hw/vnc/Xvnc.man
++++ b/unix/xserver/hw/vnc/Xvnc.man
+@@ -1,9 +1,9 @@
+ .TH Xvnc 1 "" "TigerVNC" "Virtual Network Computing"
+ .SH NAME
+-Xvnc \- the X VNC server 
++Xvnc \- the X VNC server
+ .SH SYNOPSIS
+ .B Xvnc
+-.RI [ options ] 
++.RI [ options ]
+ .RI : display#
+ .SH DESCRIPTION
+ .B Xvnc
+@@ -52,7 +52,7 @@ for depth 16 is RGB565 and for depth 24 is RGB888.
+ Listen on interface. By default Xvnc listens on all available interfaces.
+ .
+ .TP
+-.B \-inetd 
++.B \-inetd
+ This significantly changes Xvnc's behaviour so that it can be launched from
+ inetd.  See the section below on usage with inetd.
+ .
+@@ -83,12 +83,19 @@ protocol used in VNC is called RFB - "remote framebuffer").  The default is
+ 5900 plus the display number.
+ .
+ .TP
++.B \-UseIPv4
++Use IPv4 for incoming and outgoing connections. Default is on.
++.
++.TP
++.B \-UseIPv6
++Use IPv6 for incoming and outgoing connections. Default is on.
++.
++.TP
+ .B \-rfbwait \fItime\fP, \-ClientWaitTimeMillis \fItime\fP
+-
+-Time in milliseconds to wait for a viewer which is blocking Xvnc.  This is
+-necessary because Xvnc is single-threaded and sometimes blocks until the viewer
+-has finished sending or receiving a message - note that this does not mean an
+-update will be aborted after this time.  Default is 20000 (20 seconds).
++Time in milliseconds to wait for a viewer which is blocking the server. This is
++necessary because the server is single-threaded and sometimes blocks until the
++viewer has finished sending or receiving a message - note that this does not
++mean an update will be aborted after this time.  Default is 20000 (20 seconds).
+ .
+ .TP
+ .B \-httpd \fIdirectory\fP
+@@ -105,29 +112,14 @@ the display number.
+ .
+ .TP
+ .B \-rfbauth \fIpasswd-file\fP, \-PasswordFile \fIpasswd-file\fP
+-Specifies the file containing the password used to authenticate viewers.  The
+-file is accessed each time a connection comes in, so it can be changed on the
+-fly via \fBvncpasswd\fP(1).
+-.
+-.TP
+-.B \-DeferUpdate \fItime\fP
+-Xvnc uses a "deferred update" mechanism which enhances performance in many
+-cases. After any change to the framebuffer, Xvnc waits for this number of
+-milliseconds (default 1) before sending an update to any waiting clients. This
+-means that more changes tend to get coalesced together in a single
+-update. Setting it to 0 results in the same behaviour as earlier versions of
+-Xvnc, where the first change to the framebuffer causes an immediate update to
+-any waiting clients.
+-.
+-.TP
+-.B \-AlwaysSetDeferUpdateTimer
+-Keep delaying sending the screen update to the client(s) each time the
+-screen is updated. Otherwise the delay is from the first update. Default
+-is off.
++Password file for VNC authentication.  There is no default, you should
++specify the password file explicitly.  Password file should be created with
++the \fBvncpasswd\fP(1) utility.  The file is accessed each time a connection
++comes in, so it can be changed on the fly.
+ .
+ .TP
+ .B \-AcceptCutText
+-Accept clipboard updates from clients (default is on).
++Accept clipboard updates from clients. Default is on.
+ .
+ .TP
+ .B \-MaxCutText \fIbytes\fP
+@@ -136,7 +128,7 @@ Default is \fB262144\fP.
+ .
+ .TP
+ .B \-SendCutText
+-Send clipboard changes to clients (default is on).
++Send clipboard changes to clients. Default is on.
+ .
+ .TP
+ .B \-SendPrimary
+@@ -144,42 +136,58 @@ Send the primary selection and cut buffer to the server as well as the
+ clipboard selection. Default is on.
+ .
+ .TP
++.B \-SetPrimary
++Set the PRIMARY as well as the CLIPBOARD selection. Default is on.
++.
++.TP
+ .B \-AcceptPointerEvents
+-Accept pointer press and release events from clients (default is on).
++Accept pointer press and release events from clients. Default is on.
+ .
+ .TP
+ .B \-AcceptKeyEvents
+-Accept key press and release events from clients (default is on).
++Accept key press and release events from clients. Default is on.
++.
++.TP
++.B \-AcceptSetDesktopSize
++Accept requests to resize the size of the desktop. Default is on.
+ .
+ .TP
+ .B \-DisconnectClients
+-Disconnect existing clients if an incoming connection is non-shared (default is
+-on). If \fBDisconnectClients\fP is false, then a new non-shared connection will
++Disconnect existing clients if an incoming connection is non-shared. Default is
++on. If \fBDisconnectClients\fP is false, then a new non-shared connection will
+ be refused while there is a client active.  When combined with
+ \fBNeverShared\fP this means only one client is allowed at a time.
+ .
+ .TP
+ .B \-NeverShared
+ Never treat incoming connections as shared, regardless of the client-specified
+-setting (default is off).
++setting. Default is off.
+ .
+ .TP
+ .B \-AlwaysShared
+ Always treat incoming connections as shared, regardless of the client-specified
+-setting (default is off).
++setting. Default is off.
+ .
+ .TP
+ .B \-Protocol3.3
+ Always use protocol version 3.3 for backwards compatibility with badly-behaved
+-clients (default is off).
++clients. Default is off.
+ .
+ .TP
+-.B \-CompareFB
+-Perform pixel comparison on framebuffer to reduce unnecessary updates (default
+-is on).
++.B \-FrameRate \fIfps\fP
++The maximum number of updates per second sent to each client. If the screen
++updates any faster then those changes will be aggregated and sent in a single
++update to the client. Note that this only controls the maximum rate and a
++client may get a lower rate when resources are limited. Default is \fB60\fP.
+ .
+ .TP
+-.B \-ZlibLevel
++.B \-CompareFB \fImode\fP
++Perform pixel comparison on framebuffer to reduce unnecessary updates. Can
++be either \fB0\fP (off), \fB1\fP (always) or \fB2\fP (auto). Default is
++\fB2\fP.
++.
++.TP
++.B \-ZlibLevel \fIlevel\fP
+ Zlib compression level for ZRLE encoding (it does not affect Tight encoding).
+ Acceptable values are between 0 and 9.  Default is to use the standard
+ compression level provided by the \fBzlib\fP(3) compression library.
+@@ -226,6 +234,11 @@ Private key counter part to the certificate given in \fBX509Cert\fP. Must
+ also be in PEM format.
+ .
+ .TP
++.B \-GnuTLSPriority \fIpriority\fP
++GnuTLS priority string that controls the TLS session’s handshake algorithms.
++See the GnuTLS manual for possible values. Default is \fBNORMAL\fP.
++.
++.TP
+ .B \-BlacklistThreshold \fIcount\fP
+ The number of unauthenticated connection attempts allowed from any individual
+ host before that host is black-listed.  Default is 5.
+@@ -237,8 +250,8 @@ cannot re-attempt a connection until the timeout expires.  Default is 10.
+ .
+ .TP
+ .B \-IdleTimeout \fIseconds\fP
+-The number of seconds after which an idle VNC connection will be dropped
+-(default is 0, which means that idle connections will never be dropped).
++The number of seconds after which an idle VNC connection will be dropped.
++Default is 0, which means that idle connections will never be dropped.
+ .
+ .TP
+ .B \-MaxDisconnectionTime \fIseconds\fP
+@@ -257,13 +270,10 @@ Terminate after \fIN\fP seconds of user inactivity.  Default is 0.
+ .TP
+ .B \-QueryConnect
+ Prompts the user of the desktop to explicitly accept or reject incoming
+-connections.  This is most useful when using the vnc.so module or
+-\fBx0vncserver\fP(1) program to access an existing X desktop via VNC.
++connections. Default is off.
+ 
+ The \fBvncconfig\fP(1) program must be running on the desktop in order for
+-QueryConnect to be supported by the \fBvnc.so\fP(1) module or
+-\fBXvnc\fP(1) program.  The \fBx0vncserver\fP(1) program does not require
+-\fBvncconfig\fP(1) to be running.
++QueryConnect to be supported.
+ .
+ .TP
+ .B \-QueryConnectTimeout \fIseconds\fP
+@@ -294,8 +304,10 @@ or
+ where
+ .I char
+ is a hexadecimal keysym. For example, to exchange the " and @ symbols you would specify the following:
+-.IP "" 10
++
++.RS 10
+ RemapKeys=0x22<>0x40
++.RE
+ .
+ .TP
+ .B \-AvoidShiftNumLock
diff --git a/SPECS/tigervnc.spec b/SPECS/tigervnc.spec
index 16987f9..04ac796 100644
--- a/SPECS/tigervnc.spec
+++ b/SPECS/tigervnc.spec
@@ -1,6 +1,6 @@
 Name:           tigervnc
 Version:        1.8.0
-Release:        5%{?dist}
+Release:        13%{?dist}
 Summary:        A TigerVNC remote display system
 
 Group:          User Interface/Desktops
@@ -20,7 +20,7 @@ BuildRequires:  libXext-devel, xorg-x11-server-source, libXi-devel, libxshmfence
 BuildRequires:  xorg-x11-xtrans-devel, xorg-x11-util-macros, libXtst-devel
 BuildRequires:  libdrm-devel, libXt-devel, pixman-devel libXfont-devel
 BuildRequires:  libxkbfile-devel, openssl-devel, libpciaccess-devel
-BuildRequires:  mesa-libGL-devel, libXinerama-devel, ImageMagick
+BuildRequires:  mesa-libGL-devel, libXinerama-devel
 BuildRequires:  freetype-devel, libXdmcp-devel
 BuildRequires:  desktop-file-utils, java-devel, jpackage-utils
 BuildRequires:  libjpeg-turbo-devel, gnutls-devel, pam-devel
@@ -56,9 +56,15 @@ Patch8:        tigervnc-1.3.1-do-not-die-when-port-is-already-taken.patch
 Patch9:        tigervnc-let-user-know-about-not-using-view-only-password.patch
 Patch10:       tigervnc-working-tls-on-fips-systems.patch
 Patch11:       tigervnc-broken-scrolling.patch
+Patch12:       tigervnc-kill-session-after-logout.patch
+Patch13:       tigervnc-support-xorg120.patch
+Patch14:       tigervnc-ignore-fake-focus-events-from-xgrabkeyboard.patch
+Patch15:       tigervnc-use-current-server-time-for-ungrab.patch
+Patch16:       tigervnc-check-endianness-when-constructing-platformpixelbuffer.patch
+Patch17:       tigervnc-xvnc-update-manpage.patch
 
 # This is tigervnc-%{version}/unix/xserver116.patch rebased on the latest xorg
-Patch100:       tigervnc-xserver119.patch
+Patch100:       tigervnc-xserver120.patch
 # 1326867 - [RHEL7.3] GLX applications in an Xvnc session fails to start
 Patch101:       0001-rpath-hack.patch
 
@@ -160,7 +166,7 @@ pushd unix/xserver
 for all in `find . -type f -perm -001`; do
         chmod -x "$all"
 done
-%patch100 -p1 -b .xserver119
+%patch100 -p1 -b .xserver120
 %patch101 -p1 -b .rpath
 popd
 
@@ -191,6 +197,19 @@ popd
 # Bug 1499018 - bump scrolling is broken in tigervnc 1.8.0
 %patch11 -p1 -b .broken-scrolling
 
+# Bug 1259757 - unable to log out from vnc session
+%patch12 -p1 -b .kill-session-after-logout
+
+%patch13 -p1 -b .support-xorg120
+
+%patch14 -p1 -b .ignore-fake-focus-events-from-xgrabkeyboard
+
+%patch15 -p1 -b .use-current-server-time-for-ungrab
+
+%patch16 -p1 -b .check-endianness-when-constructing-platformpixelbuffer
+
+%patch17 -p1 -b .xvnc-update-manpage
+
 %build
 %ifarch sparcv9 sparc64 s390 s390x
 export CFLAGS="$RPM_OPT_FLAGS -fPIC"
@@ -212,7 +231,7 @@ autoreconf -fiv
         --with-fontdir=%{_datadir}/X11/fonts \
         --with-xkb-output=%{_localstatedir}/lib/xkb \
         --enable-install-libxf86config \
-        --enable-glx --disable-dri --enable-dri2 --enable-dri3 \
+        --enable-glx --disable-dri --enable-dri2 --disable-dri3 \
         --disable-unit-tests \
         --disable-config-hal \
         --disable-config-udev \
@@ -354,6 +373,41 @@ fi
 %{_datadir}/icons/hicolor/*/apps/*
 
 %changelog
+* Wed Aug 29 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-13
+- Add one remaining option to Xvnc manpage
+  Resolves: bz#1601880
+  
+* Wed Aug 29 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-12
+- Add missing options to Xvnc manpage
+  Resolves: bz#1601880
+
+* Fri Aug 17 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-11
+- Properly kill session after user logs out
+  Resolves: bz#1259757
+
+* Fri Aug 17 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-10
+- Check endianness when constructing platform pixel buffer
+  Resolves: bz#1613264
+
+* Mon Jul 23 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-9
+- Use current server time for XUngrabPointer and XUngrabKeyboard
+  Resolves: bz#1605325
+
+* Thu Jul 19 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-8
+- Ignore fake focus events from XGrabKeyboard()
+  Resolves: bz#1602855
+
+* Wed Jun 27 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-7
+  Properly support Xorg 1.20
+  Resolves: bz#1564061
+
+* Tue May 29 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-6
+- Kill session after user logs out
+  Resolves: bz#1259757
+
+  Build against Xorg 1.20
+  Resolves: bz#1564061
+
 * Thu Jan 18 2018 Jan Grulich <jgrulich@redhat.com> - 1.8.0-5
 - Fix broken scrolling
   Resolves: bz#1499018