diff --git a/CMakeLists.txt b/CMakeLists.txt
index 930c1ab..0e150cb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,7 +44,7 @@ set(NEKO_VERSION ${NEKO_VERSION_MAJOR}.${NEKO_VERSION_MINOR}.${NEKO_VERSION_PATC
 TEST_BIG_ENDIAN(NEKO_BIG_ENDIAN)
 
 option(WITH_REGEXP "Build Perl-compatible regex support." ON)
-option(WITH_UI "Build GTK-2 UI support." ON)
+option(WITH_UI "Build GTK-3 UI support." ON)
 option(WITH_SSL "Build SSL support." ON)
 option(WITH_MYSQL "Build MySQL support." ON)
 option(WITH_SQLITE "Build Sqlite support." ON)
diff --git a/README.md b/README.md
index 70c16b3..3965608 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ Users of other Linux/FreeBSD distributions should build Neko from source. See be
 
 Neko can be built using CMake (version 3.x is recommended) and one of the C compilers listed as follows:
 
- * Windows: Visual Studio 2010 / 2013 / 2015 / 2017 
+ * Windows: Visual Studio 2010 / 2013 / 2015 / 2017
  * Mac: XCode (with its "Command line tools")
  * Linux: gcc (can be obtained by installing the "build-essential" Debian/Ubuntu package)
 
@@ -41,7 +41,7 @@ Neko needs to link with various third-party libraries, which are summarized as f
 | MariaDB / MySQL (Connector/C)           | all         | libmariadb-client-lgpl-dev-compat (or libmysqlclient-dev) |
 | SQLite                                  | all         | libsqlite3-dev                                            |
 | mbed TLS                                | all         | libmbedtls-dev                                            |
-| GTK+2                                   | Linux       | libgtk2.0-dev                                             |
+| GTK+3                                   | Linux       | libgtk-3-dev                                              |
 
 On Windows, CMake will automatically download and build the libraries in the build folder during the build process. However, you need to install [Perl](http://www.activestate.com/activeperl) manually because OpenSSL needs it for configuration. On Mac/Linux, you should install the libraries manually to your system before building Neko, or use the `STATIC_DEPS` CMake option, which will be explained in [CMake options](#cmake-options).
 
@@ -73,7 +73,7 @@ You may use the CMake GUI and Visual Studio to build it instead.
 mkdir build
 cd build
 
-# run cmake specifying the visual studio version you need 
+# run cmake specifying the visual studio version you need
 # Visual Studio 12 2013, Visual Studio 14 2015, Visual Studio 15 2017
 # you can additionally specify platform via -A switch (x86, x64)
 cmake -G "Visual Studio 12 2013" ..
@@ -99,7 +99,7 @@ cmake "-Doption=value" ..
 Settings that allow to exclude libraries and their dependencies from the build; available on all platforms. By default all are `ON`:
 
 - `WITH_REGEXP` - Build Perl-compatible regex support
-- `WITH_UI` - Build GTK-2 UI support
+- `WITH_UI` - Build GTK-3 UI support
 - `WITH_SSL` - Build SSL support
 - `WITH_MYSQL` - Build MySQL support
 - `WITH_SQLITE` - Build Sqlite support
@@ -113,7 +113,7 @@ It defines the dependencies that should be linked statically. Can be `all`, `non
 
 CMake will automatically download and build the specified dependencies into the build folder. If a library is not present in this list, it should be installed manually, and it will be linked dynamically.
 
-All third-party libraries, except GTK+2 (Linux), can be linked statically. We do not support statically linking GTK+2 due to the difficulty of building it and its own dependencies.
+All third-party libraries, except GTK+3 (Linux), can be linked statically. We do not support statically linking GTK+3 due to the difficulty of building it and its own dependencies.
 
 #### `RELOCATABLE`
 
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 1a66a87..1c0bdcb 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -190,7 +190,7 @@ stages:
           - script: |
               set -ex
               sudo apt-get update -qqy
-              sudo apt-get install -qqy ninja-build pkg-config libgtk2.0-dev devscripts git-buildpackage ubuntu-dev-tools dh-make dh-apache2
+              sudo apt-get install -qqy ninja-build pkg-config libgtk-3-dev devscripts git-buildpackage ubuntu-dev-tools dh-make dh-apache2
             displayName: Install devscripts
           - script: cmake . -DSTATIC_DEPS=all
             displayName: CMake
diff --git a/cmake/FindGTK2.cmake b/cmake/FindGTK3.cmake
similarity index 56%
rename from cmake/FindGTK2.cmake
rename to cmake/FindGTK3.cmake
index e784692..714f66a 100644
--- a/cmake/FindGTK2.cmake
+++ b/cmake/FindGTK3.cmake
@@ -1,64 +1,64 @@
-FILE(TO_CMAKE_PATH "$ENV{GTK2_DIR}" TRY1_DIR)
-FILE(TO_CMAKE_PATH "${GTK2_DIR}" TRY2_DIR)
+FILE(TO_CMAKE_PATH "$ENV{GTK3_DIR}" TRY1_DIR)
+FILE(TO_CMAKE_PATH "${GTK3_DIR}" TRY2_DIR)
 FILE(GLOB GTK_DIR ${TRY1_DIR} ${TRY2_DIR})
 
-FIND_PATH(GTK_gtk_2_INCLUDE_DIR gtk/gtk.h
+FIND_PATH(GTK_gtk_3_INCLUDE_DIR gtk/gtk.h
                                 ENV INCLUDE DOC "Directory containing gtk/gtk.h include file")
 
-FIND_PATH(GTK_gdk_2_INCLUDE_DIR gdk/gdk.h
+FIND_PATH(GTK_gdk_3_INCLUDE_DIR gdk/gdk.h
                                 ENV INCLUDE DOC "Directory containing gdk/gdk.h include file")
 
-FIND_PATH(GTK_gdkconfig_2_INCLUDE_DIR gdkconfig.h
+FIND_PATH(GTK_gdkconfig_3_INCLUDE_DIR gdkconfig.h
                                       ENV INCLUDE DOC "Directory containing gdkconfig.h include file")
 
-FIND_LIBRARY(GTK_gdk_pixbuf_2_LIBRARY NAMES gdk_pixbuf-2.0
+FIND_LIBRARY(GTK_gdk_pixbuf_3_LIBRARY NAMES gdk_pixbuf-3.0
                                       PATHS ${GTK_DIR}/lib ${GTK_DIR}/bin ${GTK_DIR}/win32/bin ${GTK_DIR}/lib ${GTK_DIR}/win32/lib /usr/local/lib /usr/lib
                                       ENV LIB
                                       DOC "gdk_pixbuf library to link with"
                                       NO_SYSTEM_ENVIRONMENT_PATH)
 
-FIND_LIBRARY(GTK_gdk_2_LIBRARY NAMES gdk-win32-2.0 gdk-x11-2.0
+FIND_LIBRARY(GTK_gdk_3_LIBRARY NAMES gdk-win32-3.0 gdk-x11-3.0
                                      PATHS ${GTK_DIR}/lib ${GTK_DIR}/bin ${GTK_DIR}/win32/bin ${GTK_DIR}/lib ${GTK_DIR}/win32/lib /usr/lib /usr/local/lib
                                      ENV LIB
-                                     DOC "gdk2 library to link with"
+                                     DOC "gdk3 library to link with"
                                      NO_SYSTEM_ENVIRONMENT_PATH)
 
-FIND_LIBRARY(GTK_gtk_2_LIBRARY NAMES gtk-win32-2.0 gtk-x11-2.0
+FIND_LIBRARY(GTK_gtk_3_LIBRARY NAMES gtk-win32-3.0 gtk-x11-3.0
                                      PATHS ${GTK_DIR}/lib ${GTK_DIR}/bin ${GTK_DIR}/win32/bin ${GTK_DIR}/lib ${GTK_DIR}/win32/lib /usr/lib /usr/local/lib
                                      ENV LIB
-                                     DOC "gtk2 library to link with"
+                                     DOC "gtk3 library to link with"
                                      NO_SYSTEM_ENVIRONMENT_PATH)
 
-FIND_LIBRARY(GTK_gdk_pixbuf_2_STATIC_LIBRARY NAMES libgdk_pixbuf-2.0.a
+FIND_LIBRARY(GTK_gdk_pixbuf_3_STATIC_LIBRARY NAMES libgdk_pixbuf-3.0.a
                                       PATHS ${GTK_DIR}/lib ${GTK_DIR}/bin ${GTK_DIR}/win32/bin ${GTK_DIR}/lib ${GTK_DIR}/win32/lib /usr/local/lib /usr/lib
                                       ENV LIB
                                       DOC "gdk_pixbuf library to link with"
                                       NO_SYSTEM_ENVIRONMENT_PATH)
 
-FIND_LIBRARY(GTK_gdk_2_STATIC_LIBRARY NAMES libgdk-x11-2.0.a
+FIND_LIBRARY(GTK_gdk_3_STATIC_LIBRARY NAMES libgdk-x11-3.0.a
                                      PATHS ${GTK_DIR}/lib ${GTK_DIR}/bin ${GTK_DIR}/win32/bin ${GTK_DIR}/lib ${GTK_DIR}/win32/lib /usr/lib /usr/local/lib
                                      ENV LIB
-                                     DOC "gdk2 library to link with"
+                                     DOC "gdk3 library to link with"
                                      NO_SYSTEM_ENVIRONMENT_PATH)
 
-FIND_LIBRARY(GTK_gtk_2_STATIC_LIBRARY NAMES libgtk-x11-2.0.a
+FIND_LIBRARY(GTK_gtk_3_STATIC_LIBRARY NAMES libgtk-x11-3.0.a
                                      PATHS ${GTK_DIR}/lib ${GTK_DIR}/bin ${GTK_DIR}/win32/bin ${GTK_DIR}/lib ${GTK_DIR}/win32/lib /usr/lib /usr/local/lib
                                      ENV LIB
-                                     DOC "gtk2 library to link with"
+                                     DOC "gtk3 library to link with"
                                      NO_SYSTEM_ENVIRONMENT_PATH)
 
 
-IF (GTK_gtk_2_INCLUDE_DIR AND GTK_gdk_2_INCLUDE_DIR AND GTK_gdkconfig_2_INCLUDE_DIR)
-  SET(GTK2_INCLUDE_DIR ${GTK_gtk_2_INCLUDE_DIR} ${GTK_gdk_2_INCLUDE_DIR} ${GTK_gdkconfig_2_INCLUDE_DIR})
-  list(REMOVE_DUPLICATES GTK2_INCLUDE_DIR)
-  SET(GTK2_LIBRARIES ${GTK_gdk_pixbuf_2_LIBRARY} ${GTK_gdk_2_LIBRARY} ${GTK_gtk_2_LIBRARY})
-  list(REMOVE_DUPLICATES GTK2_LIBRARIES)
-  SET(GTK2_STATIC_LIBRARIES ${GTK_gdk_pixbuf_2_STATIC_LIBRARY} ${GTK_gdk_2_STATIC_LIBRARY} ${GTK_gtk_2_STATIC_LIBRARY})
-  list(REMOVE_DUPLICATES GTK2_STATIC_LIBRARIES)
-  SET(GTK2_FOUND TRUE)
+IF (GTK_gtk_3_INCLUDE_DIR AND GTK_gdk_3_INCLUDE_DIR AND GTK_gdkconfig_3_INCLUDE_DIR)
+  SET(GTK3_INCLUDE_DIR ${GTK_gtk_3_INCLUDE_DIR} ${GTK_gdk_3_INCLUDE_DIR} ${GTK_gdkconfig_3_INCLUDE_DIR})
+  list(REMOVE_DUPLICATES GTK3_INCLUDE_DIR)
+  SET(GTK3_LIBRARIES ${GTK_gdk_pixbuf_3_LIBRARY} ${GTK_gdk_3_LIBRARY} ${GTK_gtk_3_LIBRARY})
+  list(REMOVE_DUPLICATES GTK3_LIBRARIES)
+  SET(GTK3_STATIC_LIBRARIES ${GTK_gdk_pixbuf_3_STATIC_LIBRARY} ${GTK_gdk_3_STATIC_LIBRARY} ${GTK_gtk_3_STATIC_LIBRARY})
+  list(REMOVE_DUPLICATES GTK3_STATIC_LIBRARIES)
+  SET(GTK3_FOUND TRUE)
 
 
-  message(STATUS "GTK2_INCLUDE_DIR: ${GTK2_INCLUDE_DIR}")
-  message(STATUS "GTK2_LIBRARIES: ${GTK2_LIBRARIES}")
-  message(STATUS "GTK2_STATIC_LIBRARIES: ${GTK2_STATIC_LIBRARIES}")
-ENDIF ()
\ No newline at end of file
+  message(STATUS "GTK3_INCLUDE_DIR: ${GTK3_INCLUDE_DIR}")
+  message(STATUS "GTK3_LIBRARIES: ${GTK3_LIBRARIES}")
+  message(STATUS "GTK3_STATIC_LIBRARIES: ${GTK3_STATIC_LIBRARIES}")
+ENDIF ()
diff --git a/extra/azure-pipelines/build-linux.yml b/extra/azure-pipelines/build-linux.yml
index 2978719..87cbdb3 100644
--- a/extra/azure-pipelines/build-linux.yml
+++ b/extra/azure-pipelines/build-linux.yml
@@ -10,10 +10,10 @@ jobs:
       vmImage: ${{ parameters.vmImage }}
     variables:
       ${{ if eq(parameters.staticDeps, 'true') }}:
-        APT_PACKAGES: cmake ninja-build pkg-config libgtk2.0-dev
+        APT_PACKAGES: cmake ninja-build pkg-config libgtk-3-dev
         STATIC_DEPS: all
       ${{ if eq(parameters.staticDeps, 'false') }}:
-        APT_PACKAGES: cmake ninja-build pkg-config libgtk2.0-dev libgc-dev libpcre3-dev zlib1g-dev apache2-dev libmysqlclient-dev libsqlite3-dev
+        APT_PACKAGES: cmake ninja-build pkg-config libgtk-3-dev libgc-dev libpcre3-dev zlib1g-dev apache2-dev libmysqlclient-dev libsqlite3-dev
         STATIC_DEPS: none
     steps:
       - script: |
diff --git a/libs/ui/CMakeLists.txt b/libs/ui/CMakeLists.txt
index 72b37ba..e53b77c 100644
--- a/libs/ui/CMakeLists.txt
+++ b/libs/ui/CMakeLists.txt
@@ -11,12 +11,12 @@ if(APPLE)
 	find_library(CARBON_LIBRARY Carbon REQUIRED)
 	target_link_libraries(ui.ndll ${CARBON_LIBRARY})
 elseif(UNIX)
-	pkg_check_modules(GTK2 REQUIRED gtk+-2.0)
+	pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
 	target_include_directories(ui.ndll PRIVATE
-		${GTK2_INCLUDEDIR}
-		${GTK2_INCLUDE_DIRS}
+		${GTK3_INCLUDEDIR}
+		${GTK3_INCLUDE_DIRS}
 	)
-	target_link_libraries(ui.ndll ${GTK2_LIBRARIES})
+	target_link_libraries(ui.ndll ${GTK3_LIBRARIES})
 endif()
 
 set_target_properties(ui.ndll
diff --git a/libs/ui/ui.c b/libs/ui/ui.c
index 334567e..3d8c298 100644
--- a/libs/ui/ui.c
+++ b/libs/ui/ui.c
@@ -48,7 +48,7 @@ enum { pFunc = 'func' };
 	<h1>UI</h1>
 	<p>
 	Core native User Interface support. This API uses native WIN32 API on Windows,
-	Carbon API on OSX, and GTK2 on Linux.
+	Carbon API on OSX, and GTK3 on Linux.
 	</p>
 	</doc>
 **/
@@ -248,7 +248,7 @@ static value ui_sync( value f ) {
 	// however the GTK lock mechanism is a LOT slower than
 	// using a pthread_mutex
 	pthread_mutex_lock(&data.lock);
-	gtk_timeout_add( 0, onSyncCall, (gpointer)r );
+	gdk_threads_add_timeout( 0, onSyncCall, (gpointer)r );
 	pthread_mutex_unlock(&data.lock);
 #	endif
 	return val_null;
