aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorZandr Martin <zandrmartin@gmail.com>2016-07-02 08:14:40 -0500
committerZandr Martin <zandrmartin@gmail.com>2016-07-02 08:14:40 -0500
commit034410819d4c8ea28105c5a5eef0563635a36a9d (patch)
treef24f60afd5ee641bddc78e6b16a8035e3abf7469 /sway
parentcbbeeb2cc3037d7538c7124e6ac0fe9e239731bb (diff)
parent7144fb9fc3b3d3b45d23deaab6a10caf3216cca4 (diff)
Merge remote-tracking branch 'upstream/master' into set-size-command
Diffstat (limited to 'sway')
-rw-r--r--sway/commands.c4
-rw-r--r--sway/container.c4
-rw-r--r--sway/debug_log.c4
-rw-r--r--sway/handlers.c13
4 files changed, 14 insertions, 11 deletions
diff --git a/sway/commands.c b/sway/commands.c
index 4009997b..55f46f79 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -251,7 +251,7 @@ static struct cmd_results *cmd_bindsym(int argc, char **argv) {
} else {
free_sway_binding(binding);
return cmd_results_new(CMD_FAILURE, "bindsym",
- "Invalid bindsym command"
+ "Invalid bindsym command "
"(expected more than 2 arguments, got %d)", argc);
}
}
@@ -317,7 +317,7 @@ static struct cmd_results *cmd_bindcode(int argc, char **argv) {
} else {
free_sway_binding(binding);
return cmd_results_new(CMD_FAILURE, "bindcode",
- "Invalid bindcode command"
+ "Invalid bindcode command "
"(expected more than 2 arguments, got %d)", argc);
}
}
diff --git a/sway/container.c b/sway/container.c
index 15975064..21538ab4 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -853,12 +853,12 @@ swayc_t *swayc_tabbed_stacked_parent(swayc_t *view) {
if (!ASSERT_NONNULL(view)) {
return NULL;
}
- do {
+ while (view->type != C_WORKSPACE && view->parent) {
view = view->parent;
if (view->layout == L_TABBED || view->layout == L_STACKED) {
parent = view;
}
- } while (view && view->type != C_WORKSPACE);
+ }
return parent;
}
diff --git a/sway/debug_log.c b/sway/debug_log.c
index f804a541..7c988464 100644
--- a/sway/debug_log.c
+++ b/sway/debug_log.c
@@ -12,8 +12,6 @@
#include <stringop.h>
#include "workspace.h"
-extern log_importance_t v;
-
/* XXX:DEBUG:XXX */
static void container_log(const swayc_t *c, int depth) {
fprintf(stderr, "focus:%c",
@@ -49,7 +47,7 @@ static void container_log(const swayc_t *c, int depth) {
fprintf(stderr, "name:%.16s\n", c->name);
}
void layout_log(const swayc_t *c, int depth) {
- if (L_DEBUG > v) return;
+ if (L_DEBUG > get_log_level()) return;
int i, d;
int e = c->children ? c->children->length : 0;
container_log(c, depth);
diff --git a/sway/handlers.c b/sway/handlers.c
index b38f05a6..53dbeb87 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -198,11 +198,12 @@ static bool handle_view_created(wlc_handle handle) {
if (pid) {
// using newview as a temp storage location here,
// rather than adding yet another workspace var
- if ((newview = workspace_for_pid(pid))) {
+ newview = workspace_for_pid(pid);
+ if (newview && newview != current_ws) {
focused = newview;
- newview = NULL;
return_to_workspace = true;
}
+ newview = NULL;
}
}
@@ -234,8 +235,12 @@ static bool handle_view_created(wlc_handle handle) {
switch (wlc_view_get_type(handle)) {
// regular view created regularly
case 0:
- newview = new_view(focused, handle);
- wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true);
+ if (parent) {
+ newview = new_floating_view(handle);
+ } else {
+ newview = new_view(focused, handle);
+ wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, true);
+ }
break;
// Dmenu keeps viewfocus, but others with this flag don't, for now simulate