-
Notifications
You must be signed in to change notification settings - Fork 768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Left and right dockarea #3123
Conversation
Oh, i broke commit history. How i can fix it? |
I guess you need to rebase your branch against the next branch. |
Thanks for taking a shot at this! I really think this would be a cool feature to have in i3. As @okraits mentioned you'll need to rebase. Once that is sorted out, two very high-level comments (I haven't reviewed the PR in detail yet):
Let us know via comment when you rebased the PR! |
b5aa7f7
to
42b0fc9
Compare
@Airblader I've fixed this branch. There was ~170 commits difference... idk how I did this. I've just created new branch, and applied my latest commit, and renamed it. |
Please don't do this in this PR. It's a completely separate topic and one that has to be decided separately as well. I currently don't think we want a vertical mode for i3bar because we have no good answer to what the statusline should look like. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a quick initial pass over the changes, but I haven't yet looked at it too closely. I think there's some stuff to work on still and would also appreciate the textual description I mentioned previously.
src/con.c
Outdated
@@ -535,7 +536,10 @@ bool con_is_docked(Con *con) { | |||
if (con->parent == NULL) | |||
return false; | |||
|
|||
if (con->parent->type == CT_DOCKAREA) | |||
if (con->parent->type == CT_HDOCKAREA ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in general, please run the clang formatter to fix the code formatting.
src/con.c
Outdated
if (con->parent->type == CT_HDOCKAREA ) | ||
return true; | ||
|
||
if (con->parent->type == CT_VDOCKAREA ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not combine these two conditions?
src/con.c
Outdated
@@ -2124,7 +2132,7 @@ void con_update_parents_urgency(Con *con) { | |||
return; | |||
|
|||
bool new_urgency_value = con->urgent; | |||
while (parent && parent->type != CT_WORKSPACE && parent->type != CT_DOCKAREA) { | |||
while (parent && parent->type != CT_WORKSPACE && parent->type != CT_HDOCKAREA && parent->type != CT_VDOCKAREA ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I think it'd be good to use something like con_is_docked
for all of these conditions since they get pretty lengthy.
src/handlers.c
Outdated
DLOG("geom->y = %d >= rect.height / 2 = %d, it is a bottom dock client\n", | ||
con->geometry.y, (search_at->rect.height / 2)); | ||
con->window->dock = W_DOCK_BOTTOM; | ||
if(abs(con->window->reserved.bottom - con->window->reserved.top) > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This entire block has become quite unreadable. I think we'd really gain a lot of clarity from refactoring this a little bit (if you want).
src/ipc.c
Outdated
case CT_DOCKAREA: | ||
ystr("dockarea"); | ||
case CT_HDOCKAREA: | ||
ystr("hdockarea"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this to dumping "dockarea"
to maintain compatibility on the IPC.
src/load_layout.c
Outdated
@@ -340,8 +340,10 @@ static int json_string(void *ctx, const unsigned char *val, size_t len) { | |||
json_node->type = CT_FLOATING_CON; | |||
else if (strcasecmp(buf, "workspace") == 0) | |||
json_node->type = CT_WORKSPACE; | |||
else if (strcasecmp(buf, "dockarea") == 0) | |||
json_node->type = CT_DOCKAREA; | |||
else if (strcasecmp(buf, "hdockarea") == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this would have to be adjusted back as well
src/randr.c
Outdated
@@ -316,6 +316,7 @@ void output_init_con(Output *output) { | |||
} | |||
con->rect = output->rect; | |||
output->con = con; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this extra newline
src/randr.c
Outdated
DLOG("attaching\n"); | ||
con_attach(topdock, con, false); | ||
|
||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These blocks absolutely do need to be refactored; using scoped blocks with this much duplication is not good. :-)
src/render.c
Outdated
@@ -338,41 +343,100 @@ static void render_output(Con *con) { | |||
|
|||
/* First pass: determine the height of all CT_DOCKAREAs (the sum of their | |||
* children) and figure out how many pixels we have left for the rest */ | |||
Con *left_dock = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use NULL over 0
src/render.c
Outdated
} | ||
|
||
|
||
if(bottom_dock) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, these blocks are a lot of repetition that should be refactored.
@Airblader do you have idea how to rewrite this part: https://github.com/vesim987/i3/blob/vertical-dockarea/src/handlers.c#L1376-L1415 |
Hi there, any progress on this? I tried this PR and found some problems:
Here is some changes to fixes problems above: I'm new to i3, please take a look and point me out if I didn't do it right. :) |
@vesim987 Are you continuing your work on this? |
This PR add support for vertical dock client.
TODO:
handle_strut_partial_change
seem's to doesn't workrender_output
fixes: #1129