Bug 291819 - Please automatically reconfigure to remaining screen when another screen detached
Summary: Please automatically reconfigure to remaining screen when another screen deta...
Status: RESOLVED FIXED
Alias: None
Product: krandr
Classification: Unmaintained
Component: general (show other bugs)
Version: 4.10.0
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 00:19 UTC by Alexandre Bonneau
Modified: 2014-05-16 07:01 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.13.0
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandre Bonneau 2012-01-18 00:19:01 UTC
Version:           4.7.4 (using KDE 4.7.4) 
OS:                Linux

When an external vga cable get disconnected from a laptop, kwin doesn't fall back to the default screen.

Reproducible: Always

Steps to Reproduce:
Power up your laptop
Connect an external screen to the laptop (vga, hdmi or displayport)
Use krandr to deactivate the laptop screen and activate the external display
Then
unplug the vga/hdmi/displayport

Actual Results:  
-> the laptop screen stays deactivated

Expected Results:  
The laptop screen should be automatically reactivated to its native resolution.

That little detail should give my grandma more incentive to use her computer with the tv !
Comment 1 Thomas Lübking 2012-01-18 01:14:34 UTC
Not the WMs job - also i'm not sure whether this should actually be dealt by krandr or not rather udev.

And i'm even more unsure whether esp. VGA adapter status changes can be detected by the system (except for polling?) at all (and whether "turned off screen" can be distinguished from "unplugged cable")
Comment 2 Alexandre Bonneau 2012-01-18 15:03:48 UTC
I'm not sure where to report the 'wish' then.

That and Windows 7 seems to know how to reactivate the laptop sceen when the vga is unplugged.

Anyway, the main idea behind my bug report was to point out I can't really see the point in making a distinction between "turned off screen" and "unplugged cable", as in both case you end up with just a black screen, which is counter-intuitive imho.
Comment 3 Martin Flöser 2012-01-18 16:40:48 UTC
> Anyway, the main idea behind my bug report was to point out I can't really
> see the point in making a distinction between "turned off screen" and
> "unplugged cable", as in both case you end up with just a black screen,
> which is counter-intuitive imho.
Actually there is. I very often unplug but don't want to change the screen. 
Consider a presentation and someone else wants to test the connection to the 
projector before your presentation. This is a valid usecase for unplug, but 
don't change screens.

But anyway: it's probably nothing we can do in KDE layer. This needs to be 
supported by udev first (in case it isn't yet).
Comment 4 Thomas Lübking 2012-01-18 16:56:50 UTC
(In reply to comment #2)
> I'm not sure where to report the 'wish' then.

krandr, already re-assigned. Whether it should be handled upstream is matter to the krandr maintainers. I've no idea (but likely would try)

> That and Windows 7 seems to know how to reactivate the laptop sceen when the
> vga is unplugged.
"VGA" means "D-SUB" (that fat veeeery old plug) i assume. No idea whether there was a standard for device recognition, but you should be able to query "status" in "/sys/class/drm/<some-device>" if this is supported by your HW.
Personally i'd set up a udev rule and make it "do stuff" on changes there.
 
> Anyway, the main idea behind my bug report was to point out I can't really see
> the point in making a distinction between "turned off screen" and "unplugged
> cable"
"temporary" (to save energy) and "permanent" - could become relevant in case the screen you just turned off kept private data for your presentation ("DO NOT FORGET: THEY ARE ALL MORONS") while the other one contained the presentation.
Merging output to the remaining screen could have... "unwanted" results ;-)

So i guess there would have to be some sort of configuration UI on what to do on what occurrence. *shrug*
Comment 5 Alexandre Bonneau 2012-01-19 09:25:22 UTC
You are both right, it's always a bad idea to limit functionalities, therefore I guess there should be an option to activate/deactivate this behavior somewhere.

As I see it, that could also allow users whose Fn keys aren't supported a simple way to bind this useful replacement.
Comment 6 Alexandre Bonneau 2012-01-19 09:30:35 UTC
I don't know udev enough to create rules and not break my system, but as you pointed out, I can see all my display ports in /sys/class/drm/, and specially :
`cat /sys/class/drm/card0-VGA-1/status` returns "disconnected" so I guess perhaps it's 'just' a matter of writing a rules for that ?

Then, what would be the command line to select the (Auto) mode for the laptop screen (for binding that to a shortcut) ?
Comment 7 Thomas Lübking 2012-01-19 16:46:56 UTC
gg:"/sys/class/drm" card0 status

first result is on stackoverflow:
http://stackoverflow.com/questions/5469828/how-to-create-a-callback-for-monitor-plugged-on-an-intel-graphics

udev rules meanwhile likely reside in /lib/udev and the HOTPLUG value will likely be relevant but otherwise it should still work fine.

> Then, what would be the command line to select the (Auto) mode for the laptop
screen (for binding that to a shortcut) ?

Sorry but i've not the least idea what this is supposed to ask for, but the CLI tool you want to invoke is xrandr, notably it's "--output" and "--screen" switches. Since you're about to run this from a script (invoked by udev) you also want to use "-display :0"
Comment 8 Alexandre Bonneau 2013-02-18 15:06:47 UTC
With 4.10, when you plug an external display, KDE asks you if you want to switch "automatically".
That's new and welcome.

I guess using the same hooks (or any other way this has been implemented), somebody could force the default display to light up if an external display is disconnected ?
That would be the default behavior since most users want this, but there could be an option somewhere to prevent that if a few wants to keep the video output configuration that way.

CLI is not for basic users unfortunately..
Comment 9 Thomas Lübking 2013-02-18 15:22:19 UTC
Moving to some unrelated component will not get this done any faster.
I think the kscreen kded can do that (different from the kephal one) - no idea about configurability.
Comment 10 Alexandre Bonneau 2014-05-15 23:16:04 UTC
You can close this wish ; Kscreen in 4.13 do _exactly_ what I asked for :)

Thank you !
Comment 11 Myriam Schweingruber 2014-05-16 07:01:43 UTC
Closing based on comment #10