4 * Copyright 2001 Sun Microsystems Inc.
6 * Erwann Chenede <erwann.chenede@sun.com>
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
24 #include "gdkscreenprivate.h"
25 #include "gdkrectangle.h"
26 #include "gdkwindow.h"
32 * @Short_description: Object representing a physical screen
35 * #GdkScreen objects are the GDK representation of the screen on
36 * which windows can be displayed and on which the pointer moves.
37 * X originally identified screens with physical screens, but
38 * nowadays it is more common to have a single #GdkScreen which
39 * combines several physical monitors (see gdk_screen_get_n_monitors()).
41 * GdkScreen is used throughout GDK and GTK+ to specify which screen
42 * the top level windows are to be displayed on. it is also used to
43 * query the screen specification and default settings such as
44 * the default visual (gdk_screen_get_system_visual()), the dimensions
45 * of the physical monitors (gdk_screen_get_monitor_geometry()), etc.
49 static void gdk_screen_finalize (GObject *object);
50 static void gdk_screen_set_property (GObject *object,
54 static void gdk_screen_get_property (GObject *object,
74 static guint signals[LAST_SIGNAL] = { 0 };
76 G_DEFINE_TYPE (GdkScreen, gdk_screen, G_TYPE_OBJECT)
79 gdk_screen_class_init (GdkScreenClass *klass)
81 GObjectClass *object_class = G_OBJECT_CLASS (klass);
83 object_class->finalize = gdk_screen_finalize;
84 object_class->set_property = gdk_screen_set_property;
85 object_class->get_property = gdk_screen_get_property;
87 g_object_class_install_property (object_class,
89 g_param_spec_pointer ("font-options",
91 P_("The default font options for the screen"),
92 G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
93 G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
95 g_object_class_install_property (object_class,
97 g_param_spec_double ("resolution",
98 P_("Font resolution"),
99 P_("The resolution for fonts on the screen"),
103 G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
104 G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
107 * GdkScreen::size-changed:
108 * @screen: the object on which the signal is emitted
110 * The ::size-changed signal is emitted when the pixel width or
111 * height of a screen changes.
115 signals[SIZE_CHANGED] =
116 g_signal_new (g_intern_static_string ("size-changed"),
117 G_OBJECT_CLASS_TYPE (klass),
119 G_STRUCT_OFFSET (GdkScreenClass, size_changed),
121 g_cclosure_marshal_VOID__VOID,
126 * GdkScreen::composited-changed:
127 * @screen: the object on which the signal is emitted
129 * The ::composited-changed signal is emitted when the composited
130 * status of the screen changes
134 signals[COMPOSITED_CHANGED] =
135 g_signal_new (g_intern_static_string ("composited-changed"),
136 G_OBJECT_CLASS_TYPE (klass),
138 G_STRUCT_OFFSET (GdkScreenClass, composited_changed),
140 g_cclosure_marshal_VOID__VOID,
145 * GdkScreen::monitors-changed:
146 * @screen: the object on which the signal is emitted
148 * The ::monitors-changed signal is emitted when the number, size
149 * or position of the monitors attached to the screen change.
151 * Only for X11 and OS X for now. A future implementation for Win32
152 * may be a possibility.
156 signals[MONITORS_CHANGED] =
157 g_signal_new (g_intern_static_string ("monitors-changed"),
158 G_OBJECT_CLASS_TYPE (klass),
160 G_STRUCT_OFFSET (GdkScreenClass, monitors_changed),
162 g_cclosure_marshal_VOID__VOID,
168 gdk_screen_init (GdkScreen *screen)
170 screen->resolution = -1.;
174 gdk_screen_finalize (GObject *object)
176 GdkScreen *screen = GDK_SCREEN (object);
178 if (screen->font_options)
179 cairo_font_options_destroy (screen->font_options);
181 G_OBJECT_CLASS (gdk_screen_parent_class)->finalize (object);
185 _gdk_screen_close (GdkScreen *screen)
187 g_return_if_fail (GDK_IS_SCREEN (screen));
191 screen->closed = TRUE;
192 g_object_run_dispose (G_OBJECT (screen));
196 /* Fallback used when the monitor "at" a point or window
200 get_nearest_monitor (GdkScreen *screen,
204 gint num_monitors, i;
205 gint nearest_dist = G_MAXINT;
206 gint nearest_monitor = 0;
208 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
210 num_monitors = gdk_screen_get_n_monitors (screen);
212 for (i = 0; i < num_monitors; i++)
214 GdkRectangle monitor;
215 gint dist_x, dist_y, dist;
217 gdk_screen_get_monitor_geometry (screen, i, &monitor);
220 dist_x = monitor.x - x;
221 else if (x >= monitor.x + monitor.width)
222 dist_x = x - (monitor.x + monitor.width) + 1;
227 dist_y = monitor.y - y;
228 else if (y >= monitor.y + monitor.height)
229 dist_y = y - (monitor.y + monitor.height) + 1;
233 dist = dist_x + dist_y;
234 if (dist < nearest_dist)
241 return nearest_monitor;
245 * gdk_screen_get_monitor_at_point:
246 * @screen: a #GdkScreen.
247 * @x: the x coordinate in the virtual screen.
248 * @y: the y coordinate in the virtual screen.
250 * Returns the monitor number in which the point (@x,@y) is located.
252 * Returns: the monitor number in which the point (@x,@y) lies, or
253 * a monitor close to (@x,@y) if the point is not in any monitor.
258 gdk_screen_get_monitor_at_point (GdkScreen *screen,
262 gint num_monitors, i;
264 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
266 num_monitors = gdk_screen_get_n_monitors (screen);
268 for (i=0;i<num_monitors;i++)
270 GdkRectangle monitor;
272 gdk_screen_get_monitor_geometry (screen, i, &monitor);
274 if (x >= monitor.x &&
275 x < monitor.x + monitor.width &&
277 y < (monitor.y + monitor.height))
281 return get_nearest_monitor (screen, x, y);
285 * gdk_screen_get_monitor_at_window:
286 * @screen: a #GdkScreen.
287 * @window: a #GdkWindow
289 * Returns the number of the monitor in which the largest area of the
290 * bounding rectangle of @window resides.
292 * Returns: the monitor number in which most of @window is located,
293 * or if @window does not intersect any monitors, a monitor,
299 gdk_screen_get_monitor_at_window (GdkScreen *screen,
302 gint num_monitors, i, area = 0, screen_num = -1;
303 GdkRectangle win_rect;
305 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
307 gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width,
309 gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
310 num_monitors = gdk_screen_get_n_monitors (screen);
312 for (i=0;i<num_monitors;i++)
314 GdkRectangle tmp_monitor, intersect;
316 gdk_screen_get_monitor_geometry (screen, i, &tmp_monitor);
317 gdk_rectangle_intersect (&win_rect, &tmp_monitor, &intersect);
319 if (intersect.width * intersect.height > area)
321 area = intersect.width * intersect.height;
328 return get_nearest_monitor (screen,
329 win_rect.x + win_rect.width / 2,
330 win_rect.y + win_rect.height / 2);
336 * Returns the width of the default screen in pixels.
338 * Return value: the width of the default screen in pixels.
341 gdk_screen_width (void)
343 return gdk_screen_get_width (gdk_screen_get_default ());
349 * Returns the height of the default screen in pixels.
351 * Return value: the height of the default screen in pixels.
354 gdk_screen_height (void)
356 return gdk_screen_get_height (gdk_screen_get_default ());
360 * gdk_screen_width_mm:
362 * Returns the width of the default screen in millimeters.
363 * Note that on many X servers this value will not be correct.
365 * Return value: the width of the default screen in millimeters,
366 * though it is not always correct.
369 gdk_screen_width_mm (void)
371 return gdk_screen_get_width_mm (gdk_screen_get_default ());
375 * gdk_screen_height_mm:
377 * Returns the height of the default screen in millimeters.
378 * Note that on many X servers this value will not be correct.
380 * Return value: the height of the default screen in millimeters,
381 * though it is not always correct.
384 gdk_screen_height_mm (void)
386 return gdk_screen_get_height_mm (gdk_screen_get_default ());
390 * gdk_screen_set_font_options:
391 * @screen: a #GdkScreen
392 * @options: (allow-none): a #cairo_font_options_t, or %NULL to unset any
393 * previously set default font options.
395 * Sets the default font options for the screen. These
396 * options will be set on any #PangoContext's newly created
397 * with gdk_pango_context_get_for_screen(). Changing the
398 * default set of font options does not affect contexts that
399 * have already been created.
404 gdk_screen_set_font_options (GdkScreen *screen,
405 const cairo_font_options_t *options)
407 g_return_if_fail (GDK_IS_SCREEN (screen));
409 if (screen->font_options != options)
411 if (screen->font_options)
412 cairo_font_options_destroy (screen->font_options);
415 screen->font_options = cairo_font_options_copy (options);
417 screen->font_options = NULL;
419 g_object_notify (G_OBJECT (screen), "font-options");
424 * gdk_screen_get_font_options:
425 * @screen: a #GdkScreen
427 * Gets any options previously set with gdk_screen_set_font_options().
429 * Return value: the current font options, or %NULL if no default
430 * font options have been set.
434 const cairo_font_options_t *
435 gdk_screen_get_font_options (GdkScreen *screen)
437 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
439 return screen->font_options;
443 * gdk_screen_set_resolution:
444 * @screen: a #GdkScreen
445 * @dpi: the resolution in "dots per inch". (Physical inches aren't actually
446 * involved; the terminology is conventional.)
448 * Sets the resolution for font handling on the screen. This is a
449 * scale factor between points specified in a #PangoFontDescription
450 * and cairo units. The default value is 96, meaning that a 10 point
451 * font will be 13 units high. (10 * 96. / 72. = 13.3).
456 gdk_screen_set_resolution (GdkScreen *screen,
459 g_return_if_fail (GDK_IS_SCREEN (screen));
464 if (screen->resolution != dpi)
466 screen->resolution = dpi;
468 g_object_notify (G_OBJECT (screen), "resolution");
473 * gdk_screen_get_resolution:
474 * @screen: a #GdkScreen
476 * Gets the resolution for font handling on the screen; see
477 * gdk_screen_set_resolution() for full details.
479 * Return value: the current resolution, or -1 if no resolution
485 gdk_screen_get_resolution (GdkScreen *screen)
487 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1.0);
489 return screen->resolution;
493 gdk_screen_get_property (GObject *object,
498 GdkScreen *screen = GDK_SCREEN (object);
502 case PROP_FONT_OPTIONS:
503 g_value_set_pointer (value, (gpointer) gdk_screen_get_font_options (screen));
505 case PROP_RESOLUTION:
506 g_value_set_double (value, gdk_screen_get_resolution (screen));
509 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
515 gdk_screen_set_property (GObject *object,
520 GdkScreen *screen = GDK_SCREEN (object);
524 case PROP_FONT_OPTIONS:
525 gdk_screen_set_font_options (screen, g_value_get_pointer (value));
527 case PROP_RESOLUTION:
528 gdk_screen_set_resolution (screen, g_value_get_double (value));
531 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
537 * gdk_screen_get_display:
538 * @screen: a #GdkScreen
540 * Gets the display to which the @screen belongs.
542 * Returns: (transfer none): the display to which @screen belongs
547 gdk_screen_get_display (GdkScreen *screen)
549 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
551 return GDK_SCREEN_GET_CLASS (screen)->get_display (screen);
556 * gdk_screen_get_width:
557 * @screen: a #GdkScreen
559 * Gets the width of @screen in pixels
561 * Returns: the width of @screen in pixels.
566 gdk_screen_get_width (GdkScreen *screen)
568 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
570 return GDK_SCREEN_GET_CLASS (screen)->get_width (screen);
574 * gdk_screen_get_height:
575 * @screen: a #GdkScreen
577 * Gets the height of @screen in pixels
579 * Returns: the height of @screen in pixels.
584 gdk_screen_get_height (GdkScreen *screen)
586 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
588 return GDK_SCREEN_GET_CLASS (screen)->get_height (screen);
592 * gdk_screen_get_width_mm:
593 * @screen: a #GdkScreen
595 * Gets the width of @screen in millimeters.
596 * Note that on some X servers this value will not be correct.
598 * Returns: the width of @screen in millimeters.
603 gdk_screen_get_width_mm (GdkScreen *screen)
605 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
607 return GDK_SCREEN_GET_CLASS (screen)->get_width_mm (screen);
611 * gdk_screen_get_height_mm:
612 * @screen: a #GdkScreen
614 * Returns the height of @screen in millimeters.
615 * Note that on some X servers this value will not be correct.
617 * Returns: the heigth of @screen in millimeters.
622 gdk_screen_get_height_mm (GdkScreen *screen)
624 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
626 return GDK_SCREEN_GET_CLASS (screen)->get_height_mm (screen);
630 * gdk_screen_get_number:
631 * @screen: a #GdkScreen
633 * Gets the index of @screen among the screens in the display
634 * to which it belongs. (See gdk_screen_get_display())
641 gdk_screen_get_number (GdkScreen *screen)
643 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
645 return GDK_SCREEN_GET_CLASS (screen)->get_number (screen);
649 * gdk_screen_get_root_window:
650 * @screen: a #GdkScreen
652 * Gets the root window of @screen.
654 * Returns: (transfer none): the root window
659 gdk_screen_get_root_window (GdkScreen *screen)
661 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
663 return GDK_SCREEN_GET_CLASS (screen)->get_root_window (screen);
667 * gdk_screen_get_n_monitors:
668 * @screen: a #GdkScreen
670 * Returns the number of monitors which @screen consists of.
672 * Returns: number of monitors which @screen consists of
677 gdk_screen_get_n_monitors (GdkScreen *screen)
679 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
681 return GDK_SCREEN_GET_CLASS (screen)->get_n_monitors (screen);
685 * gdk_screen_get_primary_monitor:
686 * @screen: a #GdkScreen.
688 * Gets the primary monitor for @screen. The primary monitor
689 * is considered the monitor where the 'main desktop' lives.
690 * While normal application windows typically allow the window
691 * manager to place the windows, specialized desktop applications
692 * such as panels should place themselves on the primary monitor.
694 * If no primary monitor is configured by the user, the return value
695 * will be 0, defaulting to the first monitor.
697 * Returns: An integer index for the primary monitor, or 0 if none is configured.
702 gdk_screen_get_primary_monitor (GdkScreen *screen)
704 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
706 return GDK_SCREEN_GET_CLASS (screen)->get_primary_monitor (screen);
710 * gdk_screen_get_monitor_width_mm:
711 * @screen: a #GdkScreen
712 * @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
714 * Gets the width in millimeters of the specified monitor, if available.
716 * Returns: the width of the monitor, or -1 if not available
721 gdk_screen_get_monitor_width_mm (GdkScreen *screen,
724 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
725 g_return_val_if_fail (monitor_num >= 0, -1);
726 g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), -1);
728 return GDK_SCREEN_GET_CLASS (screen)->get_monitor_width_mm (screen, monitor_num);
732 * gdk_screen_get_monitor_height_mm:
733 * @screen: a #GdkScreen
734 * @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
736 * Gets the height in millimeters of the specified monitor.
738 * Returns: the height of the monitor, or -1 if not available
743 gdk_screen_get_monitor_height_mm (GdkScreen *screen,
746 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
747 g_return_val_if_fail (monitor_num >= 0, -1);
748 g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), -1);
750 return GDK_SCREEN_GET_CLASS (screen)->get_monitor_height_mm (screen, monitor_num);
754 * gdk_screen_get_monitor_plug_name:
755 * @screen: a #GdkScreen
756 * @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
758 * Returns the output name of the specified monitor.
759 * Usually something like VGA, DVI, or TV, not the actual
760 * product name of the display device.
762 * Returns: a newly-allocated string containing the name of the monitor,
763 * or %NULL if the name cannot be determined
768 gdk_screen_get_monitor_plug_name (GdkScreen *screen,
771 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
772 g_return_val_if_fail (monitor_num >= 0, NULL);
773 g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), NULL);
775 return GDK_SCREEN_GET_CLASS (screen)->get_monitor_plug_name (screen, monitor_num);
779 * gdk_screen_get_monitor_geometry:
780 * @screen: a #GdkScreen
781 * @monitor_num: the monitor number
782 * @dest: (out) (allow-none): a #GdkRectangle to be filled with
783 * the monitor geometry
785 * Retrieves the #GdkRectangle representing the size and position of
786 * the individual monitor within the entire screen area.
788 * Monitor numbers start at 0. To obtain the number of monitors of
789 * @screen, use gdk_screen_get_n_monitors().
791 * Note that the size of the entire screen area can be retrieved via
792 * gdk_screen_get_width() and gdk_screen_get_height().
797 gdk_screen_get_monitor_geometry (GdkScreen *screen,
801 g_return_if_fail (GDK_IS_SCREEN (screen));
802 g_return_if_fail (monitor_num >= 0);
803 g_return_if_fail (monitor_num < gdk_screen_get_n_monitors (screen));
805 GDK_SCREEN_GET_CLASS(screen)->get_monitor_geometry (screen, monitor_num, dest);
809 * gdk_screen_get_monitor_workarea:
810 * @screen: a #GdkScreen
811 * @monitor_num: the monitor number
812 * @dest: (out) (allow-none): a #GdkRectangle to be filled with
813 * the monitor workarea
815 * Retrieves the #GdkRectangle representing the size and position of
816 * the "work area" on a monitor within the entire screen area.
818 * The work area should be considered when positioning menus and
819 * similar popups, to avoid placing them below panels, docks or other
820 * desktop components.
822 * Monitor numbers start at 0. To obtain the number of monitors of
823 * @screen, use gdk_screen_get_n_monitors().
828 gdk_screen_get_monitor_workarea (GdkScreen *screen,
832 g_return_if_fail (GDK_IS_SCREEN (screen));
833 g_return_if_fail (monitor_num >= 0);
834 g_return_if_fail (monitor_num < gdk_screen_get_n_monitors (screen));
836 GDK_SCREEN_GET_CLASS (screen)->get_monitor_workarea (screen, monitor_num, dest);
840 * gdk_screen_list_visuals:
841 * @screen: the relevant #GdkScreen.
843 * Lists the available visuals for the specified @screen.
844 * A visual describes a hardware image data format.
845 * For example, a visual might support 24-bit color, or 8-bit color,
846 * and might expect pixels to be in a certain format.
848 * Call g_list_free() on the return value when you're finished with it.
850 * Return value: (transfer container) (element-type GdkVisual):
851 * a list of visuals; the list must be freed, but not its contents
856 gdk_screen_list_visuals (GdkScreen *screen)
858 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
860 return GDK_SCREEN_GET_CLASS (screen)->list_visuals (screen);
864 * gdk_screen_get_system_visual:
865 * @screen: a #GdkScreen.
867 * Get the system's default visual for @screen.
868 * This is the visual for the root window of the display.
869 * The return value should not be freed.
871 * Return value: (transfer none): the system visual
876 gdk_screen_get_system_visual (GdkScreen * screen)
878 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
880 return GDK_SCREEN_GET_CLASS (screen)->get_system_visual (screen);
884 * gdk_screen_get_rgba_visual:
885 * @screen: a #GdkScreen
887 * Gets a visual to use for creating windows with an alpha channel.
888 * The windowing system on which GTK+ is running
889 * may not support this capability, in which case %NULL will
890 * be returned. Even if a non-%NULL value is returned, its
891 * possible that the window's alpha channel won't be honored
892 * when displaying the window on the screen: in particular, for
893 * X an appropriate windowing manager and compositing manager
894 * must be running to provide appropriate display.
896 * This functionality is not implemented in the Windows backend.
898 * For setting an overall opacity for a top-level window, see
899 * gdk_window_set_opacity().
901 * Return value: (transfer none): a visual to use for windows with an
902 * alpha channel or %NULL if the capability is not available.
907 gdk_screen_get_rgba_visual (GdkScreen *screen)
909 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
911 return GDK_SCREEN_GET_CLASS (screen)->get_rgba_visual (screen);
915 * gdk_screen_is_composited:
916 * @screen: a #GdkScreen
918 * Returns whether windows with an RGBA visual can reasonably
919 * be expected to have their alpha channel drawn correctly on
922 * On X11 this function returns whether a compositing manager is
923 * compositing @screen.
925 * Return value: Whether windows with RGBA visuals can reasonably be
926 * expected to have their alpha channels drawn correctly on the screen.
931 gdk_screen_is_composited (GdkScreen *screen)
933 g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
935 return GDK_SCREEN_GET_CLASS (screen)->is_composited (screen);
939 * gdk_screen_make_display_name:
940 * @screen: a #GdkScreen
942 * Determines the name to pass to gdk_display_open() to get
943 * a #GdkDisplay with this screen as the default screen.
945 * Return value: a newly allocated string, free with g_free()
950 gdk_screen_make_display_name (GdkScreen *screen)
952 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
954 return GDK_SCREEN_GET_CLASS (screen)->make_display_name (screen);
958 * gdk_screen_get_active_window:
959 * @screen: a #GdkScreen
961 * Returns the screen's currently active window.
963 * On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property
964 * on the root window, as described in the <ulink
965 * url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
966 * Manager Hints</ulink>. If there is no currently currently active
967 * window, or the window manager does not support the
968 * _NET_ACTIVE_WINDOW hint, this function returns %NULL.
970 * On other platforms, this function may return %NULL, depending on whether
971 * it is implementable on that platform.
973 * The returned window should be unrefed using g_object_unref() when
976 * Return value: (transfer full): the currently active window, or %NULL.
981 gdk_screen_get_active_window (GdkScreen *screen)
983 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
985 return GDK_SCREEN_GET_CLASS (screen)->get_active_window (screen);
989 * gdk_screen_get_window_stack:
990 * @screen: a #GdkScreen
992 * Returns a #GList of #GdkWindow<!-- -->s representing the current
995 * On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING
996 * property on the root window, as described in the <ulink
997 * url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
998 * Manager Hints</ulink>. If the window manager does not support the
999 * _NET_CLIENT_LIST_STACKING hint, this function returns %NULL.
1001 * On other platforms, this function may return %NULL, depending on whether
1002 * it is implementable on that platform.
1004 * The returned list is newly allocated and owns references to the
1005 * windows it contains, so it should be freed using g_list_free() and
1006 * its windows unrefed using g_object_unref() when no longer needed.
1008 * Return value: (transfer full) (element-type GdkWindow):
1009 * a list of #GdkWindow<!-- -->s for the current window stack,
1015 gdk_screen_get_window_stack (GdkScreen *screen)
1017 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
1019 return GDK_SCREEN_GET_CLASS (screen)->get_window_stack (screen);
1023 * gdk_screen_get_setting:
1024 * @screen: the #GdkScreen where the setting is located
1025 * @name: the name of the setting
1026 * @value: location to store the value of the setting
1028 * Retrieves a desktop-wide setting such as double-click time
1029 * for the #GdkScreen @screen.
1031 * FIXME needs a list of valid settings here, or a link to
1034 * Returns: %TRUE if the setting existed and a value was stored
1035 * in @value, %FALSE otherwise.
1040 gdk_screen_get_setting (GdkScreen *screen,
1044 g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
1045 g_return_val_if_fail (name != NULL, FALSE);
1046 g_return_val_if_fail (value != NULL, FALSE);
1048 return GDK_SCREEN_GET_CLASS (screen)->get_setting (screen, name, value);