On Thursday 16 April 2009 16:24:54 Will Stephenson wrote:
> On Wednesday 15 April 2009 19:55:56 Greg Freemyer wrote:
> > When I connect up to the projector, X / KDE is not auto-detecting the
> > extra screen until I logout.
> >
> > Thus I would like to have a way to force X and/or KDE to detect the
> > projector and reconfig itself.
> >
> > Is this possible:
> >
> > from KDM login screen?
> >
> > after being logged into KDE 4.2.2?
> >
> > As I said, currently it only autodetects on logout from KDE. So if
> > I'm sitting at the KDM, I have to connect up the projector, login,
> > then logout, and login a second time. At which point I have a dual
> > screen capability.
>
> Yes, it's definitely possible (even with 4.1.3 on 11.1). A KDED module
> (kephal) watches for XRANDR events indicating that a monitor or projector
> was hotplugged and pops up a dialog shortly after the cable was connected
> asking if your desktop should be extended onto the new screen.
>
> The catch is that driver support for XRANDR events is patchy at best.
> nvidia binary is probably the worst since it only supports xrandr 1.1. I
> know it works nicely on intel 945GM on 11.1 because I presented in exactly
> this way with 11.1 at FOSDEM in February (satisfyingly, a GNOME colleague
> uttered a surprised "KDE can do /that/?!).
>
> Does 'xrandr' show the projector after hotplug (but before logout)?
>
> Does 'qdbus org.kde.kded /modules/kephal/Screens
> org.kde.Kephal.Screens.numScreens' reflect the number of connected
> displays?


After a bit of digging in the kephal code I see that there is a polling mode where it periodically (10s) polls the X server for new screens. I tried it out briefly with nvidia but neither xrandr nor kephal noticed the new screen, so blame the broken closed source driver, but you can try it out in 4.2.2 with:


qdbus org.kde.kded /Configurations setPolling true


In trunk the dbus object path has been corrected to /modules/kephal/Configurations


Allegedly polling is off by default as on some hardware the driver handles the poll so slowly that it makes X stutter every 10s. If it works for you, I suggest rolling up a setPolling call with a sleep and a setPolling false once the new monitor is detected, reference that script in a .desktop file and you can activate a few seconds of polling manually.


HTH


Will