Fix for GTK+ on multiple monitors

"Alan <[email protected]>" <[email protected]> Wed, 12 Feb 2003 20:18:16 -0000
Newsgroups gmane.comp.video.gimp.windows.devel
Message-ID <[email protected]>
I think it's been noted before that GTK+ always pops up
new windows on the primary monitor with multiple-monitor
systems.

I haven't compiled GTK+ on my system, but downloaded the
1.3.0 sources on Tor's website, as this is a common problem
that I've seen before, typically with a simple fix.

I noticed that in gdk_input_init(), the following calls are made:

      gdk_input_root_width = GetSystemMetrics (SM_CXSCREEN);
      gdk_input_root_height = GetSystemMetrics (SM_CYSCREEN);

According to MSDN, SM_CXSCREEN and SM_CYSCREEN will give the "Width
and height, in pixels, of the screen of the primary display monitor."
This causes problems with multiple screens, because GTK+ assumes that
the second monitor part of the screen doesn't exist.

On Win98/2000 or later, the following values can be passed to
GetSystemMetrics: SM_CXVIRTUALSCREEN and SM_CYVIRTUALSCREEN,
which should give "the width and height of the virtual screen."

The same changes should probably be made to other calls to
GetSystemMetrics() within GTK+.

Hope this helps,

--Alan