diff options
-rw-r--r-- | ldmicro/CMakeLists.txt | 16 | ||||
-rw-r--r-- | ldmicro/lib/freezeLD/freezeLD.cpp | 8 |
2 files changed, 22 insertions, 2 deletions
diff --git a/ldmicro/CMakeLists.txt b/ldmicro/CMakeLists.txt index 023d17a..b1772a8 100644 --- a/ldmicro/CMakeLists.txt +++ b/ldmicro/CMakeLists.txt @@ -30,6 +30,20 @@ IF(UNIX) add_definitions ("-g") add_definitions(-D__UNIX__) add_definitions(-DLDLANG_EN) + execute_process(COMMAND lsb_release -cs + OUTPUT_VARIABLE RELEASE_CODENAME + OUTPUT_STRIP_TRAILING_WHITESPACE) + STRING(TOLOWER ${RELEASE_CODENAME} RELEASE_LOWER) + message("-- os_version_suffix:${RELEASE_CODENAME}") + if(${RELEASE_LOWER} MATCHES "trusty") + MESSAGE("Add flag to compile for Ubuntu 14") + add_definitions(-D__UBUNTU_14_) + SET(CMAKE_BUILD_TYPE Debug) + MESSAGE("Build type is " ${CMAKE_BUILD_TYPE}) + else() + MESSAGE("Add flag to compile for Ubuntu 16") + add_definitions(-D__UBUNTU_16_) + endif() use_cxx11() # set_property(DIRECTORY PROPERTY ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/build/") @@ -158,7 +172,7 @@ IF(UNIX) set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_VERSION_MAJOR "2") set(CPACK_PACKAGE_VERSION_MINOR "2") - set(CPACK_PACKAGE_VERSION_PATCH "4") + set(CPACK_PACKAGE_VERSION_PATCH "5") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_PACKAGE_DESCRIPTION "Ladder Logic editor, simulator and compiler for 8 bit microcontrollers") diff --git a/ldmicro/lib/freezeLD/freezeLD.cpp b/ldmicro/lib/freezeLD/freezeLD.cpp index 75bbb30..e577f13 100644 --- a/ldmicro/lib/freezeLD/freezeLD.cpp +++ b/ldmicro/lib/freezeLD/freezeLD.cpp @@ -117,7 +117,13 @@ void FreezeWindowPosF(HWID hwid, char *subKey, char *name) return; } newKey.type = 'b'; - newKey.val.b = gtk_window_is_maximized(GTK_WINDOW(hwid)); + + #if defined(__UBUNTU_16_) + newKey.val.b = gtk_window_is_maximized(GTK_WINDOW(hwid)); + #elif defined(__UBUNTU_14_) + newKey.val.b = false; + #endif + Register.write((char*) &newKey, sizeof(newKey)); Register.close(); |