Skip to content

Commit

Permalink
Move GTK integration out of process with D-Bus
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-fedin authored and john-preston committed Jul 1, 2021
1 parent 7b96c41 commit f493a81
Show file tree
Hide file tree
Showing 8 changed files with 593 additions and 211 deletions.
19 changes: 0 additions & 19 deletions CMakeLists.txt
Expand Up @@ -42,8 +42,6 @@ PRIVATE
base/platform/linux/base_linux_xcb_utilities.h
base/platform/linux/base_linux_xdp_utilities.cpp
base/platform/linux/base_linux_xdp_utilities.h
base/platform/linux/base_linux_xlib_helper.cpp
base/platform/linux/base_linux_xlib_helper.h
base/platform/linux/base_network_reachability_linux.cpp
base/platform/linux/base_network_reachability_linux.h
base/platform/linux/base_process_linux.cpp
Expand Down Expand Up @@ -203,17 +201,13 @@ if (DESKTOP_APP_DISABLE_X11_INTEGRATION)
remove_target_sources(lib_base ${src_loc}
base/platform/linux/base_linux_xcb_utilities.cpp
base/platform/linux/base_linux_xcb_utilities.h
base/platform/linux/base_linux_xlib_helper.cpp
base/platform/linux/base_linux_xlib_helper.h
)
endif()

if (DESKTOP_APP_DISABLE_GTK_INTEGRATION)
remove_target_sources(lib_base ${src_loc}
base/platform/linux/base_linux_gtk_integration_p.h
base/platform/linux/base_linux_gtk_integration.cpp
base/platform/linux/base_linux_xlib_helper.cpp
base/platform/linux/base_linux_xlib_helper.h
)
else()
remove_target_sources(lib_base ${src_loc}
Expand Down Expand Up @@ -263,26 +257,13 @@ elseif (LINUX)
if (DESKTOP_APP_USE_PACKAGED AND NOT DESKTOP_APP_USE_PACKAGED_LAZY)
pkg_check_modules(GTK3 REQUIRED IMPORTED_TARGET gtk+-3.0)
target_link_libraries(lib_base PUBLIC PkgConfig::GTK3)

if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
pkg_check_modules(X11 REQUIRED IMPORTED_TARGET x11)
target_link_libraries(lib_base PUBLIC PkgConfig::X11)
endif()
else()
pkg_check_modules(GTK REQUIRED gtk+-3.0)
target_include_directories(lib_base PUBLIC ${GTK_INCLUDE_DIRS})

if (NOT DESKTOP_APP_DISABLE_X11_INTEGRATION)
target_link_libraries(lib_base PUBLIC X11)
endif()
endif()
endif()
endif()

target_compile_definitions(lib_base
PRIVATE
G_LOG_DOMAIN="lib_base"
)
if (DESKTOP_APP_USE_ALLOCATION_TRACER)
target_compile_definitions(lib_base
PRIVATE
Expand Down
17 changes: 0 additions & 17 deletions base/platform/linux/base_info_linux.cpp
Expand Up @@ -6,8 +6,6 @@
//
#include "base/platform/linux/base_info_linux.h"

#include "base/platform/linux/base_linux_gtk_integration.h"

#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
#include "base/platform/linux/base_linux_xcb_utilities.h"
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
Expand All @@ -18,10 +16,6 @@
#include <QtCore/QDate>
#include <QtGui/QGuiApplication>

#include <glib.h>
#include <glibmm.h>
#include <giomm.h>

// this file is used on both Linux & BSD
#ifdef Q_OS_LINUX
#include <gnu/libc-version.h>
Expand Down Expand Up @@ -233,17 +227,6 @@ bool IsWayland() {
}

void Start(QJsonObject options) {
Glib::init();
Gio::init();

using base::Platform::GtkIntegration;
if (const auto integration = GtkIntegration::Instance()) {
integration->prepareEnvironment();
integration->load();
integration->initializeSettings();
} else {
g_warning("GTK integration is disabled, some features unavailable.");
}
}

void Finish() {
Expand Down
1 change: 1 addition & 0 deletions base/platform/linux/base_linux_dbus_utilities.h
Expand Up @@ -6,6 +6,7 @@
//
#pragma once

#include "base/basic_types.h"
#include "base/const_string.h"

#include <glibmm.h>
Expand Down

0 comments on commit f493a81

Please sign in to comment.