mirror of
https://github.com/tmux/tmux.git
synced 2026-06-23 08:27:08 +00:00
Merge branch 'master' into screen_redraw
This commit is contained in:
26
layout.c
26
layout.c
@@ -1359,14 +1359,21 @@ layout_split_pane(struct window_pane *wp, enum layout_type type, int size,
|
|||||||
* layout_assign_pane before much else happens!
|
* layout_assign_pane before much else happens!
|
||||||
*/
|
*/
|
||||||
struct layout_cell *
|
struct layout_cell *
|
||||||
layout_floating_pane(struct window *w, u_int sx, u_int sy, int ox, int oy)
|
layout_floating_pane(struct window *w, struct window_pane *wp, u_int sx,
|
||||||
|
u_int sy, int ox, int oy)
|
||||||
{
|
{
|
||||||
struct layout_cell *lc = w->layout_root, *lcnew, *lcparent;
|
struct layout_cell *lc, *lcnew, *lcparent;
|
||||||
|
|
||||||
if (lc->type == LAYOUT_WINDOWPANE) {
|
if (wp == NULL)
|
||||||
|
lc = w->layout_root;
|
||||||
|
else
|
||||||
|
lc = wp->layout_cell;
|
||||||
|
lcparent = lc->parent;
|
||||||
|
|
||||||
|
if (lcparent == NULL) {
|
||||||
/*
|
/*
|
||||||
* Adding a pane to a root that doesn't have a container. Must
|
* Adding a pane to a root that isn't node. Must create and
|
||||||
* create and insert a new root.
|
* insert a new root.
|
||||||
*/
|
*/
|
||||||
lcparent = layout_create_cell(NULL);
|
lcparent = layout_create_cell(NULL);
|
||||||
layout_make_node(lcparent, LAYOUT_TOPBOTTOM);
|
layout_make_node(lcparent, LAYOUT_TOPBOTTOM);
|
||||||
@@ -1376,11 +1383,10 @@ layout_floating_pane(struct window *w, u_int sx, u_int sy, int ox, int oy)
|
|||||||
/* Insert the old cell. */
|
/* Insert the old cell. */
|
||||||
lc->parent = lcparent;
|
lc->parent = lcparent;
|
||||||
TAILQ_INSERT_HEAD(&lcparent->cells, lc, entry);
|
TAILQ_INSERT_HEAD(&lcparent->cells, lc, entry);
|
||||||
} else
|
}
|
||||||
lcparent = w->layout_root;
|
|
||||||
|
|
||||||
lcnew = layout_create_cell(lcparent);
|
lcnew = layout_create_cell(lcparent);
|
||||||
TAILQ_INSERT_TAIL(&lcparent->cells, lcnew, entry);
|
TAILQ_INSERT_AFTER(&lcparent->cells, lc, lcnew, entry);
|
||||||
lcnew->flags |= LAYOUT_CELL_FLOATING;
|
lcnew->flags |= LAYOUT_CELL_FLOATING;
|
||||||
layout_set_size(lcnew, sx, sy, ox, oy);
|
layout_set_size(lcnew, sx, sy, ox, oy);
|
||||||
|
|
||||||
@@ -1555,7 +1561,7 @@ layout_get_tiled_cell(struct cmdq_item *item, struct args *args,
|
|||||||
/* Get a new floating cell. */
|
/* Get a new floating cell. */
|
||||||
struct layout_cell *
|
struct layout_cell *
|
||||||
layout_get_floating_cell(struct cmdq_item *item, struct args *args,
|
layout_get_floating_cell(struct cmdq_item *item, struct args *args,
|
||||||
struct window *w, __unused struct window_pane *wp, char **cause)
|
struct window *w, struct window_pane *wp, char **cause)
|
||||||
{
|
{
|
||||||
struct layout_cell *lcnew;
|
struct layout_cell *lcnew;
|
||||||
int sx = w->sx / 2, sy = w->sy / 4;
|
int sx = w->sx / 2, sy = w->sy / 4;
|
||||||
@@ -1629,7 +1635,7 @@ layout_get_floating_cell(struct cmdq_item *item, struct args *args,
|
|||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
lcnew = layout_floating_pane(w, sx, sy, ox, oy);
|
lcnew = layout_floating_pane(w, wp, sx, sy, ox, oy);
|
||||||
return (lcnew);
|
return (lcnew);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
spawn.c
2
spawn.c
@@ -660,7 +660,7 @@ spawn_editor(struct client *c, const char *buf, size_t len,
|
|||||||
px = w->sx / 2 - sx / 2;
|
px = w->sx / 2 - sx / 2;
|
||||||
py = w->sy / 2 - sy / 2;
|
py = w->sy / 2 - sy / 2;
|
||||||
window_push_zoom(w, 1, 0);
|
window_push_zoom(w, 1, 0);
|
||||||
lc = layout_floating_pane(w, sx, sy, px, py);
|
lc = layout_floating_pane(w, NULL, sx, sy, px, py);
|
||||||
if (lc == NULL) {
|
if (lc == NULL) {
|
||||||
spawn_editor_free(es);
|
spawn_editor_free(es);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|||||||
4
tmux.h
4
tmux.h
@@ -3576,8 +3576,8 @@ void layout_assign_pane(struct layout_cell *, struct window_pane *,
|
|||||||
int);
|
int);
|
||||||
struct layout_cell *layout_split_pane(struct window_pane *, enum layout_type,
|
struct layout_cell *layout_split_pane(struct window_pane *, enum layout_type,
|
||||||
int, int);
|
int, int);
|
||||||
struct layout_cell *layout_floating_pane(struct window *, u_int, u_int, int,
|
struct layout_cell *layout_floating_pane(struct window *, struct window_pane *,
|
||||||
int);
|
u_int, u_int, int, int);
|
||||||
void layout_close_pane(struct window_pane *);
|
void layout_close_pane(struct window_pane *);
|
||||||
int layout_spread_cell(struct window *, struct layout_cell *);
|
int layout_spread_cell(struct window *, struct layout_cell *);
|
||||||
void layout_spread_out(struct window_pane *);
|
void layout_spread_out(struct window_pane *);
|
||||||
|
|||||||
Reference in New Issue
Block a user