2 * Screens and displays::
5 @node Screens and displays
6 @section Screens and displays
13 Multihead support is based around two main object types:
19 @ref{display} objects are the GDK representation of the X Display which
20 can be described as a workstation consisting of a keyboard a pointing
21 device (such as a mouse) and one or more screens. It is used to open and
22 keep track of various GdkScreen objects currently instanciated by the
23 application. It is also used to grab and release the keyboard and the
26 @ref{screen} objects are the GDK representation of a physical screen. It
27 is used throughout GDK and GTK+ to specify which screen the top level
28 windows are to be displayed on. It is also used to query the screen
29 specification and default settings such as the default colormap
30 (@code{screen-default-colormap}), the screen width
31 (@code{screen-width}), etc.
33 The following code samples demonstrate common usage of the objects
36 Testing the number of screen on the current display:
40 (defvar *display* (default-display))
42 (display-name *display*) @result{} ":0.0"
44 (display-n-screens *display*) @result{} 1
47 Opening a second display:
50 /* screen2_name needs to be initialized before calling
51 /* gdk_display_new() */
52 second_display = gdk_display_new (&argc, &argv, second_screen_name);
54 second_screen = gdk_display_get_default_screen (second_display);
57 g_print ("Can't open display :\n\t%s\n\n",
61 /* now GdkScreen can be assigned to GtkWindows */
63 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
64 gtk_window_set_screen (window, second_screen);
73 * display-default-screen::
79 @ref{display} controls the keyboard/mouse pointer grabs and a set of @ref{screen}s.
81 @ref{display} objects purpose are two fold:
84 @item To grab/ungrab keyboard focus and mouse pointer
85 @item To manage and provide information about the @ref{screen}(s) available for this @ref{display}
88 @ref{display} objects are the GDK representation of the X Display which
89 can be described as a workstation consisting of a keyboard a pointing
90 device (such as a mouse) and one or more screens. It is used to open and
91 keep track of various @ref{screen} objects currently instanciated by the
92 application. It is also used to grab and release the keyboard and the
96 @subsubsection display-name
97 @TypedAccessor {display-name, display, @code{string}}
98 The name of a @var{display} (e.g. @code{":0.0"})
100 @node display-n-screens
101 @subsubsection display-n-screens
102 @TypedAccessor {display-n-screens, display, @code{integer}}
103 The number of screen managed by the @var{display}.
105 @node display-default-screen
106 @subsubsection display-default-screens
107 @TypedAccessor {display-default-screen, display, @code{screen}}
108 The default screen of the @var{display}.