Commit 026cb538 authored by LRN's avatar LRN Committed by Matthias Clasen

win32: Port to new monitor api

parent 5c1d0915
......@@ -385,7 +385,7 @@ if test "$enable_win32_backend" = "yes"; then
backend_immodules="$backend_immodules,ime"
GDK_WINDOWING="$GDK_WINDOWING
#define GDK_WINDOWING_WIN32"
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi"
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32"
AM_CONDITIONAL(USE_WIN32, true)
PANGO_PACKAGES="pangowin32 pangocairo"
else
......@@ -756,6 +756,54 @@ case $host in
;;
esac
AS_CASE([$host_os],
[mingw*],
[
AC_CHECK_SIZEOF(
[DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY],
[],
[
#define _WIN32_WINNT 0x601
#include <windows.h>
]
)
AS_IF(
[test x$ac_cv_sizeof_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY = x4],
[AC_MSG_RESULT([DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY is OK])],
[test x$ac_cv_sizeof_DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY = x0],
[AC_MSG_ERROR([DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY is unavailable])],
[AC_MSG_RESULT([DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY is not OK])]
)
AC_MSG_CHECKING([for SetupDiGetDevicePropertyW])
gtk_save_LIBS="$LIBS"
LIBS="-lsetupapi $LIBS"
AC_TRY_LINK(
[
#define _WIN32_WINNT 0x0600
#include <windows.h>
#include <devpropdef.h>
#include <setupapi.h>
],
[return SetupDiGetDevicePropertyW(NULL, NULL, NULL, NULL, NULL, 0, NULL, 0);],
[have_SetupDiGetDevicePropertyW=yes],
[have_SetupDiGetDevicePropertyW=no]
)
AS_IF(
[test x$have_SetupDiGetDevicePropertyW = xyes],
[
AC_DEFINE(
[HAVE_SETUP_DI_GET_DEVICE_PROPERTY_W],
[1],
[Define to 1 if SetupDiGetDevicePropertyW() is available]
)
]
)
AC_MSG_RESULT([$have_SetupDiGetDevicePropertyW])
LIBS="$gtk_save_LIBS"
],
[]
)
AC_SUBST(MATH_LIB)
#
# see bug 162979
......
......@@ -47,6 +47,8 @@ libgdk_win32_la_SOURCES = \
gdkglobals-win32.c \
gdkkeys-win32.c \
gdkmain-win32.c \
gdkmonitor-win32.c \
gdkmonitor-win32.h \
gdkprivate-win32.h \
gdkproperty-win32.c \
gdkscreen-win32.c \
......@@ -56,10 +58,11 @@ libgdk_win32_la_SOURCES = \
gdkwin32display.h \
gdkwin32displaymanager.h \
gdkwin32dnd.h \
gdkwin32glcontext.h \
gdkwin32glcontext.h \
gdkwin32.h \
gdkwin32id.c \
gdkwin32keys.h \
gdkwin32monitor.h \
gdkwin32screen.h \
gdkwin32window.h \
gdkwindow-win32.c \
......@@ -76,9 +79,10 @@ libgdkwin32include_HEADERS = \
gdkwin32display.h \
gdkwin32displaymanager.h\
gdkwin32dnd.h \
gdkwin32glcontext.h \
gdkwin32glcontext.h \
gdkwin32keys.h \
gdkwin32misc.h \
gdkwin32monitor.h \
gdkwin32screen.h \
gdkwin32window.h
......
......@@ -25,10 +25,178 @@
#include "gdkwin32display.h"
#include "gdkwin32screen.h"
#include "gdkwin32window.h"
#include "gdkmonitor-win32.h"
#include "gdkwin32.h"
static int debug_indent = 0;
static GdkMonitor *
_gdk_win32_display_find_matching_monitor (GdkWin32Display *win32_display,
GdkMonitor *needle)
{
int i;
for (i = 0; i < win32_display->monitors->len; i++)
{
GdkWin32Monitor *m;
m = GDK_WIN32_MONITOR (g_ptr_array_index (win32_display->monitors, i));
if (_gdk_win32_monitor_compare (m, GDK_WIN32_MONITOR (needle)) == 0)
return GDK_MONITOR (m);
}
return NULL;
}
gboolean
_gdk_win32_display_init_monitors (GdkWin32Display *win32_display)
{
GdkDisplay *display = GDK_DISPLAY (win32_display);
GPtrArray *new_monitors;
gint i;
gboolean changed = FALSE;
GdkWin32Monitor *primary_to_move = NULL;
for (i = 0; i < win32_display->monitors->len; i++)
GDK_WIN32_MONITOR (g_ptr_array_index (win32_display->monitors, i))->remove = TRUE;
new_monitors = _gdk_win32_display_get_monitor_list (win32_display);
for (i = 0; i < new_monitors->len; i++)
{
GdkWin32Monitor *w32_m;
GdkMonitor *m;
GdkWin32Monitor *w32_ex_monitor;
GdkMonitor *ex_monitor;
GdkRectangle geometry, ex_geometry;
GdkRectangle workarea, ex_workarea;
w32_m = GDK_WIN32_MONITOR (g_ptr_array_index (new_monitors, i));
m = GDK_MONITOR (w32_m);
ex_monitor = _gdk_win32_display_find_matching_monitor (win32_display, m);
w32_ex_monitor = GDK_WIN32_MONITOR (ex_monitor);
if (ex_monitor == NULL)
{
w32_m->add = TRUE;
changed = TRUE;
continue;
}
w32_ex_monitor->remove = FALSE;
if (i == 0)
primary_to_move = w32_ex_monitor;
gdk_monitor_get_geometry (m, &geometry);
gdk_monitor_get_geometry (ex_monitor, &ex_geometry);
gdk_monitor_get_workarea (m, &workarea);
gdk_monitor_get_workarea (ex_monitor, &ex_workarea);
if (memcmp (&workarea, &ex_workarea, sizeof (GdkRectangle)) != 0)
{
w32_ex_monitor->work_rect = workarea;
changed = TRUE;
}
if (memcmp (&geometry, &ex_geometry, sizeof (GdkRectangle)) != 0)
{
gdk_monitor_set_size (ex_monitor, geometry.width, geometry.height);
gdk_monitor_set_position (ex_monitor, geometry.x, geometry.y);
changed = TRUE;
}
if (gdk_monitor_get_width_mm (m) != gdk_monitor_get_width_mm (ex_monitor) ||
gdk_monitor_get_height_mm (m) != gdk_monitor_get_height_mm (ex_monitor))
{
gdk_monitor_set_physical_size (ex_monitor,
gdk_monitor_get_width_mm (m),
gdk_monitor_get_height_mm (m));
changed = TRUE;
}
if (g_strcmp0 (gdk_monitor_get_model (m), gdk_monitor_get_model (ex_monitor)) != 0)
{
gdk_monitor_set_model (ex_monitor,
gdk_monitor_get_model (m));
changed = TRUE;
}
if (g_strcmp0 (gdk_monitor_get_manufacturer (m), gdk_monitor_get_manufacturer (ex_monitor)) != 0)
{
gdk_monitor_set_manufacturer (ex_monitor,
gdk_monitor_get_manufacturer (m));
changed = TRUE;
}
if (gdk_monitor_get_refresh_rate (m) != gdk_monitor_get_refresh_rate (ex_monitor))
{
gdk_monitor_set_refresh_rate (ex_monitor, gdk_monitor_get_refresh_rate (m));
changed = TRUE;
}
if (gdk_monitor_get_scale_factor (m) != gdk_monitor_get_scale_factor (ex_monitor))
{
gdk_monitor_set_scale_factor (ex_monitor, gdk_monitor_get_scale_factor (m));
changed = TRUE;
}
if (gdk_monitor_get_subpixel_layout (m) != gdk_monitor_get_subpixel_layout (ex_monitor))
{
gdk_monitor_set_subpixel_layout (ex_monitor, gdk_monitor_get_subpixel_layout (m));
changed = TRUE;
}
}
for (i = win32_display->monitors->len - 1; i >= 0; i--)
{
GdkWin32Monitor *w32_ex_monitor;
GdkMonitor *ex_monitor;
w32_ex_monitor = GDK_WIN32_MONITOR (g_ptr_array_index (win32_display->monitors, i));
ex_monitor = GDK_MONITOR (w32_ex_monitor);
if (!w32_ex_monitor->remove)
continue;
changed = TRUE;
gdk_display_monitor_removed (display, ex_monitor);
g_ptr_array_remove_index (win32_display->monitors, i);
}
for (i = 0; i < new_monitors->len; i++)
{
GdkWin32Monitor *w32_m;
GdkMonitor *m;
w32_m = GDK_WIN32_MONITOR (g_ptr_array_index (new_monitors, i));
m = GDK_MONITOR (w32_m);
if (!w32_m->add)
continue;
gdk_display_monitor_added (display, m);
if (i == 0)
g_ptr_array_insert (win32_display->monitors, 0, g_object_ref (w32_m));
else
g_ptr_array_add (win32_display->monitors, g_object_ref (w32_m));
}
g_ptr_array_free (new_monitors, TRUE);
if (primary_to_move)
{
g_ptr_array_remove (win32_display->monitors, g_object_ref (primary_to_move));
g_ptr_array_insert (win32_display->monitors, 0, primary_to_move);
changed = TRUE;
}
return changed;
}
/**
* gdk_win32_display_set_cursor_theme:
* @display: (type GdkWin32Display): a #GdkDisplay
......@@ -636,12 +804,15 @@ gdk_win32_display_finalize (GObject *object)
_gdk_win32_display_finalize_cursors (display_win32);
_gdk_win32_dnd_exit ();
g_ptr_array_free (display_win32->monitors, TRUE);
G_OBJECT_CLASS (gdk_win32_display_parent_class)->finalize (object);
}
static void
gdk_win32_display_init (GdkWin32Display *display)
{
display->monitors = g_ptr_array_new_with_free_func (g_object_unref);
_gdk_win32_display_init_cursors (display);
}
......@@ -676,6 +847,39 @@ gdk_win32_display_pop_error_trap (GdkDisplay *display,
return 0;
}
static int
gdk_win32_display_get_n_monitors (GdkDisplay *display)
{
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display);
return win32_display->monitors->len;
}
static GdkMonitor *
gdk_win32_display_get_monitor (GdkDisplay *display,
int monitor_num)
{
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display);
if (0 <= monitor_num || monitor_num < win32_display->monitors->len)
return (GdkMonitor *) g_ptr_array_index (win32_display->monitors, monitor_num);
return NULL;
}
static GdkMonitor *
gdk_win32_display_get_primary_monitor (GdkDisplay *display)
{
GdkWin32Display *win32_display = GDK_WIN32_DISPLAY (display);
/* We arrange for the first monitor in the array to also be the primiary monitor */
if (win32_display->monitors->len > 0)
return (GdkMonitor *) g_ptr_array_index (win32_display->monitors, 0);
return NULL;
}
static void
gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
{
......@@ -731,5 +935,9 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->utf8_to_string_target = _gdk_win32_display_utf8_to_string_target;
display_class->make_gl_context_current = _gdk_win32_display_make_gl_context_current;
display_class->get_n_monitors = gdk_win32_display_get_n_monitors;
display_class->get_monitor = gdk_win32_display_get_monitor;
display_class->get_primary_monitor = gdk_win32_display_get_primary_monitor;
_gdk_win32_windowing_init ();
}
......@@ -42,6 +42,8 @@ struct _GdkWin32Display
HDC gl_hdc;
HWND gl_hwnd;
GPtrArray *monitors;
guint hasWglARBCreateContext : 1;
guint hasWglEXTSwapControl : 1;
guint hasWglOMLSyncControl : 1;
......@@ -52,4 +54,8 @@ struct _GdkWin32DisplayClass
GdkDisplayClass display_class;
};
gboolean _gdk_win32_display_init_monitors (GdkWin32Display *display);
GPtrArray *_gdk_win32_display_get_monitor_list (GdkWin32Display *display);
#endif /* __GDK_DISPLAY__WIN32_H__ */
This diff is collapsed.
/*
* Copyright © 2016 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GDK_WIN32_MONITOR_PRIVATE_H__
#define __GDK_WIN32_MONITOR_PRIVATE_H__
#include <windows.h>
#include <glib.h>
#include <gio/gio.h>
#include "gdkmonitorprivate.h"
#include "gdkwin32monitor.h"
struct _GdkWin32Monitor
{
GdkMonitor parent;
/* work area */
GdkRectangle work_rect;
/* Device instance path (used to match GdkWin32Monitor to monitor device) */
gchar *instance_path;
/* TRUE if monitor is made up by us
* (this happens when system has logical monitors, but no physical ones).
*/
guint madeup : 1;
/* TRUE if we should notify GDK about this monitor being added */
guint add : 1;
/* TRUE if we should notify GDK about this monitor being removed */
guint remove : 1;
};
struct _GdkWin32MonitorClass {
GdkMonitorClass parent_class;
};
int _gdk_win32_monitor_compare (GdkWin32Monitor *a, GdkWin32Monitor *b);
#endif
......@@ -22,24 +22,15 @@
#include "gdkwin32screen.h"
#include "gdkdisplayprivate.h"
#include "gdkvisualprivate.h"
#include "gdkdisplay-win32.h"
#include "gdkmonitor-win32.h"
#include <dwmapi.h>
typedef struct
{
gchar *name;
gint width_mm, height_mm;
GdkRectangle rect;
GdkRectangle work_rect;
} GdkWin32Monitor;
struct _GdkWin32Screen
{
GdkScreen parent_instance;
gint num_monitors;
GdkWin32Monitor *monitors;
GdkVisual *system_visual;
GdkVisual *rgba_visual;
gint available_visual_depths[1];
......@@ -257,26 +248,44 @@ init_visual (GdkScreen *screen,
return visual;
}
static void
static gboolean
init_root_window_size (GdkWin32Screen *screen)
{
GdkRectangle rect;
GdkRectangle result;
int i;
GdkDisplay *display = _gdk_display;
int monitor_count;
GdkMonitor *monitor;
gboolean changed;
monitor_count = gdk_display_get_n_monitors (display);
monitor = gdk_display_get_monitor (display, 0);
gdk_monitor_get_geometry (monitor, &result);
rect = screen->monitors[0].rect;
for (i = 1; i < screen->num_monitors; i++)
gdk_rectangle_union (&rect, &screen->monitors[i].rect, &rect);
for (i = 1; i < monitor_count; i++)
{
GdkRectangle rect;
monitor = gdk_display_get_monitor (display, i);
gdk_monitor_get_geometry (monitor, &rect);
gdk_rectangle_union (&result, &rect, &result);
}
changed = screen->root_window->width != result.width ||
screen->root_window->height != result.height;
screen->root_window->width = result.width;
screen->root_window->height = result.height;
screen->root_window->width = rect.width;
screen->root_window->height = rect.height;
return changed;
}
static void
static gboolean
init_root_window (GdkWin32Screen *screen_win32)
{
GdkScreen *screen;
GdkWindow *window;
GdkWindowImplWin32 *impl_win32;
gboolean changed;
screen = GDK_SCREEN (screen_win32);
......@@ -295,7 +304,7 @@ init_root_window (GdkWin32Screen *screen_win32)
screen_win32->root_window = window;
init_root_window_size (screen_win32);
changed = init_root_window_size (screen_win32);
window->x = 0;
window->y = 0;
......@@ -307,134 +316,8 @@ init_root_window (GdkWin32Screen *screen_win32)
gdk_win32_handle_table_insert ((HANDLE *) &impl_win32->handle, window);
GDK_NOTE (MISC, g_print ("screen->root_window=%p\n", window));
}
static BOOL CALLBACK
count_monitor (HMONITOR hmonitor,
HDC hdc,
LPRECT rect,
LPARAM data)
{
gint *n = (gint *) data;
(*n)++;
return TRUE;
}
typedef struct {
GdkWin32Screen *screen;
gint index;
} EnumMonitorData;
static BOOL CALLBACK
enum_monitor (HMONITOR hmonitor,
HDC hdc,
LPRECT rect,
LPARAM param)
{
/* The struct MONITORINFOEX definition is for some reason different
* in the winuser.h bundled with mingw64 from that in MSDN and the
* official 32-bit mingw (the MONITORINFO part is in a separate "mi"
* member). So to keep this easily compileable with either, repeat
* the MSDN definition it here.
*/
typedef struct tagMONITORINFOEXA2 {
DWORD cbSize;
RECT rcMonitor;
RECT rcWork;
DWORD dwFlags;
CHAR szDevice[CCHDEVICENAME];
} MONITORINFOEXA2;
EnumMonitorData *data = (EnumMonitorData *) param;
GdkWin32Monitor *monitor;
MONITORINFOEXA2 monitor_info;
HDC hDC;
g_assert (data->index < data->screen->num_monitors);
monitor = data->screen->monitors + data->index;
monitor_info.cbSize = sizeof (MONITORINFOEXA2);
GetMonitorInfoA (hmonitor, (MONITORINFO *) &monitor_info);
#ifndef MONITORINFOF_PRIMARY
#define MONITORINFOF_PRIMARY 1
#endif
monitor->name = g_strdup (monitor_info.szDevice);
hDC = CreateDCA ("DISPLAY", monitor_info.szDevice, NULL, NULL);
monitor->width_mm = GetDeviceCaps (hDC, HORZSIZE);
monitor->height_mm = GetDeviceCaps (hDC, VERTSIZE);
DeleteDC (hDC);
monitor->rect.x = monitor_info.rcMonitor.left;
monitor->rect.y = monitor_info.rcMonitor.top;
monitor->rect.width = monitor_info.rcMonitor.right - monitor_info.rcMonitor.left;
monitor->rect.height = monitor_info.rcMonitor.bottom - monitor_info.rcMonitor.top;
monitor->work_rect.x = monitor_info.rcWork.left;
monitor->work_rect.y = monitor_info.rcWork.top;
monitor->work_rect.width = monitor_info.rcWork.right - monitor_info.rcWork.left;
monitor->work_rect.height = monitor_info.rcWork.bottom - monitor_info.rcWork.top;
if (monitor_info.dwFlags & MONITORINFOF_PRIMARY && data->index != 0)
{
/* Put primary monitor at index 0, just in case somebody needs
* to know which one is the primary.
*/
GdkWin32Monitor temp = *monitor;
*monitor = data->screen->monitors[0];
data->screen->monitors[0] = temp;
}
data->index++;
return TRUE;
}
static void
init_monitors (GdkWin32Screen *screen)
{
gint count;
EnumMonitorData data;
gint i;
count = 0;
EnumDisplayMonitors (NULL, NULL, count_monitor, (LPARAM) &count);
screen->num_monitors = count;
screen->monitors = g_renew (GdkWin32Monitor, screen->monitors, screen->num_monitors);
data.screen = screen;
data.index = 0;
EnumDisplayMonitors (NULL, NULL, enum_monitor, (LPARAM) &data);
_gdk_offset_x = G_MININT;
_gdk_offset_y = G_MININT;
/* Calculate offset */
for (i = 0; i < screen->num_monitors; i++)
{
GdkRectangle *rect = &screen->monitors[i].rect;
_gdk_offset_x = MAX (_gdk_offset_x, -rect->x);
_gdk_offset_y = MAX (_gdk_offset_y, -rect->y);
}
GDK_NOTE (MISC, g_print ("Multi-monitor offset: (%d,%d)\n",
_gdk_offset_x, _gdk_offset_y));
/* Translate monitor coords into GDK coordinate space */
for (i = 0; i < screen->num_monitors; i++)
{
GdkRectangle *rect;
rect = &screen->monitors[i].rect;
rect->x += _gdk_offset_x;
rect->y += _gdk_offset_y;
rect = &screen->monitors[i].work_rect;
rect->x += _gdk_offset_x;
rect->y += _gdk_offset_y;
GDK_NOTE (MISC, g_print ("Monitor %d: %dx%d@%+d%+d\n", i,
rect->width, rect->height, rect->x, rect->y));
}
return changed;
}
static void
......@@ -470,7 +353,7 @@ gdk_win32_screen_init (GdkWin32Screen *win32_screen)
win32_screen->available_visual_depths[0] = win32_screen->rgba_visual->depth;
win32_screen->available_visual_types[0] = win32_screen->rgba_visual->type;
init_monitors (win32_screen);
_gdk_win32_display_init_monitors (GDK_WIN32_DISPLAY (_gdk_display));
init_root_window (win32_screen);
/* On Windows 8 and later, DWM (composition) is always enabled */
......@@ -480,9 +363,15 @@ gdk_win32_screen_init (GdkWin32Screen *win32_screen)
void
_gdk_win32_screen_on_displaychange_event (GdkWin32Screen *screen)
{
init_monitors (screen);
init_root_window_size (screen);
g_signal_emit_by_name (screen, "size-changed");
gboolean monitors_changed;
monitors_changed = _gdk_win32_display_init_monitors (GDK_WIN32_DISPLAY (_gdk_display));
if (init_root_window_size (screen))
g_signal_emit_by_name (screen, "size-changed");
if (monitors_changed)
g_signal_emit_by_name (screen, "monitors-changed");
}
static GdkDisplay *
......@@ -521,84 +410,6 @@ gdk_win32_screen_get_root_window (GdkScreen *screen)
return GDK_WIN32_SCREEN (screen)->root_window;
}
static gint
gdk_win32_screen_get_n_monitors (GdkScreen *screen)
{
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
return GDK_WIN32_SCREEN (screen)->num_monitors;
}
static gint
gdk_win32_screen_get_primary_monitor (GdkScreen *screen)
{
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
return 0;
}
static gint
gdk_win32_screen_get_monitor_width_mm (GdkScreen *screen,
gint num_monitor)
{
GdkWin32Screen *win32_screen = GDK_WIN32_SCREEN (screen);
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, 0);
return win32_screen->monitors[num_monitor].width_mm;
}
static gint
gdk_win32_screen_get_monitor_height_mm (GdkScreen *screen,
gint num_monitor)
{
GdkWin32Screen *win32_screen = GDK_WIN32_SCREEN (screen);
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), 0);
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, 0);
return win32_screen->monitors[num_monitor].height_mm;
}
static gchar *
gdk_win32_screen_get_monitor_plug_name (GdkScreen *screen,
gint num_monitor)
{
GdkWin32Screen *win32_screen = GDK_WIN32_SCREEN (screen);
g_return_val_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()), NULL);
g_return_val_if_fail (num_monitor < win32_screen->num_monitors, NULL);
return g_strdup (win32_screen->monitors[num_monitor].name);
}
static void
gdk_win32_screen_get_monitor_geometry (GdkScreen *screen,
gint num_monitor,
GdkRectangle *dest)
{
GdkWin32Screen *win32_screen = GDK_WIN32_SCREEN (screen);
g_return_if_fail (screen == gdk_display_get_default_screen (gdk_display_get_default ()));
g_return_if_fail (num_monitor < win32_screen->num_monitors);
*dest = win32_screen->monitors[num_monitor].rect;
}
static void
gdk_win32_screen_get_monitor_workarea (GdkScreen *screen,
gint num_monitor,
GdkRectangle *dest)
{
GdkWin32Screen *win32_screen = GDK_WIN32_SCREEN (screen);
g_return_if_fail