Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Jan 10, 2025
1 parent 1454809 commit 9747bbc
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 13 deletions.
19 changes: 19 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,25 @@ if(QWINDOWKIT_INSTALL)
include(CMakePackageConfigHelpers)
endif()

option(QWINDOWKIT_ENABLE_VCLTL "Enable VC-LTL." OFF)
option(QWINDOWKIT_ENABLE_YYTHUNKS "Enable YY-Thunks." OFF)
if(QWINDOWKIT_ENABLE_VCLTL)
include(qmsetup/cmake/find-modules/VC-LTL.cmake)
if("x${SupportLTL}" STREQUAL "xtrue")
unset(CMAKE_MSVC_RUNTIME_LIBRARY)
unset(CMAKE_MSVC_RUNTIME_LIBRARY CACHE)
#unset(CMAKE_MSVC_RUNTIME_LIBRARY PARENT_SCOPE)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>" CACHE STRING "" FORCE)
endif()
endif()
if(QWINDOWKIT_ENABLE_YYTHUNKS)
unset(YYTHUNKS_TARGET_OS)
unset(YYTHUNKS_TARGET_OS CACHE)
#unset(YYTHUNKS_TARGET_OS PARENT_SCOPE)
set(YYTHUNKS_TARGET_OS "WinXP" CACHE STRING "" FORCE)
include(qmsetup/cmake/find-modules/YY-Thunks.cmake)
endif()

# ----------------------------------
# Project Variables
# ----------------------------------
Expand Down
5 changes: 5 additions & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ macro(qwk_add_example _target)
set(CMAKE_AUTORCC ON)

add_executable(${_target})
set_target_properties(${_target} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED TRUE
INTERPROCEDURAL_OPTIMIZATION_RELEASE ON
)
qm_configure_target(${_target} ${ARGN})
qm_add_win_rc(${_target} ICON ${QWK_EXAMPLES_DIR}/shared/resources/app/example.ico)
qm_add_win_manifest(${_target})
Expand Down
8 changes: 2 additions & 6 deletions examples/qml/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
project(QWKExample_QML)

file(GLOB _src *.h *.cpp *.qrc)
file(GLOB _src *.h *.cpp)

qwk_add_example(${PROJECT_NAME}
SOURCES ${_src} ../shared/resources/shared.qrc
QT_LINKS Core Gui Qml Quick
LINKS QWKQuick
)

set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED TRUE
QML_FILES *.qml
)
4 changes: 2 additions & 2 deletions examples/qml/QWKButton.qml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick
import QtQuick.Controls.Basic

Button {
id: root
Expand Down
10 changes: 5 additions & 5 deletions examples/qml/main.qml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import Qt.labs.platform 1.1
import QWindowKit 1.0
import QtQuick
import QtQuick.Controls.Basic
import Qt.labs.platform
import QWindowKit
import QWKExample_QML

Window {
id: window
Expand Down
2 changes: 2 additions & 0 deletions src/core/contexts/win32windowcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2017,6 +2017,7 @@ namespace QWK {
// help much either.
if (m_windowHandle && m_windowHandle->surfaceType() == QSurface::Direct3DSurface
&& isDwmCompositionEnabled() && DynamicApis::instance().pDwmFlush) {
#if 0
DynamicApis::instance().pDwmFlush();
static const auto magicWaitTime = []() {
qreal refreshRate = qreal(60);
Expand All @@ -2034,6 +2035,7 @@ namespace QWK {
}();
// We need some time to wait for the presentation really done.
::Sleep(magicWaitTime);
#endif
}
});
if (isSystemBorderEnabled()) {
Expand Down

0 comments on commit 9747bbc

Please sign in to comment.