Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Commit 19823e5

Browse files
committed
Updates for Linux
1 parent f09e3d6 commit 19823e5

18 files changed

Lines changed: 630 additions & 284 deletions

src/cefpython.pyx

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -480,17 +480,6 @@ def Initialize(applicationSettings=None, commandLineSwitches=None, **kwargs):
480480
del command_line_switches
481481
del commandLineSwitches
482482

483-
IF UNAME_SYSNAME == "Linux":
484-
# Fix Issue #231 - Discovery of the "icudtl.dat" file fails on Linux.
485-
cdef str py_module_dir = GetModuleDirectory()
486-
cdef CefString cef_module_dir
487-
PyToCefString(py_module_dir, cef_module_dir)
488-
CefOverridePath(PK_DIR_EXE, cef_module_dir)\
489-
or Debug("ERROR: CefOverridePath failed")
490-
CefOverridePath(PK_DIR_MODULE, cef_module_dir)\
491-
or Debug("ERROR: CefOverridePath failed")
492-
# END IF UNAME_SYSNAME == "Linux":
493-
494483
if not application_settings:
495484
application_settings = {}
496485

@@ -608,8 +597,13 @@ def Initialize(applicationSettings=None, commandLineSwitches=None, **kwargs):
608597
cdef HINSTANCE hInstance = GetModuleHandle(NULL)
609598
cdef CefMainArgs cefMainArgs = CefMainArgs(hInstance)
610599
ELIF UNAME_SYSNAME == "Linux":
611-
# TODO: use the CefMainArgs(int argc, char** argv) constructor.
612-
cdef CefMainArgs cefMainArgs
600+
cdef int argc = len(sys.argv)
601+
cdef char** argv
602+
args = [bytes(x, "utf-8") for x in sys.argv]
603+
argv = <char**>malloc(sizeof(char*) * argc)
604+
for (idx, s) in enumerate(args):
605+
argv[idx] = s
606+
cdef CefMainArgs cefMainArgs = CefMainArgs(argc, argv)
613607
ELIF UNAME_SYSNAME == "Darwin":
614608
# TODO: use the CefMainArgs(int argc, char** argv) constructor.
615609
cdef CefMainArgs cefMainArgs
@@ -970,10 +964,11 @@ def Shutdown():
970964
IF UNAME_SYSNAME == "Darwin":
971965
MacShutdown()
972966

973-
def SetOsModalLoop(py_bool modalLoop):
974-
cdef cpp_bool cefModalLoop = bool(modalLoop)
975-
with nogil:
976-
CefSetOSModalLoop(cefModalLoop)
967+
IF UNAME_SYSNAME == "Windows":
968+
def SetOsModalLoop(py_bool modalLoop):
969+
cdef cpp_bool cefModalLoop = bool(modalLoop)
970+
with nogil:
971+
CefSetOSModalLoop(cefModalLoop)
977972

978973
cpdef py_void SetGlobalClientCallback(py_string name, object callback):
979974
global g_globalClientCallbacks

src/client_handler/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ SRC = client_handler.cpp cookie_visitor.cpp resource_handler.cpp \
2323
download_handler.cpp focus_handler.cpp js_dialog_handler.cpp \
2424
keyboard_handler.cpp lifespan_handler.cpp load_handler.cpp \
2525
render_handler.cpp request_handler.cpp dialog_handler.cpp \
26-
cef_log.cpp accessibility_handler.cpp \
26+
cef_log.cpp accessibility_handler.cpp util_gtk.cpp \
2727
$(SRC_MORE)
2828

2929
OBJ = $(filter %.o, $(SRC:.cpp=.o) $(SRC:.mm=.o))

src/client_handler/client_handler.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ class ClientHandler : public CefClient,
4848
CefRefPtr<CefDialogHandler> GetDialogHandler() override {
4949
return this;
5050
}
51-
CefRefPtr<CefPrintHandler> GetPrintHandler() override {
52-
return this;
53-
}
5451
#endif
5552

5653
CefRefPtr<CefDisplayHandler> GetDisplayHandler() override {

src/client_handler/dialog_handler.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ bool DialogHandler::OnFileDialog(CefRefPtr<CefBrowser> browser,
2828
title,
2929
default_file_path,
3030
accept_filters,
31-
selected_accept_filter,
3231
callback);
3332
#else
3433
return false;

0 commit comments

Comments
 (0)