2 * Screens and displays::
9 @node Screens and displays
10 @section Screens and displays
17 Multihead support is based around two main object types:
23 @ref{display} objects are the GDK representation of the X Display which
24 can be described as a workstation consisting of a keyboard a pointing
25 device (such as a mouse) and one or more screens. It is used to open and
26 keep track of various GdkScreen objects currently instanciated by the
27 application. It is also used to grab and release the keyboard and the
30 @ref{screen} objects are the GDK representation of a physical screen. It
31 is used throughout GDK and GTK+ to specify which screen the top level
32 windows are to be displayed on. It is also used to query the screen
33 specification and default settings such as the default colormap
34 (@code{screen-default-colormap}), the screen width
35 (@code{screen-width}), etc.
37 The following code samples demonstrate common usage of the objects
40 Testing the number of screen on the current display:
44 (defvar *display* (default-display))
46 (display-name *display*) @result{} ":0.0"
48 (display-n-screens *display*) @result{} 1
51 Opening a second display:
54 /* screen2_name needs to be initialized before calling
55 /* gdk_display_new() */
56 second_display = gdk_display_new (&argc, &argv, second_screen_name);
58 second_screen = gdk_display_get_default_screen (second_display);
61 g_print ("Can't open display :\n\t%s\n\n",
65 /* now GdkScreen can be assigned to GtkWindows */
67 window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
68 gtk_window_set_screen (window, second_screen);
77 * display-default-screen::
83 @ref{display} controls the keyboard/mouse pointer grabs and a set of @ref{screen}s.
85 @ref{display} objects purpose are two fold:
88 @item To grab/ungrab keyboard focus and mouse pointer
89 @item To manage and provide information about the @ref{screen}(s) available for this @ref{display}
92 @ref{display} objects are the GDK representation of the X Display which
93 can be described as a workstation consisting of a keyboard a pointing
94 device (such as a mouse) and one or more screens. It is used to open and
95 keep track of various @ref{screen} objects currently instanciated by the
96 application. It is also used to grab and release the keyboard and the
100 @subsubsection display-name
101 @TypedAccessor {display-name, display, @code{string}}
102 The name of a @var{display} (e.g. @code{":0.0"})
104 @node display-n-screens
105 @subsubsection display-n-screens
106 @TypedAccessor {display-n-screens, display, @code{integer}}
107 The number of screen managed by the @var{display}.
109 @node display-default-screen
110 @subsubsection display-default-screens
111 @TypedAccessor {display-default-screen, display, @code{screen}}
112 The default screen of the @var{display}.
124 @include gdk.objects.texi
131 @include gdk.structs.texi
138 @include gdk.enums.texi
145 @include gdk.flags.texi