aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-17 13:09:44 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-17 13:09:44 -0400
commit107f961752641ca81cfb38a95948ea8fd0f236af (patch)
tree4e71c6fa01a1e68997c985e221307a11af67490c /sway
parentb48e8d1b178f2c713579dc532ff4be6edfccc5bc (diff)
parentf832c02065830127fcdb3d4c94ebce5f5b532b01 (diff)
Merge pull request #55 from taiyu-len/master
fixed when views dont have names.
Diffstat (limited to 'sway')
-rw-r--r--sway/container.c10
-rw-r--r--sway/handlers.c7
2 files changed, 10 insertions, 7 deletions
diff --git a/sway/container.c b/sway/container.c
index 231876c5..f10fbecf 100644
--- a/sway/container.c
+++ b/sway/container.c
@@ -54,9 +54,7 @@ swayc_t *new_output(wlc_handle handle) {
output->width = size->w;
output->height = size->h;
output->handle = handle;
- if (name) {
- output->name = strdup(name);
- }
+ output->name = name ? strdup(name) : NULL;
add_child(&root_container, output);
@@ -95,7 +93,7 @@ swayc_t *new_container(swayc_t *child, enum swayc_layouts layout) {
cont->layout = layout;
cont->width = child->width;
cont->height = child->height;
- cont->x = child->x;
+ cont->x = child->x;
cont->y = child->y;
cont->visible = child->visible;
@@ -132,7 +130,7 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) {
(unsigned int)handle, title, sibling, sibling?sibling->type:0);
//Setup values
view->handle = handle;
- view->name = strdup(title);
+ view->name = title ? strdup(title) : NULL;
view->visible = true;
view->desired_width = -1;
@@ -159,7 +157,7 @@ swayc_t *new_floating_view(wlc_handle handle) {
(unsigned int)handle, title);
//Setup values
view->handle = handle;
- view->name = strdup(title);
+ view->name = title ? strdup(title) : NULL;
view->visible = true;
// Set the geometry of the floating view
diff --git a/sway/handlers.c b/sway/handlers.c
index 77e8f237..b166b7a6 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -104,6 +104,7 @@ static bool handle_view_created(wlc_handle handle) {
// Float popups
if (type & WLC_BIT_POPUP) {
swayc_t *view = new_floating_view(handle);
+ wlc_view_set_state(handle, WLC_BIT_MAXIMIZED, false);
focus_view(view);
arrange_windows(active_workspace, -1, -1);
}
@@ -136,13 +137,17 @@ static void handle_view_destroyed(wlc_handle handle) {
focus_view(focus_pointer());
arrange_windows(active_workspace, -1, -1);
return;
- }
+ }
if (type & WLC_BIT_OVERRIDE_REDIRECT) {
focus_view(focus_pointer());
arrange_windows(active_workspace, -1, -1);
return;
}
+ if (type & WLC_BIT_POPUP) {
+ swayc_t *view = get_swayc_for_handle(handle, &root_container);
+ destroy_view(view);
+ }
}
swayc_t *view = get_swayc_for_handle(handle, &root_container);
swayc_t *parent;