Monitor and projector hotplug (aka RandR 1.2 support for GTK+)



Hi

I have been doing some work on adding RandR 1.2 support to GTK+. There
is an initial patch here:

        http://www.gnome.org/~ssp/randr/gtk.patch

The interesting part is perhaps the API:

A new signal on GdkScreen:

    void (*monitors_changed) (GdkScreen *screen);

that is emitted whenever the number of attached monitors change. I
hope that we can get the X server to actually generate this event on
its own whenever a monitor is hotplugged, but if not, then this signal
would be emitted whenever the user changed the control panel
appropriately.


These new calls:

    gint   gdk_screen_get_monitor_width_mm  (GdkScreen *screen,
                                             gint monitor_num);
    gint          gdk_screen_get_monitor_height_mm (GdkScreen *screen,
                                                    gint monitor_num);
    gchar *       gdk_screen_get_monitor_plug_name (GdkScreen *screen,
                                                    gint monitor_num);
    gchar *       gdk_screen_get_monitor_display_name (GdkScreen
                                             *screen,
                                                      gint
                                             monitor_num);

The "get_monitor_display_name()" would return a UTF-8 string that
could be shown to the user. Ie., it might be something like "Sony 21"
or "Epson Projector".

Comments appreciated.

I am especially interested in feedback from people writing
applications such as presentation program, that would make use of
such external screens as more than just extra screen space.


Soren


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]