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 "gdkinternals.h"
25 #include "gdkscreenprivate.h"
26 #include "gdkrectangle.h"
27 #include "gdkwindow.h"
33 * @Short_description: Object representing a physical screen
36 * #GdkScreen objects are the GDK representation of the screen on
37 * which windows can be displayed and on which the pointer moves.
38 * X originally identified screens with physical screens, but
39 * nowadays it is more common to have a single #GdkScreen which
40 * combines several physical monitors (see gdk_screen_get_n_monitors()).
42 * GdkScreen is used throughout GDK and GTK+ to specify which screen
43 * the top level windows are to be displayed on. it is also used to
44 * query the screen specification and default settings such as
45 * the default visual (gdk_screen_get_system_visual()), the dimensions
46 * of the physical monitors (gdk_screen_get_monitor_geometry()), etc.
50 static void gdk_screen_finalize (GObject *object);
51 static void gdk_screen_set_property (GObject *object,
55 static void gdk_screen_get_property (GObject *object,
75 static guint signals[LAST_SIGNAL] = { 0 };
77 G_DEFINE_TYPE (GdkScreen, gdk_screen, G_TYPE_OBJECT)
80 gdk_screen_class_init (GdkScreenClass *klass)
82 GObjectClass *object_class = G_OBJECT_CLASS (klass);
84 object_class->finalize = gdk_screen_finalize;
85 object_class->set_property = gdk_screen_set_property;
86 object_class->get_property = gdk_screen_get_property;
88 g_object_class_install_property (object_class,
90 g_param_spec_pointer ("font-options",
92 P_("The default font options for the screen"),
93 G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
94 G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
96 g_object_class_install_property (object_class,
98 g_param_spec_double ("resolution",
99 P_("Font resolution"),
100 P_("The resolution for fonts on the screen"),
104 G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
105 G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
108 * GdkScreen::size-changed:
109 * @screen: the object on which the signal is emitted
111 * The ::size-changed signal is emitted when the pixel width or
112 * height of a screen changes.
116 signals[SIZE_CHANGED] =
117 g_signal_new (g_intern_static_string ("size-changed"),
118 G_OBJECT_CLASS_TYPE (klass),
120 G_STRUCT_OFFSET (GdkScreenClass, size_changed),
122 g_cclosure_marshal_VOID__VOID,
127 * GdkScreen::composited-changed:
128 * @screen: the object on which the signal is emitted
130 * The ::composited-changed signal is emitted when the composited
131 * status of the screen changes
135 signals[COMPOSITED_CHANGED] =
136 g_signal_new (g_intern_static_string ("composited-changed"),
137 G_OBJECT_CLASS_TYPE (klass),
139 G_STRUCT_OFFSET (GdkScreenClass, composited_changed),
141 g_cclosure_marshal_VOID__VOID,
146 * GdkScreen::monitors-changed:
147 * @screen: the object on which the signal is emitted
149 * The ::monitors-changed signal is emitted when the number, size
150 * or position of the monitors attached to the screen change.
152 * Only for X11 and OS X for now. A future implementation for Win32
153 * may be a possibility.
157 signals[MONITORS_CHANGED] =
158 g_signal_new (g_intern_static_string ("monitors-changed"),
159 G_OBJECT_CLASS_TYPE (klass),
161 G_STRUCT_OFFSET (GdkScreenClass, monitors_changed),
163 g_cclosure_marshal_VOID__VOID,
169 gdk_screen_init (GdkScreen *screen)
171 screen->resolution = -1.;
175 gdk_screen_finalize (GObject *object)
177 GdkScreen *screen = GDK_SCREEN (object);
179 if (screen->font_options)
180 cairo_font_options_destroy (screen->font_options);
182 G_OBJECT_CLASS (gdk_screen_parent_class)->finalize (object);
186 _gdk_screen_close (GdkScreen *screen)
188 g_return_if_fail (GDK_IS_SCREEN (screen));
192 screen->closed = TRUE;
193 g_object_run_dispose (G_OBJECT (screen));
197 /* Fallback used when the monitor "at" a point or window
201 get_nearest_monitor (GdkScreen *screen,
205 gint num_monitors, i;
206 gint nearest_dist = G_MAXINT;
207 gint nearest_monitor = 0;
209 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
211 num_monitors = gdk_screen_get_n_monitors (screen);
213 for (i = 0; i < num_monitors; i++)
215 GdkRectangle monitor;
216 gint dist_x, dist_y, dist;
218 gdk_screen_get_monitor_geometry (screen, i, &monitor);
221 dist_x = monitor.x - x;
222 else if (x >= monitor.x + monitor.width)
223 dist_x = x - (monitor.x + monitor.width) + 1;
228 dist_y = monitor.y - y;
229 else if (y >= monitor.y + monitor.height)
230 dist_y = y - (monitor.y + monitor.height) + 1;
234 dist = dist_x + dist_y;
235 if (dist < nearest_dist)
242 return nearest_monitor;
246 * gdk_screen_get_monitor_at_point:
247 * @screen: a #GdkScreen.
248 * @x: the x coordinate in the virtual screen.
249 * @y: the y coordinate in the virtual screen.
251 * Returns the monitor number in which the point (@x,@y) is located.
253 * Returns: the monitor number in which the point (@x,@y) lies, or
254 * a monitor close to (@x,@y) if the point is not in any monitor.
259 gdk_screen_get_monitor_at_point (GdkScreen *screen,
263 gint num_monitors, i;
265 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
267 num_monitors = gdk_screen_get_n_monitors (screen);
269 for (i=0;i<num_monitors;i++)
271 GdkRectangle monitor;
273 gdk_screen_get_monitor_geometry (screen, i, &monitor);
275 if (x >= monitor.x &&
276 x < monitor.x + monitor.width &&
278 y < (monitor.y + monitor.height))
282 return get_nearest_monitor (screen, x, y);
286 * gdk_screen_get_monitor_at_window:
287 * @screen: a #GdkScreen.
288 * @window: a #GdkWindow
290 * Returns the number of the monitor in which the largest area of the
291 * bounding rectangle of @window resides.
293 * Returns: the monitor number in which most of @window is located,
294 * or if @window does not intersect any monitors, a monitor,
300 gdk_screen_get_monitor_at_window (GdkScreen *screen,
303 gint num_monitors, i, area = 0, screen_num = -1;
304 GdkRectangle win_rect;
306 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
308 gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width,
310 gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
311 num_monitors = gdk_screen_get_n_monitors (screen);
313 for (i=0;i<num_monitors;i++)
315 GdkRectangle tmp_monitor, intersect;
317 gdk_screen_get_monitor_geometry (screen, i, &tmp_monitor);
318 gdk_rectangle_intersect (&win_rect, &tmp_monitor, &intersect);
320 if (intersect.width * intersect.height > area)
322 area = intersect.width * intersect.height;
329 return get_nearest_monitor (screen,
330 win_rect.x + win_rect.width / 2,
331 win_rect.y + win_rect.height / 2);
337 * Returns the width of the default screen in pixels.
339 * Return value: the width of the default screen in pixels.
342 gdk_screen_width (void)
344 return gdk_screen_get_width (gdk_screen_get_default ());
350 * Returns the height of the default screen in pixels.
352 * Return value: the height of the default screen in pixels.
355 gdk_screen_height (void)
357 return gdk_screen_get_height (gdk_screen_get_default ());
361 * gdk_screen_width_mm:
363 * Returns the width of the default screen in millimeters.
364 * Note that on many X servers this value will not be correct.
366 * Return value: the width of the default screen in millimeters,
367 * though it is not always correct.
370 gdk_screen_width_mm (void)
372 return gdk_screen_get_width_mm (gdk_screen_get_default ());
376 * gdk_screen_height_mm:
378 * Returns the height of the default screen in millimeters.
379 * Note that on many X servers this value will not be correct.
381 * Return value: the height of the default screen in millimeters,
382 * though it is not always correct.
385 gdk_screen_height_mm (void)
387 return gdk_screen_get_height_mm (gdk_screen_get_default ());
391 * gdk_screen_set_font_options:
392 * @screen: a #GdkScreen
393 * @options: (allow-none): a #cairo_font_options_t, or %NULL to unset any
394 * previously set default font options.
396 * Sets the default font options for the screen. These
397 * options will be set on any #PangoContext's newly created
398 * with gdk_pango_context_get_for_screen(). Changing the
399 * default set of font options does not affect contexts that
400 * have already been created.
405 gdk_screen_set_font_options (GdkScreen *screen,
406 const cairo_font_options_t *options)
408 g_return_if_fail (GDK_IS_SCREEN (screen));
410 if (screen->font_options != options)
412 if (screen->font_options)
413 cairo_font_options_destroy (screen->font_options);
416 screen->font_options = cairo_font_options_copy (options);
418 screen->font_options = NULL;
420 g_object_notify (G_OBJECT (screen), "font-options");
425 * gdk_screen_get_font_options:
426 * @screen: a #GdkScreen
428 * Gets any options previously set with gdk_screen_set_font_options().
430 * Return value: the current font options, or %NULL if no default
431 * font options have been set.
435 const cairo_font_options_t *
436 gdk_screen_get_font_options (GdkScreen *screen)
438 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
440 return screen->font_options;
444 * gdk_screen_set_resolution:
445 * @screen: a #GdkScreen
446 * @dpi: the resolution in "dots per inch". (Physical inches aren't actually
447 * involved; the terminology is conventional.)
449 * Sets the resolution for font handling on the screen. This is a
450 * scale factor between points specified in a #PangoFontDescription
451 * and cairo units. The default value is 96, meaning that a 10 point
452 * font will be 13 units high. (10 * 96. / 72. = 13.3).
457 gdk_screen_set_resolution (GdkScreen *screen,
460 g_return_if_fail (GDK_IS_SCREEN (screen));
465 if (screen->resolution != dpi)
467 screen->resolution = dpi;
469 g_object_notify (G_OBJECT (screen), "resolution");
474 * gdk_screen_get_resolution:
475 * @screen: a #GdkScreen
477 * Gets the resolution for font handling on the screen; see
478 * gdk_screen_set_resolution() for full details.
480 * Return value: the current resolution, or -1 if no resolution
486 gdk_screen_get_resolution (GdkScreen *screen)
488 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1.0);
490 return screen->resolution;
494 gdk_screen_get_property (GObject *object,
499 GdkScreen *screen = GDK_SCREEN (object);
503 case PROP_FONT_OPTIONS:
504 g_value_set_pointer (value, (gpointer) gdk_screen_get_font_options (screen));
506 case PROP_RESOLUTION:
507 g_value_set_double (value, gdk_screen_get_resolution (screen));
510 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
516 gdk_screen_set_property (GObject *object,
521 GdkScreen *screen = GDK_SCREEN (object);
525 case PROP_FONT_OPTIONS:
526 gdk_screen_set_font_options (screen, g_value_get_pointer (value));
528 case PROP_RESOLUTION:
529 gdk_screen_set_resolution (screen, g_value_get_double (value));
532 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
538 * gdk_screen_get_display:
539 * @screen: a #GdkScreen
541 * Gets the display to which the @screen belongs.
543 * Returns: (transfer none): the display to which @screen belongs
548 gdk_screen_get_display (GdkScreen *screen)
550 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
552 return GDK_SCREEN_GET_CLASS (screen)->get_display (screen);
557 * gdk_screen_get_width:
558 * @screen: a #GdkScreen
560 * Gets the width of @screen in pixels
562 * Returns: the width of @screen in pixels.
567 gdk_screen_get_width (GdkScreen *screen)
569 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
571 return GDK_SCREEN_GET_CLASS (screen)->get_width (screen);
575 * gdk_screen_get_height:
576 * @screen: a #GdkScreen
578 * Gets the height of @screen in pixels
580 * Returns: the height of @screen in pixels.
585 gdk_screen_get_height (GdkScreen *screen)
587 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
589 return GDK_SCREEN_GET_CLASS (screen)->get_height (screen);
593 * gdk_screen_get_width_mm:
594 * @screen: a #GdkScreen
596 * Gets the width of @screen in millimeters.
597 * Note that on some X servers this value will not be correct.
599 * Returns: the width of @screen in millimeters.
604 gdk_screen_get_width_mm (GdkScreen *screen)
606 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
608 return GDK_SCREEN_GET_CLASS (screen)->get_width_mm (screen);
612 * gdk_screen_get_height_mm:
613 * @screen: a #GdkScreen
615 * Returns the height of @screen in millimeters.
616 * Note that on some X servers this value will not be correct.
618 * Returns: the heigth of @screen in millimeters.
623 gdk_screen_get_height_mm (GdkScreen *screen)
625 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
627 return GDK_SCREEN_GET_CLASS (screen)->get_height_mm (screen);
631 * gdk_screen_get_number:
632 * @screen: a #GdkScreen
634 * Gets the index of @screen among the screens in the display
635 * to which it belongs. (See gdk_screen_get_display())
642 gdk_screen_get_number (GdkScreen *screen)
644 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
646 return GDK_SCREEN_GET_CLASS (screen)->get_number (screen);
650 * gdk_screen_get_root_window:
651 * @screen: a #GdkScreen
653 * Gets the root window of @screen.
655 * Returns: (transfer none): the root window
660 gdk_screen_get_root_window (GdkScreen *screen)
662 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
664 return GDK_SCREEN_GET_CLASS (screen)->get_root_window (screen);
668 * gdk_screen_get_n_monitors:
669 * @screen: a #GdkScreen
671 * Returns the number of monitors which @screen consists of.
673 * Returns: number of monitors which @screen consists of
678 gdk_screen_get_n_monitors (GdkScreen *screen)
680 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
682 return GDK_SCREEN_GET_CLASS (screen)->get_n_monitors (screen);
686 * gdk_screen_get_primary_monitor:
687 * @screen: a #GdkScreen.
689 * Gets the primary monitor for @screen. The primary monitor
690 * is considered the monitor where the 'main desktop' lives.
691 * While normal application windows typically allow the window
692 * manager to place the windows, specialized desktop applications
693 * such as panels should place themselves on the primary monitor.
695 * If no primary monitor is configured by the user, the return value
696 * will be 0, defaulting to the first monitor.
698 * Returns: An integer index for the primary monitor, or 0 if none is configured.
703 gdk_screen_get_primary_monitor (GdkScreen *screen)
705 g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
707 return GDK_SCREEN_GET_CLASS (screen)->get_primary_monitor (screen);
711 * gdk_screen_get_monitor_width_mm:
712 * @screen: a #GdkScreen
713 * @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
715 * Gets the width in millimeters of the specified monitor, if available.
717 * Returns: the width of the monitor, or -1 if not available
722 gdk_screen_get_monitor_width_mm (GdkScreen *screen,
725 g_return_val_if_fail (GDK_IS_SCREEN (screen), -1);
726 g_return_val_if_fail (monitor_num >= 0, -1);
727 g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), -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);
749 g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), -1);
751 return GDK_SCREEN_GET_CLASS (screen)->get_monitor_height_mm (screen, monitor_num);
755 * gdk_screen_get_monitor_plug_name:
756 * @screen: a #GdkScreen
757 * @monitor_num: number of the monitor, between 0 and gdk_screen_get_n_monitors (screen)
759 * Returns the output name of the specified monitor.
760 * Usually something like VGA, DVI, or TV, not the actual
761 * product name of the display device.
763 * Returns: a newly-allocated string containing the name of the monitor,
764 * or %NULL if the name cannot be determined
769 gdk_screen_get_monitor_plug_name (GdkScreen *screen,
772 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
773 g_return_val_if_fail (monitor_num >= 0, NULL);
774 g_return_val_if_fail (monitor_num < gdk_screen_get_n_monitors (screen), NULL);
776 return GDK_SCREEN_GET_CLASS (screen)->get_monitor_plug_name (screen, monitor_num);
780 * gdk_screen_get_monitor_geometry:
781 * @screen: a #GdkScreen
782 * @monitor_num: the monitor number
783 * @dest: (out) (allow-none): a #GdkRectangle to be filled with
784 * the monitor geometry
786 * Retrieves the #GdkRectangle representing the size and position of
787 * the individual monitor within the entire screen area.
789 * Monitor numbers start at 0. To obtain the number of monitors of
790 * @screen, use gdk_screen_get_n_monitors().
792 * Note that the size of the entire screen area can be retrieved via
793 * gdk_screen_get_width() and gdk_screen_get_height().
798 gdk_screen_get_monitor_geometry (GdkScreen *screen,
802 g_return_if_fail (GDK_IS_SCREEN (screen));
803 g_return_if_fail (monitor_num >= 0);
804 g_return_if_fail (monitor_num < gdk_screen_get_n_monitors (screen));
806 GDK_SCREEN_GET_CLASS(screen)->get_monitor_geometry (screen, monitor_num, dest);
810 * gdk_screen_get_monitor_workarea:
811 * @screen: a #GdkScreen
812 * @monitor_num: the monitor number
813 * @dest: (out) (allow-none): a #GdkRectangle to be filled with
814 * the monitor workarea
816 * Retrieves the #GdkRectangle representing the size and position of
817 * the "work area" on a monitor within the entire screen area.
819 * The work area should be considered when positioning menus and
820 * similar popups, to avoid placing them below panels, docks or other
821 * desktop components.
823 * Monitor numbers start at 0. To obtain the number of monitors of
824 * @screen, use gdk_screen_get_n_monitors().
829 gdk_screen_get_monitor_workarea (GdkScreen *screen,
833 g_return_if_fail (GDK_IS_SCREEN (screen));
834 g_return_if_fail (monitor_num >= 0);
835 g_return_if_fail (monitor_num < gdk_screen_get_n_monitors (screen));
837 GDK_SCREEN_GET_CLASS (screen)->get_monitor_workarea (screen, monitor_num, dest);
841 * gdk_screen_list_visuals:
842 * @screen: the relevant #GdkScreen.
844 * Lists the available visuals for the specified @screen.
845 * A visual describes a hardware image data format.
846 * For example, a visual might support 24-bit color, or 8-bit color,
847 * and might expect pixels to be in a certain format.
849 * Call g_list_free() on the return value when you're finished with it.
851 * Return value: (transfer container) (element-type GdkVisual):
852 * a list of visuals; the list must be freed, but not its contents
857 gdk_screen_list_visuals (GdkScreen *screen)
859 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
861 return GDK_SCREEN_GET_CLASS (screen)->list_visuals (screen);
865 * gdk_screen_get_system_visual:
866 * @screen: a #GdkScreen.
868 * Get the system's default visual for @screen.
869 * This is the visual for the root window of the display.
870 * The return value should not be freed.
872 * Return value: (transfer none): the system visual
877 gdk_screen_get_system_visual (GdkScreen * screen)
879 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
881 return GDK_SCREEN_GET_CLASS (screen)->get_system_visual (screen);
885 * gdk_screen_get_rgba_visual:
886 * @screen: a #GdkScreen
888 * Gets a visual to use for creating windows with an alpha channel.
889 * The windowing system on which GTK+ is running
890 * may not support this capability, in which case %NULL will
891 * be returned. Even if a non-%NULL value is returned, its
892 * possible that the window's alpha channel won't be honored
893 * when displaying the window on the screen: in particular, for
894 * X an appropriate windowing manager and compositing manager
895 * must be running to provide appropriate display.
897 * This functionality is not implemented in the Windows backend.
899 * For setting an overall opacity for a top-level window, see
900 * gdk_window_set_opacity().
902 * Return value: (transfer none): a visual to use for windows with an
903 * alpha channel or %NULL if the capability is not available.
908 gdk_screen_get_rgba_visual (GdkScreen *screen)
910 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
912 return GDK_SCREEN_GET_CLASS (screen)->get_rgba_visual (screen);
916 * gdk_screen_is_composited:
917 * @screen: a #GdkScreen
919 * Returns whether windows with an RGBA visual can reasonably
920 * be expected to have their alpha channel drawn correctly on
923 * On X11 this function returns whether a compositing manager is
924 * compositing @screen.
926 * Return value: Whether windows with RGBA visuals can reasonably be
927 * expected to have their alpha channels drawn correctly on the screen.
932 gdk_screen_is_composited (GdkScreen *screen)
934 g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
936 return GDK_SCREEN_GET_CLASS (screen)->is_composited (screen);
940 * gdk_screen_make_display_name:
941 * @screen: a #GdkScreen
943 * Determines the name to pass to gdk_display_open() to get
944 * a #GdkDisplay with this screen as the default screen.
946 * Return value: a newly allocated string, free with g_free()
951 gdk_screen_make_display_name (GdkScreen *screen)
953 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
955 return GDK_SCREEN_GET_CLASS (screen)->make_display_name (screen);
959 * gdk_screen_get_active_window:
960 * @screen: a #GdkScreen
962 * Returns the screen's currently active window.
964 * On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property
965 * on the root window, as described in the <ulink
966 * url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
967 * Manager Hints</ulink>. If there is no currently currently active
968 * window, or the window manager does not support the
969 * _NET_ACTIVE_WINDOW hint, this function returns %NULL.
971 * On other platforms, this function may return %NULL, depending on whether
972 * it is implementable on that platform.
974 * The returned window should be unrefed using g_object_unref() when
977 * Return value: (transfer full): the currently active window, or %NULL.
982 gdk_screen_get_active_window (GdkScreen *screen)
984 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
986 return GDK_SCREEN_GET_CLASS (screen)->get_active_window (screen);
990 * gdk_screen_get_window_stack:
991 * @screen: a #GdkScreen
993 * Returns a #GList of #GdkWindow<!-- -->s representing the current
996 * On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING
997 * property on the root window, as described in the <ulink
998 * url="http://www.freedesktop.org/Standards/wm-spec">Extended Window
999 * Manager Hints</ulink>. If the window manager does not support the
1000 * _NET_CLIENT_LIST_STACKING hint, this function returns %NULL.
1002 * On other platforms, this function may return %NULL, depending on whether
1003 * it is implementable on that platform.
1005 * The returned list is newly allocated and owns references to the
1006 * windows it contains, so it should be freed using g_list_free() and
1007 * its windows unrefed using g_object_unref() when no longer needed.
1009 * Return value: (transfer full) (element-type GdkWindow):
1010 * a list of #GdkWindow<!-- -->s for the current window stack,
1016 gdk_screen_get_window_stack (GdkScreen *screen)
1018 g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
1020 return GDK_SCREEN_GET_CLASS (screen)->get_window_stack (screen);
1024 * gdk_screen_get_setting:
1025 * @screen: the #GdkScreen where the setting is located
1026 * @name: the name of the setting
1027 * @value: location to store the value of the setting
1029 * Retrieves a desktop-wide setting such as double-click time
1030 * for the #GdkScreen @screen.
1032 * FIXME needs a list of valid settings here, or a link to
1035 * Returns: %TRUE if the setting existed and a value was stored
1036 * in @value, %FALSE otherwise.
1041 gdk_screen_get_setting (GdkScreen *screen,
1045 g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
1046 g_return_val_if_fail (name != NULL, FALSE);
1047 g_return_val_if_fail (value != NULL, FALSE);
1049 return GDK_SCREEN_GET_CLASS (screen)->get_setting (screen, name, value);