← Back to team overview

compiz team mailing list archive

[Bug 729903] Re: Xrandr, Handle RRScreenChangeNotify in src/screen.cpp

 

On Tue, Mar 8, 2011 at 12:24 AM, Danny Baumann <dannybaumann@xxxxxx> wrote:
> Hi,
>
>> It will now update the screen info, then detect and update output
>> devices just like it does in CompScreen::init. This allows compiz to
>> do the right thing when an external monitor or projector is plugged in
>> and enabled using the 'gnome-display-properties' dialog or the
>> 'xrandr' command line tool.
>>
>> Call XRRSelectInput in CompScreen::init, asking for
>> RRScreenChangeNotify events. Without this those events are never given
>> to compiz. That means that the switch case for it in
>> plugins/composite/screen.cpp was never triggered, until now.
>
> What is the exact problem this patch is trying to solve? I never had a
> problem with dynamically adding/removing monitors, because compiz is
> listening for ConfigureNotify on the root window, and some esoterical
> corner cases aside, the root window will change its size anyway when
> hotplugging monitors.
>

I re-read some of the explanations here [1], it looks like this is
specifically to handle the case where you don't get a ConfigureNotify
event on the root window because only the layout of the two monitors
is actually changing (eg the bounding rect of both monitors is the
same).

Although I'm worried about some potential doubling-up of handing
screen resizes - since it is possible for us to get both an
RRScreenChangeNotify and ConfigureNotify on the root window for the
same resolution change. Perhaps it would be better to check for the
existence of XRandR in this case and *only* handle the
RRScreenChangeNotify event if XRandR is available. According to the
documentation anyways it looks like you'll get RRScreenChangeNotify
for pretty much anything regarding the size of the screen [2]

Cheers,

Sam

[1] https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/729903
[2] http://keithp.com/~keithp/talks/randr/protocol.txt

> I don't see a problem in adding that patch (it's obviously correct), I
> just want to understand the reasoning.
>
> Regards,
>
> Danny

-- 
You received this bug notification because you are a member of compiz
packagers, which is subscribed to compiz in ubuntu.
https://bugs.launchpad.net/bugs/729903

Title:
  Xrandr, Handle RRScreenChangeNotify in src/screen.cpp



References