summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt70
-rw-r--r--sway/commands.c2
-rw-r--r--sway/container.c4
-rw-r--r--sway/handlers.c4
-rw-r--r--sway/main.c4
-rw-r--r--sway/sway.1.txt8
-rw-r--r--swaybar/main.c2
-rw-r--r--swaybg/CMakeLists.txt12
-rw-r--r--swaygrab/main.c2
-rw-r--r--swaylock/CMakeLists.txt12
-rw-r--r--swaylock/main.c8
11 files changed, 66 insertions, 62 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 109b233a..9c556b0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,28 +8,28 @@ set(CMAKE_C_EXTENSIONS OFF)
8set(CMAKE_POSITION_INDEPENDENT_CODE ON) 8set(CMAKE_POSITION_INDEPENDENT_CODE ON)
9set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) 9set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
10add_definitions( 10add_definitions(
11 -D_GNU_SOURCE 11 -D_GNU_SOURCE
12) 12 )
13set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") 13set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
14set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra") 14set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
15set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter") 15set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
16 16
17list(INSERT CMAKE_MODULE_PATH 0 17list(INSERT CMAKE_MODULE_PATH 0
18 ${CMAKE_CURRENT_SOURCE_DIR}/CMake 18 ${CMAKE_CURRENT_SOURCE_DIR}/CMake
19) 19 )
20if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git) 20if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
21 execute_process( 21 execute_process(
22 COMMAND git describe --always 22 COMMAND git describe --always
23 OUTPUT_VARIABLE GIT_COMMIT_HASH 23 OUTPUT_VARIABLE GIT_COMMIT_HASH
24 OUTPUT_STRIP_TRAILING_WHITESPACE 24 OUTPUT_STRIP_TRAILING_WHITESPACE
25 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 25 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
26 ) 26 )
27 execute_process( 27 execute_process(
28 COMMAND git rev-parse --abbrev-ref HEAD 28 COMMAND git rev-parse --abbrev-ref HEAD
29 OUTPUT_VARIABLE GIT_BRANCH 29 OUTPUT_VARIABLE GIT_BRANCH
30 OUTPUT_STRIP_TRAILING_WHITESPACE 30 OUTPUT_STRIP_TRAILING_WHITESPACE
31 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} 31 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
32 ) 32 )
33endif() 33endif()
34 34
35add_definitions(-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\") 35add_definitions(-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\")
@@ -57,10 +57,10 @@ find_package(PAM)
57 57
58find_package(Backtrace) 58find_package(Backtrace)
59if(Backtrace_FOUND) 59if(Backtrace_FOUND)
60 include_directories("${Backtrace_INCLUDE_DIRS}") 60 include_directories("${Backtrace_INCLUDE_DIRS}")
61 add_definitions(-DSWAY_Backtrace_FOUND=1) 61 add_definitions(-DSWAY_Backtrace_FOUND=1)
62 set(LINK_LIBRARIES, "${LINK_LIBRARIES} ${Backtrace_LIBRARIES}") 62 set(LINK_LIBRARIES, "${LINK_LIBRARIES} ${Backtrace_LIBRARIES}")
63 set(SWAY_Backtrace_HEADER "${Backtrace_HEADER}") 63 set(SWAY_Backtrace_HEADER "${Backtrace_HEADER}")
64endif() 64endif()
65 65
66include(FeatureSummary) 66include(FeatureSummary)
@@ -68,14 +68,14 @@ include(Manpage)
68include(GNUInstallDirs) 68include(GNUInstallDirs)
69 69
70if (enable-gdk-pixbuf) 70if (enable-gdk-pixbuf)
71 if (GDK_PIXBUF_FOUND) 71 if (GDK_PIXBUF_FOUND)
72 set(WITH_GDK_PIXBUF YES) 72 set(WITH_GDK_PIXBUF YES)
73 add_definitions(-DWITH_GDK_PIXBUF) 73 add_definitions(-DWITH_GDK_PIXBUF)
74 else() 74 else()
75 message(WARNING "gdk-pixbuf required but not found, only png images supported.") 75 message(WARNING "gdk-pixbuf required but not found, only png images supported.")
76 endif() 76 endif()
77else() 77else()
78 message(STATUS "Building without gdk-pixbuf, only png images supported.") 78 message(STATUS "Building without gdk-pixbuf, only png images supported.")
79endif() 79endif()
80 80
81include_directories(include) 81include_directories(include)
@@ -86,43 +86,43 @@ add_subdirectory(wayland)
86 86
87add_subdirectory(sway) 87add_subdirectory(sway)
88if(enable-swaybg) 88if(enable-swaybg)
89 if(CAIRO_FOUND AND PANGO_FOUND) 89 if(CAIRO_FOUND AND PANGO_FOUND)
90 add_subdirectory(swaybg) 90 add_subdirectory(swaybg)
91 else() 91 else()
92 message(WARNING "Not building swaybg - cairo, and pango are required.") 92 message(WARNING "Not building swaybg - cairo, and pango are required.")
93 endif() 93 endif()
94endif() 94endif()
95if(enable-swaymsg) 95if(enable-swaymsg)
96 add_subdirectory(swaymsg) 96 add_subdirectory(swaymsg)
97endif() 97endif()
98if(enable-swaygrab) 98if(enable-swaygrab)
99 add_subdirectory(swaygrab) 99 add_subdirectory(swaygrab)
100endif() 100endif()
101if(enable-swaybar) 101if(enable-swaybar)
102 if(CAIRO_FOUND AND PANGO_FOUND) 102 if(CAIRO_FOUND AND PANGO_FOUND)
103 add_subdirectory(swaybar) 103 add_subdirectory(swaybar)
104 else() 104 else()
105 message(WARNING "Not building swaybar - cairo, and pango are required.") 105 message(WARNING "Not building swaybar - cairo, and pango are required.")
106 endif() 106 endif()
107endif() 107endif()
108if(enable-swaylock) 108if(enable-swaylock)
109 if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND) 109 if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND)
110 add_subdirectory(swaylock) 110 add_subdirectory(swaylock)
111 else() 111 else()
112 message(WARNING "Not building swaylock - cairo, pango, and PAM are required.") 112 message(WARNING "Not building swaylock - cairo, pango, and PAM are required.")
113 endif() 113 endif()
114endif() 114endif()
115 115
116install( 116install(
117 FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop 117 FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop
118 DESTINATION share/wayland-sessions 118 DESTINATION share/wayland-sessions
119 COMPONENT data 119 COMPONENT data
120) 120 )
121 121
122install( 122install(
123 FILES ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper.jpg 123 FILES ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper.jpg
124 DESTINATION share/sway 124 DESTINATION share/sway
125 COMPONENT data 125 COMPONENT data
126) 126 )
127 127
128feature_summary(WHAT ALL) 128feature_summary(WHAT ALL)
diff --git a/sway/commands.c b/sway/commands.c
index 3a4079e4..4e5bc712 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -1439,7 +1439,7 @@ static struct cmd_results *cmd_fullscreen(int argc, char **argv) {
1439 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current); 1439 wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
1440 // Resize workspace if going from fullscreen -> notfullscreen 1440 // Resize workspace if going from fullscreen -> notfullscreen
1441 // otherwise just resize container 1441 // otherwise just resize container
1442 if (current) { 1442 if (!current) {
1443 arrange_windows(workspace, -1, -1); 1443 arrange_windows(workspace, -1, -1);
1444 workspace->fullscreen = container; 1444 workspace->fullscreen = container;
1445 } else { 1445 } else {
diff --git a/sway/container.c b/sway/container.c
index dcf4dcc8..63374f9e 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -149,7 +149,7 @@ swayc_t *new_output(wlc_handle handle) {
149 ws->is_focused = true; 149 ws->is_focused = true;
150 150
151 free(ws_name); 151 free(ws_name);
152 152
153 return output; 153 return output;
154} 154}
155 155
@@ -354,7 +354,7 @@ swayc_t *destroy_workspace(swayc_t *workspace) {
354 if (!ASSERT_NONNULL(workspace)) { 354 if (!ASSERT_NONNULL(workspace)) {
355 return NULL; 355 return NULL;
356 } 356 }
357 357
358 // Do not destroy this if it's the last workspace on this output 358 // Do not destroy this if it's the last workspace on this output
359 swayc_t *output = swayc_parent_by_type(workspace, C_OUTPUT); 359 swayc_t *output = swayc_parent_by_type(workspace, C_OUTPUT);
360 if (output && output->children->length == 1) { 360 if (output && output->children->length == 1) {
diff --git a/sway/handlers.c b/sway/handlers.c
index db3a0206..470f3c95 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -221,6 +221,10 @@ static bool handle_view_created(wlc_handle handle) {
221 // refocus in-between command lists 221 // refocus in-between command lists
222 set_focused_container(newview); 222 set_focused_container(newview);
223 } 223 }
224 swayc_t *workspace = swayc_parent_by_type(focused, C_WORKSPACE);
225 if (workspace && workspace->fullscreen) {
226 set_focused_container(workspace->fullscreen);
227 }
224 } else { 228 } else {
225 swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT); 229 swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT);
226 wlc_handle *h = malloc(sizeof(wlc_handle)); 230 wlc_handle *h = malloc(sizeof(wlc_handle));
diff --git a/sway/main.c b/sway/main.c
index 37681f2d..e85f7269 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -188,13 +188,13 @@ int main(int argc, char **argv) {
188 sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH); 188 sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH);
189#endif 189#endif
190 190
191 init_layout();
192
191 if (validate) { 193 if (validate) {
192 bool valid = load_config(config_path); 194 bool valid = load_config(config_path);
193 return valid ? 0 : 1; 195 return valid ? 0 : 1;
194 } 196 }
195 197
196 init_layout();
197
198 if (!load_config(config_path)) { 198 if (!load_config(config_path)) {
199 sway_log(L_ERROR, "Error(s) loading config!"); 199 sway_log(L_ERROR, "Error(s) loading config!");
200 } 200 }
diff --git a/sway/sway.1.txt b/sway/sway.1.txt
index 402b2d77..b073e552 100644
--- a/sway/sway.1.txt
+++ b/sway/sway.1.txt
@@ -68,10 +68,10 @@ Configuration
68If _-c_ is not specified, sway will look in several locations for your config 68If _-c_ is not specified, sway will look in several locations for your config
69file. The suggested location for your config file is ~/.config/sway/config. 69file. The suggested location for your config file is ~/.config/sway/config.
70~/.sway/config will also work, and the rest of the usual XDG config locations 70~/.sway/config will also work, and the rest of the usual XDG config locations
71are supported. At last, sway looks for a config file in a fallback directory, 71are supported. If no sway config is found, sway will attempt to load an i3
72which is /etc/sway/ by default. A standard configuration file is installed at 72config from all the config locations i3 supports. At last, sway looks for a
73this location. If no sway config is found, sway will attempt to load an i3 73config file in a fallback directory, which is /etc/sway/ by default. A standard
74config from all the config locations i3 supports. If still nothing is found, 74configuration file is installed at this location. If still nothing is found,
75you will receive an error. 75you will receive an error.
76 76
77For information on the config file format, see **sway**(5). 77For information on the config file format, see **sway**(5).
diff --git a/swaybar/main.c b/swaybar/main.c
index e3967846..98b75aee 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -1231,7 +1231,7 @@ int main(int argc, char **argv) {
1231 if (!bar_id) { 1231 if (!bar_id) {
1232 sway_abort("No bar_id passed. Provide --bar_id or let sway start swaybar"); 1232 sway_abort("No bar_id passed. Provide --bar_id or let sway start swaybar");
1233 } 1233 }
1234 1234
1235 if (debug) { 1235 if (debug) {
1236 init_log(L_DEBUG); 1236 init_log(L_DEBUG);
1237 } else { 1237 } else {
diff --git a/swaybg/CMakeLists.txt b/swaybg/CMakeLists.txt
index 68098370..c5efae91 100644
--- a/swaybg/CMakeLists.txt
+++ b/swaybg/CMakeLists.txt
@@ -20,12 +20,12 @@ target_link_libraries(swaybg
20) 20)
21 21
22if (WITH_GDK_PIXBUF) 22if (WITH_GDK_PIXBUF)
23 include_directories( 23 include_directories(
24 ${GDK_PIXBUF_INCLUDE_DIRS} 24 ${GDK_PIXBUF_INCLUDE_DIRS}
25 ) 25 )
26 target_link_libraries(swaybg 26 target_link_libraries(swaybg
27 ${GDK_PIXBUF_LIBRARIES} 27 ${GDK_PIXBUF_LIBRARIES}
28 ) 28 )
29endif() 29endif()
30 30
31install( 31install(
diff --git a/swaygrab/main.c b/swaygrab/main.c
index d64d2ff2..403f7b38 100644
--- a/swaygrab/main.c
+++ b/swaygrab/main.c
@@ -72,7 +72,7 @@ void grab_and_apply_movie_magic(const char *file, const char *output,
72 "-video_size %dx%d -pixel_format argb " 72 "-video_size %dx%d -pixel_format argb "
73 "-i pipe:0 -r %d -vf vflip %s"; 73 "-i pipe:0 -r %d -vf vflip %s";
74 char *cmd = malloc(strlen(fmt) - 8 /*args*/ 74 char *cmd = malloc(strlen(fmt) - 8 /*args*/
75 + numlen(width) + numlen(height) + numlen(framerate) * 2 75 + numlen(width) + numlen(height) + numlen(framerate) * 2
76 + strlen(file) + 1); 76 + strlen(file) + 1);
77 sprintf(cmd, fmt, framerate, width, height, framerate, file); 77 sprintf(cmd, fmt, framerate, width, height, framerate, file);
78 78
diff --git a/swaylock/CMakeLists.txt b/swaylock/CMakeLists.txt
index 6b110e77..ff76cdbc 100644
--- a/swaylock/CMakeLists.txt
+++ b/swaylock/CMakeLists.txt
@@ -22,12 +22,12 @@ target_link_libraries(swaylock
22) 22)
23 23
24if (WITH_GDK_PIXBUF) 24if (WITH_GDK_PIXBUF)
25 include_directories( 25 include_directories(
26 ${GDK_PIXBUF_INCLUDE_DIRS} 26 ${GDK_PIXBUF_INCLUDE_DIRS}
27 ) 27 )
28 target_link_libraries(swaylock 28 target_link_libraries(swaylock
29 ${GDK_PIXBUF_LIBRARIES} 29 ${GDK_PIXBUF_LIBRARIES}
30 ) 30 )
31endif() 31endif()
32 32
33install( 33install(
diff --git a/swaylock/main.c b/swaylock/main.c
index eccb902e..9de95e7a 100644
--- a/swaylock/main.c
+++ b/swaylock/main.c
@@ -38,10 +38,10 @@ char *password;
38struct pam_response *pam_reply; 38struct pam_response *pam_reply;
39 39
40int function_conversation(int num_msg, const struct pam_message **msg, 40int function_conversation(int num_msg, const struct pam_message **msg,
41 struct pam_response **resp, void *appdata_ptr) { 41 struct pam_response **resp, void *appdata_ptr) {
42 *resp = pam_reply; 42 *resp = pam_reply;
43 return PAM_SUCCESS; 43 return PAM_SUCCESS;
44} 44}
45 45
46/** 46/**
47 * password will be zeroed out. 47 * password will be zeroed out.
@@ -122,7 +122,7 @@ int main(int argc, char **argv) {
122 cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf); 122 cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf);
123 g_object_unref(pixbuf); 123 g_object_unref(pixbuf);
124#else 124#else
125 cairo_surface_t *image = cairo_image_surface_create_from_png(argv[1]); 125 cairo_surface_t *image = cairo_image_surface_create_from_png(argv[1]);
126#endif //WITH_GDK_PIXBUF 126#endif //WITH_GDK_PIXBUF
127 if (!image) { 127 if (!image) {
128 sway_abort("Failed to read background image."); 128 sway_abort("Failed to read background image.");