Commit 491e51ca authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov
parent 52747d83
......@@ -7,12 +7,6 @@ CONFIG += c++11
CONFIG -= debug_and_release debug_and_release_target
CONFIG(debug, debug|release) {
DESTDIR = $$PWD/build/windows/Debug
} else {
DESTDIR = $$PWD/build/windows/Release
}
win32:contains(QMAKE_TARGET.arch, x86_64):{
PLATFORM_BUILD = win64
message(windows64)
......@@ -32,9 +26,12 @@ linux-g++:!contains(QMAKE_HOST.arch, x86_64):{
CONFIG(debug, debug|release) {
PLATFORM_BUILD2 = $$PLATFORM_BUILD/debug
DESTDIR = $$PWD/build/$$PLATFORM_BUILD/Debug
message(debug)
} else {
PLATFORM_BUILD2 = $$PLATFORM_BUILD
DESTDIR = $$PWD/build/$$PLATFORM_BUILD/Release
message(release)
}
include($$PWD/AscDocumentEditor.pri)
......
......@@ -81,7 +81,7 @@ static int AscEditor_Main( int argc, char *argv[] )
}
#if 0
FILE* f = fopen("E:\\12345.txt", "a+");
FILE* f = fopen("/home/oleg/activex/1/12345.txt", "a+");
fprintf(f, "-----------------------------------------------\n");
for (int i = 0; i < argc; ++i)
{
......@@ -101,7 +101,7 @@ static int AscEditor_Main( int argc, char *argv[] )
std::wstring sUserPath = GetAppDataPath();
oManager.m_oSettings.SetUserDataPath(sUserPath);
oCef.Init_CEF(&oManager);
oCef.Init_CEF(&oManager, argc, argv);
return aa.exec();
}
......@@ -116,7 +116,7 @@ static int AscEditor_Main( int argc, char *argv[] )
qreal ww = a.primaryScreen()->logicalDotsPerInch();
qreal hh = a.primaryScreen()->physicalDotsPerInch();
application_cef->Init_CEF(pApplicationManager);
application_cef->Init_CEF(pApplicationManager, argc, argv);
pApplicationManager->CheckFonts();
......
......@@ -11,6 +11,21 @@
#endif
#include "cefclient/browser/main_message_loop_std.h"
#if defined(_LINUX) && !defined(_MAC)
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <gtk/gtkgl.h>
#include <X11/Xlib.h>
#undef Status // Definition conflicts with cef_urlrequest.h
#undef Success // Definition conflicts with cef_message_router.h
#include "include/wrapper/cef_helpers.h"
#endif
class CApplicationCEF_Private
{
public:
......@@ -18,13 +33,24 @@ public:
scoped_ptr<client::MainContextImpl> context;
scoped_ptr<client::MainMessageLoop> message_loop;
#if defined(_LINUX) && !defined(_MAC)
CefScopedArgArray* argc_copy;
#endif
CApplicationCEF_Private()
{
#if defined(_LINUX) && !defined(_MAC)
argc_copy = NULL;
#endif
}
~CApplicationCEF_Private()
{
message_loop.reset();
context.reset();
#if defined(_LINUX) && !defined(_MAC)
RELEASEOBJECT(argc_copy);
#endif
}
};
......@@ -38,6 +64,13 @@ void CApplicationCEF::Init_CEF(CAscApplicationManager* pManager, int argc, char*
// Enable High-DPI support on Windows 7 or newer.
CefEnableHighDPISupport();
#if defined(_LINUX) && !defined(_MAC)
// Create a copy of |argv| on Linux because Chromium mangles the value
// internally (see issue #620).
m_pInternal->argc_copy = new CefScopedArgArray(argc, argv);
char** argv_copy = m_pInternal->argc_copy->array();
#endif
void* sandbox_info = NULL;
#if defined(CEF_USE_SANDBOX)
......@@ -167,6 +200,15 @@ void CApplicationCEF::Init_CEF(CAscApplicationManager* pManager, int argc, char*
bool bInit = CefInitialize(main_args, settings, m_pInternal->m_app.get(), sandbox_info);
bool bIsInitScheme = asc_scheme::InitScheme();
#if defined(_LINUX) && !defined(_MAC)
// The Chromium sandbox requires that there only be a single thread during
// initialization. Therefore initialize GTK after CEF.
gtk_init(&argc, &argv_copy);
// Perform gtkglext initialization required by the OSR example.
gtk_gl_init(&argc, &argv_copy);
#endif
pManager->SetApplication(this);
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment