diff options
-rw-r--r-- | CMake/FindPCRE.cmake | 37 | ||||
-rw-r--r-- | CMakeLists.txt | 13 | ||||
-rw-r--r-- | sway/handlers.c | 3 |
3 files changed, 43 insertions, 10 deletions
diff --git a/CMake/FindPCRE.cmake b/CMake/FindPCRE.cmake new file mode 100644 index 00000000..dbbd60ad --- /dev/null +++ b/CMake/FindPCRE.cmake | |||
@@ -0,0 +1,37 @@ | |||
1 | # Copyright (C) 2007-2009 LuaDist. | ||
2 | # Created by Peter Kapec <kapecp@gmail.com> | ||
3 | # Redistribution and use of this file is allowed according to the terms of the MIT license. | ||
4 | # For details see the COPYRIGHT file distributed with LuaDist. | ||
5 | # Note: | ||
6 | # Searching headers and libraries is very simple and is NOT as powerful as scripts | ||
7 | # distributed with CMake, because LuaDist defines directories to search for. | ||
8 | # Everyone is encouraged to contact the author with improvements. Maybe this file | ||
9 | # becomes part of CMake distribution sometimes. | ||
10 | |||
11 | # - Find pcre | ||
12 | # Find the native PCRE headers and libraries. | ||
13 | # | ||
14 | # PCRE_INCLUDE_DIRS - where to find pcre.h, etc. | ||
15 | # PCRE_LIBRARIES - List of libraries when using pcre. | ||
16 | # PCRE_FOUND - True if pcre found. | ||
17 | |||
18 | # Look for the header file. | ||
19 | FIND_PATH(PCRE_INCLUDE_DIR NAMES pcre.h) | ||
20 | |||
21 | # Look for the library. | ||
22 | FIND_LIBRARY(PCRE_LIBRARY NAMES pcre) | ||
23 | |||
24 | # Handle the QUIETLY and REQUIRED arguments and set PCRE_FOUND to TRUE if all listed variables are TRUE. | ||
25 | INCLUDE(FindPackageHandleStandardArgs) | ||
26 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY PCRE_INCLUDE_DIR) | ||
27 | |||
28 | # Copy the results to the output variables. | ||
29 | IF(PCRE_FOUND) | ||
30 | SET(PCRE_LIBRARIES ${PCRE_LIBRARY}) | ||
31 | SET(PCRE_INCLUDE_DIRS ${PCRE_INCLUDE_DIR}) | ||
32 | ELSE(PCRE_FOUND) | ||
33 | SET(PCRE_LIBRARIES) | ||
34 | SET(PCRE_INCLUDE_DIRS) | ||
35 | ENDIF(PCRE_FOUND) | ||
36 | |||
37 | MARK_AS_ADVANCED(PCRE_INCLUDE_DIRS PCRE_LIBRARIES) | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e639e1f..bbf61299 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -1,6 +1,7 @@ | |||
1 | cmake_minimum_required(VERSION 2.8.5) | 1 | cmake_minimum_required(VERSION 2.8.5) |
2 | project(sway C) | 2 | project(sway C) |
3 | set(CMAKE_C_FLAGS "-g") | 3 | set(CMAKE_C_FLAGS "-g") |
4 | set(CMAKE_C_STANDARD 99) | ||
4 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin/") | 5 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin/") |
5 | add_definitions("-Wall -Wextra -Wno-unused-parameter") | 6 | add_definitions("-Wall -Wextra -Wno-unused-parameter") |
6 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake) | 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMake) |
@@ -20,19 +21,13 @@ add_definitions("${GIT_VERSION_FLAG}") | |||
20 | find_package(XKBCommon REQUIRED) | 21 | find_package(XKBCommon REQUIRED) |
21 | find_package(WLC REQUIRED) | 22 | find_package(WLC REQUIRED) |
22 | find_package(A2X REQUIRED) | 23 | find_package(A2X REQUIRED) |
23 | 24 | find_package(PCRE REQUIRED) | |
24 | if (UNIX) | ||
25 | find_library(DL_LIBRARY dl) | ||
26 | mark_as_advanced(DL_LIBRARY) | ||
27 | if (NOT DL_LIBRARY) | ||
28 | message(FATAL_ERROR "libdl is needed on unix systems") | ||
29 | endif () | ||
30 | endif (UNIX) | ||
31 | 25 | ||
32 | FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) | 26 | FILE(GLOB sources ${PROJECT_SOURCE_DIR}/sway/*.c) |
33 | 27 | ||
34 | include_directories( | 28 | include_directories( |
35 | ${WLC_INCLUDE_DIRS} | 29 | ${WLC_INCLUDE_DIRS} |
30 | ${PCRE_INCLUDE_DIRS} | ||
36 | include/ | 31 | include/ |
37 | ) | 32 | ) |
38 | 33 | ||
@@ -43,7 +38,7 @@ add_executable(sway | |||
43 | target_link_libraries(sway | 38 | target_link_libraries(sway |
44 | ${WLC_LIBRARIES} | 39 | ${WLC_LIBRARIES} |
45 | ${XKBCOMMON_LIBRARIES} | 40 | ${XKBCOMMON_LIBRARIES} |
46 | ${DL_LIBRARY} | 41 | ${PCRE_LIBRARIES} |
47 | ) | 42 | ) |
48 | 43 | ||
49 | INSTALL( | 44 | INSTALL( |
diff --git a/sway/handlers.c b/sway/handlers.c index 330f6c0c..93b124bd 100644 --- a/sway/handlers.c +++ b/sway/handlers.c | |||
@@ -302,7 +302,8 @@ static bool handle_key(wlc_handle view, uint32_t time, const struct wlc_modifier | |||
302 | 302 | ||
303 | struct sway_mode *mode = config->current_mode; | 303 | struct sway_mode *mode = config->current_mode; |
304 | 304 | ||
305 | uint32_t sym = tolower(wlc_keyboard_get_keysym_for_key(key, modifiers)); | 305 | struct wlc_modifiers no_mods = { 0, 0 }; |
306 | uint32_t sym = tolower(wlc_keyboard_get_keysym_for_key(key, &no_mods)); | ||
306 | 307 | ||
307 | int i; | 308 | int i; |
308 | 309 | ||