aboutsummaryrefslogtreecommitdiff
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)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
add_definitions(
- -D_GNU_SOURCE
-)
+ -D_GNU_SOURCE
+ )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-parameter")
list(INSERT CMAKE_MODULE_PATH 0
${CMAKE_CURRENT_SOURCE_DIR}/CMake
-)
+ )
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
execute_process(
COMMAND git describe --always
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- )
+ )
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- )
+ )
endif()
add_definitions(-DSWAY_GIT_VERSION=\"${GIT_COMMIT_HASH}\")
@@ -57,10 +57,10 @@ find_package(PAM)
find_package(Backtrace)
if(Backtrace_FOUND)
- include_directories("${Backtrace_INCLUDE_DIRS}")
- add_definitions(-DSWAY_Backtrace_FOUND=1)
- set(LINK_LIBRARIES, "${LINK_LIBRARIES} ${Backtrace_LIBRARIES}")
- set(SWAY_Backtrace_HEADER "${Backtrace_HEADER}")
+ include_directories("${Backtrace_INCLUDE_DIRS}")
+ add_definitions(-DSWAY_Backtrace_FOUND=1)
+ set(LINK_LIBRARIES, "${LINK_LIBRARIES} ${Backtrace_LIBRARIES}")
+ set(SWAY_Backtrace_HEADER "${Backtrace_HEADER}")
endif()
include(FeatureSummary)
@@ -68,14 +68,14 @@ include(Manpage)
include(GNUInstallDirs)
if (enable-gdk-pixbuf)
- if (GDK_PIXBUF_FOUND)
- set(WITH_GDK_PIXBUF YES)
- add_definitions(-DWITH_GDK_PIXBUF)
- else()
- message(WARNING "gdk-pixbuf required but not found, only png images supported.")
- endif()
+ if (GDK_PIXBUF_FOUND)
+ set(WITH_GDK_PIXBUF YES)
+ add_definitions(-DWITH_GDK_PIXBUF)
+ else()
+ message(WARNING "gdk-pixbuf required but not found, only png images supported.")
+ endif()
else()
- message(STATUS "Building without gdk-pixbuf, only png images supported.")
+ message(STATUS "Building without gdk-pixbuf, only png images supported.")
endif()
include_directories(include)
@@ -86,43 +86,43 @@ add_subdirectory(wayland)
add_subdirectory(sway)
if(enable-swaybg)
- if(CAIRO_FOUND AND PANGO_FOUND)
- add_subdirectory(swaybg)
- else()
- message(WARNING "Not building swaybg - cairo, and pango are required.")
- endif()
+ if(CAIRO_FOUND AND PANGO_FOUND)
+ add_subdirectory(swaybg)
+ else()
+ message(WARNING "Not building swaybg - cairo, and pango are required.")
+ endif()
endif()
if(enable-swaymsg)
- add_subdirectory(swaymsg)
+ add_subdirectory(swaymsg)
endif()
if(enable-swaygrab)
- add_subdirectory(swaygrab)
+ add_subdirectory(swaygrab)
endif()
if(enable-swaybar)
- if(CAIRO_FOUND AND PANGO_FOUND)
- add_subdirectory(swaybar)
- else()
- message(WARNING "Not building swaybar - cairo, and pango are required.")
- endif()
+ if(CAIRO_FOUND AND PANGO_FOUND)
+ add_subdirectory(swaybar)
+ else()
+ message(WARNING "Not building swaybar - cairo, and pango are required.")
+ endif()
endif()
if(enable-swaylock)
- if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND)
- add_subdirectory(swaylock)
- else()
- message(WARNING "Not building swaylock - cairo, pango, and PAM are required.")
- endif()
+ if(CAIRO_FOUND AND PANGO_FOUND AND PAM_FOUND)
+ add_subdirectory(swaylock)
+ else()
+ message(WARNING "Not building swaylock - cairo, pango, and PAM are required.")
+ endif()
endif()
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/sway.desktop
DESTINATION share/wayland-sessions
COMPONENT data
-)
+ )
install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/wallpaper.jpg
DESTINATION share/sway
COMPONENT data
-)
+ )
feature_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) {
wlc_view_set_state(container->handle, WLC_BIT_FULLSCREEN, !current);
// Resize workspace if going from fullscreen -> notfullscreen
// otherwise just resize container
- if (current) {
+ if (!current) {
arrange_windows(workspace, -1, -1);
workspace->fullscreen = container;
} 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) {
ws->is_focused = true;
free(ws_name);
-
+
return output;
}
@@ -354,7 +354,7 @@ swayc_t *destroy_workspace(swayc_t *workspace) {
if (!ASSERT_NONNULL(workspace)) {
return NULL;
}
-
+
// Do not destroy this if it's the last workspace on this output
swayc_t *output = swayc_parent_by_type(workspace, C_OUTPUT);
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) {
// refocus in-between command lists
set_focused_container(newview);
}
+ swayc_t *workspace = swayc_parent_by_type(focused, C_WORKSPACE);
+ if (workspace && workspace->fullscreen) {
+ set_focused_container(workspace->fullscreen);
+ }
} else {
swayc_t *output = swayc_parent_by_type(focused, C_OUTPUT);
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) {
sway_log(L_INFO, "Starting sway version %s (%s, branch \"%s\")\n", SWAY_GIT_VERSION, SWAY_VERSION_DATE, SWAY_GIT_BRANCH);
#endif
+ init_layout();
+
if (validate) {
bool valid = load_config(config_path);
return valid ? 0 : 1;
}
- init_layout();
-
if (!load_config(config_path)) {
sway_log(L_ERROR, "Error(s) loading config!");
}
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
If _-c_ is not specified, sway will look in several locations for your config
file. The suggested location for your config file is ~/.config/sway/config.
~/.sway/config will also work, and the rest of the usual XDG config locations
-are supported. At last, sway looks for a config file in a fallback directory,
-which is /etc/sway/ by default. A standard configuration file is installed at
-this location. If no sway config is found, sway will attempt to load an i3
-config from all the config locations i3 supports. If still nothing is found,
+are supported. If no sway config is found, sway will attempt to load an i3
+config from all the config locations i3 supports. At last, sway looks for a
+config file in a fallback directory, which is /etc/sway/ by default. A standard
+configuration file is installed at this location. If still nothing is found,
you will receive an error.
For 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) {
if (!bar_id) {
sway_abort("No bar_id passed. Provide --bar_id or let sway start swaybar");
}
-
+
if (debug) {
init_log(L_DEBUG);
} 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
)
if (WITH_GDK_PIXBUF)
- include_directories(
- ${GDK_PIXBUF_INCLUDE_DIRS}
- )
- target_link_libraries(swaybg
- ${GDK_PIXBUF_LIBRARIES}
- )
+ include_directories(
+ ${GDK_PIXBUF_INCLUDE_DIRS}
+ )
+ target_link_libraries(swaybg
+ ${GDK_PIXBUF_LIBRARIES}
+ )
endif()
install(
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,
"-video_size %dx%d -pixel_format argb "
"-i pipe:0 -r %d -vf vflip %s";
char *cmd = malloc(strlen(fmt) - 8 /*args*/
- + numlen(width) + numlen(height) + numlen(framerate) * 2
+ + numlen(width) + numlen(height) + numlen(framerate) * 2
+ strlen(file) + 1);
sprintf(cmd, fmt, framerate, width, height, framerate, file);
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
)
if (WITH_GDK_PIXBUF)
- include_directories(
- ${GDK_PIXBUF_INCLUDE_DIRS}
- )
- target_link_libraries(swaylock
- ${GDK_PIXBUF_LIBRARIES}
- )
+ include_directories(
+ ${GDK_PIXBUF_INCLUDE_DIRS}
+ )
+ target_link_libraries(swaylock
+ ${GDK_PIXBUF_LIBRARIES}
+ )
endif()
install(
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;
struct pam_response *pam_reply;
int function_conversation(int num_msg, const struct pam_message **msg,
- struct pam_response **resp, void *appdata_ptr) {
+ struct pam_response **resp, void *appdata_ptr) {
*resp = pam_reply;
- return PAM_SUCCESS;
-}
+ return PAM_SUCCESS;
+}
/**
* password will be zeroed out.
@@ -122,7 +122,7 @@ int main(int argc, char **argv) {
cairo_surface_t *image = gdk_cairo_image_surface_create_from_pixbuf(pixbuf);
g_object_unref(pixbuf);
#else
- cairo_surface_t *image = cairo_image_surface_create_from_png(argv[1]);
+ cairo_surface_t *image = cairo_image_surface_create_from_png(argv[1]);
#endif //WITH_GDK_PIXBUF
if (!image) {
sway_abort("Failed to read background image.");