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}.
118 Superclass: @ref{g-object}
122 @item @anchor{slot.screen.active-window}active-window. Type: @ref{gdk-window}. Accessor: @anchor{fn.screen-active-window}@code{screen-active-window}. Read-only.
123 @item @anchor{slot.screen.composited-p}composited-p. Type: @code{boolean}. Accessor: @anchor{fn.screen-composited-p}@code{screen-composited-p}. Read-only.
124 @item @anchor{slot.screen.default-colormap}default-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-default-colormap}@code{screen-default-colormap}.
125 @item @anchor{slot.screen.display}display. Type: @ref{display}. Accessor: @anchor{fn.screen-display}@code{screen-display}. Read-only.
126 @item @anchor{slot.screen.display-name}display-name. Type: @code{string}. Accessor: @anchor{fn.screen-display-name}@code{screen-display-name}. Read-only.
127 @item @anchor{slot.screen.font-options}font-options. Type: gpointer. Accessor: @anchor{fn.screen-font-options}@code{screen-font-options}.
128 @item @anchor{slot.screen.height}height. Type: @code{integer}. Accessor: @anchor{fn.screen-height}@code{screen-height}. Read-only.
129 @item @anchor{slot.screen.height-mm}height-mm. Type: @code{integer}. Accessor: @anchor{fn.screen-height-mm}@code{screen-height-mm}. Read-only.
130 @item @anchor{slot.screen.n-monitors}n-monitors. Type: @code{integer}. Accessor: @anchor{fn.screen-n-monitors}@code{screen-n-monitors}. Read-only.
131 @item @anchor{slot.screen.number}number. Type: @code{integer}. Accessor: @anchor{fn.screen-number}@code{screen-number}. Read-only.
132 @item @anchor{slot.screen.resolution}resolution. Type: @code{double-float}. Accessor: @anchor{fn.screen-resolution}@code{screen-resolution}.
133 @item @anchor{slot.screen.rgb-colormap}rgb-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-rgb-colormap}@code{screen-rgb-colormap}. Read-only.
134 @item @anchor{slot.screen.rgb-visual}rgb-visual. Type: @ref{visual}. Accessor: @anchor{fn.screen-rgb-visual}@code{screen-rgb-visual}. Read-only.
135 @item @anchor{slot.screen.rgba-colormap}rgba-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-rgba-colormap}@code{screen-rgba-colormap}. Read-only.
136 @item @anchor{slot.screen.rgba-visual}rgba-visual. Type: @ref{visual}. Accessor: @anchor{fn.screen-rgba-visual}@code{screen-rgba-visual}. Read-only.
137 @item @anchor{slot.screen.root-window}root-window. Type: @ref{gdk-window}. Accessor: @anchor{fn.screen-root-window}@code{screen-root-window}. Read-only.
138 @item @anchor{slot.screen.system-colormap}system-colormap. Type: @ref{gdk-colormap}. Accessor: @anchor{fn.screen-system-colormap}@code{screen-system-colormap}. Read-only.
139 @item @anchor{slot.screen.system-visual}system-visual. Type: @ref{visual}. Accessor: @anchor{fn.screen-system-visual}@code{screen-system-visual}. Read-only.
140 @item @anchor{slot.screen.toplevel-windows}toplevel-windows. Type: list of @ref{gdk-window}. Accessor: @anchor{fn.screen-toplevel-windows}@code{screen-toplevel-windows}. Read-only.
141 @item @anchor{slot.screen.visuals}visuals. Type: list of @ref{visual}. Accessor: @anchor{fn.screen-visuals}@code{screen-visuals}. Read-only.
142 @item @anchor{slot.screen.width}width. Type: @code{integer}. Accessor: @anchor{fn.screen-width}@code{screen-width}. Read-only.
143 @item @anchor{slot.screen.width-mm}width-mm. Type: @code{integer}. Accessor: @anchor{fn.screen-width-mm}@code{screen-width-mm}. Read-only.
144 @item @anchor{slot.screen.window-stack}window-stack. Type: list of @ref{gdk-window}. Accessor: @anchor{fn.screen-window-stack}@code{screen-window-stack}. Read-only.
150 @item @anchor{signal.screen.composited-changed}\"composited-changed\". Signature: (instance @ref{screen}) @result{} void. Options: run-last.
151 @item @anchor{signal.screen.monitors-changed}\"monitors-changed\". Signature: (instance @ref{screen}) @result{} void. Options: run-last.
152 @item @anchor{signal.screen.size-changed}\"size-changed\". Signature: (instance @ref{screen}) @result{} void. Options: run-last.
159 @include gdk.objects.texi
166 @include gdk.structs.texi
173 @include gdk.enums.texi
180 @include gdk.flags.texi