Skip to content
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

Allow vertical switching. #231

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Allow vertical switching. #231

wants to merge 3 commits into from

Conversation

AsocPro
Copy link

@AsocPro AsocPro commented Feb 26, 2025

I want to enable vertical switching to be able to more easily support complex custom layouts. My current layout is three monitors side by side on one computer and then one on top in the middle that is on a separate computer I want to only be able to travel between computers at the top of the middle monitor and the bottom of the top monitor. This code allows for pretty trivial custom do_screen_switch functions. As an example the main part of mine is as follows:

if (state->active_output == OUTPUT_B) {
        if (output->screen_index == 1) {
            if (direction == RIGHT)
                switch_virtual_desktop(state, output, 2, direction);
        }
       else if (output->screen_index == 2) {
            if (direction == TOP)
                switch_to_another_pc(state, output, OUTPUT_A, direction);
            if (direction == RIGHT)
                switch_virtual_desktop(state, output, 3, direction);
            if (direction == LEFT)
                switch_virtual_desktop(state, output, 1, direction);
        }
       else if (output->screen_index == 3) {
            if (direction == LEFT)
                switch_virtual_desktop(state, output, 2, direction);
        }
            
    }
    else {
        if (direction == BOTTOM)
            switch_to_another_pc(state, output, OUTPUT_B, direction);

This is only really gonna work for my setup but I am also planning on writing a doc so that others with less standard layouts can also take advantage of this instead of pretending they are in a linear setup. I have not written this doc yet and if desired I can get it written and add it to this PR or I can do a future one to put it wherever would be best. I just wanted to get this PR up to make sure there wasn't anything that I'm doing here that is a good way to handle it and I don't need to change my approach before writing the doc.

I ran some basic tests with the stock do_screen_switch function and the changes seem to not have any side effects until the custom do_screen_switch logic is introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant