Commit 19209e3a authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

Use the monitor the window currently is on, not always the primary

2007-11-26  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkwindow-win32.c (gdk_window_fullscreen): Use the
	monitor the window currently is on, not always the primary
	monitor. (#463865, Tim Evans)


svn path=/trunk/; revision=19047
parent fa7b91a8
2007-11-26 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkwindow-win32.c (gdk_window_fullscreen): Use the
monitor the window currently is on, not always the primary
monitor. (#463865, Tim Evans)
2007-11-26 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdktestutils-win32.c: New file, dummy implementations.
......
......@@ -3313,9 +3313,11 @@ struct _FullscreenInfo
void
gdk_window_fullscreen (GdkWindow *window)
{
gint width, height;
gint x, y, width, height;
FullscreenInfo *fi;
GdkWindowObject *private = (GdkWindowObject *) window;
HMONITOR monitor;
MONITORINFO mi;
g_return_if_fail (GDK_IS_WINDOW (window));
......@@ -3327,9 +3329,22 @@ gdk_window_fullscreen (GdkWindow *window)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (private->impl);
width = GetSystemMetrics (SM_CXSCREEN);
height = GetSystemMetrics (SM_CYSCREEN);
monitor = MonitorFromWindow (GDK_WINDOW_HWND (window), MONITOR_DEFAULTTONEAREST);
mi.cbSize = sizeof (mi);
if (monitor && GetMonitorInfo (monitor, &mi))
{
x = mi.rcMonitor.left;
y = mi.rcMonitor.top;
width = mi.rcMonitor.right - x;
height = mi.rcMonitor.bottom - y;
}
else
{
x = y = 0;
width = GetSystemMetrics (SM_CXSCREEN);
height = GetSystemMetrics (SM_CYSCREEN);
}
/* remember for restoring */
fi->hint_flags = impl->hint_flags;
impl->hint_flags &= ~GDK_HINT_MAX_SIZE;
......@@ -3340,7 +3355,7 @@ gdk_window_fullscreen (GdkWindow *window)
(fi->style & ~WS_OVERLAPPEDWINDOW) | WS_POPUP);
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
0, 0, width, height,
x, y, width, height,
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
gdk_synthesize_window_state (window, 0, GDK_WINDOW_STATE_FULLSCREEN);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment