diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-17 10:14:33 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-17 10:14:33 +1000 |
commit | 75c699db62e63e2a3c2aa652c9ba9482a8f13ec3 (patch) | |
tree | f8b454f2e07f894443cfa76ab48ae0e3fa372829 /sway/tree/view.c | |
parent | Merge pull request #2285 from emersion/cleanup-swayidle (diff) | |
download | sway-75c699db62e63e2a3c2aa652c9ba9482a8f13ec3.tar.gz sway-75c699db62e63e2a3c2aa652c9ba9482a8f13ec3.tar.zst sway-75c699db62e63e2a3c2aa652c9ba9482a8f13ec3.zip |
Implement default_floating_border command and adjust CSD behaviour
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r-- | sway/tree/view.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 76e0f42c..d9938130 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -316,11 +316,15 @@ void view_set_activated(struct sway_view *view, bool activated) { | |||
316 | } | 316 | } |
317 | 317 | ||
318 | void view_set_tiled(struct sway_view *view, bool tiled) { | 318 | void view_set_tiled(struct sway_view *view, bool tiled) { |
319 | bool csd = true; | 319 | if (!tiled) { |
320 | if (view->impl->has_client_side_decorations) { | 320 | view->using_csd = true; |
321 | csd = view->impl->has_client_side_decorations(view); | 321 | if (view->impl->has_client_side_decorations) { |
322 | view->using_csd = view->impl->has_client_side_decorations(view); | ||
323 | } | ||
324 | } else { | ||
325 | view->using_csd = false; | ||
322 | } | 326 | } |
323 | view->border = tiled || !csd ? config->border : B_NONE; | 327 | |
324 | if (view->impl->set_tiled) { | 328 | if (view->impl->set_tiled) { |
325 | view->impl->set_tiled(view, tiled); | 329 | view->impl->set_tiled(view, tiled); |
326 | } | 330 | } |
@@ -573,8 +577,6 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) { | |||
573 | 577 | ||
574 | view->surface = wlr_surface; | 578 | view->surface = wlr_surface; |
575 | view->swayc = cont; | 579 | view->swayc = cont; |
576 | view->border = config->border; | ||
577 | view->border_thickness = config->border_thickness; | ||
578 | 580 | ||
579 | view_init_subsurfaces(view, wlr_surface); | 581 | view_init_subsurfaces(view, wlr_surface); |
580 | wl_signal_add(&wlr_surface->events.new_subsurface, | 582 | wl_signal_add(&wlr_surface->events.new_subsurface, |
@@ -585,8 +587,12 @@ void view_map(struct sway_view *view, struct wlr_surface *wlr_surface) { | |||
585 | view->container_reparent.notify = view_handle_container_reparent; | 587 | view->container_reparent.notify = view_handle_container_reparent; |
586 | 588 | ||
587 | if (view->impl->wants_floating && view->impl->wants_floating(view)) { | 589 | if (view->impl->wants_floating && view->impl->wants_floating(view)) { |
590 | view->border = config->floating_border; | ||
591 | view->border_thickness = config->floating_border_thickness; | ||
588 | container_set_floating(view->swayc, true); | 592 | container_set_floating(view->swayc, true); |
589 | } else { | 593 | } else { |
594 | view->border = config->border; | ||
595 | view->border_thickness = config->border_thickness; | ||
590 | view_set_tiled(view, true); | 596 | view_set_tiled(view, true); |
591 | } | 597 | } |
592 | 598 | ||