-
Notifications
You must be signed in to change notification settings - Fork 20
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
bug: unplugging a monitor #90
Comments
This one can definitely use a bit of planning, I think.
I think the program should find the new primary and move (combine?) all the workspaces there and maybe leave any additional workspaces on other monitors unaffected. I think an additional wrinkle to think about on this one is what happens when a display gets added and it is the new primary display. That's how I have my laptop setup, for instance. Any monitor plugged into it turns into the primary display. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I tried to implement a fix for this and already know when a monitor gets disconnected/connected. The problem is that it seems like the |
Hi, I have been working on fixing this in this branch https://github.com/fredizzimo/nog/commits/dpi_scaling It's almost ready, but I still have to fix a few issues and I also need to go through everything again and perhaps clean up some code, since this is the first time I'm writing rust and I have learned quite a bit during the process. The logic I have chosen is quite simple, if the old monitor still exist, move the workspace there, otherwise move it to the default monitor, but this can of course be extended in the future. I currently don't handle the case when no monitor is connected, for that we would need either a virtual monitor, or exit the workmode. For me the Note that I originally did not plan to fix this, my original plan was to just fix #92, which I still had. But it turned out that in order to do that I had to properly enable per monitor DPI scaling. And that lead adding support for changing of dpi scaling and resolutions. Which lead me to handle changes to the task bar size and positions. And by that time multi-monitor handling was basically there, so I had to add that too. It also automaticaly fixes the frame calculation for #207, without the need for any special cases. Another thing that I noticed that it fixes, is the title bar texts of some programs, which previously permanently got really small when the window was moved to another monitor. |
Could you please open a draft PR?
😆
So special rules for Thank you for your hard work 🙏 |
Description
@ramirezmike
Detecting when a device gets removed is possible via the WM_DEVICECHANGE event. I am thinking about just listening to this event and then comparing the list of displays returned by the EnumDisplayMonitors and the ones currently saved.
Things to consider:
Ideas on how to solve this
What happens when the primary display gets removed
Add the workspaces to the new primary display.
What happens when a display gets removed
Move all of the workspaces on the removed display to the primary display.
What happens when a display gets added
This shouldn't really affect the existing displays. It will just be added to the current list.
What happens when a display gets added and it is the new primary display
All of the current displays should stay the same, but the current primary display and the new display swap places.
The text was updated successfully, but these errors were encountered: