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

Multi Monitor Support #5

Open
HarveyHunt opened this issue Sep 1, 2014 · 23 comments
Open

Multi Monitor Support #5

HarveyHunt opened this issue Sep 1, 2014 · 23 comments

Comments

@HarveyHunt
Copy link
Owner

This has been requested by a lot of people and is something that should be added in the future.

@Anachron
Copy link

Hows it going here?

@HarveyHunt
Copy link
Owner Author

I haven't made any progress really - been super busy and wasn't sure if this was still a requested feature.

I've bought a second monitor, so I can start to work on this soon.

I still need to work out how to represent workspaces - does each monitor have its own set of workspaces or is a monitor classed as a single workspace?

@Anachron
Copy link

I would LOVE to be able to do any!

So that I could say: Monitor 1+2, please display workspace 1, and monitor 3, please display workspace 2.

The usecase is (for me) pretty obvious:
When using workspaces like developing or important stuff, I would like to see it both on my laptop (no1) and on the secondary screen (no2). The other screen number (no3) would then display the result or presentation or anything that is not good on a small laptop display.

@madmod
Copy link

madmod commented Aug 31, 2015

Having relative sizing for workspaces on different sized monitors would be killer. Also restoring groups workspaces to specific monitors when they are plugged in would make me install arch on my MacBook!

@Anachron
Copy link

Anachron commented Oct 9, 2015

May I give another ping here? I'm looking forward to this feature.

@HarveyHunt
Copy link
Owner Author

I've researched this a bit more, but not put together any code yet - work has been busy.

I think it is best to not support Xinerama and instead only support Xrandr - Xinerama seems to be legacy stuff now.

@HarveyHunt
Copy link
Owner Author

I've finally got some time and have started working on this. My idea is to convert howm to use a monitor structure which shall store workspaces etc. The first step is getting howm to use a single monitor. The following needs to be done to get that working:

  • Implement a monitor structure.
  • Identify a monitor.
  • Focus a monitor.
  • Support moving a window to a monitor.
  • Update functions to use the monitor structure, rather than global state.
  • Store workspaces in a linked list.
    • Dynamically add and remove workspaces.
    • Add IPC function for adding a new workspace.
    • Modify workspace functions to use a linked list, rather than array indexing.
    • Correctly update EWMH information when a monitor is added / removed.

Then we can move on to getting multi monitor support working:

  • Add a new motion for monitors.
  • Identify monitors using xrandr.
  • Support the removal of monitors.
  • Support swapping monitors.
  • Support urgent hints on multiple monitors.
  • TESTING.

I'm sure there are some other things I am missing...

@HarveyHunt
Copy link
Owner Author

I've nearly got the basis of this working for a single monitor - the next release of howm will make use of the monitor structure. Unfortunately my laptop's bootloader has exploded and the code is on my laptop, so I need to recover it from there...

Once that is done, I'll dig into the xrandr stuff so that multiple monitors will work.

@Anachron
Copy link

@HarveyHunt thanks for the update!
It's always good to push new branches to some online repo, such as github. 👍

@HarveyHunt
Copy link
Owner Author

Just done it, the multi monitor work is going to be in the xrandr branch. I'm going to be rebasing / messing with history a lot on the branch, so don't try to use it for anything. 👍

@HarveyHunt
Copy link
Owner Author

I've made some more progress - howm can now have monitors and workspaces added dynamically. However, it can only detect a single monitor right now. The big refactoring work is completed though. I am imagining there being a lot of bugs in the current code - I'll test it out over the next few days.

Multi monitor support isn't far off now, just a matter of time. Work is super busy right now, so progress will be slow for a little while. :-)

@Anachron
Copy link

Anachron commented Nov 4, 2015

Thanks for the hint! I'm trying to understand the tools you're using in your howm example setup. I'm fairly new to arch and full control setups. :)

@Anachron
Copy link

Anachron commented Nov 4, 2015

By the way I can give you some code how to detect monitor changes with xrandr. Basically it will keep executing xrandr and then grep which ports are connected and compare them to the latest iterarion.

@HarveyHunt
Copy link
Owner Author

@Anachron that sounds useful - thanks.

@Anachron
Copy link

Looks like you are making good progress!
Can I ask you how far you've got and what is still ahead? I cannot really see it from the commits you are doing. :)

@HarveyHunt
Copy link
Owner Author

Progress has been good - adding and removing workspaces dynamically works and howm can now recognise XRandR outputs and treat them as monitors.

I need to do some more testing and handle focusing a monitor, but there isn't much left to do now. :-)

@HarveyHunt
Copy link
Owner Author

Things are coming along well now - I hope to test out multi monitor stuff tomorrow. Then I have a horrible rebase to do. :-(

@Anachron
Copy link

Well, there is no rebase I experienced which was not horrible. 👍
So good luck and keep up the good work!

@Anachron
Copy link

Hey Harvey, is there still any Todo left here?

@HarveyHunt
Copy link
Owner Author

The only TODO in the code is here.

It would also be nice to add dynamic plug/unplug support for monitors, moving windows between monitors and merging monitor contents.

@Anachron
Copy link

I would agree with all except last. What would merging do exactly?

@HarveyHunt
Copy link
Owner Author

The idea is that you can merge all of the windows from one monitor onto another. The user could do it explicitly, or howm could do it automatically as part of removing a monitor.

@Anachron
Copy link

Yes I got that, but if you have three monitors and remove one, on which way will it decide which desktop gets which clients? Since I have multiple monitors and can plugin/unplug at any time, this feature is quite important for me.

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

No branches or pull requests

3 participants