From 26beaa442eef6aab4e8a7ef3a5dc9c3a4a818aa0 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 23 Mar 2020 19:05:11 +0300 Subject: [PATCH 01/33] [linux] editor's window wrong maximizing after udock --- win-linux/src/ceditorwindow.cpp | 4 + win-linux/src/linux/cx11decoration.cpp | 112 +++++++++++++++++++++++++ 2 files changed, 116 insertions(+) diff --git a/win-linux/src/ceditorwindow.cpp b/win-linux/src/ceditorwindow.cpp index 36fb7e748..3cb0ce586 100644 --- a/win-linux/src/ceditorwindow.cpp +++ b/win-linux/src/ceditorwindow.cpp @@ -158,10 +158,14 @@ bool CEditorWindow::holdView(const wstring& portal) const void CEditorWindow::undock(bool maximized) { +#ifdef Q_OS_LINUX + maximized = false; +#else if ( maximized ) { m_restoreMaximized = true; maximized = false; } +#endif CSingleWindowPlatform::show(maximized); CSingleWindowPlatform::captureMouse(); diff --git a/win-linux/src/linux/cx11decoration.cpp b/win-linux/src/linux/cx11decoration.cpp index 4bb01556f..74c011973 100644 --- a/win-linux/src/linux/cx11decoration.cpp +++ b/win-linux/src/linux/cx11decoration.cpp @@ -52,6 +52,9 @@ const int k_NET_WM_MOVERESIZE_SIZE_BOTTOM = 5; const int k_NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT = 6; const int k_NET_WM_MOVERESIZE_SIZE_LEFT = 7; const int k_NET_WM_MOVERESIZE_MOVE = 8; +#define k_NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */ +#define k_NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */ +#define k_NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ #define MWM_HINTS_DECORATIONS 2 typedef struct { @@ -272,6 +275,42 @@ namespace { } +auto release_main_cursor(XID id) -> void { + Display *display = XOpenDisplay(NULL); + if(display == NULL) + { +// std::cout<<"Cannot open display"<pos()) ? k_NET_WM_MOVERESIZE_MOVE : hitTest(e->pos().x(), e->pos().y()); } + + QTimer::singleShot(100, [=]{ + Display *dpy = getXDisplay(); + + XSetInputFocus(dpy, m_window->winId(), RevertToNone, CurrentTime); + + long mask = ExposureMask | SubstructureNotifyMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonMotionMask; + XSelectInput(getXDisplay(), m_window->winId(),mask); +// XSelectInput(dpy, XDefaultRootWindow(dpy),mask); +// XFlush(dpy); + + static int _c = 0; + XEvent _e; + while (XPending(dpy)) { +// XCheckMaskEvent() +// while (XCheckWindowEvent(dpy, XDefaultRootWindow(dpy), mask, &_e)) { +// qDebug() << ++_c << "before event"; + XNextEvent(dpy, &_e); + qDebug() << ++_c << "event" << _e.type; + } + + qDebug() << "no event"; + }); } void CX11Decoration::dispatchMouseMove(QMouseEvent *e) @@ -420,6 +482,7 @@ void CX11Decoration::dispatchMouseMove(QMouseEvent *e) m_motionTimer = new QTimer; QObject::connect(m_motionTimer, &QTimer::timeout, [=]{ + qDebug() << "motion timer:" << m_window->winId(); if ( CX11Decoration::checkButtonState(Qt::LeftButton) ) { if ( need_to_check_motion ) { QMoveEvent _e{QCursor::pos(), m_window->pos()}; @@ -578,6 +641,8 @@ void CX11Decoration::sendButtonRelease() &event.xbutton.x_root, &event.xbutton.y_root, &event.xbutton.x, &event.xbutton.y, &event.xbutton.state); XSendEvent(xdisplay_, PointerWindow, True, ButtonReleaseMask, &event); XFlush(xdisplay_); + + qDebug() << "send button release to" << m_window->winId(); } void CX11Decoration::setCursorPos(int x, int y) @@ -588,3 +653,50 @@ void CX11Decoration::setCursorPos(int x, int y) XWarpPointer(xdisplay_, None, root_window, 0, 0, 0, 0, x, y); XFlush(xdisplay_); } + +void* x11_handle_events(void *void_ptr) +{ +// Renderer* renderer = static_cast(void_ptr); +// renderer->stop = false; +// XEvent event; +// XWindowAttributes opengl_attrs; +// while(!renderer->stop) +// { +// XNextEvent(renderer->x_display, &event); +// switch(event.type) +// { +// case Expose: +// if (event.xexpose.window == renderer->child) +// { +// XRaiseWindow(renderer->x_display, renderer->win); +// } +// break; + +// case FocusIn: +// if (event.xfocus.window == renderer->child) +// { +// XRaiseWindow(renderer->x_display, renderer->win); +// } +// break; + +// } + +// // Make sure both windows are in the same location +// XGetWindowAttributes(renderer->x_display, renderer->child, &opengl_attrs); +// XMoveWindow(renderer->x_display, renderer->win, opengl_attrs.x, opengl_attrs.y); +// } + + + pthread_exit(0); + return NULL; +} + +void CX11Decoration::grabCursor() +{ + qDebug() << "grab pointer"; +// Display * dpy = getXDisplay(); + Display * dpy = QX11Info::display(); + XSetInputFocus(dpy, m_title->winId(), RevertToNone, CurrentTime); + +// int id = pthread_create(&x11loop, NULL, x11_handle_events, this); +} From bbc2b3689ec1a8ba04a9d7edd51e667540d7ec8e Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 23 Mar 2020 20:12:05 +0300 Subject: [PATCH 02/33] [linux] correct editor's window size when undock --- win-linux/src/linux/cmainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win-linux/src/linux/cmainwindow.cpp b/win-linux/src/linux/cmainwindow.cpp index 7cd66e6bf..fe55feb76 100644 --- a/win-linux/src/linux/cmainwindow.cpp +++ b/win-linux/src/linux/cmainwindow.cpp @@ -354,7 +354,7 @@ CMainPanel * CMainWindow::mainPanel() const QRect CMainWindow::windowRect() const { - return geometry(); + return normalGeometry(); } bool CMainWindow::isMaximized() const From 6a830c25a6e6dc55807797739ad7b432e24aac43 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 24 Mar 2020 14:23:10 +0300 Subject: [PATCH 03/33] [linux] correct commit --- win-linux/src/linux/cx11decoration.cpp | 112 ------------------------- 1 file changed, 112 deletions(-) diff --git a/win-linux/src/linux/cx11decoration.cpp b/win-linux/src/linux/cx11decoration.cpp index 74c011973..4bb01556f 100644 --- a/win-linux/src/linux/cx11decoration.cpp +++ b/win-linux/src/linux/cx11decoration.cpp @@ -52,9 +52,6 @@ const int k_NET_WM_MOVERESIZE_SIZE_BOTTOM = 5; const int k_NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT = 6; const int k_NET_WM_MOVERESIZE_SIZE_LEFT = 7; const int k_NET_WM_MOVERESIZE_MOVE = 8; -#define k_NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */ -#define k_NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */ -#define k_NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ #define MWM_HINTS_DECORATIONS 2 typedef struct { @@ -275,42 +272,6 @@ namespace { } -auto release_main_cursor(XID id) -> void { - Display *display = XOpenDisplay(NULL); - if(display == NULL) - { -// std::cout<<"Cannot open display"<pos()) ? k_NET_WM_MOVERESIZE_MOVE : hitTest(e->pos().x(), e->pos().y()); } - - QTimer::singleShot(100, [=]{ - Display *dpy = getXDisplay(); - - XSetInputFocus(dpy, m_window->winId(), RevertToNone, CurrentTime); - - long mask = ExposureMask | SubstructureNotifyMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask | ButtonMotionMask; - XSelectInput(getXDisplay(), m_window->winId(),mask); -// XSelectInput(dpy, XDefaultRootWindow(dpy),mask); -// XFlush(dpy); - - static int _c = 0; - XEvent _e; - while (XPending(dpy)) { -// XCheckMaskEvent() -// while (XCheckWindowEvent(dpy, XDefaultRootWindow(dpy), mask, &_e)) { -// qDebug() << ++_c << "before event"; - XNextEvent(dpy, &_e); - qDebug() << ++_c << "event" << _e.type; - } - - qDebug() << "no event"; - }); } void CX11Decoration::dispatchMouseMove(QMouseEvent *e) @@ -482,7 +420,6 @@ void CX11Decoration::dispatchMouseMove(QMouseEvent *e) m_motionTimer = new QTimer; QObject::connect(m_motionTimer, &QTimer::timeout, [=]{ - qDebug() << "motion timer:" << m_window->winId(); if ( CX11Decoration::checkButtonState(Qt::LeftButton) ) { if ( need_to_check_motion ) { QMoveEvent _e{QCursor::pos(), m_window->pos()}; @@ -641,8 +578,6 @@ void CX11Decoration::sendButtonRelease() &event.xbutton.x_root, &event.xbutton.y_root, &event.xbutton.x, &event.xbutton.y, &event.xbutton.state); XSendEvent(xdisplay_, PointerWindow, True, ButtonReleaseMask, &event); XFlush(xdisplay_); - - qDebug() << "send button release to" << m_window->winId(); } void CX11Decoration::setCursorPos(int x, int y) @@ -653,50 +588,3 @@ void CX11Decoration::setCursorPos(int x, int y) XWarpPointer(xdisplay_, None, root_window, 0, 0, 0, 0, x, y); XFlush(xdisplay_); } - -void* x11_handle_events(void *void_ptr) -{ -// Renderer* renderer = static_cast(void_ptr); -// renderer->stop = false; -// XEvent event; -// XWindowAttributes opengl_attrs; -// while(!renderer->stop) -// { -// XNextEvent(renderer->x_display, &event); -// switch(event.type) -// { -// case Expose: -// if (event.xexpose.window == renderer->child) -// { -// XRaiseWindow(renderer->x_display, renderer->win); -// } -// break; - -// case FocusIn: -// if (event.xfocus.window == renderer->child) -// { -// XRaiseWindow(renderer->x_display, renderer->win); -// } -// break; - -// } - -// // Make sure both windows are in the same location -// XGetWindowAttributes(renderer->x_display, renderer->child, &opengl_attrs); -// XMoveWindow(renderer->x_display, renderer->win, opengl_attrs.x, opengl_attrs.y); -// } - - - pthread_exit(0); - return NULL; -} - -void CX11Decoration::grabCursor() -{ - qDebug() << "grab pointer"; -// Display * dpy = getXDisplay(); - Display * dpy = QX11Info::display(); - XSetInputFocus(dpy, m_title->winId(), RevertToNone, CurrentTime); - -// int id = pthread_create(&x11loop, NULL, x11_handle_events, this); -} From dcac6d7eb6d1de8db20aa1f24e48ce332a0bfbfb Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 25 Mar 2020 15:38:38 +0300 Subject: [PATCH 04/33] [win-nix] refactoring --- win-linux/src/chelp.cpp | 6 +++--- win-linux/src/defines.h | 2 +- win-linux/src/utils.cpp | 21 ++++++++++++++++++++- win-linux/src/utils.h | 4 ++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/win-linux/src/chelp.cpp b/win-linux/src/chelp.cpp index 703e35f61..7265b34cb 100644 --- a/win-linux/src/chelp.cpp +++ b/win-linux/src/chelp.cpp @@ -45,7 +45,7 @@ void CHelp::out() qWarning() << "keys:"; qWarning() << " --custom-title-bar turn off system title bar"; qWarning() << " --system-title-bar turn on system title bar"; - qWarning() << " --keeplang:en keep the language"; - qWarning() << " --lang:en apply the language for the current session"; - qWarning() << " --new:[doc|cell|slide] create new document/spreadsheet/presentation"; + qWarning() << " --keeplang=en keep the language"; + qWarning() << " --lang=en apply the language for the current session"; + qWarning() << " --new=[doc|cell|slide] create new document/spreadsheet/presentation"; } diff --git a/win-linux/src/defines.h b/win-linux/src/defines.h index b5270ccec..70c7c2f07 100644 --- a/win-linux/src/defines.h +++ b/win-linux/src/defines.h @@ -36,7 +36,7 @@ #define rePortalName "^https?:\\/\\/(.+)" #define reFileExtension "\\.(\\w{1,10})$" #define reUserName "([^\\.]+)\\.?([^\\.]+)?" -#define reCmdLang "--(keep)?lang:(\\w{2,5})" +#define reCmdLang "--(keep)?lang[:|=](\\w{2,5})" #define FILE_DOWNLOAD_START 3 diff --git a/win-linux/src/utils.cpp b/win-linux/src/utils.cpp index 037b17978..86d004fc8 100644 --- a/win-linux/src/utils.cpp +++ b/win-linux/src/utils.cpp @@ -62,6 +62,25 @@ typedef HRESULT (__stdcall *SetCurrentProcessExplicitAppUserModelIDProc)(PCWSTR #include extern QStringList g_cmdArgs; +namespace InputArgs { + auto contains(const QString& param) -> bool { + return g_cmdArgs.contains(param); + } + + auto get_arg_value(const QString& param) -> QString { + QRegularExpression _re("^" + param + "[=|:]([\\w\\\":\\\\/]+)", QRegularExpression::CaseInsensitiveOption); + + for (const auto& item: g_cmdArgs) { + QRegularExpressionMatch _match = _re.match(item); + if ( _match.hasMatch() ) + return _match.captured(1); + } + + return QString(); + } +} + + QStringList * Utils::getInputFiles(const QStringList& inlist) { QStringList * _ret_files_list = nullptr; @@ -73,7 +92,7 @@ QStringList * Utils::getInputFiles(const QStringList& inlist) while (i.hasNext()) { QString arg = i.next(); - if ( arg.startsWith("--new:") ) + if ( arg.startsWith("--new:") || arg.startsWith("--new=") ) _ret_files_list->append( arg ); else { QFileInfo info( arg ); diff --git a/win-linux/src/utils.h b/win-linux/src/utils.h index fa8a9896a..94a1a727e 100644 --- a/win-linux/src/utils.h +++ b/win-linux/src/utils.h @@ -41,6 +41,10 @@ #endif using namespace std; +namespace InputArgs { + auto contains(QString&) -> bool; + auto get_arg_value(const QString& param) -> QString; +} class Utils { public: From 05aa0693de3bb1c8f05f86ba0939884763da872e Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 26 Mar 2020 14:16:43 +0300 Subject: [PATCH 05/33] [win-nix] correct copyright year during compile time --- win-linux/defaults.pri | 1 + win-linux/src/version.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/win-linux/defaults.pri b/win-linux/defaults.pri index c032a9101..0534c9567 100644 --- a/win-linux/defaults.pri +++ b/win-linux/defaults.pri @@ -105,6 +105,7 @@ SOURCES += \ # src/casclabel.cpp RESOURCES += $$PWD/resources.qrc +DEFINES += COPYRIGHT_YEAR=$${CURRENT_YEAR} isEqual(QT_MAJOR_VERSION, 5) { lessThan(QT_MINOR_VERSION, 10) { diff --git a/win-linux/src/version.h b/win-linux/src/version.h index fc9f72318..a6447caa6 100644 --- a/win-linux/src/version.h +++ b/win-linux/src/version.h @@ -34,9 +34,9 @@ #define VERSION_H #define VER_STRINGIFY(d) #d +#define TO_STR(v) VER_STRINGIFY(v) #ifdef VER_PRODUCT_VERSION -# define TO_STR(v) VER_STRINGIFY(v) # define VER_FILEVERSION VER_PRODUCT_VERSION_COMMAS # define VER_FILEVERSION_STR TO_STR(VER_PRODUCT_VERSION) @@ -62,7 +62,7 @@ #endif #define VER_COMPANYNAME_STR "Ascensio System SIA\0" -#define VER_LEGALCOPYRIGHT_STR "Ascensio System SIA 2020\0" +#define VER_LEGALCOPYRIGHT_STR "Ascensio System SIA " TO_STR(COPYRIGHT_YEAR) "\0" #define VER_COMPANYDOMAIN_STR "www.onlyoffice.com\0" #define ABOUT_COPYRIGHT_STR VER_LEGALCOPYRIGHT_STR #define VER_FILEDESCRIPTION_STR "ONLYOFFICE Desktop Editors\0" From 178574f546bb2980172e007bffab4e6582ef1974 Mon Sep 17 00:00:00 2001 From: Alexey Golubev Date: Thu, 26 Mar 2020 14:46:19 +0300 Subject: [PATCH 06/33] [win-nix] Disable installer signing by default --- win-linux/package/windows/Makefile.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/win-linux/package/windows/Makefile.mk b/win-linux/package/windows/Makefile.mk index 4c4ea817f..06551df63 100644 --- a/win-linux/package/windows/Makefile.mk +++ b/win-linux/package/windows/Makefile.mk @@ -40,7 +40,9 @@ ISCC_PARAMS += //DSCRIPT_CUSTOM_FILES=1 ISCC_PARAMS += //DsAppVersion=$(PACKAGE_VERSION) ISCC_PARAMS += //DsBrandingFolder="$(shell cygpath -a -w $(BRANDING_DIR))" ISCC_PARAMS += //DsOutputFileName=$(notdir $(basename $@)) +ifdef ENABLE_SIGNING ISCC_PARAMS += //DENABLE_SIGNING=1 +endif ISCC_PARAMS += //S"byparam=signtool.exe sign /v /n $(word 1, $(PUBLISHER_NAME)) /t http://timestamp.verisign.com/scripts/timstamp.dll \$$f" $(DESKTOP_EDITORS_EXE): $(DEST_DIR) $(VCREDIST) From 83e0848cb6b7ffbf67b5881ee720d9ee2ee503d2 Mon Sep 17 00:00:00 2001 From: Alexander Yuzhin Date: Fri, 27 Mar 2020 18:46:20 +0300 Subject: [PATCH 07/33] Fixed bug #44927 (#106) --- .../Code/Controllers/Common/ASCCommonViewController.mm | 3 +++ .../Code/Controllers/MainWindow/ASCTitleBarController.m | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm b/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm index 0ee882e84..82b4b49cf 100644 --- a/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm +++ b/macos/ONLYOFFICE/Code/Controllers/Common/ASCCommonViewController.mm @@ -632,6 +632,9 @@ if (NSString *provider = tab.params[@"provider"]) { if ([@[@"asc", @"onlyoffice"] containsObject:provider]) { + if ([localTabValue isEqualToString:localValue]) { + return tab; + } localValue = [localValue stringByReplacingOccurrencesOfString:@"/products/files/" withString:@""]; } } diff --git a/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleBarController.m b/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleBarController.m index 4e06ea3c5..4e10cd649 100644 --- a/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleBarController.m +++ b/macos/ONLYOFFICE/Code/Controllers/MainWindow/ASCTitleBarController.m @@ -239,7 +239,7 @@ static float kASCWindowMinTitleWidth = 0; } #pragma mark - -#pragma mark - CEF events handler +#pragma mark CEF events handler - (void)onCEFChangedTabEditorType:(NSNotification *)notification { if (notification && notification.userInfo) { @@ -314,7 +314,7 @@ static float kASCWindowMinTitleWidth = 0; } #pragma mark - -#pragma mark - Actions +#pragma mark Actions - (void)setupCustomPopover:(SFBPopover *)popover { popover.closesWhenPopoverResignsKey = YES; popover.closesWhenApplicationBecomesInactive = YES; @@ -383,7 +383,7 @@ static float kASCWindowMinTitleWidth = 0; } #pragma mark - -#pragma mark - ASCTabsControl Delegate +#pragma mark ASCTabsControl Delegate - (void)tabs:(ASCTabsControl *)control didResize:(CGRect)rect { [self doLayout]; @@ -422,7 +422,7 @@ static float kASCWindowMinTitleWidth = 0; } #pragma mark - -#pragma mark - Navigation +#pragma mark Navigation - (void)prepareForSegue:(NSStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"ASCUserInfoSegueID"]) { From 72b9b92483cda19fd6be934892db360c50b46f5f Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 30 Mar 2020 11:43:10 +0300 Subject: [PATCH 08/33] [win-nix] fix bug 42697 (#107) --- .../src/cascapplicationmanagerwrapper.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/win-linux/src/cascapplicationmanagerwrapper.cpp b/win-linux/src/cascapplicationmanagerwrapper.cpp index b5931717e..abe3b6b3f 100644 --- a/win-linux/src/cascapplicationmanagerwrapper.cpp +++ b/win-linux/src/cascapplicationmanagerwrapper.cpp @@ -500,6 +500,25 @@ bool CAscApplicationManagerWrapper::processCommonEvent(NSEditorApi::CAscCefMenuE return true;} + case ASC_MENU_EVENT_TYPE_CEF_LOCALFILES_OPEN: { + CAscLocalOpenFiles * pData = (CAscLocalOpenFiles *)event->m_pData; + vector& files = pData->get_Files(); + + CEditorWindow * _editor; + for (size_t i(files.size()); i --> 0;) { + _editor = editorWindowFromUrl(QString::fromStdWString(files[i])); + + if ( _editor ) { + files.erase(files.begin() + i); +#ifdef Q_OS_WIN + SetForegroundWindow(_editor->handle()); +#else + _editor->activateWindow(); +#endif + } + } + } + case ASC_MENU_EVENT_TYPE_CEF_LOCALFILE_RECOVEROPEN: case ASC_MENU_EVENT_TYPE_CEF_LOCALFILE_RECENTOPEN: { CAscLocalOpenFileRecent_Recover * data = (CAscLocalOpenFileRecent_Recover *)event->m_pData; From 74fa52fceb55674719241a7b070cc4beefa30b55 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 30 Mar 2020 11:43:58 +0300 Subject: [PATCH 09/33] Update defaults.pri (#108) --- win-linux/defaults.pri | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/win-linux/defaults.pri b/win-linux/defaults.pri index 0534c9567..a3698c0dd 100644 --- a/win-linux/defaults.pri +++ b/win-linux/defaults.pri @@ -105,7 +105,6 @@ SOURCES += \ # src/casclabel.cpp RESOURCES += $$PWD/resources.qrc -DEFINES += COPYRIGHT_YEAR=$${CURRENT_YEAR} isEqual(QT_MAJOR_VERSION, 5) { lessThan(QT_MINOR_VERSION, 10) { @@ -166,10 +165,12 @@ core_linux { LIBS += $$CORE_3DPARTY_PATH/icu/$$PLATFORM_BUILD/build/libicudata.so.58 DEFINES += DOCUMENTSCORE_OPENSSL_SUPPORT + DEFINES += COPYRIGHT_YEAR=$${CURRENT_YEAR} } core_windows { DEFINES += Q_COMPILER_INITIALIZER_LISTS + DEFINES += COPYRIGHT_YEAR=$$system("echo %Date:~10,4%") RC_ICONS += ./res/icons/desktop_icons.ico From 932d4e5e3764f38ae9f75976b1a3c47389553a34 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 30 Mar 2020 17:46:25 +0300 Subject: [PATCH 10/33] [win-nix] fix bug 44948 (#109) --- win-linux/defaults.pri | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/win-linux/defaults.pri b/win-linux/defaults.pri index a3698c0dd..0534c9567 100644 --- a/win-linux/defaults.pri +++ b/win-linux/defaults.pri @@ -105,6 +105,7 @@ SOURCES += \ # src/casclabel.cpp RESOURCES += $$PWD/resources.qrc +DEFINES += COPYRIGHT_YEAR=$${CURRENT_YEAR} isEqual(QT_MAJOR_VERSION, 5) { lessThan(QT_MINOR_VERSION, 10) { @@ -165,12 +166,10 @@ core_linux { LIBS += $$CORE_3DPARTY_PATH/icu/$$PLATFORM_BUILD/build/libicudata.so.58 DEFINES += DOCUMENTSCORE_OPENSSL_SUPPORT - DEFINES += COPYRIGHT_YEAR=$${CURRENT_YEAR} } core_windows { DEFINES += Q_COMPILER_INITIALIZER_LISTS - DEFINES += COPYRIGHT_YEAR=$$system("echo %Date:~10,4%") RC_ICONS += ./res/icons/desktop_icons.ico From 70660d374409937f5e40039ab2747f52762e732e Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 31 Mar 2020 18:29:06 +0300 Subject: [PATCH 11/33] [win-nix] fix bug 44976 (#111) --- win-linux/src/asctabwidget.cpp | 2 +- win-linux/src/ceditorwindow_p.h | 2 +- win-linux/src/ctabpanel.cpp | 5 +++++ win-linux/src/ctabpanel.h | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/win-linux/src/asctabwidget.cpp b/win-linux/src/asctabwidget.cpp index 8705b7abd..6aecb7816 100644 --- a/win-linux/src/asctabwidget.cpp +++ b/win-linux/src/asctabwidget.cpp @@ -1146,7 +1146,7 @@ void CAscTabWidget::setFullScreen(bool apply, int id) ((CTabPanel *)fsWidget)->showFullScreen(); ((CTabPanel *)fsWidget)->cef()->focus(); - cefConnection = connect(((CTabPanel *)fsWidget)->view(), &QCefView::closeWidget, [=](QCloseEvent * e){ + cefConnection = connect((CTabPanel *)fsWidget, &CTabPanel::closePanel, [=](QCloseEvent * e){ NSEditorApi::CAscExecCommandJS * pCommand = new NSEditorApi::CAscExecCommandJS; pCommand->put_Command(L"editor:stopDemonstration"); diff --git a/win-linux/src/ceditorwindow_p.h b/win-linux/src/ceditorwindow_p.h index c0cfcb4cb..2ee94acdb 100644 --- a/win-linux/src/ceditorwindow_p.h +++ b/win-linux/src/ceditorwindow_p.h @@ -375,7 +375,7 @@ public: _fs_widget->cef()->focus(); window->hide(); - cefConnection = connect(_fs_widget->view(), &QCefView::closeWidget, [=](QCloseEvent * e){ + cefConnection = connect(_fs_widget, &CTabPanel::closePanel, [=](QCloseEvent * e){ _break_demonstration(); e->ignore(); diff --git a/win-linux/src/ctabpanel.cpp b/win-linux/src/ctabpanel.cpp index 6de737cb1..4912c17d3 100644 --- a/win-linux/src/ctabpanel.cpp +++ b/win-linux/src/ctabpanel.cpp @@ -137,6 +137,11 @@ void CTabPanel::timerEvent(QTimerEvent *) } } +void CTabPanel::closeEvent(QCloseEvent *event) +{ + emit closePanel(event); +} + void CTabPanel::resize(int w, int h) { if ( m_idTimerResize == 0 ) { diff --git a/win-linux/src/ctabpanel.h b/win-linux/src/ctabpanel.h index 795b8e72d..7132833c6 100644 --- a/win-linux/src/ctabpanel.h +++ b/win-linux/src/ctabpanel.h @@ -42,6 +42,7 @@ public: protected: void timerEvent(QTimerEvent *event); void paintEvent(QPaintEvent *event); + void closeEvent(QCloseEvent *event); private: QCefView * m_pViewer; @@ -52,6 +53,8 @@ private: int m_idTimerResize = 0; bool m_prettyTitle = false; signals: + void closePanel(QCloseEvent *event); + public slots: void showFullScreen(); void showNormal(); From cbcee647254283d4891b681a15c27a1445fa24b6 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Wed, 1 Apr 2020 00:24:52 +0300 Subject: [PATCH 12/33] fix bug 44976 --- win-linux/src/ceditorwindow_p.h | 1 + 1 file changed, 1 insertion(+) diff --git a/win-linux/src/ceditorwindow_p.h b/win-linux/src/ceditorwindow_p.h index 2ee94acdb..678421260 100644 --- a/win-linux/src/ceditorwindow_p.h +++ b/win-linux/src/ceditorwindow_p.h @@ -355,6 +355,7 @@ public: window->m_pMainPanel->layout()->addWidget(_fs_widget); window->recalculatePlaces(); _fs_widget->showNormal(); + _fs_widget->cef()->focus(); disconnect(cefConnection); } else { From bc61443d4b58915ae7f17ab5e99f23819813efce Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Wed, 1 Apr 2020 00:38:10 +0300 Subject: [PATCH 13/33] fix bug 44989 --- win-linux/src/ceditorwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win-linux/src/ceditorwindow.cpp b/win-linux/src/ceditorwindow.cpp index 3cb0ce586..8b2a1ae21 100644 --- a/win-linux/src/ceditorwindow.cpp +++ b/win-linux/src/ceditorwindow.cpp @@ -271,7 +271,7 @@ QWidget * CEditorWindow::createMainPanel(QWidget * parent, const QString& title, if ( d_ptr->canExtendTitle() ) layoutBtns->addWidget(d_ptr.get()->iconUser()); - else m_labelTitle->setText("ONLYOFFICE"); + else m_labelTitle->setText(APP_TITLE); if ( custom ) { layoutBtns->addWidget(m_buttonMinimize); From 12e8dcb6a0307c458f84e17dd9384203a4b3c9e6 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Wed, 1 Apr 2020 14:07:41 +0300 Subject: [PATCH 14/33] [win-nix] fix bug 44998 (#113) --- win-linux/src/asctabwidget.cpp | 3 ++- win-linux/src/cmainpanel.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/win-linux/src/asctabwidget.cpp b/win-linux/src/asctabwidget.cpp index 6aecb7816..ecb573657 100644 --- a/win-linux/src/asctabwidget.cpp +++ b/win-linux/src/asctabwidget.cpp @@ -1155,7 +1155,8 @@ void CAscTabWidget::setFullScreen(bool apply, int id) ((CTabPanel *)fsWidget)->cef()->Apply(pEvent); e->ignore(); - emit closeAppRequest(); + emit tabCloseRequested(m_dataFullScreen->tabindex()); +// emit closeAppRequest(); }); fsWidget->setGeometry(QApplication::desktop()->screenGeometry(mapToGlobal(pos()))); diff --git a/win-linux/src/cmainpanel.cpp b/win-linux/src/cmainpanel.cpp index 197eff3b8..b3b1d4b69 100644 --- a/win-linux/src/cmainpanel.cpp +++ b/win-linux/src/cmainpanel.cpp @@ -487,6 +487,7 @@ void CMainPanel::onTabCloseRequest(int index) { if ( !m_closeAct.isEmpty() ) return; + onFullScreen(-1, false); if ( m_pTabs->isProcessed(index) ) { return; } else { From 888b594c8cf0c00e30615ea74708e4a621892f54 Mon Sep 17 00:00:00 2001 From: Alexander Yuzhin Date: Wed, 1 Apr 2020 13:58:36 +0300 Subject: [PATCH 15/33] [macos] Fixed display native skeleton --- macos/ONLYOFFICE/Base.lproj/Main.storyboard | 73 ++++++++----------- .../MainWindow/ASCTitleWindowController.mm | 31 +++++++- 2 files changed, 56 insertions(+), 48 deletions(-) diff --git a/macos/ONLYOFFICE/Base.lproj/Main.storyboard b/macos/ONLYOFFICE/Base.lproj/Main.storyboard index 7bd345a95..9f1f872f0 100644 --- a/macos/ONLYOFFICE/Base.lproj/Main.storyboard +++ b/macos/ONLYOFFICE/Base.lproj/Main.storyboard @@ -1,8 +1,9 @@ - + - - + + + @@ -746,59 +747,59 @@ - + - + - + - + - + - + - + - + - +