Skip to content

Commit 724ef3e

Browse files
linesightclaude
andcommitted
Fix Linux-specific compile errors in x11.cpp and print_handler_gtk.cpp
- cef_config.h: define CEF_X11 on Linux so cef_get_xdisplay() is declared (CEF_X11 guard was present in cef_types_linux.h but the macro was never set) - x11.h: add <gtk/gtkx.h> for explicit GtkPlug/GtkSocket X11 declarations - subprocess/CMakeLists.txt: add gtk+-unix-print-3.0 pkg-config module so its include dirs are available for <gtk/gtkunixprint.h> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent abdf42a commit 724ef3e

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

src/client_handler/x11.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <X11/Xlib.h>
88
#include <gtk/gtk.h>
9+
#include <gtk/gtkx.h>
910
#include <gdk/gdkx.h>
1011

1112
#include "include/cef_browser.h"

src/include/cef_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,9 @@
3737

3838
#define CEF_V8_ENABLE_SANDBOX 1
3939

40+
// X11 windowing support (Linux only; required for cef_get_xdisplay and GtkPlug).
41+
#if defined(__linux__) && !defined(OS_CHROMEOS)
42+
#define CEF_X11 1
43+
#endif
44+
4045
#endif // CEF_INCLUDE_CEF_CONFIG_H_

src/subprocess/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ list(APPEND _app_sources ${_filtered_mml})
5353
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
5454
find_package(PkgConfig REQUIRED)
5555
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
56+
pkg_check_modules(GTK3_UNIXPRINT REQUIRED gtk+-unix-print-3.0)
5657
endif()
5758

5859
add_library(cefpython_app STATIC ${_app_sources})
@@ -66,7 +67,10 @@ target_include_directories(cefpython_app PRIVATE
6667
)
6768

6869
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
69-
target_include_directories(cefpython_app PRIVATE ${GTK3_INCLUDE_DIRS})
70+
target_include_directories(cefpython_app PRIVATE
71+
${GTK3_INCLUDE_DIRS}
72+
${GTK3_UNIXPRINT_INCLUDE_DIRS}
73+
)
7074
endif()
7175

7276
if(WIN32)

0 commit comments

Comments
 (0)