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, write to the
20 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 * Boston, MA 02111-1307, USA.
26 #include "gdkscreenprivate.h"
27 #include "gdkrectangle.h"
28 #include "gdkwindow.h"
34 * @Short_description: Object representing a physical screen
37 * #GdkScreen objects are the GDK representation of the screen on
38 * which windows can be displayed and on which the pointer moves.
39 * X originally identified screens with physical screens, but
40 * nowadays it is more common to have a single #GdkScreen which
41 * combines several physical monitors (see gdk_screen_get_n_monitors()).
43 * GdkScreen is used throughout GDK and GTK+ to specify which screen
44 * the top level windows are to be displayed on. it is also used to
45 * query the screen specification and default settings such as
46 * the default visual (gdk_screen_get_system_visual()), the dimensions
47 * of the physical monitors (gdk_screen_get_monitor_geometry()), etc.
51 static void gdk_screen_finalize (GObject *object);
52 static void gdk_screen_set_property (GObject *object,
56 static void gdk_screen_get_property (GObject *object,
76 static guint signals[LAST_SIGNAL] = { 0 };
78 G_DEFINE_TYPE (GdkScreen, gdk_screen, G_TYPE_OBJECT)
81 gdk_screen_class_init (GdkScreenClass *klass)
83 GObjectClass *object_class = G_OBJECT_CLASS (klass);
85 object_class->finalize = gdk_screen_finalize;
86 object_class->set_property = gdk_screen_set_property;
87 object_class->get_property = gdk_screen_get_property;
89 g_object_class_install_property (object_class,
91 g_param_spec_pointer ("font-options",
93 P_("The default font options for the screen"),
94 G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
95 G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
97 g_object_class_install_property (object_class,
99 g_param_spec_double ("resolution",
100 P_("Font resolution"),
101 P_("The resolution for fonts on the screen"),
105 G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
106 G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
109 * GdkScreen::size-changed:
110 * @screen: the object on which the signal is emitted
112 * The ::size-changed signal is emitted when the pixel width or
113 * height of a screen changes.
117 signals[SIZE_CHANGED] =
118 g_signal_new (g_intern_static_string ("size-changed"),
119 G_OBJECT_CLASS_TYPE (klass),
121 G_STRUCT_OFFSET (GdkScreenClass, size_changed),
123 g_cclosure_marshal_VOID__VOID,
128 * GdkScreen::composited-changed:
129 * @screen: the object on which the signal is emitted
131 * The ::composited-changed signal is emitted when the composited
132 * status of the screen changes
136 signals[COMPOSITED_CHANGED] =
137 g_signal_new (g_intern_static_string ("composited-changed"),
138 G_OBJECT_CLASS_TYPE (klass),
140 G_STRUCT_OFFSET (GdkScreenClass, composited_changed),
142 g_cclosure_marshal_VOID__VOID,
147 * GdkScreen::monitors-changed:
148 * @screen: the object on which the signal is emitted
150 * The ::monitors-changed signal is emitted when the number, size
151 * or position of the monitors attached to the screen change.
153 * Only for X11 and OS X for now. A future implementation for Win32
154 * may be a possibility.
158 signals[MONITORS_CHANGED] =
159 g_signal_new (g_intern_static_string ("monitors-changed"),
160 G_OBJECT_CLASS_TYPE (klass),
162 G_STRUCT_OFFSET (GdkScreenClass, monitors_changed),
164 g_cclosure_marshal_VOID__VOID,
170 gdk_screen_init (GdkScreen *screen)
172 screen->resolution = -1.;
176 gdk_screen_finalize (GObject *object)
178 GdkScreen *screen = GDK_SCREEN (object);
180 if (screen->font_options)
181 cairo_font_options_destroy (screen->font_options);
183 G_OBJECT_CLASS (gdk_screen_parent_class)->finalize (object);
187 _gdk_screen_close (GdkScreen *screen)
189 g_return_if_fail (GDK_IS_SCREEN (screen));
193 screen->closed = TRUE;
194 g_object_run_dispose (G_OBJECT (screen));
198 /* Fallback used when the monitor "at" a point or window
202 get_nearest_monitor (GdkScreen *screen,
206 gint num_monitors, i;
207 gint nearest_dist = G_MAXINT;
208 gint nearest_monitor = 0;
210 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
212 num_monitors = gdk_screen_get_n_monitors (screen);
214 for (i = 0; i < num_monitors; i++)
216 GdkRectangle monitor;
217 gint dist_x, dist_y, dist;
219 gdk_screen_get_monitor_geometry (screen, i, &monitor);
222 dist_x = monitor.x - x;
223 else if (x >= monitor.x + monitor.width)
224 dist_x = x - (monitor.x + monitor.width) + 1;
229 dist_y = monitor.y - y;
230 else if (y >= monitor.y + monitor.height)
231 dist_y = y - (monitor.y + monitor.height) + 1;
235 dist = dist_x + dist_y;
236 if (dist < nearest_dist)
243 return nearest_monitor;
247 * gdk_screen_get_monitor_at_point:
248 * @screen: a #GdkScreen.
249 * @x: the x coordinate in the virtual screen.
250 * @y: the y coordinate in the virtual screen.
252 * Returns the monitor number in which the point (@x,@y) is located.
254 * Returns: the monitor number in which the point (@x,@y) lies, or
255 * a monitor close to (@x,@y) if the point is not in any monitor.
260 gdk_screen_get_monitor_at_point (GdkScreen *screen,
264 gint num_monitors, i;
266 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
268 num_monitors = gdk_screen_get_n_monitors (screen);
270 for (i=0;i<num_monitors;i++)
272 GdkRectangle monitor;
274 gdk_screen_get_monitor_geometry (screen, i, &monitor);
276 if (x >= monitor.x &&
277 x < monitor.x + monitor.width &&
279 y < (monitor.y + monitor.height))
283 return get_nearest_monitor (screen, x, y);
287 * gdk_screen_get_monitor_at_window:
288 * @screen: a #GdkScreen.
289 * @window: a #GdkWindow
291 * Returns the number of the monitor in which the largest area of the
292 * bounding rectangle of @window resides.
294 * Returns: the monitor number in which most of @window is located,
295 * or if @window does not intersect any monitors, a monitor,
301 gdk_screen_get_monitor_at_window (GdkScreen *screen,
304 gint num_monitors, i, area = 0, screen_num = -1;
305 GdkRectangle win_rect;
307 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
309 gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width,
311 gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
312 num_monitors = gdk_screen_get_n_monitors (screen);
314 for (i=0;i<num_monitors;i++)
316 GdkRectangle tmp_monitor, intersect;
318 gdk_screen_get_monitor_geometry (screen, i, &tmp_monitor);
319 gdk_rectangle_intersect (&win_rect, &tmp_monitor, &intersect);
321 if (intersect.width * intersect.height > area)
323 area = intersect.width * intersect.height;
330 return get_nearest_monitor (screen,
331 win_rect.x + win_rect.width / 2,
332 win_rect.y + win_rect.height / 2);
338 * Returns the width of the default screen in pixels.
340 * Return value: the width of the default screen in pixels.
343 gdk_screen_width (void)
345 return gdk_screen_get_width (gdk_screen_get_default ());
351 * Returns the height of the default screen in pixels.
353 * Return value: the height of the default screen in pixels.
356 gdk_screen_height (void)
358 return gdk_screen_get_height (gdk_screen_get_default ());
362 * gdk_screen_width_mm:
364 * Returns the width of the default screen in millimeters.
365 * Note that on many X servers this value will not be correct.
367 * Return value: the width of the default screen in millimeters,
368 * though it is not always correct.
371 gdk_screen_width_mm (void)
373 return gdk_screen_get_width_mm (gdk_screen_get_default ());
377 * gdk_screen_height_mm:
379 * Returns the height of the default screen in millimeters.
380 * Note that on many X servers this value will not be correct.
382 * Return value: the height of the default screen in millimeters,
383 * though it is not always correct.
386 gdk_screen_height_mm (void)
388 return gdk_screen_get_height_mm (gdk_screen_get_default ());
392 * gdk_screen_set_font_options:
393 * @screen: a #GdkScreen
394 * @options: (allow-none): a #cairo_font_options_t, or %NULL to unset any
395 * previously set default font options.
397 * Sets the default font options for the screen. These
398 * options will be set on any #PangoContext's newly created
399 * with gdk_pango_context_get_for_screen(). Changing the
400 * default set of font options does not affect contexts that
401 * have already been created.
406 gdk_screen_set_font_options (GdkScreen *screen,
407 const cairo_font_options_t *options)
409 g_return_if_fail (GDK_IS_SCREEN (screen));
411 if (screen->font_options != options)
413 if (screen->font_options)
414 cairo_font_options_destroy (screen->font_options);
417 screen->font_options = cairo_font_options_copy (options);
419 screen->font_options = NULL;
421 g_object_notify (G_OBJECT (screen), "font-options");
426 * gdk_screen_get_font_options:
427 * @screen: a #GdkScreen
429 * Gets any options previously set with gdk_screen_set_font_options().
431 * Return value: the current font options, or %NULL if no default
432 * font options have been set.
436 const cairo_font_options_t *
437 gdk_screen_get_font_options (GdkScreen *screen)
439 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
441 return screen->font_options;
445 * gdk_screen_set_resolution:
446 * @screen: a #GdkScreen
447 * @dpi: the resolution in "dots per inch". (Physical inches aren't actually
448 * involved; the terminology is conventional.)
450 * Sets the resolution for font handling on the screen. This is a
451 * scale factor between points specified in a #PangoFontDescription
452 * and cairo units. The default value is 96, meaning that a 10 point
453 * font will be 13 units high. (10 * 96. / 72. = 13.3).
458 gdk_screen_set_resolution (GdkScreen *screen,
461 g_return_if_fail (GDK_IS_SCREEN (screen));
466 if (screen->resolution != dpi)
468 screen->resolution = dpi;
470 g_object_notify (G_OBJECT (screen), "resolution");
475 * gdk_screen_get_resolution:
476 * @screen: a #GdkScreen
478 * Gets the resolution for font handling on the screen; see
479 * gdk_screen_set_resolution() for full details.
481 * Return value: the current resolution, or -1 if no resolution
487 gdk_screen_get_resolution (GdkScreen *screen)
489 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1.0);
491 return screen->resolution;
495 gdk_screen_get_property (GObject *object,
500 GdkScreen *screen = GDK_SCREEN (object);
504 case PROP_FONT_OPTIONS:
505 g_value_set_pointer (value, (gpointer) gdk_screen_get_font_options (screen));
507 case PROP_RESOLUTION:
508 g_value_set_double (value, gdk_screen_get_resolution (screen));
511 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
517 gdk_screen_set_property (GObject *object,
522 GdkScreen *screen = GDK_SCREEN (object);
526 case PROP_FONT_OPTIONS:
527 gdk_screen_set_font_options (screen, g_value_get_pointer (value));
529 case PROP_RESOLUTION:
530 gdk_screen_set_resolution (screen, g_value_get_double (value));
533 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
539 * gdk_screen_get_display:
540 * @screen: a #GdkScreen
542 * Gets the display to which the @screen belongs.
544 * Returns: (transfer none): the display to which @screen belongs
549 gdk_screen_get_display (GdkScreen *screen)
551 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
553 return GDK_SCREEN_GET_CLASS (screen)->get_display (screen);
558 * gdk_screen_get_width:
559 * @screen: a #GdkScreen
561 * Gets the width of @screen in pixels
563 * Returns: the width of @screen in pixels.
568 gdk_screen_get_width (GdkScreen *screen)
570 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
572 return GDK_SCREEN_GET_CLASS (screen)->get_width (screen);
576 * gdk_screen_get_height:
577 * @screen: a #GdkScreen
579 * Gets the height of @screen in pixels
581 * Returns: the height of @screen in pixels.
586 gdk_screen_get_height (GdkScreen *screen)
588 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
590 return GDK_SCREEN_GET_CLASS (screen)->get_height (screen);
594 * gdk_screen_get_width_mm:
595 * @screen: a #GdkScreen
597 * Gets the width of @screen in millimeters.
598 * Note that on some X servers this value will not be correct.
600 * Returns: the width of @screen in millimeters.
605 gdk_screen_get_width_mm (GdkScreen *screen)
607 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
609 return GDK_SCREEN_GET_CLASS (screen)->get_width_mm (screen);
613 * gdk_screen_get_height_mm:
614 * @screen: a #GdkScreen
616 * Returns the height of @screen in millimeters.
617 * Note that on some X servers this value will not be correct.
619 * Returns: the heigth of @screen in millimeters.
624 gdk_screen_get_height_mm (GdkScreen *screen)
626 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
628 return GDK_SCREEN_GET_CLASS (screen)->get_height_mm (screen);
632 * gdk_screen_get_number:
633 * @screen: a #GdkScreen
635 * Gets the index of @screen among the screens in the display
636 * to which it belongs. (See gdk_screen_get_display())
643 gdk_screen_get_number (GdkScreen *screen)
645 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
647 return GDK_SCREEN_GET_CLASS (screen)->get_number (screen);
651 * gdk_screen_get_root_window:
652 * @screen: a #GdkScreen
654 * Gets the root window of @screen.
656 * Returns: (transfer none): the root window
661 gdk_screen_get_root_window (GdkScreen *screen)
663 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
665 return GDK_SCREEN_GET_CLASS (screen)->get_root_window (screen);
669 * gdk_screen_get_n_monitors:
670 * @screen: a #GdkScreen
672 * Returns the number of monitors which @screen consists of.
674 * Returns: number of monitors which @screen consists of
679 gdk_screen_get_n_monitors (GdkScreen *screen)
681 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
683 return GDK_SCREEN_GET_CLASS (screen)->get_n_monitors (screen);
687 * gdk_screen_get_primary_monitor:
688 * @screen: a #GdkScreen.
690 * Gets the primary monitor for @screen. The primary monitor
691 * is considered the monitor where the 'main desktop' lives.
692 * While normal application windows typically allow the window
693 * manager to place the windows, specialized desktop applications
694 * such as panels should place themselves on the primary monitor.
696 * If no primary monitor is configured by the user, the return value
697 * will be 0, defaulting to the first monitor.
699 * Returns: An integer index for the primary monitor, or 0 if none is configured.
704 gdk_screen_get_primary_monitor (GdkScreen *screen)
706 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
708 return GDK_SCREEN_GET_CLASS (screen)->get_primary_monitor (screen);
712 * gdk_screen_get_monitor_width_mm:
713 * @screen: a #GdkScreen
714 * @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
716 * Gets the width in millimeters of the specified monitor, if available.
718 * Returns: the width of the monitor, or -1 if not available
723 gdk_screen_get_monitor_width_mm (GdkScreen *screen,
726 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
727 g_return_val_if_fail (monitor_num >= 0, -1);
729 return GDK_SCREEN_GET_CLASS (screen)->get_monitor_width_mm (screen, monitor_num);
733 * gdk_screen_get_monitor_height_mm:
734 * @screen: a #GdkScreen
735 * @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
737 * Gets the height in millimeters of the specified monitor.
739 * Returns: the height of the monitor, or -1 if not available
744 gdk_screen_get_monitor_height_mm (GdkScreen *screen,
747 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
748 g_return_val_if_fail (monitor_num >= 0, -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);
774 return GDK_SCREEN_GET_CLASS (screen)->get_monitor_plug_name (screen, monitor_num);
778 * gdk_screen_get_monitor_geometry:
779 * @screen: a #GdkScreen
780 * @monitor_num: the monitor number
781 * @dest: (out) (allow-none): a #GdkRectangle to be filled with
782 * the monitor geometry
784 * Retrieves the #GdkRectangle representing the size and position of
785 * the individual monitor within the entire screen area.
787 * Monitor numbers start at 0. To obtain the number of monitors of
788 * @screen, use gdk_screen_get_n_monitors().
790 * Note that the size of the entire screen area can be retrieved via
791 * gdk_screen_get_width() and gdk_screen_get_height().
796 gdk_screen_get_monitor_geometry (GdkScreen *screen,
800 g_return_if_fail (GDK_IS_SCREEN (screen));
801 g_return_if_fail (monitor_num >= 0);
803 GDK_SCREEN_GET_CLASS(screen)->get_monitor_geometry (screen, monitor_num, dest);
807 * gdk_screen_get_monitor_workarea:
808 * @screen: a #GdkScreen
809 * @monitor_num: the monitor number
810 * @dest: (out) (allow-none): a #GdkRectangle to be filled with
811 * the monitor workarea
813 * Retrieves the #GdkRectangle representing the size and position of
814 * the "work area" on a monitor within the entire screen area.
816 * The work area should be considered when positioning menus and
817 * similar popups, to avoid placing them below panels, docks or other
818 * desktop components.
820 * Monitor numbers start at 0. To obtain the number of monitors of
821 * @screen, use gdk_screen_get_n_monitors().
826 gdk_screen_get_monitor_workarea (GdkScreen *screen,
830 g_return_if_fail (GDK_IS_SCREEN (screen));
831 g_return_if_fail (monitor_num >= 0);
833 GDK_SCREEN_GET_CLASS (screen)->get_monitor_workarea (screen, monitor_num, dest);
837 * gdk_screen_list_visuals:
838 * @screen: the relevant #GdkScreen.
840 * Lists the available visuals for the specified @screen.
841 * A visual describes a hardware image data format.
842 * For example, a visual might support 24-bit color, or 8-bit color,
843 * and might expect pixels to be in a certain format.
845 * Call g_list_free() on the return value when you're finished with it.
847 * Return value: (transfer container) (element-type GdkVisual):
848 * a list of visuals; the list must be freed, but not its contents
853 gdk_screen_list_visuals (GdkScreen *screen)
855 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
857 return GDK_SCREEN_GET_CLASS (screen)->list_visuals (screen);
861 * gdk_screen_get_system_visual:
862 * @screen: a #GdkScreen.
864 * Get the system's default visual for @screen.
865 * This is the visual for the root window of the display.
866 * The return value should not be freed.
868 * Return value: (transfer none): the system visual
873 gdk_screen_get_system_visual (GdkScreen * screen)
875 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
877 return GDK_SCREEN_GET_CLASS (screen)->get_system_visual (screen);
881 * gdk_screen_get_rgba_visual:
882 * @screen: a #GdkScreen
884 * Gets a visual to use for creating windows with an alpha channel.
885 * The windowing system on which GTK+ is running
886 * may not support this capability, in which case %NULL will
887 * be returned. Even if a non-%NULL value is returned, its
888 * possible that the window's alpha channel won't be honored
889 * when displaying the window on the screen: in particular, for
890 * X an appropriate windowing manager and compositing manager
891 * must be running to provide appropriate display.
893 * This functionality is not implemented in the Windows backend.
895 * For setting an overall opacity for a top-level window, see
896 * gdk_window_set_opacity().
898 * Return value: (transfer none): a visual to use for windows with an
899 * alpha channel or %NULL if the capability is not available.
904 gdk_screen_get_rgba_visual (GdkScreen *screen)
906 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
908 return GDK_SCREEN_GET_CLASS (screen)->get_rgba_visual (screen);
912 * gdk_screen_is_composited:
913 * @screen: a #GdkScreen
915 * Returns whether windows with an RGBA visual can reasonably
916 * be expected to have their alpha channel drawn correctly on
919 * On X11 this function returns whether a compositing manager is
920 * compositing @screen.
922 * Return value: Whether windows with RGBA visuals can reasonably be
923 * expected to have their alpha channels drawn correctly on the screen.
928 gdk_screen_is_composited (GdkScreen *screen)
930 g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
932 return GDK_SCREEN_GET_CLASS (screen)->is_composited (screen);
936 * gdk_screen_make_display_name:
937 * @screen: a #GdkScreen
939 * Determines the name to pass to gdk_display_open() to get
940 * a #GdkDisplay with this screen as the default screen.
942 * Return value: a newly allocated string, free with g_free()
947 gdk_screen_make_display_name (GdkScreen *screen)
949 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
951 return GDK_SCREEN_GET_CLASS (screen)->make_display_name (screen);
955 * gdk_screen_get_active_window:
956 * @screen: a #GdkScreen
958 * Returns the screen's currently active window.
960 * On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property
961 * on the root window, as described in the <ulink
962 * url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
963 * Manager Hints</ulink>. If there is no currently currently active
964 * window, or the window manager does not support the
965 * _NET_ACTIVE_WINDOW hint, this function returns %NULL.
967 * On other platforms, this function may return %NULL, depending on whether
968 * it is implementable on that platform.
970 * The returned window should be unrefed using g_object_unref() when
973 * Return value: (transfer full): the currently active window, or %NULL.
978 gdk_screen_get_active_window (GdkScreen *screen)
980 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
982 return GDK_SCREEN_GET_CLASS (screen)->get_active_window (screen);
986 * gdk_screen_get_window_stack:
987 * @screen: a #GdkScreen
989 * Returns a #GList of #GdkWindow<!-- -->s representing the current
992 * On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING
993 * property on the root window, as described in the <ulink
994 * url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
995 * Manager Hints</ulink>. If the window manager does not support the
996 * _NET_CLIENT_LIST_STACKING hint, this function returns %NULL.
998 * On other platforms, this function may return %NULL, depending on whether
999 * it is implementable on that platform.
1001 * The returned list is newly allocated and owns references to the
1002 * windows it contains, so it should be freed using g_list_free() and
1003 * its windows unrefed using g_object_unref() when no longer needed.
1005 * Return value: (transfer full) (element-type GdkWindow):
1006 * a list of #GdkWindow<!-- -->s for the current window stack,
1012 gdk_screen_get_window_stack (GdkScreen *screen)
1014 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
1016 return GDK_SCREEN_GET_CLASS (screen)->get_window_stack (screen);
1020 * gdk_screen_get_setting:
1021 * @screen: the #GdkScreen where the setting is located
1022 * @name: the name of the setting
1023 * @value: location to store the value of the setting
1025 * Retrieves a desktop-wide setting such as double-click time
1026 * for the #GdkScreen @screen.
1028 * FIXME needs a list of valid settings here, or a link to
1031 * Returns: %TRUE if the setting existed and a value was stored
1032 * in @value, %FALSE otherwise.
1037 gdk_screen_get_setting (GdkScreen *screen,
1041 g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
1042 g_return_val_if_fail (name != NULL, FALSE);
1043 g_return_val_if_fail (value != NULL, FALSE);
1045 return GDK_SCREEN_GET_CLASS (screen)->get_setting (screen, name, value);