Add floating window movement with keys. Add focus moving on floating
This commit is contained in:
+7
-4
@@ -83,13 +83,13 @@ ipc_send_output_state(IpcOutput *ipc_out)
|
||||
{
|
||||
uint32_t i;
|
||||
for (i = 0; i < LENGTH(layouts); i++)
|
||||
if (&layouts[i] == m->lt[m->sellt])
|
||||
if (&layouts[i] == curlayout(m))
|
||||
break;
|
||||
zpeachwm_ipc_output_v2_send_layout(res, i);
|
||||
}
|
||||
|
||||
/* layout symbol */
|
||||
zpeachwm_ipc_output_v2_send_layout_symbol(res, m->ltsymbol);
|
||||
zpeachwm_ipc_output_v2_send_layout_symbol(res, m->ltsymbol[current_tag_idx(m)]);
|
||||
|
||||
/* title/appid/fullscreen/floating */
|
||||
if (c) {
|
||||
@@ -184,8 +184,11 @@ ipc_output_handle_set_layout(struct wl_client *client,
|
||||
Monitor *m = out->mon;
|
||||
if (!m || idx >= LENGTH(layouts)) return;
|
||||
|
||||
m->lt[m->sellt] = &layouts[idx];
|
||||
strncpy(m->ltsymbol, layouts[idx].symbol, LENGTH(m->ltsymbol));
|
||||
int ti = current_tag_idx(m);
|
||||
if (m->lt[ti][m->sellt[ti]] != &layouts[idx])
|
||||
m->sellt[ti] ^= 1;
|
||||
m->lt[ti][m->sellt[ti]] = &layouts[idx];
|
||||
strncpy(m->ltsymbol[ti], layouts[idx].symbol, LENGTH(m->ltsymbol[ti]));
|
||||
arrange(m);
|
||||
printstatus();
|
||||
}
|
||||
|
||||
@@ -394,7 +394,7 @@ ipc_build_workspace(struct json_writer *w, Monitor *m, uint32_t tag_bit,
|
||||
json_object_end(w);
|
||||
|
||||
json_key_string(w, "output", m->wlr_output->name);
|
||||
json_key_string(w, "layout", m->ltsymbol);
|
||||
json_key_string(w, "layout", m->ltsymbol[tag_idx]);
|
||||
json_key_string(w, "representation", "");
|
||||
json_key_string(w, "type", "workspace");
|
||||
|
||||
@@ -495,7 +495,7 @@ static void
|
||||
ipc_build_client(struct json_writer *w, Client *c)
|
||||
{
|
||||
int floating = c->isfloating ||
|
||||
!c->mon->lt[c->mon->sellt]->arrange;
|
||||
!curlayout(c->mon)->arrange;
|
||||
|
||||
json_object_start(w);
|
||||
json_key_int(w, "id", (int64_t)(uintptr_t)c);
|
||||
@@ -685,7 +685,7 @@ ipc_handle_get_tree(struct ipc_client *client)
|
||||
json_key_string(&w, "type", "workspace");
|
||||
json_key_string(&w, "name",
|
||||
ipc_tag_name(i));
|
||||
json_key_string(&w, "layout", m->ltsymbol);
|
||||
json_key_string(&w, "layout", m->ltsymbol[i]);
|
||||
|
||||
json_key(&w, "rect");
|
||||
json_object_start(&w);
|
||||
|
||||
Reference in New Issue
Block a user