@@ -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
978973cpdef py_void SetGlobalClientCallback(py_string name, object callback):
979974 global g_globalClientCallbacks
0 commit comments