|
|
@ -4,6 +4,7 @@
|
|
|
|
#include "layout.h"
|
|
|
|
#include "layout.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "log.h"
|
|
|
|
#include "list.h"
|
|
|
|
#include "list.h"
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "container.h"
|
|
|
|
#include "container.h"
|
|
|
|
#include "workspace.h"
|
|
|
|
#include "workspace.h"
|
|
|
|
#include "focus.h"
|
|
|
|
#include "focus.h"
|
|
|
@ -123,11 +124,11 @@ void arrange_windows(swayc_t *container, int width, int height) {
|
|
|
|
// y -= container->y;
|
|
|
|
// y -= container->y;
|
|
|
|
for (i = 0; i < container->children->length; ++i) {
|
|
|
|
for (i = 0; i < container->children->length; ++i) {
|
|
|
|
swayc_t *child = container->children->items[i];
|
|
|
|
swayc_t *child = container->children->items[i];
|
|
|
|
sway_log(L_DEBUG, "Arranging workspace #%d", i);
|
|
|
|
child->x = x + container->gaps;
|
|
|
|
child->x = x;
|
|
|
|
child->y = y + container->gaps;
|
|
|
|
child->y = y;
|
|
|
|
child->width = width - container->gaps * 2;
|
|
|
|
child->width = width;
|
|
|
|
child->height = height - container->gaps * 2;
|
|
|
|
child->height = height;
|
|
|
|
sway_log(L_DEBUG, "Arranging workspace #%d at %d, %d", i, child->x, child->y);
|
|
|
|
arrange_windows(child, -1, -1);
|
|
|
|
arrange_windows(child, -1, -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -135,12 +136,12 @@ void arrange_windows(swayc_t *container, int width, int height) {
|
|
|
|
{
|
|
|
|
{
|
|
|
|
struct wlc_geometry geometry = {
|
|
|
|
struct wlc_geometry geometry = {
|
|
|
|
.origin = {
|
|
|
|
.origin = {
|
|
|
|
.x = container->x + container->gaps / 2,
|
|
|
|
.x = container->x + container->gaps,
|
|
|
|
.y = container->y + container->gaps / 2
|
|
|
|
.y = container->y + container->gaps
|
|
|
|
},
|
|
|
|
},
|
|
|
|
.size = {
|
|
|
|
.size = {
|
|
|
|
.w = width - container->gaps,
|
|
|
|
.w = width - container->gaps * 2,
|
|
|
|
.h = height - container->gaps
|
|
|
|
.h = height - container->gaps * 2
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) {
|
|
|
|
if (wlc_view_get_state(container->handle) & WLC_BIT_FULLSCREEN) {
|
|
|
@ -148,10 +149,10 @@ void arrange_windows(swayc_t *container, int width, int height) {
|
|
|
|
while (parent->type != C_OUTPUT) {
|
|
|
|
while (parent->type != C_OUTPUT) {
|
|
|
|
parent = parent->parent;
|
|
|
|
parent = parent->parent;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
geometry.origin.x = container->gaps / 2;
|
|
|
|
geometry.origin.x = 0;
|
|
|
|
geometry.origin.y = container->gaps / 2;
|
|
|
|
geometry.origin.y = 0;
|
|
|
|
geometry.size.w = parent->width - container->gaps;
|
|
|
|
geometry.size.w = parent->width;
|
|
|
|
geometry.size.h = parent->height - container->gaps;
|
|
|
|
geometry.size.h = parent->height;
|
|
|
|
wlc_view_set_geometry(container->handle, 0, &geometry);
|
|
|
|
wlc_view_set_geometry(container->handle, 0, &geometry);
|
|
|
|
wlc_view_bring_to_front(container->handle);
|
|
|
|
wlc_view_bring_to_front(container->handle);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|