summaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2018-05-04 08:41:16 -0400
committerLibravatar Ryan Dwyer <ryandwyer1@gmail.com>2018-06-01 23:14:58 +1000
commit1132efe42e8086216c7bab6b405d09a22231dde5 (patch)
tree918a682faf3dd5f53fda799bcd3e12d2b0123840 /sway
parentRender floating views (diff)
downloadsway-1132efe42e8086216c7bab6b405d09a22231dde5.tar.gz
sway-1132efe42e8086216c7bab6b405d09a22231dde5.tar.zst
sway-1132efe42e8086216c7bab6b405d09a22231dde5.zip
Send frame done to floating views
Also centers them on the screen when initially floated In the future we'll need a more sophisticated solution than that
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/floating.c13
-rw-r--r--sway/debug-tree.c2
-rw-r--r--sway/ipc-json.c2
3 files changed, 13 insertions, 4 deletions
diff --git a/sway/commands/floating.c b/sway/commands/floating.c
index 8432b0dc..9e0be9d0 100644
--- a/sway/commands/floating.c
+++ b/sway/commands/floating.c
@@ -3,9 +3,11 @@
3#include "sway/commands.h" 3#include "sway/commands.h"
4#include "sway/input/seat.h" 4#include "sway/input/seat.h"
5#include "sway/ipc-server.h" 5#include "sway/ipc-server.h"
6#include "sway/output.h"
6#include "sway/tree/arrange.h" 7#include "sway/tree/arrange.h"
7#include "sway/tree/container.h" 8#include "sway/tree/container.h"
8#include "sway/tree/layout.h" 9#include "sway/tree/layout.h"
10#include "sway/tree/view.h"
9#include "list.h" 11#include "list.h"
10 12
11struct cmd_results *cmd_floating(int argc, char **argv) { 13struct cmd_results *cmd_floating(int argc, char **argv) {
@@ -38,6 +40,17 @@ struct cmd_results *cmd_floating(int argc, char **argv) {
38 container, C_WORKSPACE); 40 container, C_WORKSPACE);
39 container_remove_child(container); 41 container_remove_child(container);
40 container_add_floating(workspace, container); 42 container_add_floating(workspace, container);
43
44 struct sway_output *output = workspace->parent->sway_output;
45 output_damage_whole_container(output, container);
46 // Reset to sane size and position
47 container->width = 640;
48 container->height = 480;
49 container->x = workspace->width / 2 - container->width / 2;
50 container->y = workspace->height / 2 - container->height / 2;
51 view_autoconfigure(container->sway_view);
52 output_damage_whole_container(output, container);
53
41 seat_set_focus(config->handler_context.seat, container); 54 seat_set_focus(config->handler_context.seat, container);
42 arrange_workspace(workspace); 55 arrange_workspace(workspace);
43 } else if (container->is_floating && !wants_floating) { 56 } else if (container->is_floating && !wants_floating) {
diff --git a/sway/debug-tree.c b/sway/debug-tree.c
index ae0a1869..5af5b565 100644
--- a/sway/debug-tree.c
+++ b/sway/debug-tree.c
@@ -22,8 +22,6 @@ static const char *layout_to_str(enum sway_container_layout layout) {
22 return "L_STACKED"; 22 return "L_STACKED";
23 case L_TABBED: 23 case L_TABBED:
24 return "L_TABBED"; 24 return "L_TABBED";
25 case L_FLOATING:
26 return "L_FLOATING";
27 case L_NONE: 25 case L_NONE:
28 default: 26 default:
29 return "L_NONE"; 27 return "L_NONE";
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index 03582950..da4bef60 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -21,8 +21,6 @@ static const char *ipc_json_layout_description(enum sway_container_layout l) {
21 return "tabbed"; 21 return "tabbed";
22 case L_STACKED: 22 case L_STACKED:
23 return "stacked"; 23 return "stacked";
24 case L_FLOATING:
25 return "floating";
26 case L_NONE: 24 case L_NONE:
27 break; 25 break;
28 } 26 }